// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movq %r8, %r14
movl %ecx, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movl %esi, %r13d
movq %rdi, %rbp
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %r12
testl %esi, %esi
movq %r12, %rbx
movq %r9, 0x28(%rsp)
cmoveq %r9, %rbx
movq %rbx, %rdi
callq 0x4b7ab
movq %rax, %r15
movq %rbx, %rdi
callq 0x4b988
leaq -0x316e5(%rip), %r8     # 0x5cec8
pushq $0x10
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xb7e0
testq %rax, %rax
je 0x8e60d
movq %rax, %r14
movl 0x8(%rsp), %r15d
testl %r13d, %r13d
je 0x8e649
movq %r12, %rdi
callq 0x4b7ab
subq %rax, %r14
sarq $0x4, %r14
movq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x4b48e
movq (%rax), %rcx
testq %rcx, %rcx
je 0x8e681
decq %rcx
movq %rcx, (%rax)
movq 0x18(%rsp), %rdi
callq 0xc3719
jmp 0x8e68d
movzbl 0x8(%rsp), %esi
movq %rbp, %rdi
callq 0x8e6eb
cmpb $0x0, 0xc(%rsp)
je 0x8e6b9
movq %rbp, %rdi
xorl %esi, %esi
callq 0x6568c
leaq 0x44dc8(%rip), %rdi     # 0xd33fe
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb9b0
movq 0x28(%rsp), %rdi
callq 0x4b7ab
subq %rax, %r14
sarq $0x4, %r14
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x4b48e
movq (%rax), %rcx
testq %rcx, %rcx
je 0x8e694
decq %rcx
movq %rcx, (%rax)
movq 0x18(%rsp), %rdi
callq 0xc3719
jmp 0x8e6a0
movzbl %r15b, %esi
movq %rbp, %rdi
callq 0x8e6eb
movq 0x40(%rsp), %rbx
jmp 0x8e6a5
movzbl %r15b, %esi
movq %rbp, %rdi
callq 0x8e6eb
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0x8e6b9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4de2d
testb %al, %al
je 0x8e6c8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d737
movq 0x10(%rsp), %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc3719