// File: /workspace/github_c_makefile_star2_O1/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 0x14764e
movq %rax, %r12
callq 0x148ed1
movq %rax, %r15
movq %r12, %rdi
callq 0x1472ac
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x14b478
movq %rax, %rbp
movq %rax, %rdi
movq %r14, %rsi
callq 0x16adca
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x147477
movq %r15, %rdi
movq %r14, %rsi
callq 0x147e36
movq %rax, %rbx
movq %rax, %rdi
callq 0x121e78
movq %rbx, %rdi
cmpq $0x3, %rax
jne 0x147459
callq 0x121e8b
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 0x23f14c(%rip), %rdx    # 0x3864f6
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x147e84
leaq 0x23f13a(%rip), %rdx    # 0x3864fb
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x147e84
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
leaq 0x23f0fc(%rip), %rdx    # 0x3864f6
leaq 0x20(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x147eeb
leaq 0x23f0e7(%rip), %rdx    # 0x3864fb
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x147eeb
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x117710
testl %eax, %eax
jne 0x147446
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x117710
testl %eax, %eax
je 0x147488
leaq 0x23f0b6(%rip), %rsi    # 0x386503
movq %r14, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x147472
callq 0x121e78
leaq 0x23f04c(%rip), %rsi    # 0x3864b1
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1019cf
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 0x147952
movq %r15, %rdi
callq 0x147952
movq %r13, %rdi
callq 0x16ac6e
movq %rbp, %rdi
callq 0x16ac6e
movq %r14, %rdi
callq 0x14764e
movq %rax, %rbx
callq 0x148ed1
movq %rax, %r15
movq %rbx, %rdi
callq 0x1472ac
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x14b478
movq %rax, %rbp
movb $0x1, 0x20(%r13)
movq %rax, %rdi
movq %r14, %rsi
callq 0x16adca
cmpl $-0x1, %eax
je 0x147472
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 0x23efdc(%rip), %rdx    # 0x3864f6
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x147e84
leaq 0x23efc7(%rip), %rdx    # 0x3864fb
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x147e84
movq %r12, %rdi
movq %rbx, %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
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 0x23ef51(%rip), %rdx    # 0x3864f6
leaq 0x20(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x147eeb
leaq 0x23ef3c(%rip), %rdx    # 0x3864fb
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x147eeb
leaq 0x23ef70(%rip), %rdx    # 0x386546
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x147eeb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
leaq 0x58(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x117710
testl %eax, %eax
jne 0x147446
movq 0x30(%rsp), %rdi
callq 0x147952
movq %r15, %rdi
callq 0x147952
movq %r13, %rdi
callq 0x16ac6e
movq %rbp, %rdi
callq 0x16ac6e
xorl %ecx, %ecx
jmp 0x147477