// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/stream_evaluator.c
// Function: genes_are_equal
static bool genes_are_equal(GtGenomeNode *gn_1, GtGenomeNode *gn_2,
                            const char *feature_type)
{
  GtArray *exons_1, *exons_2, *mRNAs_1, *mRNAs_2;
  StoreGeneFeatureInfo info;
  GtUword i;
  bool equal;
  GT_UNUSED int had_err;

  gt_assert(gn_1 && gn_2 && feature_type);

  /* init */
  exons_1 = gt_array_new(sizeof (GtRange));
  exons_2 = gt_array_new(sizeof (GtRange));
  mRNAs_1 = gt_array_new(sizeof (GtGenomeNode*));
  mRNAs_2 = gt_array_new(sizeof (GtGenomeNode*));

  /* get (direct) gene features */
  info.exons = exons_1;
  info.mRNAs = mRNAs_1;
  info.feature_type = feature_type;
  had_err = gt_feature_node_traverse_direct_children(gt_feature_node_cast(gn_1),
                                                     &info, store_gene_feature,
                                                     NULL);
  gt_assert(!had_err); /* cannot happen, store_gene_feature() is sane */
  info.exons = exons_2;
  info.mRNAs = mRNAs_2;
  had_err = gt_feature_node_traverse_direct_children(gt_feature_node_cast(gn_2),
                                                     &info, store_gene_feature,
                                                     NULL);
  gt_assert(!had_err); /* cannot happen, store_gene_feature() is sane */

  /* sort exon ranges */
  gt_ranges_sort(exons_1);
  gt_ranges_sort(exons_2);

  /* compare exon ranges */
  equal = gt_ranges_are_equal(exons_1, exons_2);

  /* compare mRNAs, if necessary */
  if (equal && gt_array_size(mRNAs_1) == gt_array_size(mRNAs_2)) {
    /* sort mRNAs */
    gt_genome_nodes_sort(mRNAs_1);
    gt_genome_nodes_sort(mRNAs_2);
    for (i = 0; i < gt_array_size(mRNAs_1); i++) {
      gt_assert(equal);
      equal = mRNAs_are_equal(*(GtGenomeNode**) gt_array_get(mRNAs_1, i),
                              *(GtGenomeNode**) gt_array_get(mRNAs_2, i),
                              feature_type);
      if (!equal)
        break;
    }
  }

  /* free */
  gt_array_delete(exons_1);
  gt_array_delete(exons_2);
  gt_array_delete(mRNAs_1);
  gt_array_delete(mRNAs_2);

  return equal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
je 0xac781
testq %rsi, %rsi
je 0xac781
movq %rdx, %rbx
testq %rdx, %rdx
je 0xac781
movq %rdi, %r14
movq %rsi, 0x18(%rsp)
movl $0x10, %edi
callq 0x6e93c
movq %rbx, (%rsp)
movq %rax, %rbx
movl $0x10, %edi
callq 0x6e93c
movq %rax, %r13
movl $0x8, %edi
callq 0x6e93c
movq %rax, %r12
movl $0x8, %edi
callq 0x6e93c
movq %rax, %rbp
leaq 0x20(%rsp), %r15
movq %rbx, 0x8(%rsp)
movq %rbx, (%r15)
movq %r12, 0x8(%r15)
movq (%rsp), %rax
movq %rax, 0x10(%r15)
movq %r14, %rdi
callq 0x3fcd9
leaq 0x741(%rip), %rdx       # 0xacd80
movq %rax, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x411ba
testl %eax, %eax
jne 0xac786
leaq 0x20(%rsp), %r14
movq %r13, (%r14)
movq %rbp, %r15
movq %rbp, 0x8(%r14)
movq 0x18(%rsp), %rdi
callq 0x3fcd9
leaq 0x70c(%rip), %rdx       # 0xacd80
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x411ba
testl %eax, %eax
jne 0xac78b
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x7e92e
movq %r13, %rdi
callq 0x7e92e
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7eb1a
movl %eax, %ebp
testb %al, %al
movq %r13, 0x10(%rsp)
je 0xac73f
movq %r12, %rdi
callq 0x6ecda
movq %rax, %r14
movq %r15, %rbx
movq %r15, %rdi
callq 0x6ecda
cmpq %rax, %r14
jne 0xac744
movq %r12, %rdi
callq 0x4216d
movq %rbx, %rdi
callq 0x4216d
movq %r12, %rdi
callq 0x6ecda
testq %rax, %rax
movq %rbx, %r13
je 0xac747
xorl %r14d, %r14d
movq (%rsp), %rbx
testb $0x1, %bpl
je 0xac77c
movq %r12, %rdi
movq %r14, %rsi
callq 0x6e9fa
movq (%rax), %r15
movq %r13, %rdi
movq %r14, %rsi
callq 0x6e9fa
movq (%rax), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0xac790
movl %eax, %ebp
testb %al, %al
je 0xac747
incq %r14
movq %r12, %rdi
callq 0x6ecda
cmpq %rax, %r14
jb 0xac6fa
jmp 0xac747
movq %r15, %r13
jmp 0xac747
movq %rbx, %r13
movq 0x8(%rsp), %rdi
callq 0x6f134
movq 0x10(%rsp), %rdi
callq 0x6f134
movq %r12, %rdi
callq 0x6f134
movq %r13, %rdi
callq 0x6f134
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x252bf
callq 0x25214
callq 0x2524d
callq 0x25286