// File: /workspace/github_c_makefile_star2_O1/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, (%rsp)
testq %rdx, %rdx
je 0xab313
movq %rdx, %rdi
callq 0x3566a
testb %al, %al
jne 0xab97a
testq %r14, %r14
je 0xab975
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xab975
callq 0x41f83
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq (%rsp), %rdi
callq 0x3fdd2
movl %eax, %ebp
movl $0x8, %edi
callq 0x6e93c
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x61545(%rip), %rsi     # 0x10c8a0
callq 0x40409
testb %al, %al
je 0xab46f
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0xdaaae
movq 0x20(%r14), %rdi
movl $0x1, %esi
callq 0xdaaae
cmpl $0x1, %ebp
ja 0xab59b
xorl %r13d, %r13d
testl %ebp, %ebp
setne %r13b
movq (%r14), %rax
shll $0x3, %r13d
movq (%rax,%r13), %rdi
callq 0x6ebe9
movq %rax, %r15
movq (%r14), %rax
movq (%rax,%r13), %rdi
callq 0x6ecda
movq (%r14), %r10
leaq -0x69318(%rip), %r9     # 0x420a7
movq %rsp, %r12
movl $0x8, %r8d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
pushq 0x120(%r10,%r13)
pushq $0x0
callq 0xbc909
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x6ecda
movq (%r12), %rsi
movq (%r14), %rdi
testq %rax, %rax
je 0xab797
movq (%rdi), %rdx
movq 0x8(%rdi), %rcx
movq 0xd8(%rdi), %r8
movq 0xe0(%rdi), %r9
subq $0x8, %rsp
leaq 0x51563(%rip), %rax     # 0xfc982
leaq 0x1185(%rip), %r15      # 0xac5ab
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x18(%r14)
callq 0xac434
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 0x39d8f(%rip), %rax     # 0xe51ef
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x20(%r14)
jmp 0xab58d
movq (%rsp), %rdi
leaq 0x397d0(%rip), %rsi     # 0xe4c4a
callq 0x40409
testb %al, %al
je 0xab5b3
movq 0x28(%r14), %rdi
movl $0x1, %esi
callq 0xdaaae
movq 0x30(%r14), %rdi
movl $0x1, %esi
callq 0xdaaae
cmpl $0x1, %ebp
ja 0xab69b
xorl %r13d, %r13d
testl %ebp, %ebp
setne %r13b
movq (%r14), %rax
shll $0x3, %r13d
movq 0x10(%rax,%r13), %rdi
callq 0x6ebe9
movq %rax, %r15
movq (%r14), %rax
movq 0x10(%rax,%r13), %rdi
callq 0x6ecda
movq (%r14), %r10
leaq -0x69439(%rip), %r9     # 0x420a7
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 0xbc909
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x6ecda
movq (%r12), %rsi
movq (%r14), %rdi
testq %rax, %rax
je 0xab8ca
movq 0x10(%rdi), %rdx
movq 0x18(%rdi), %rcx
movq 0xf8(%rdi), %r8
movq 0x100(%rdi), %r9
subq $0x8, %rsp
leaq 0x51441(%rip), %rax     # 0xfc982
leaq 0x1248(%rip), %r15      # 0xac790
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x28(%r14)
callq 0xac434
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 0x39c6c(%rip), %rax     # 0xe51ef
movq %rbx, %rdi
pushq %rax
pushq %r15
pushq 0x30(%r14)
callq 0xac434
addq $0x20, %rsp
jmp 0xab952
cmpb $0x1, 0x9(%r14)
jne 0xab952
movq %rsp, %rdi
callq 0x24f08
jmp 0xab952
movq (%rsp), %rdi
leaq 0x50eb4(%rip), %rsi     # 0xfc472
callq 0x40409
testb %al, %al
je 0xab6b3
movq 0x38(%r14), %rdi
movl $0x1, %esi
callq 0xdaaae
movq (%r14), %rax
movq 0x20(%rax), %rdi
callq 0x6ebe9
movq %rax, %r15
movq (%r14), %rax
movq 0x20(%rax), %rdi
callq 0x6ecda
leaq 0x10(%r14), %r10
movq (%r14), %r11
leaq -0x6954e(%rip), %r9     # 0x420b4
movq %rsp, %rsi
movl $0x8, %r8d
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
pushq 0x140(%r11)
pushq %r10
callq 0xbc909
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x6ecda
testq %rax, %rax
je 0xab8f9
movq %rbx, %rdi
callq 0x6ecda
testq %rax, %rax
je 0xab952
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6e9fa
movq (%rax), %r12
movq (%r14), %rax
movq 0x20(%rax), %rdi
callq 0x6ebe9
subq %rax, %r12
sarq $0x3, %r12
movq (%r14), %rax
movq 0x118(%rax), %rdi
movq %r12, %rsi
callq 0x70b1b
testb %al, %al
je 0xab92e
incq %r15
movq %rbx, %rdi
callq 0x6ecda
cmpq %rax, %r15
jb 0xab64b
jmp 0xab952
cmpb $0x1, 0x9(%r14)
jne 0xab952
movq %rsp, %rdi
callq 0x24ee1
jmp 0xab952
movq (%rsp), %rdi
leaq 0x512c4(%rip), %rsi     # 0xfc982
callq 0x40409
testb %al, %al
je 0xab7cc
movq 0x40(%r14), %rdi
movq (%rsp), %rsi
callq 0xac885
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r14), %rcx
movq 0x48(%r14), %rdx
movq 0x168(%rcx,%rax,8), %rdi
movq (%rsp), %rcx
leaq 0x8(%rsp), %rsi
callq 0xac938
cmpl $0x1, %ebp
ja 0xab91d
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 0xac9fd
addq $0x40, %rsp
cmpb $0x1, 0x8(%r14)
jne 0xab952
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 0xab8ae
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
shll $0x3, %ecx
movq (%rdi,%rcx), %rax
movq (%r14), %rdx
movq 0x120(%rdx,%rcx), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x41611
testb %al, %al
jne 0xab952
movq 0x60(%r14), %rax
jmp 0xab918
movq (%rsp), %rdi
leaq 0x39a18(%rip), %rsi     # 0xe51ef
callq 0x40409
testb %al, %al
je 0xab952
movq 0x50(%r14), %rdi
movq (%rsp), %rsi
callq 0xac885
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r14), %rcx
movq 0x58(%r14), %rdx
movq 0x178(%rcx,%rax,8), %rdi
movq (%rsp), %rcx
leaq 0x8(%rsp), %rsi
callq 0xac938
cmpl $0x1, %ebp
ja 0xab94b
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 0xac9fd
addq $0x40, %rsp
cmpb $0x1, 0x8(%r14)
jne 0xab952
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 0xac3b6
jmp 0xab952
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
shll $0x3, %ecx
movq 0x10(%rdi,%rcx), %rax
movq (%r14), %rdx
movq 0x130(%rdx,%rcx), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x41611
testb %al, %al
jne 0xab952
movq 0x68(%r14), %rax
jmp 0xab918
movq (%rsp), %rdi
movq (%r14), %rax
movq 0x20(%rax), %rsi
movq 0x140(%rax), %rdx
callq 0x41611
testb %al, %al
jne 0xab952
movq 0x70(%r14), %rax
incq (%rax)
jmp 0xab952
cmpb $0x1, 0x9(%r14)
jne 0xab952
movq %rsp, %rdi
callq 0x24eb9
jmp 0xab952
movq (%r14), %rax
movq 0x118(%rax), %rdi
movq %r12, %rsi
callq 0x70790
movq 0x38(%r14), %rdi
callq 0xdaa77
jmp 0xab952
cmpb $0x1, 0x9(%r14)
je 0xab96b
movq %rbx, %rdi
callq 0x6f134
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
callq 0x24e91
jmp 0xab952
callq 0x24e58
callq 0x24e1f