// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/feature_in_stream.c
// Function: gt_feature_in_stream_unit_test
int gt_feature_in_stream_unit_test(GtError *error)
{
  GtNodeStream *src, *dest;
  GtFeatureIndex *prefeat, *postfeat;
  GtRange range1, range1test, range2, range2test, range3, range3test;
  GtStrArray *seqids;

  prefeat = in_stream_test_data(error);
  postfeat = gt_feature_index_memory_new();
  src = gt_feature_in_stream_new(prefeat);
  dest = gt_feature_out_stream_new(src, postfeat);
  int result = gt_node_stream_pull(dest, error);
  if (result == -1)
    return -1;

  seqids = gt_feature_index_get_seqids(postfeat, error);
  if (gt_str_array_size(seqids) != 3)
  {
    gt_error_set(error, "error in feature_in_stream unit test 1: expected 3 "
                 "seqids, found "GT_WU"", gt_str_array_size(seqids));
    return -1;
  }
  gt_str_array_delete(seqids);

  range1test.start = 500;  range1test.end = 75000;
  range2test.start = 4000; range2test.end = 9500;
  gt_feature_index_get_range_for_seqid(postfeat, &range1, "chr1", error);
  gt_feature_index_get_range_for_seqid(postfeat, &range2, "scf0001", error);
  if (gt_range_compare(&range1, &range1test) ||
      gt_range_compare(&range2, &range2test))
  {
    gt_error_set(error, "error in feature_in_stream unit test 1: incorrect "
                 "sequence regions");
    return -1;
  }

  gt_feature_index_get_orig_range_for_seqid(postfeat, &range1, "chr1", error);
  gt_feature_index_get_orig_range_for_seqid(postfeat, &range2, "scf0001",error);
  if (gt_range_compare(&range1, &range1test) ||
      gt_range_compare(&range2, &range2test))
  {
    gt_error_set(error, "error in feature_in_stream unit test 1: incorrect "
                 "sequence regions");
    return -1;
  }
  gt_feature_index_delete(prefeat);
  gt_feature_index_delete(postfeat);
  gt_node_stream_delete(src);
  gt_node_stream_delete(dest);

  prefeat = in_stream_test_data(error);
  postfeat = gt_feature_index_memory_new();
  src = gt_feature_in_stream_new(prefeat);
  dest = gt_feature_out_stream_new(src, postfeat);
  gt_feature_in_stream_use_orig_ranges((GtFeatureInStream *)src);
  result = gt_node_stream_pull(dest, error);
  if (result == -1)
    return -1;

  range1test.start = 500;  range1test.end = 75000;
  range2test.start = 4000; range2test.end = 9500;
  gt_feature_index_get_range_for_seqid(postfeat, &range1, "chr1", error);
  gt_feature_index_get_range_for_seqid(postfeat, &range2, "scf0001",error);
  if (gt_range_compare(&range1, &range1test) ||
      gt_range_compare(&range2, &range2test))
  {
    gt_error_set(error, "error in feature_in_stream unit test 1: incorrect "
                 "sequence regions");
    return -1;
  }
  range1test.start = 1; range1test.end = 100000;
  range2test.start = 1; range2test.end = 10000;
  range3test.start = 1; range3test.end = 25000;
  gt_feature_index_get_orig_range_for_seqid(postfeat, &range1, "chr1", error);
  gt_feature_index_get_orig_range_for_seqid(postfeat, &range2, "scf0001",error);
  gt_feature_index_get_orig_range_for_seqid(postfeat, &range3, "ChrM", error);
  if (gt_range_compare(&range1, &range1test) ||
      gt_range_compare(&range2, &range2test) ||
      gt_range_compare(&range3, &range3test))
  {
    gt_error_set(error, "error in feature_in_stream unit test 1: incorrect "
                 "sequence regions");
    return -1;
  }
  gt_feature_index_delete(prefeat);
  gt_feature_index_delete(postfeat);
  gt_node_stream_delete(src);
  gt_node_stream_delete(dest);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
callq 0x14040a
movq %rax, %r12
callq 0x141cb1
movq %rax, %r15
movq %r12, %rdi
callq 0x140068
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x144224
movq %rax, %rbp
movq %rax, %rdi
movq %r14, %rsi
callq 0x162f5d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x140233
movq %r15, %rdi
movq %r14, %rsi
callq 0x140bf2
movq %rax, %rbx
movq %rax, %rdi
callq 0x11c131
movq %rbx, %rdi
cmpq $0x3, %rax
jne 0x140215
callq 0x11c144
leaq 0x38(%rsp), %rbx
movq $0x1f4, (%rbx)          # imm = 0x1F4
movq $0x124f8, 0x8(%rbx)     # imm = 0x124F8
movq $0xfa0, (%rsp)          # imm = 0xFA0
movq $0x251c, 0x8(%rsp)      # imm = 0x251C
leaq 0x23d020(%rip), %rdx    # 0x37d186
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x140c40
leaq 0x23d00e(%rip), %rdx    # 0x37d18b
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x140c40
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
leaq 0x23cfd0(%rip), %rdx    # 0x37d186
leaq 0x20(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x140ca7
leaq 0x23cfbb(%rip), %rdx    # 0x37d18b
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x140ca7
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x112130
testl %eax, %eax
jne 0x140202
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x112130
testl %eax, %eax
je 0x140244
leaq 0x23cf8a(%rip), %rsi    # 0x37d193
movq %r14, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x14022e
callq 0x11c131
leaq 0x23cf20(%rip), %rsi    # 0x37d141
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x14070e
movq %r15, %rdi
callq 0x14070e
movq %r13, %rdi
callq 0x162dee
movq %rbp, %rdi
callq 0x162dee
movq %r14, %rdi
callq 0x14040a
movq %rax, %rbx
callq 0x141cb1
movq %rax, %r15
movq %rbx, %rdi
callq 0x140068
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x144224
movq %rax, %rbp
movb $0x1, 0x20(%r13)
movq %rax, %rdi
movq %r14, %rsi
callq 0x162f5d
cmpl $-0x1, %eax
je 0x14022e
movq %rbx, 0x30(%rsp)
leaq 0x38(%rsp), %rbx
movq $0x1f4, (%rbx)          # imm = 0x1F4
movq $0x124f8, 0x8(%rbx)     # imm = 0x124F8
movq $0xfa0, (%rsp)          # imm = 0xFA0
movq $0x251c, 0x8(%rsp)      # imm = 0x251C
leaq 0x23ceb0(%rip), %rdx    # 0x37d186
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x140c40
leaq 0x23ce9b(%rip), %rdx    # 0x37d18b
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x140c40
movq %r12, %rdi
movq %rbx, %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
movl $0x1, %eax
leaq 0x38(%rsp), %r12
movq %rax, (%r12)
movq $0x186a0, 0x8(%r12)     # imm = 0x186A0
movq %rax, (%rsp)
movq $0x2710, 0x8(%rsp)      # imm = 0x2710
movq %rax, 0x48(%rsp)
movq $0x61a8, 0x50(%rsp)     # imm = 0x61A8
leaq 0x23ce25(%rip), %rdx    # 0x37d186
leaq 0x20(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x140ca7
leaq 0x23ce10(%rip), %rdx    # 0x37d18b
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x140ca7
leaq 0x23ce44(%rip), %rdx    # 0x37d1d6
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x140ca7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
leaq 0x58(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x112130
testl %eax, %eax
jne 0x140202
movq 0x30(%rsp), %rdi
callq 0x14070e
movq %r15, %rdi
callq 0x14070e
movq %r13, %rdi
callq 0x162dee
movq %rbp, %rdi
callq 0x162dee
xorl %ecx, %ecx
jmp 0x140233