// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/feature_index.c
// Function: gt_feature_index_unit_test
int gt_feature_index_unit_test(GtFeatureIndex *fi, GtError *err)
{
  int had_err = 0, i, rval;
  GtFeatureIndexTestShared sh;
  GtStrArray *seqids;
  GtStr *seqid;
  GtRange check_range;
  GtRegionNode *rn;
  bool has_seqid;
  gt_error_check(err);

  sh.mutex = gt_mutex_new();
  sh.nodes = gt_array_new(sizeof (GtFeatureNode*));
  sh.error_count = 0;
  sh.next_node_idx = 0;
  sh.fi = fi;
  sh.err = gt_error_new();

  /* create region */
  seqid = gt_str_new_cstr(GT_FI_TEST_SEQID);
  rn = (GtRegionNode*) gt_region_node_new(seqid, GT_FI_TEST_START,
                                          GT_FI_TEST_END);

  /* test seqid is not supposed to exist */
  gt_ensure(gt_feature_index_has_seqid(sh.fi, &has_seqid,
                                                 GT_FI_TEST_SEQID, err) == 0);
  gt_ensure(!has_seqid);

  /* add a sequence region directly and check if it has been added */
  rval = gt_feature_index_add_region_node(sh.fi, rn, err);
  gt_ensure(rval == 0);
  gt_genome_node_delete((GtGenomeNode*) rn);
  gt_ensure(gt_feature_index_has_seqid(sh.fi, &has_seqid,
                                                GT_FI_TEST_SEQID, err) == 0);
  gt_ensure(has_seqid);

  gt_feature_index_get_range_for_seqid(sh.fi, &check_range, GT_FI_TEST_SEQID,
                                       err);
  gt_ensure(check_range.start == GT_FI_TEST_START
                    && check_range.end == GT_FI_TEST_END);

  /* set up nodes to store */
  for (i=0;i<GT_FI_TEST_FEATURES_PER_THREAD*gt_jobs;i++) {
    GtUword start, end;
    GtFeatureNode *fn;
    start = random() % (GT_FI_TEST_END - GT_FI_TEST_FEATURE_WIDTH);
    end = start + random() % (GT_FI_TEST_FEATURE_WIDTH);
    fn = gt_feature_node_cast(gt_feature_node_new(seqid, "gene", start, end,
                                                  GT_STRAND_FORWARD));
    gt_array_add(sh.nodes, fn);
  }
  /* test parallel addition */
  gt_multithread(gt_feature_index_unit_test_add, &sh, err);
  seqids = gt_feature_index_get_seqids(fi, err);
  gt_ensure(seqids);
  gt_ensure(gt_feature_index_has_seqid(fi, &has_seqid,GT_FI_TEST_SEQID,
                                                err) == 0);
  gt_ensure(has_seqid);
  gt_ensure(gt_str_array_size(seqids) == 1);

  /* test parallel query */
  if (!had_err)
    gt_multithread(gt_feature_index_unit_test_query, &sh, err);
  gt_ensure(sh.error_count == 0);

  gt_mutex_delete(sh.mutex);
  gt_error_delete(sh.err);
  gt_str_array_delete(seqids);
  gt_array_delete(sh.nodes);
  gt_str_delete(seqid);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x3e6ba
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0x3eb7b
callq 0x3d96a
movq %rax, 0x38(%rsp)
movl $0x8, %edi
callq 0x6e93c
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rsp)
movq %rbx, 0x50(%rsp)
movq %rbx, 0x20(%rsp)
callq 0x35584
movq %rax, 0x28(%rsp)
leaq 0xa5f6a(%rip), %r13     # 0xe4660
movq %r13, %rdi
callq 0x3c03d
movq %rax, %r15
movl $0x1, %esi
movl $0x989680, %edx         # imm = 0x989680
movq %rax, %rdi
callq 0x4a248
movq %rax, %r12
movq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3e616
testl %eax, %eax
je 0x3e756
leaq 0xa4a43(%rip), %rsi     # 0xe3179
leaq 0xa5f2d(%rip), %rdx     # 0xe466a
leaq 0xa5f01(%rip), %rcx     # 0xe4645
leaq 0xa5afa(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1c5, %r9d            # imm = 0x1C5
jmp 0x3e789
xorl %ebp, %ebp
cmpb $0x1, 0xf(%rsp)
movl $0x0, %ebx
jne 0x3e798
leaq 0xa4a0e(%rip), %rsi     # 0xe3179
leaq 0xa5f42(%rip), %rdx     # 0xe46b4
leaq 0xa5ecc(%rip), %rcx     # 0xe4645
leaq 0xa5ac5(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1c6, %r9d            # imm = 0x1C6
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3e0b9
testb %bpl, %bpl
jne 0x3e7e2
testl %eax, %eax
je 0x3e7e2
leaq 0xa49c1(%rip), %rsi     # 0xe3179
leaq 0xa5f00(%rip), %rdx     # 0xe46bf
leaq 0xa5e7f(%rip), %rcx     # 0xe4645
leaq 0xa5a78(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1ca, %r9d            # imm = 0x1CA
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r12, %rdi
callq 0x42ade
testl %ebx, %ebx
movq %r15, 0x18(%rsp)
jne 0x3e8d4
movq 0x20(%rsp), %rdi
leaq 0xa5e5d(%rip), %rdx     # 0xe4660
leaq 0xf(%rsp), %rsi
movq %r14, %rcx
callq 0x3e616
testl %eax, %eax
je 0x3e83e
leaq 0xa495e(%rip), %rsi     # 0xe3179
leaq 0xa5e48(%rip), %rdx     # 0xe466a
leaq 0xa5e1c(%rip), %rcx     # 0xe4645
leaq 0xa5a15(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1cd, %r9d            # imm = 0x1CD
jmp 0x3e8cd
cmpb $0x0, 0xf(%rsp)
je 0x3e8a8
movq 0x20(%rsp), %rdi
leaq 0xa5e0f(%rip), %rdx     # 0xe4660
leaq 0x68(%rsp), %r12
movq %r12, %rsi
movq %r14, %rcx
callq 0x3e548
cmpq $0x1, (%r12)
jne 0x3e87a
xorl %ecx, %ecx
cmpq $0x989680, 0x70(%rsp)   # imm = 0x989680
movl $0x0, %eax
je 0x3e8f4
leaq 0xa48f8(%rip), %rsi     # 0xe3179
leaq 0xa5e41(%rip), %rdx     # 0xe46c9
leaq 0xa5db6(%rip), %rcx     # 0xe4645
leaq 0xa59af(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1d3, %r9d            # imm = 0x1D3
xorl %eax, %eax
callq 0x3559f
jmp 0x3e8ed
leaq 0xa48ca(%rip), %rsi     # 0xe3179
leaq 0xa5dff(%rip), %rdx     # 0xe46b5
leaq 0xa5d88(%rip), %rcx     # 0xe4645
leaq 0xa5981(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1ce, %r9d            # imm = 0x1CE
xorl %eax, %eax
callq 0x3559f
movq 0x20(%rsp), %rdi
leaq 0xa5d80(%rip), %rdx     # 0xe4660
leaq 0x68(%rsp), %rsi
movq %r14, %rcx
callq 0x3e548
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movb $0x1, %cl
movl %ecx, 0x10(%rsp)
movl %eax, 0x14(%rsp)
movq %r14, 0x58(%rsp)
leaq 0x112ddc(%rip), %r12    # 0x1516e4
imull $0x3e8, (%r12), %eax    # imm = 0x3E8
testl %eax, %eax
movq 0x18(%rsp), %rbx
je 0x3e9ab
xorl %r15d, %r15d
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq 0x60(%rsp), %r13
callq 0x3dd98
movl %eax, %ebp
andl %r14d, %ebp
imulq $0x6b654a13, %rbp, %rax # imm = 0x6B654A13
shrq $0x36, %rax
imull $0x988eb0, %eax, %eax   # imm = 0x988EB0
subl %eax, %ebp
callq 0x3dd98
andl %r14d, %eax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
shrq $0x27, %rcx
imull $0x7d0, %ecx, %ecx      # imm = 0x7D0
subl %ecx, %eax
movl %ebp, %ecx
addl %eax, %ecx
movq %rbx, %rdi
leaq 0xcdf2f(%rip), %rsi     # 0x10c8a0
movq %rbp, %rdx
xorl %r8d, %r8d
callq 0x3fbf0
movq %rax, %rdi
callq 0x3fcd9
movq %rax, 0x60(%rsp)
movq 0x30(%rsp), %rdi
movl $0x8, %edx
movq %r13, %rsi
callq 0x6ec0e
incl %r15d
imull $0x3e8, (%r12), %eax    # imm = 0x3E8
cmpl %eax, %r15d
jb 0x3e92b
leaq 0x1ce(%rip), %rdi       # 0x3eb80
leaq 0x20(%rsp), %rsi
movq 0x58(%rsp), %r14
movq %r14, %rdx
callq 0x3682c
movq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3e4fa
movq %rax, %r12
testq %rax, %rax
setne %al
movl 0x10(%rsp), %ecx
orb %al, %cl
movl 0x14(%rsp), %eax
jne 0x3ea1a
leaq 0xa4789(%rip), %rsi     # 0xe3179
leaq 0xb3209(%rip), %rdx     # 0xf1c00
leaq 0xa5c47(%rip), %rcx     # 0xe4645
leaq 0xa5840(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1e2, %r9d            # imm = 0x1E2
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movb $0x1, %bl
testl %eax, %eax
movq 0x18(%rsp), %r15
jne 0x3eae6
leaq 0xa5c2b(%rip), %rdx     # 0xe4660
leaq 0xf(%rsp), %rsi
movq %r13, %rdi
movq %r14, %rcx
callq 0x3e616
testl %eax, %eax
je 0x3ea70
leaq 0xa4729(%rip), %rsi     # 0xe3179
leaq 0xa5cbd(%rip), %rdx     # 0xe4714
leaq 0xa5be7(%rip), %rcx     # 0xe4645
leaq 0xa57e0(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1e4, %r9d            # imm = 0x1E4
jmp 0x3ead8
cmpb $0x0, 0xf(%rsp)
je 0x3eab3
movq %r12, %rdi
callq 0x3d560
xorl %ebx, %ebx
movl $0x0, %ebp
cmpq $0x1, %rax
je 0x3eae6
leaq 0xa46e6(%rip), %rsi     # 0xe3179
leaq 0xa5cc0(%rip), %rdx     # 0xe475a
leaq 0xa5ba4(%rip), %rcx     # 0xe4645
leaq 0xa579d(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1e6, %r9d            # imm = 0x1E6
jmp 0x3ead8
leaq 0xa46bf(%rip), %rsi     # 0xe3179
leaq 0xa5bf4(%rip), %rdx     # 0xe46b5
leaq 0xa5b7d(%rip), %rcx     # 0xe4645
leaq 0xa5776(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1e5, %r9d            # imm = 0x1E5
xorl %eax, %eax
callq 0x3559f
movb $0x1, %bl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %bl, %bl
jne 0x3eafe
leaq 0x122(%rip), %rdi       # 0x3ec13
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x3682c
cmpq $0x0, 0x48(%rsp)
sete %al
orb %al, %bl
jne 0x3eb3c
leaq 0xa4667(%rip), %rsi     # 0xe3179
leaq 0xa5c60(%rip), %rdx     # 0xe4779
leaq 0xa5b25(%rip), %rcx     # 0xe4645
leaq 0xa571e(%rip), %r8      # 0xe4245
movq %r14, %rdi
movl $0x1eb, %r9d            # imm = 0x1EB
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rdi
callq 0x3d995
movq 0x28(%rsp), %rdi
callq 0x35705
movq %r12, %rdi
callq 0x3d573
movq 0x30(%rsp), %rdi
callq 0x6f134
movq %r15, %rdi
callq 0x3d1eb
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xf1b4