// File: /workspace/github_c_makefile_star2_O1/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 0x6ebe9
movq %rax, %r15
movq %rbx, %rdi
callq 0x6ecda
leaq -0x2f01e(%rip), %r8     # 0x7df58
movl $0x10, %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xb7e0
testq %rax, %rax
je 0xacfd8
movq %rax, %r14
movl 0x8(%rsp), %r15d
testl %r13d, %r13d
je 0xad014
movq %r12, %rdi
callq 0x6ebe9
subq %rax, %r14
sarq $0x4, %r14
movq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x6e9fa
movq (%rax), %rcx
testq %rcx, %rcx
je 0xad04c
decq %rcx
movq %rcx, (%rax)
movq 0x18(%rsp), %rdi
callq 0xdaa77
jmp 0xad058
movzbl 0x8(%rsp), %esi
movq %rbp, %rdi
callq 0xad0b6
cmpb $0x0, 0xc(%rsp)
je 0xad084
movq %rbp, %rdi
xorl %esi, %esi
callq 0x85dd0
leaq 0x3d45d(%rip), %rdi     # 0xea45e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb9c0
movq 0x28(%rsp), %rdi
callq 0x6ebe9
subq %rax, %r14
sarq $0x4, %r14
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x6e9fa
movq (%rax), %rcx
testq %rcx, %rcx
je 0xad05f
decq %rcx
movq %rcx, (%rax)
movq 0x18(%rsp), %rdi
callq 0xdaa77
jmp 0xad06b
movzbl %r15b, %esi
movq %rbp, %rdi
callq 0xad0b6
movq 0x40(%rsp), %rbx
jmp 0xad070
movzbl %r15b, %esi
movq %rbp, %rdi
callq 0xad0b6
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0xad084
movq %rbx, %rdi
movq %r14, %rsi
callq 0x70b1b
testb %al, %al
je 0xad093
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x70790
movq 0x10(%rsp), %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdaa77