// File: /workspace/github_c_makefile_star2_O3/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 0xabc76
testq %rsi, %rsi
je 0xabc76
movq %rdx, %rbx
testq %rdx, %rdx
je 0xabc76
movq %rdi, %r14
movq %rsi, 0x18(%rsp)
movl $0x10, %edi
callq 0x6ef7c
movq %rbx, (%rsp)
movq %rax, %rbx
movl $0x10, %edi
callq 0x6ef7c
movq %rax, %r13
movl $0x8, %edi
callq 0x6ef7c
movq %rax, %r12
movl $0x8, %edi
callq 0x6ef7c
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 0x3f369
leaq 0x731(%rip), %rdx       # 0xac275
movq %rax, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x40831
testl %eax, %eax
jne 0xabc7b
leaq 0x20(%rsp), %r14
movq %r13, (%r14)
movq %rbp, %r15
movq %rbp, 0x8(%r14)
movq 0x18(%rsp), %rdi
callq 0x3f369
leaq 0x6fc(%rip), %rdx       # 0xac275
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x40831
testl %eax, %eax
jne 0xabc80
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x7ea1b
movq %r13, %rdi
callq 0x7ea1b
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7eba7
testb %al, %al
movq %r13, 0x10(%rsp)
je 0xabc3c
movq %r12, %rdi
callq 0x6f310
movq %rax, %r14
movq %r15, %r13
movq %r15, %rdi
callq 0x6f310
movb $0x1, %bpl
cmpq %rax, %r14
movq (%rsp), %rbx
jne 0xabc41
movq %r12, %rdi
callq 0x417cf
movq %r13, %rdi
callq 0x417cf
movq %r12, %rdi
callq 0x6f310
testq %rax, %rax
je 0xabc41
xorl %r14d, %r14d
movq %r12, %rdi
movq %r14, %rsi
callq 0x6f037
movq (%rax), %r15
movq %r13, %rdi
movq %r14, %rsi
callq 0x6f037
movq (%rax), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0xabc85
movl %eax, %ebp
testb %al, %al
je 0xabc41
incq %r14
movq %r12, %rdi
callq 0x6f310
cmpq %rax, %r14
jb 0xabbfd
jmp 0xabc41
xorl %ebp, %ebp
movq %r15, %r13
movq 0x8(%rsp), %rdi
callq 0x6f768
movq 0x10(%rsp), %rdi
callq 0x6f768
movq %r12, %rdi
callq 0x6f768
movq %r13, %rdi
callq 0x6f768
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x250fd
callq 0x25136
callq 0x2516f