// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r12
testq %rsi, %rsi
je 0x3dd3e
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0x3e225
callq 0x3cff6
movq %rax, 0x40(%rsp)
movl $0x8, %edi
callq 0x6ef7c
movq %rax, %rbp
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movq %r12, 0x28(%rsp)
callq 0x34f04
movq %rax, 0x30(%rsp)
leaq 0xa68c8(%rip), %r15     # 0xe4640
movq %r15, %rdi
callq 0x3b785
movq %rax, %rbx
movl $0x1, %esi
movl $0x989680, %edx         # imm = 0x989680
movq %rax, %rdi
callq 0x495f0
movq %rax, %r13
leaq 0x7(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3dc9a
testl %eax, %eax
movq %r14, 0x18(%rsp)
movq %r12, 0x10(%rsp)
je 0x3dde0
leaq 0xa5399(%rip), %rsi     # 0xe3159
leaq 0xa6883(%rip), %rdx     # 0xe464a
leaq 0xa6857(%rip), %rcx     # 0xe4625
leaq 0xa6450(%rip), %r8      # 0xe4225
movq %r14, %rdi
movl $0x1c5, %r9d            # imm = 0x1C5
jmp 0x3de10
cmpb $0x1, 0x7(%rsp)
jne 0x3dfd1
leaq 0xa5367(%rip), %rsi     # 0xe3159
leaq 0xa689b(%rip), %rdx     # 0xe4694
leaq 0xa6825(%rip), %rcx     # 0xe4625
leaq 0xa641e(%rip), %r8      # 0xe4225
movq %r14, %rdi
movl $0x1c6, %r9d            # imm = 0x1C6
xorl %eax, %eax
callq 0x34f1f
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3d73d
movq %r13, %rdi
callq 0x4210c
leaq 0xa680c(%rip), %rdx     # 0xe4640
leaq 0x58(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x3dbcc
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
leaq 0x11388b(%rip), %rcx    # 0x1516e4
imull $0x3e8, (%rcx), %eax    # imm = 0x3E8
testl %eax, %eax
movq %rbx, %r14
je 0x3deff
movq %rbp, %r13
xorl %ebx, %ebx
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %rcx, %rbp
callq 0x3d424
movl %eax, %r15d
andl %r12d, %r15d
imulq $0x6b654a13, %r15, %rax # imm = 0x6B654A13
shrq $0x36, %rax
imull $0x988eb0, %eax, %eax   # imm = 0x988EB0
subl %eax, %r15d
callq 0x3d424
andl %r12d, %eax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
shrq $0x27, %rcx
imull $0x7d0, %ecx, %ecx      # imm = 0x7D0
subl %ecx, %eax
movl %r15d, %ecx
addl %eax, %ecx
movq %r14, %rdi
leaq 0xce7ff(%rip), %rsi     # 0x10c6c0
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x3f280
movq %rax, %rdi
callq 0x3f369
movq %rax, 0x20(%rsp)
movl $0x8, %edx
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x6f240
movq %rbp, %rcx
incl %ebx
imull $0x3e8, (%rbp), %eax    # imm = 0x3E8
cmpl %eax, %ebx
jb 0x3de75
leaq 0x324(%rip), %rdi       # 0x3e22a
leaq 0x28(%rsp), %rsi
movq 0x18(%rsp), %r13
movq %r13, %rdx
callq 0x361b4
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3db7e
movq %rax, %r12
testq %rax, %rax
setne %al
movl 0xc(%rsp), %ecx
orb %al, %cl
je 0x3df98
movq %rbx, %rdi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, 0x8(%rsp)
movq %r14, %rbx
je 0x3e172
leaq 0xa66ea(%rip), %rdx     # 0xe4640
leaq 0x7(%rsp), %rsi
movq %r13, %r14
movq %r13, %rcx
callq 0x3dc9a
testl %eax, %eax
je 0x3e018
leaq 0xa51e4(%rip), %rsi     # 0xe3159
leaq 0xa6778(%rip), %rdx     # 0xe46f4
leaq 0xa66a2(%rip), %rcx     # 0xe4625
leaq 0xa629b(%rip), %r8      # 0xe4225
movq %r14, %rdi
movl $0x1e4, %r9d            # imm = 0x1E4
jmp 0x3e16b
leaq 0xa51ba(%rip), %rsi     # 0xe3159
leaq 0xb3c0a(%rip), %rdx     # 0xf1bb0
leaq 0xa6678(%rip), %rcx     # 0xe4625
leaq 0xa6271(%rip), %r8      # 0xe4225
movq %r13, %rdi
movl $0x1e2, %r9d            # imm = 0x1E2
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r14, %rbx
jmp 0x3e172
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3d73d
testl %eax, %eax
je 0x3e081
leaq 0xa516b(%rip), %rsi     # 0xe3159
leaq 0xa66aa(%rip), %rdx     # 0xe469f
leaq 0xa6629(%rip), %rcx     # 0xe4625
leaq 0xa6222(%rip), %r8      # 0xe4225
movq %r14, %rdi
movl $0x1ca, %r9d            # imm = 0x1CA
xorl %eax, %eax
callq 0x34f1f
jmp 0x3de25
cmpb $0x0, 0x7(%rsp)
je 0x3e0ce
movq %r12, %rdi
callq 0x3cbed
cmpq $0x1, %rax
jne 0x3e146
leaq 0x281(%rip), %rdi       # 0x3e2bd
leaq 0x28(%rsp), %r15
movq %r15, %rsi
movq %r13, %rdx
callq 0x361b4
cmpq $0x0, 0x28(%r15)
je 0x3e1e2
leaq 0xa50fb(%rip), %rsi     # 0xe3159
leaq 0xa66f4(%rip), %rdx     # 0xe4759
leaq 0xa65b9(%rip), %rcx     # 0xe4625
leaq 0xa61b2(%rip), %r8      # 0xe4225
movq %r13, %rdi
movl $0x1eb, %r9d            # imm = 0x1EB
jmp 0x3e16b
movq %r13, %rdi
callq 0x4210c
leaq 0xa65b0(%rip), %rdx     # 0xe4640
leaq 0x7(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x3dc9a
testl %eax, %eax
je 0x3e0f5
leaq 0xa50ae(%rip), %rsi     # 0xe3159
leaq 0xa6598(%rip), %rdx     # 0xe464a
leaq 0xa656c(%rip), %rcx     # 0xe4625
leaq 0xa6165(%rip), %r8      # 0xe4225
movq %r14, %rdi
movl $0x1cd, %r9d            # imm = 0x1CD
jmp 0x3e1d6
leaq 0xa5084(%rip), %rsi     # 0xe3159
leaq 0xa65b9(%rip), %rdx     # 0xe4695
leaq 0xa6542(%rip), %rcx     # 0xe4625
leaq 0xa613b(%rip), %r8      # 0xe4225
movq %r13, %rdi
movl $0x1e5, %r9d            # imm = 0x1E5
jmp 0x3e16b
cmpb $0x0, 0x7(%rsp)
je 0x3e1b1
leaq 0xa6539(%rip), %rdx     # 0xe4640
leaq 0x58(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x3dbcc
cmpq $0x1, (%r15)
jne 0x3e1e6
cmpq $0x989680, 0x60(%rsp)   # imm = 0x989680
jne 0x3e1e6
movl $0x0, 0xc(%rsp)
movb $0x1, %al
movl %eax, 0x8(%rsp)
jmp 0x3de52
leaq 0xa500c(%rip), %rsi     # 0xe3159
leaq 0xa65e6(%rip), %rdx     # 0xe473a
leaq 0xa64ca(%rip), %rcx     # 0xe4625
leaq 0xa60c3(%rip), %r8      # 0xe4225
movq %r13, %rdi
movl $0x1e6, %r9d            # imm = 0x1E6
xorl %eax, %eax
callq 0x34f1f
movq 0x40(%rsp), %rdi
callq 0x3d021
movq 0x30(%rsp), %rdi
callq 0x35085
movq %r12, %rdi
callq 0x3cc00
movq 0x38(%rsp), %rdi
callq 0x6f768
movq %rbx, %rdi
callq 0x3c87b
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa4fa1(%rip), %rsi     # 0xe3159
leaq 0xa64d6(%rip), %rdx     # 0xe4695
leaq 0xa645f(%rip), %rcx     # 0xe4625
leaq 0xa6058(%rip), %r8      # 0xe4225
movq %r14, %rdi
movl $0x1ce, %r9d            # imm = 0x1CE
xorl %eax, %eax
callq 0x34f1f
jmp 0x3de2d
xorl %ebp, %ebp
jmp 0x3e172
leaq 0xa4f6c(%rip), %rsi     # 0xe3159
leaq 0xa64b5(%rip), %rdx     # 0xe46a9
leaq 0xa642a(%rip), %rcx     # 0xe4625
leaq 0xa6023(%rip), %r8      # 0xe4225
movl $0x0, 0x8(%rsp)
movq %r14, %rdi
movl $0x1d3, %r9d            # imm = 0x1D3
xorl %eax, %eax
callq 0x34f1f
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x3de52
callq 0xf17b