// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movl $0x0, 0x94(%rsp)
cmpq $0x0, 0x98(%rsp)
je 0x1df68
movq 0x98(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x1df30
jmp 0x1df68
movq 0x1960a1(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x140125(%rip), %rsi    # 0x15e066
leaq 0x140700(%rip), %rdx    # 0x15e648
leaq 0x143746(%rip), %rcx    # 0x161695
leaq 0x14333f(%rip), %r8     # 0x161295
movl $0x1b5, %r9d            # imm = 0x1B5
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x1df6a
callq 0x1c240
movq %rax, 0x70(%rsp)
movl $0x8, %edi
callq 0x75ab0
movq %rax, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x78(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x58(%rsp)
callq 0xc0b0
movq %rax, 0x60(%rsp)
leaq 0x1436fa(%rip), %rdi    # 0x1616b0
callq 0x18f70
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movl $0x1, %esi
movl $0x989680, %edx         # imm = 0x989680
callq 0x35c30
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x94(%rsp)
jne 0x1e044
movq 0x58(%rsp), %rdi
movq 0x98(%rsp), %rcx
leaq 0x2f(%rsp), %rsi
leaq 0x1436b4(%rip), %rdx    # 0x1616b0
callq 0x1ddb0
cmpl $0x0, %eax
je 0x1e042
movq 0x98(%rsp), %rdi
leaq 0x142162(%rip), %rsi    # 0x160177
leaq 0x14369e(%rip), %rdx    # 0x1616ba
leaq 0x143672(%rip), %rcx    # 0x161695
leaq 0x14326b(%rip), %r8     # 0x161295
movl $0x1c5, %r9d            # imm = 0x1C5
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e044
jmp 0x1e046
jmp 0x1e048
cmpl $0x0, 0x94(%rsp)
jne 0x1e097
testb $0x1, 0x2f(%rsp)
je 0x1e095
movq 0x98(%rsp), %rdi
leaq 0x14210f(%rip), %rsi    # 0x160177
leaq 0x143695(%rip), %rdx    # 0x161704
leaq 0x14361f(%rip), %rcx    # 0x161695
leaq 0x143218(%rip), %r8     # 0x161295
movl $0x1c6, %r9d            # imm = 0x1C6
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e097
jmp 0x1e099
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x98(%rsp), %rdx
callq 0x1d310
movl %eax, 0x8c(%rsp)
cmpl $0x0, 0x94(%rsp)
jne 0x1e109
cmpl $0x0, 0x8c(%rsp)
je 0x1e107
movq 0x98(%rsp), %rdi
leaq 0x14209d(%rip), %rsi    # 0x160177
leaq 0x14362e(%rip), %rdx    # 0x16170f
leaq 0x1435ad(%rip), %rcx    # 0x161695
leaq 0x1431a6(%rip), %r8     # 0x161295
movl $0x1ca, %r9d            # imm = 0x1CA
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e109
jmp 0x1e10b
movq 0x30(%rsp), %rdi
callq 0x26eb0
cmpl $0x0, 0x94(%rsp)
jne 0x1e180
movq 0x58(%rsp), %rdi
movq 0x98(%rsp), %rcx
leaq 0x2f(%rsp), %rsi
leaq 0x143578(%rip), %rdx    # 0x1616b0
callq 0x1ddb0
cmpl $0x0, %eax
je 0x1e17e
movq 0x98(%rsp), %rdi
leaq 0x142026(%rip), %rsi    # 0x160177
leaq 0x143562(%rip), %rdx    # 0x1616ba
leaq 0x143536(%rip), %rcx    # 0x161695
leaq 0x14312f(%rip), %r8     # 0x161295
movl $0x1cd, %r9d            # imm = 0x1CD
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e180
jmp 0x1e182
jmp 0x1e184
cmpl $0x0, 0x94(%rsp)
jne 0x1e1d3
testb $0x1, 0x2f(%rsp)
jne 0x1e1d1
movq 0x98(%rsp), %rdi
leaq 0x141fd3(%rip), %rsi    # 0x160177
leaq 0x14355a(%rip), %rdx    # 0x161705
leaq 0x1434e3(%rip), %rcx    # 0x161695
leaq 0x1430dc(%rip), %r8     # 0x161295
movl $0x1ce, %r9d            # imm = 0x1CE
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e1d3
jmp 0x1e1d5
movq 0x58(%rsp), %rdi
movq 0x98(%rsp), %rcx
leaq 0x38(%rsp), %rsi
leaq 0x1434c2(%rip), %rdx    # 0x1616b0
callq 0x1dc10
cmpl $0x0, 0x94(%rsp)
jne 0x1e24e
cmpq $0x1, 0x38(%rsp)
jne 0x1e210
cmpq $0x989680, 0x40(%rsp)   # imm = 0x989680
je 0x1e24c
movq 0x98(%rsp), %rdi
leaq 0x141f58(%rip), %rsi    # 0x160177
leaq 0x1434f3(%rip), %rdx    # 0x161719
leaq 0x143468(%rip), %rcx    # 0x161695
leaq 0x143061(%rip), %r8     # 0x161295
movl $0x1d3, %r9d            # imm = 0x1D3
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e24e
jmp 0x1e250
movl $0x0, 0x90(%rsp)
movl 0x90(%rsp), %eax
leaq 0x19645b(%rip), %rcx    # 0x1b46c4
imull $0x3e8, (%rcx), %ecx    # imm = 0x3E8
cmpl %ecx, %eax
jae 0x1e314
callq 0x1cd80
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl $0x988eb0, %ecx         # imm = 0x988EB0
cqto
idivq %rcx
movq %rdx, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0x1cd80
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl $0x7d0, %ecx            # imm = 0x7D0
cqto
idivq %rcx
movq 0x8(%rsp), %rax
addq %rdx, %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
leaq 0x17123b(%rip), %rsi    # 0x18f510
xorl %r8d, %r8d
callq 0x20580
movq %rax, %rdi
callq 0x20750
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
movl 0x90(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x90(%rsp)
jmp 0x1e25b
movq 0x98(%rsp), %rdx
leaq 0x25d(%rip), %rdi       # 0x1e580
leaq 0x58(%rsp), %rsi
callq 0xe6c0
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x1db60
movq %rax, 0x50(%rsp)
cmpl $0x0, 0x94(%rsp)
jne 0x1e397
cmpq $0x0, 0x50(%rsp)
jne 0x1e395
movq 0x98(%rsp), %rdi
leaq 0x141e0f(%rip), %rsi    # 0x160177
leaq 0x151379(%rip), %rdx    # 0x16f6e8
leaq 0x14331f(%rip), %rcx    # 0x161695
leaq 0x142f18(%rip), %r8     # 0x161295
movl $0x1e2, %r9d            # imm = 0x1E2
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e397
jmp 0x1e399
jmp 0x1e39b
cmpl $0x0, 0x94(%rsp)
jne 0x1e409
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rcx
leaq 0x2f(%rsp), %rsi
leaq 0x1432ef(%rip), %rdx    # 0x1616b0
callq 0x1ddb0
cmpl $0x0, %eax
je 0x1e407
movq 0x98(%rsp), %rdi
leaq 0x141d9d(%rip), %rsi    # 0x160177
leaq 0x143383(%rip), %rdx    # 0x161764
leaq 0x1432ad(%rip), %rcx    # 0x161695
leaq 0x142ea6(%rip), %r8     # 0x161295
movl $0x1e4, %r9d            # imm = 0x1E4
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e409
jmp 0x1e40b
jmp 0x1e40d
cmpl $0x0, 0x94(%rsp)
jne 0x1e45c
testb $0x1, 0x2f(%rsp)
jne 0x1e45a
movq 0x98(%rsp), %rdi
leaq 0x141d4a(%rip), %rsi    # 0x160177
leaq 0x1432d1(%rip), %rdx    # 0x161705
leaq 0x14325a(%rip), %rcx    # 0x161695
leaq 0x142e53(%rip), %r8     # 0x161295
movl $0x1e5, %r9d            # imm = 0x1E5
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e45c
jmp 0x1e45e
jmp 0x1e460
cmpl $0x0, 0x94(%rsp)
jne 0x1e4b8
movq 0x50(%rsp), %rdi
callq 0x1b720
cmpq $0x1, %rax
je 0x1e4b6
movq 0x98(%rsp), %rdi
leaq 0x141cee(%rip), %rsi    # 0x160177
leaq 0x14331a(%rip), %rdx    # 0x1617aa
leaq 0x1431fe(%rip), %rcx    # 0x161695
leaq 0x142df7(%rip), %r8     # 0x161295
movl $0x1e6, %r9d            # imm = 0x1E6
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e4b8
jmp 0x1e4ba
cmpl $0x0, 0x94(%rsp)
jne 0x1e4dd
movq 0x98(%rsp), %rdx
leaq 0x1cd(%rip), %rdi       # 0x1e6a0
leaq 0x58(%rsp), %rsi
callq 0xe6c0
jmp 0x1e4df
cmpl $0x0, 0x94(%rsp)
jne 0x1e532
cmpq $0x0, 0x80(%rsp)
je 0x1e530
movq 0x98(%rsp), %rdi
leaq 0x141c74(%rip), %rsi    # 0x160177
leaq 0x1432bf(%rip), %rdx    # 0x1617c9
leaq 0x143184(%rip), %rcx    # 0x161695
leaq 0x142d7d(%rip), %r8     # 0x161295
movl $0x1eb, %r9d            # imm = 0x1EB
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e532
jmp 0x1e534
movq 0x70(%rsp), %rdi
callq 0x1c2c0
movq 0x60(%rsp), %rdi
callq 0xc490
movq 0x50(%rsp), %rdi
callq 0x1b780
movq 0x68(%rsp), %rdi
callq 0x770a0
movq 0x48(%rsp), %rdi
callq 0x1afc0
movl 0x94(%rsp), %eax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)