// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/stream_evaluator.c
// Function: determine_true_exon
static void determine_true_exon(GtFeatureNode *fn, GtStrand predicted_strand,
                                bool exondiff, bool exondiffcollapsed,
                                GtRange *predicted_range,
                                GtArray *exons_forward,
                                GtArray *exons_reverse,
                                GtArray *true_exons_forward,
                                GtArray *true_exons_reverse,
                                GtBittab *true_exons_forward_collapsed,
                                GtBittab *true_exons_reverse_collapsed,
                                GtEvaluator *exon_evaluator,
                                GtEvaluator *exon_evaluator_collapsed)
{
  GtRange *actual_range;
  GtUword num, *ctr_ptr;

  if ((actual_range = bsearch(predicted_range,
                              predicted_strand == GT_STRAND_FORWARD
                              ? gt_array_get_space(exons_forward)
                              : gt_array_get_space(exons_reverse),
                              predicted_strand == GT_STRAND_FORWARD
                              ? gt_array_size(exons_forward)
                              : gt_array_size(exons_reverse), sizeof (GtRange),
                              (GtCompare) gt_range_compare))) {
    if (predicted_strand == GT_STRAND_FORWARD) {
      num = actual_range - (GtRange*) gt_array_get_space(exons_forward);
      ctr_ptr = gt_array_get(true_exons_forward, num);
      if (*ctr_ptr) {
        (*ctr_ptr)--;
        gt_evaluator_add_true(exon_evaluator);
      }
      else
        mark_and_show_false_exon(fn, exondiff);
      if (true_exons_forward_collapsed &&
          !gt_bittab_bit_is_set(true_exons_forward_collapsed, num)) {
        gt_bittab_set_bit(true_exons_forward_collapsed, num);
        gt_evaluator_add_true(exon_evaluator_collapsed);
      }
    }
    else {
      num = actual_range - (GtRange*) gt_array_get_space(exons_reverse);
      ctr_ptr = gt_array_get(true_exons_reverse, num);
      if (*ctr_ptr) {
        (*ctr_ptr)--;
        gt_evaluator_add_true(exon_evaluator);
      }
      else
        mark_and_show_false_exon(fn, exondiff);
      if (true_exons_reverse_collapsed &&
          !gt_bittab_bit_is_set(true_exons_reverse_collapsed, num)) {
        gt_bittab_set_bit(true_exons_reverse_collapsed, num);
        gt_evaluator_add_true(exon_evaluator_collapsed);
      }
    }
  }
  else {
    mark_and_show_false_exon(fn, exondiff);
    if (exondiffcollapsed) {
      gt_gff3_output_leading(fn, NULL);
      printf(".\n");
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movl %ecx, %r13d
movl %edx, 0xc(%rsp)
movq %rdi, %r14
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x20(%rsp)
testl %esi, %esi
je 0xac460
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x70(%rsp), %r15
movq 0x60(%rsp), %rbp
movq %rbp, %rdi
callq 0x6f21b
movq %r14, %r12
movq %rax, %r14
movq %rbp, %rdi
callq 0x6f310
leaq -0x2e39d(%rip), %r8     # 0x7e09c
movl $0x10, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %r14
movq %rax, %rdx
callq 0xb7e0
testq %rax, %rax
je 0xac4db
movq %rax, %rbx
movq %rbp, %rdi
jmp 0xac4aa
movq %r9, %r12
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %r15
movq %r9, %rdi
callq 0x6f21b
movq %rax, %rbp
movq %r12, %rdi
callq 0x6f310
leaq -0x2e3f0(%rip), %r8     # 0x7e09c
movl $0x10, %ecx
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0xb7e0
testq %rax, %rax
je 0xac4db
movq %rax, %rbx
movq %r12, %rdi
callq 0x6f21b
subq %rax, %rbx
sarq $0x4, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6f037
movq (%rax), %rcx
testq %rcx, %rcx
je 0xac511
decq %rcx
movq %rcx, (%rax)
movq 0x20(%rsp), %rdi
callq 0xdb133
jmp 0xac51e
movzbl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0xac569
testb %r13b, %r13b
je 0xac537
movq %r14, %rdi
xorl %esi, %esi
callq 0x858a4
leaq 0x3df10(%rip), %rdi     # 0xea40e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb9c0
movzbl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0xac569
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0xac537
movq %r14, %rdi
movq %rbx, %rsi
callq 0x710ce
testb %al, %al
je 0xac546
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x70d40
movq 0x18(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdb133