// File: /workspace/github_c_makefile_star2_O2/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 0xd740d
movq %rax, %r12
callq 0xd9354
movq %rax, %r15
movq %r12, %rdi
callq 0xd7041
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0xdcac0
movq %rax, %rbp
movq %rax, %rdi
movq %r14, %rsi
callq 0x102b93
pushq $-0x1
popq %rcx
cmpl $-0x1, %eax
je 0xd7238
movq %r15, %rdi
movq %r14, %rsi
callq 0xd7e9b
movq %rax, %rbx
movq %rax, %rdi
callq 0xae61c
movq %rbx, %rdi
cmpq $0x3, %rax
jne 0xd721c
callq 0xae662
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 0x246421(%rip), %rdx    # 0x31d58e
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0xd7f1c
leaq 0x24640f(%rip), %rdx    # 0x31d593
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0xd7f1c
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
leaq 0x2463d1(%rip), %rdx    # 0x31d58e
leaq 0x20(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0xd7fb6
leaq 0x2463bc(%rip), %rdx    # 0x31d593
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0xd7fb6
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0xa3058
testl %eax, %eax
je 0xd7249
leaq 0x24638b(%rip), %rsi    # 0x31d59b
movq %r14, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0xd7235
callq 0xae61c
leaq 0x246321(%rip), %rsi    # 0x31d549
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rcx
movl %ecx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0xd7777
movq %r15, %rdi
callq 0xd7777
movq %r13, %rdi
callq 0x10297b
movq %rbp, %rdi
callq 0x10297b
movq %r14, %rdi
callq 0xd740d
movq %rax, %rbx
callq 0xd9354
movq %rax, %r15
movq %rbx, %rdi
callq 0xd7041
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0xdcac0
movq %rax, %rbp
movb $0x1, 0x20(%r13)
movq %rax, %rdi
movq %r14, %rsi
callq 0x102b93
cmpl $-0x1, %eax
je 0xd7235
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 0x2462b3(%rip), %rdx    # 0x31d58e
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0xd7f1c
leaq 0x24629e(%rip), %rdx    # 0x31d593
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0xd7f1c
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
pushq $0x1
popq %rax
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 0x24622a(%rip), %rdx    # 0x31d58e
leaq 0x20(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0xd7fb6
leaq 0x246215(%rip), %rdx    # 0x31d593
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0xd7fb6
leaq 0x246249(%rip), %rdx    # 0x31d5de
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0xd7fb6
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
leaq 0x58(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xa3058
testl %eax, %eax
jne 0xd7209
movq 0x30(%rsp), %rdi
callq 0xd7777
movq %r15, %rdi
callq 0xd7777
movq %r13, %rdi
callq 0x10297b
movq %rbp, %rdi
callq 0x10297b
xorl %ecx, %ecx
jmp 0xd7238