// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/stream_evaluator.c
// Function: process_predicted_feature
static int process_predicted_feature(GtFeatureNode *fn, void *data,
                                     GT_UNUSED GtError *err)
{
  ProcessPredictedFeatureInfo *info = (ProcessPredictedFeatureInfo*) data;
  GtRange predicted_range;
  GtUword i, num;
  GtStrand predicted_strand;
  GtArray *real_genome_nodes;
  GtGenomeNode **real_gn;

  gt_error_check(err);
  gt_assert(fn && data);

  predicted_range = gt_genome_node_get_range((GtGenomeNode*) fn);
  predicted_strand = gt_feature_node_get_strand(fn);
  real_genome_nodes = gt_array_new(sizeof (GtGenomeNode**));

  if (gt_feature_node_has_type(fn, gt_ft_gene)) {
    /* store predicted gene */
    gt_evaluator_add_predicted(info->mRNA_gene_evaluator, 1);
    gt_evaluator_add_predicted(info->CDS_gene_evaluator, 1);
    /* determine true gene */
    switch (predicted_strand) {
      case GT_STRAND_FORWARD:
      case GT_STRAND_REVERSE:
        gt_bsearch_all_mark(real_genome_nodes, &fn,
                            predicted_strand == GT_STRAND_FORWARD
                            ? gt_array_get_space(info->slot->genes_forward)
                            : gt_array_get_space(info->slot->genes_reverse),
                            predicted_strand == GT_STRAND_FORWARD
                            ? gt_array_size(info->slot->genes_forward)
                            : gt_array_size(info->slot->genes_reverse),
                            sizeof (GtGenomeNode*),
                            (GtCompareWithData)
                            gt_genome_node_compare_with_data,
                            NULL,
                            predicted_strand == GT_STRAND_FORWARD
                            ? info->slot->overlapped_genes_forward
                            : info->slot->overlapped_genes_reverse);
        if (gt_array_size(real_genome_nodes)) {
          /* gene(s) with the same range found -> check if they are equal */
          compare_features(real_genome_nodes, fn, info->slot->genes_forward,
                           info->slot->genes_reverse,
                           info->slot->true_mRNA_genes_forward,
                           info->slot->true_mRNA_genes_reverse,
                           info->mRNA_gene_evaluator, genes_are_equal,
                           gt_ft_exon);
          compare_features(real_genome_nodes, fn, info->slot->genes_forward,
                           info->slot->genes_reverse,
                           info->slot->true_CDS_genes_forward,
                           info->slot->true_CDS_genes_reverse,
                           info->CDS_gene_evaluator, genes_are_equal,
                           gt_ft_CDS);
        }
        else {
          /* no gene with the same range found -> check if this is a wrong
             gene */
          if (!gt_feature_node_overlaps_nodes_mark(fn,
                                    predicted_strand == GT_STRAND_FORWARD
                                    ? info->slot->genes_forward
                                    : info->slot->genes_reverse,
                                    predicted_strand == GT_STRAND_FORWARD
                                    ? info->slot->overlapped_genes_forward
                                    : info->slot->overlapped_genes_reverse)) {
            (*info->wrong_genes)++;
          }
        }
        break;
      default:
        if (info->verbose) {
          fprintf(stderr, "skipping predicted gene with unknown orientation "
                  "(line %u)\n",
                  gt_genome_node_get_line_number((GtGenomeNode*) fn));
        }
    }
  }
  else if (gt_feature_node_has_type(fn, gt_ft_mRNA)) {
    /* store predicted mRNA */
    gt_evaluator_add_predicted(info->mRNA_mRNA_evaluator, 1);
    gt_evaluator_add_predicted(info->CDS_mRNA_evaluator, 1);
    /* determine true mRNA */
    switch (predicted_strand) {
      case GT_STRAND_FORWARD:
      case GT_STRAND_REVERSE:
        gt_bsearch_all_mark(real_genome_nodes, &fn,
                            predicted_strand == GT_STRAND_FORWARD
                            ? gt_array_get_space(info->slot->mRNAs_forward)
                            : gt_array_get_space(info->slot->mRNAs_reverse),
                            predicted_strand == GT_STRAND_FORWARD
                            ? gt_array_size(info->slot->mRNAs_forward)
                            : gt_array_size(info->slot->mRNAs_reverse),
                            sizeof (GtGenomeNode*),
                            (GtCompareWithData)
                            gt_genome_node_compare_with_data,
                            NULL,
                            predicted_strand == GT_STRAND_FORWARD
                            ? info->slot->overlapped_mRNAs_forward
                            : info->slot->overlapped_mRNAs_reverse);
        if (gt_array_size(real_genome_nodes)) {
          /* mRNA(s) with the same range found -> check if they are equal */
          compare_features(real_genome_nodes, fn, info->slot->mRNAs_forward,
                           info->slot->mRNAs_reverse,
                           info->slot->true_mRNA_mRNAs_forward,
                           info->slot->true_mRNA_mRNAs_reverse,
                           info->mRNA_mRNA_evaluator, mRNAs_are_equal,
                           gt_ft_exon);
          compare_features(real_genome_nodes, fn, info->slot->mRNAs_forward,
                           info->slot->mRNAs_reverse,
                           info->slot->true_CDS_mRNAs_forward,
                           info->slot->true_CDS_mRNAs_reverse,
                           info->CDS_mRNA_evaluator, mRNAs_are_equal,
                           gt_ft_CDS);
        }
        else {
          /* no mRNA with the same range found -> check if this is a wrong
             mRNA */
          if (!gt_feature_node_overlaps_nodes_mark(fn,
                                    predicted_strand == GT_STRAND_FORWARD
                                    ? info->slot->mRNAs_forward
                                    : info->slot->mRNAs_reverse,
                                    predicted_strand == GT_STRAND_FORWARD
                                    ? info->slot->overlapped_mRNAs_forward
                                    : info->slot->overlapped_mRNAs_reverse)) {
            (*info->wrong_mRNAs)++;
          }
        }
        break;
      default:
        if (info->verbose) {
          fprintf(stderr, "skipping predicted mRNA with unknown orientation "
                  "(line %u)\n",
                  gt_genome_node_get_line_number((GtGenomeNode*) fn));
        }
    }
  }
  else if (gt_feature_node_has_type(fn, gt_ft_LTR_retrotransposon)) {
    /* store predicted LTR */
    gt_evaluator_add_predicted(info->LTR_evaluator, 1);
    /* determine true LTR */
    gt_bsearch_all_mark(real_genome_nodes, &fn,
                        gt_array_get_space(info->slot->LTRs),
                        gt_array_size(info->slot->LTRs),
                        sizeof (GtGenomeNode*),
                        (GtCompareWithData) gt_genome_node_compare_delta,
                        &info->LTRdelta,
                        info->slot->overlapped_LTRs);

    if (gt_array_size(real_genome_nodes)) {
      for (i = 0; i < gt_array_size(real_genome_nodes); i++) {
        real_gn = *(GtGenomeNode***) gt_array_get(real_genome_nodes, i);
        num = real_gn - (GtGenomeNode**) gt_array_get_space(info->slot->LTRs);
        if (!gt_bittab_bit_is_set(info->slot->true_LTRs, num)) {
          gt_bittab_set_bit(info->slot->true_LTRs, num);
          gt_evaluator_add_true(info->LTR_evaluator);
          /*@loopbreak@*/
          break;
        }
      }
    }
    else {
      /* no LTR with the same range found -> check if this is a wrong LTR */
      if (!gt_feature_node_overlaps_nodes_mark(fn, info->slot->LTRs,
                                               info->slot->overlapped_LTRs)) {
        (*info->wrong_LTRs)++;
      }
    }
  }
  else if (gt_feature_node_has_type(fn, gt_ft_exon)) {
    /* store predicted exon (mRNA level)*/
    store_predicted_exon(info->mRNA_exon_evaluators, fn);

    /* store predicted exon (mRNA level, collapsed) */
    store_predicted_exon_collapsed(predicted_strand == GT_STRAND_FORWARD
                                   ? info->slot->used_mRNA_exons_forward
                                   : info->slot->used_mRNA_exons_reverse,
                                   &predicted_range,
                                   info->mRNA_exon_evaluators_collapsed, fn);

    /* determine true exon (mRNA level)*/
    switch (predicted_strand) {
      case GT_STRAND_FORWARD:
      case GT_STRAND_REVERSE:
        store_true_exon(fn, predicted_strand, &predicted_range,
                        info->exondiff, info->exondiffcollapsed,
                        info->slot->mRNA_exons_forward,
                        info->slot->mRNA_exons_reverse,
                        info->slot->mRNA_counts_forward,
                        info->slot->mRNA_counts_reverse,
                        info->slot->mRNA_exon_bittabs_forward,
                        info->slot->mRNA_exon_bittabs_reverse,
                        info->mRNA_exon_evaluators,
                        info->mRNA_exon_evaluators_collapsed);
        /* nucleotide level */
        if (info->nuceval) {
          add_nucleotide_exon(predicted_strand == GT_STRAND_FORWARD
                              ? info->slot->pred_mRNA_nucleotides_forward
                              : info->slot->pred_mRNA_nucleotides_reverse,
                              predicted_range, info->slot->real_range,
                              predicted_strand == GT_STRAND_FORWARD
                              ? &info->slot->FP_mRNA_nucleotides_forward
                              : &info->slot->FP_mRNA_nucleotides_reverse);
        }
        break;
      default:
        if (info->verbose) {
          fprintf(stderr, "skipping predicted exon with unknown orientation "
                  "(line %u)\n",
                  gt_genome_node_get_line_number((GtGenomeNode*) fn));
        }
    }
  }
  else if (gt_feature_node_has_type(fn, gt_ft_CDS)) {
    /* store predicted exon (CDS level)*/
    store_predicted_exon(info->CDS_exon_evaluators, fn);

    /* store predicted exon (CDS level, collapsed) */
    store_predicted_exon_collapsed(predicted_strand == GT_STRAND_FORWARD
                                   ? info->slot->used_CDS_exons_forward
                                   : info->slot->used_CDS_exons_reverse,
                                   &predicted_range,
                                   info->CDS_exon_evaluators_collapsed, fn);

    /* determine true exon (CDS level) */
    switch (predicted_strand) {
      case GT_STRAND_FORWARD:
      case GT_STRAND_REVERSE:
        store_true_exon(fn, predicted_strand, &predicted_range,
                        info->exondiff, info->exondiffcollapsed,
                        info->slot->CDS_exons_forward,
                        info->slot->CDS_exons_reverse,
                        info->slot->CDS_counts_forward,
                        info->slot->CDS_counts_reverse,
                        info->slot->CDS_exon_bittabs_forward,
                        info->slot->CDS_exon_bittabs_reverse,
                        info->CDS_exon_evaluators,
                        info->CDS_exon_evaluators_collapsed);
        /* nucleotide level */
        if (info->nuceval) {
          add_nucleotide_exon(predicted_strand == GT_STRAND_FORWARD
                              ? info->slot->pred_CDS_nucleotides_forward
                              : info->slot->pred_CDS_nucleotides_reverse,
                              predicted_range, info->slot->real_range,
                              predicted_strand == GT_STRAND_FORWARD
                              ? &info->slot->FP_CDS_nucleotides_forward
                              : &info->slot->FP_CDS_nucleotides_reverse);
        }
        break;
      default:
        if (info->verbose) {
          fprintf(stderr, "skipping predicted exon with unknown orientation "
                  "(line %u)\n",
                  gt_genome_node_get_line_number((GtGenomeNode*) fn));
        }
      }
  }
  gt_array_delete(real_genome_nodes);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq %rdi, (%rsp)
testq %rdx, %rdx
je 0xaa82e
movq %rdx, %rdi
callq 0x34fea
testb %al, %al
jne 0xaae8f
testq %r14, %r14
je 0xaae8a
testq %r15, %r15
je 0xaae8a
movq %r15, %rdi
callq 0x415e5
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %r15, %rdi
callq 0x3f462
movl %eax, %ebp
movl $0x8, %edi
callq 0x6ef7c
movq %rax, %rbx
leaq 0x61e50(%rip), %rsi     # 0x10c6c0
movq %r15, %rdi
callq 0x3faa4
testb %al, %al
je 0xaa8ca
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0xdb16a
movq 0x20(%r14), %rdi
movl $0x1, %esi
callq 0xdb16a
cmpl $0x1, %ebp
ja 0xaa9ec
movq (%r14), %rax
testl %ebp, %ebp
je 0xaabe4
movq 0x8(%rax), %rdi
callq 0x6f21b
movq %rax, %r15
movq (%r14), %rax
addq $0x8, %rax
movl $0x128, %r13d           # imm = 0x128
jmp 0xaabf8
leaq 0x3a359(%rip), %rsi     # 0xe4c2a
movq %r15, %rdi
callq 0x3faa4
testb %al, %al
je 0xaaa04
movq 0x28(%r14), %rdi
movl $0x1, %esi
callq 0xdb16a
movq 0x30(%r14), %rdi
movl $0x1, %esi
callq 0xdb16a
cmpl $0x1, %ebp
ja 0xaaaeb
xorl %r13d, %r13d
testl %ebp, %ebp
setne %r13b
movq (%r14), %rax
shll $0x3, %r13d
movq 0x10(%rax,%r13), %rdi
callq 0x6f21b
movq %rax, %r15
movq (%r14), %rax
movq 0x10(%rax,%r13), %rdi
callq 0x6f310
movq (%r14), %r10
leaq -0x69231(%rip), %r9     # 0x41709
movq %rsp, %r12
movl $0x8, %r8d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
pushq 0x130(%r10,%r13)
pushq $0x0
callq 0xbd973
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x6f310
movq (%r12), %rsi
movq (%r14), %rdi
testq %rax, %rax
je 0xaade5
movq 0x10(%rdi), %rdx
movq 0x18(%rdi), %rcx
movq 0xf8(%rdi), %r8
movq 0x100(%rdi), %r9
subq $0x8, %rsp
leaq 0x51f57(%rip), %rax     # 0xfc8f2
leaq 0x12e3(%rip), %r15      # 0xabc85
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x28(%r14)
callq 0xab939
addq $0x20, %rsp
movq (%rsp), %rsi
movq (%r14), %rax
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
movq 0x108(%rax), %r8
movq 0x110(%rax), %r9
subq $0x8, %rsp
leaq 0x3a7f2(%rip), %rax     # 0xe51cf
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x30(%r14)
jmp 0xaacad
cmpb $0x1, 0x9(%r14)
jne 0xaae67
movq %r15, %rdi
callq 0x24df4
jmp 0xaae67
leaq 0x519d7(%rip), %rsi     # 0xfc3e2
movq %r15, %rdi
callq 0x3faa4
testb %al, %al
je 0xaab03
movq 0x38(%r14), %rdi
movl $0x1, %esi
callq 0xdb16a
movq (%r14), %rax
movq 0x20(%rax), %rdi
callq 0x6f21b
movq %rax, %r15
movq (%r14), %rax
movq 0x20(%rax), %rdi
callq 0x6f310
leaq 0x10(%r14), %r10
movq (%r14), %r11
leaq -0x6933c(%rip), %r9     # 0x41716
movq %rsp, %rsi
movl $0x8, %r8d
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
pushq 0x140(%r11)
pushq %r10
callq 0xbd973
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x6f310
testq %rax, %rax
je 0xaae0e
movq %rbx, %rdi
callq 0x6f310
testq %rax, %rax
je 0xaae67
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6f037
movq (%rax), %r12
movq (%r14), %rax
movq 0x20(%rax), %rdi
callq 0x6f21b
subq %rax, %r12
sarq $0x3, %r12
movq (%r14), %rax
movq 0x118(%rax), %rdi
movq %r12, %rsi
callq 0x710ce
testb %al, %al
je 0xaae43
incq %r15
movq %rbx, %rdi
callq 0x6f310
cmpq %rax, %r15
jb 0xaaa9b
jmp 0xaae67
cmpb $0x1, 0x9(%r14)
jne 0xaae67
movq %r15, %rdi
callq 0x24dd0
jmp 0xaae67
leaq 0x51de8(%rip), %rsi     # 0xfc8f2
movq %r15, %rdi
callq 0x3faa4
testb %al, %al
je 0xaacea
movq 0x40(%r14), %rdi
movq %r15, %rsi
callq 0xabd7a
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r14), %rcx
movq 0x48(%r14), %rdx
movq 0x168(%rcx,%rax,8), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rcx
callq 0xabe2d
cmpl $0x1, %ebp
ja 0xaae32
movq (%rsp), %rdi
movzbl 0xa(%r14), %ecx
movzbl 0xb(%r14), %r8d
movq (%r14), %rax
movq 0x28(%rax), %r9
movq 0x30(%rax), %rdx
movq 0x48(%rax), %rsi
movq 0x50(%rax), %r10
movq 0x148(%rax), %r11
movq 0x150(%rax), %rax
movups 0x40(%r14), %xmm0
subq $0x40, %rsp
movups %xmm0, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdx, (%rsp)
leaq 0x48(%rsp), %rdx
movl %ebp, %esi
callq 0xabef2
addq $0x40, %rsp
cmpb $0x1, 0x8(%r14)
jne 0xaae67
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r14), %r8
leaq (%r8,%rax,8), %r9
addq $0x78, %r9
shll $0x4, %eax
movq 0xa0(%r8,%rax), %rdi
jmp 0xaadc9
movq (%rax), %rdi
callq 0x6f21b
movq %rax, %r15
movq (%r14), %rax
movl $0x120, %r13d           # imm = 0x120
movq (%rax), %rdi
callq 0x6f310
movq (%r14), %r10
leaq -0x69501(%rip), %r9     # 0x41709
movq %rsp, %r12
movl $0x8, %r8d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
pushq (%r10,%r13)
pushq $0x0
callq 0xbd973
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x6f310
movq (%r12), %rsi
movq (%r14), %rdi
testq %rax, %rax
je 0xaacbb
movq (%rdi), %rdx
movq 0x8(%rdi), %rcx
movq 0xd8(%rdi), %r8
movq 0xe0(%rdi), %r9
subq $0x8, %rsp
leaq 0x51c90(%rip), %rax     # 0xfc8f2
leaq 0xe47(%rip), %r15       # 0xabab0
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x18(%r14)
callq 0xab939
addq $0x20, %rsp
movq (%rsp), %rsi
movq (%r14), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq 0xe8(%rax), %r8
movq 0xf0(%rax), %r9
subq $0x8, %rsp
leaq 0x3a52c(%rip), %rax     # 0xe51cf
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x20(%r14)
callq 0xab939
addq $0x20, %rsp
jmp 0xaae67
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
movq (%rdi,%rcx,8), %rax
movq 0x120(%rdi,%rcx,8), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x40c88
testb %al, %al
jne 0xaae67
movq 0x60(%r14), %rax
jmp 0xaae2d
leaq 0x3a4de(%rip), %rsi     # 0xe51cf
movq %r15, %rdi
callq 0x3faa4
testb %al, %al
je 0xaae67
movq 0x50(%r14), %rdi
movq %r15, %rsi
callq 0xabd7a
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r14), %rcx
movq 0x58(%r14), %rdx
movq 0x178(%rcx,%rax,8), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rcx
callq 0xabe2d
cmpl $0x1, %ebp
ja 0xaae60
movq (%rsp), %rdi
movzbl 0xa(%r14), %ecx
movzbl 0xb(%r14), %r8d
movq (%r14), %rax
movq 0x38(%rax), %r9
movq 0x40(%rax), %rdx
movq 0x58(%rax), %rsi
movq 0x60(%rax), %r10
movq 0x158(%rax), %r11
movq 0x160(%rax), %rax
movups 0x50(%r14), %xmm0
subq $0x40, %rsp
movups %xmm0, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdx, (%rsp)
leaq 0x48(%rsp), %rdx
movl %ebp, %esi
callq 0xabef2
addq $0x40, %rsp
cmpb $0x1, 0x8(%r14)
jne 0xaae67
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r14), %r8
leaq (%r8,%rax,8), %r9
addq $0x88, %r9
shll $0x4, %eax
movq 0xc0(%r8,%rax), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x68(%r8), %rcx
movq 0x70(%r8), %r8
callq 0xab8bb
jmp 0xaae67
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
movq 0x10(%rdi,%rcx,8), %rax
movq 0x130(%rdi,%rcx,8), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x40c88
testb %al, %al
jne 0xaae67
movq 0x68(%r14), %rax
jmp 0xaae2d
movq (%rsp), %rdi
movq (%r14), %rax
movq 0x20(%rax), %rsi
movq 0x140(%rax), %rdx
callq 0x40c88
testb %al, %al
jne 0xaae67
movq 0x70(%r14), %rax
incq (%rax)
jmp 0xaae67
cmpb $0x1, 0x9(%r14)
jne 0xaae67
movq %rsp, %rdi
callq 0x24da8
jmp 0xaae67
movq (%r14), %rax
movq 0x118(%rax), %rdi
movq %r12, %rsi
callq 0x70d40
movq 0x38(%r14), %rdi
callq 0xdb133
jmp 0xaae67
cmpb $0x1, 0x9(%r14)
je 0xaae80
movq %rbx, %rdi
callq 0x6f768
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
callq 0x24d80
jmp 0xaae67
callq 0x24d47
callq 0x24d0e