// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/gtf_parser.c
// Function: construct_mRNAs
static int construct_mRNAs(GT_UNUSED void *key, void *value, void *data,
                           GtError *err)
{
  ConstructionInfo *cinfo = (ConstructionInfo*) data;
  GtArray *gt_genome_node_array = (GtArray*) value,
          *mRNAs = (GtArray*) cinfo->mRNAs;
  GtGenomeNode *mRNA_node, *first_node, *gn;
  const char *tname;
  GtStrand mRNA_strand;
  GtRange mRNA_range;
  GtStr *mRNA_seqid;
  GtUword i;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(key && value && data);
   /* at least one node in array */
  gt_assert(gt_array_size(gt_genome_node_array));

  /* determine the range and the strand of the mRNA */
  first_node = *(GtGenomeNode**) gt_array_get(gt_genome_node_array, 0);
  mRNA_range = gt_genome_node_get_range(first_node);
  mRNA_strand = gt_feature_node_get_strand((GtFeatureNode*) first_node);
  mRNA_seqid = gt_genome_node_get_seqid(first_node);

  /* TODO: support discontinuous start/stop codons */
  for (i = 0; !had_err && i < gt_array_size(gt_genome_node_array); i++) {
    gn = *(GtGenomeNode**) gt_array_get(gt_genome_node_array, i);
    if (gt_feature_node_get_attribute((GtFeatureNode*) gn,
        GTF_PARSER_STOP_CODON_FLAG)) {
      GtUword j;
      GtRange stop_codon_rng = gt_genome_node_get_range(gn);
      bool found_cds = false;
      for (j = 0; !had_err && j < gt_array_size(gt_genome_node_array); j++) {
        GtGenomeNode* gn2;
        GtRange this_rng;
        const char *this_type;
        gn2 = *(GtGenomeNode**) gt_array_get(gt_genome_node_array, j);
        if (gn == gn2) continue;
        this_rng = gt_genome_node_get_range(gn2);
        this_type = gt_feature_node_get_type((GtFeatureNode*) gn2);
        if (this_type == gt_symbol(gt_ft_CDS)) {
          if (gt_range_contains(&this_rng, &stop_codon_rng)) {
            if (cinfo->tidy) {
              gt_warning("stop codon on line %u in file %s is contained in "
                         "CDS in line %u",
                         gt_genome_node_get_line_number(gn),
                         gt_genome_node_get_filename(gn),
                         gt_genome_node_get_line_number(gn2));
              found_cds = true;
            } else {
              gt_error_set(err, "stop codon on line %u in file %s is "
                                "contained in CDS in line %u",
                           gt_genome_node_get_line_number(gn),
                           gt_genome_node_get_filename(gn),
                           gt_genome_node_get_line_number(gn2));
              had_err = -1;
            }
            break;
          }
          if (this_rng.end + 1 == stop_codon_rng.start) {
            this_rng.end = stop_codon_rng.end;
            gt_genome_node_set_range(gn2, &this_rng);
            found_cds = true;
            break;
          }
          if (this_rng.start == stop_codon_rng.end + 1) {
            this_rng.start = stop_codon_rng.start;
            gt_genome_node_set_range(gn2, &this_rng);
            found_cds = true;
            break;
          }
        }
      }
      if (!found_cds) {
        if (!had_err) {
          if (cinfo->tidy) {
            gt_warning("found stop codon on line %u in file %s with no "
                       "flanking CDS, ignoring it",
                       gt_genome_node_get_line_number(gn),
                       gt_genome_node_get_filename(gn));
          } else {
            gt_error_set(err, "found stop codon on line %u in file %s with no "
                              "flanking CDS",
                         gt_genome_node_get_line_number(gn),
                         gt_genome_node_get_filename(gn));
            had_err = -1;
            break;
          }
        }
      } else {
        gt_array_rem(gt_genome_node_array, i);
        gt_genome_node_delete(gn);
      }
    }
  }

  for (i = 1; !had_err && i < gt_array_size(gt_genome_node_array); i++) {
    GtRange range;
    GtStrand strand;
    gn = *(GtGenomeNode**) gt_array_get(gt_genome_node_array, i);
    range = gt_genome_node_get_range(gn);
    mRNA_range = gt_range_join(&mRNA_range, &range);
    strand = gt_feature_node_get_strand((GtFeatureNode*) gn);
    if (strand != mRNA_strand) {
      gt_error_set(err, "feature %s on line %u has strand %c, but the "
                        "parent transcript has strand %c",
                   (const char*) key,
                   gt_genome_node_get_line_number(gn),
                   GT_STRAND_CHARS[strand],
                   GT_STRAND_CHARS[mRNA_strand]);
      had_err = -1;
      break;
    } else {
      mRNA_strand = gt_strand_join(mRNA_strand, strand);
    }
    if (!had_err && gt_str_cmp(mRNA_seqid, gt_genome_node_get_seqid(gn))) {
      gt_error_set(err, "The features on lines %u and %u refer to different "
                "genomic sequences (``seqname''), although they have the same "
                "gene IDs (``gene_id'') which must be globally unique",
                gt_genome_node_get_line_number(first_node),
                gt_genome_node_get_line_number(gn));
      had_err = -1;
      break;
    }
  }

  if (!had_err) {
    mRNA_node = gt_feature_node_new(mRNA_seqid, gt_ft_mRNA, mRNA_range.start,
                                    mRNA_range.end, mRNA_strand);
    gt_feature_node_add_attribute(((GtFeatureNode*) mRNA_node), "ID", key);
    gt_feature_node_add_attribute(((GtFeatureNode*) mRNA_node), "transcript_id",
                                  key);

    if ((tname = gt_hashmap_get(cinfo->transcript_id_to_name_mapping,
                              (const char*) key)) && strlen(tname) > 0) {
      gt_feature_node_add_attribute((GtFeatureNode*) mRNA_node, GT_GFF_NAME,
                                      tname);
    }

    /* register children */
    for (i = 0; i < gt_array_size(gt_genome_node_array); i++) {
      gn = *(GtGenomeNode**) gt_array_get(gt_genome_node_array, i);
      gt_feature_node_add_child((GtFeatureNode*) mRNA_node,
                                (GtFeatureNode*) gt_genome_node_ref(gn));
    }

    /* store the mRNA */
    gt_array_add(mRNAs, mRNA_node);
  }

  return had_err;
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movq %rdx, 0x1b0(%rsp)
movq %rcx, 0x1a8(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0x1a0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x190(%rsp)
movl $0x0, 0x144(%rsp)
cmpq $0x0, 0x1a8(%rsp)
je 0x184b1c
movq 0x1a8(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x184ae4
jmp 0x184b1c
movq 0x4b74b5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x39151e(%rip), %rsi    # 0x516013
leaq 0x3916c3(%rip), %rdx    # 0x5161bf
leaq 0x3cfec0(%rip), %rcx    # 0x5549c3
leaq 0x3cfba6(%rip), %r8     # 0x5546b0
movl $0x81, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x184b1e
jmp 0x184b20
cmpq $0x0, 0x1c0(%rsp)
je 0x184b41
cmpq $0x0, 0x1b8(%rsp)
je 0x184b41
cmpq $0x0, 0x1b0(%rsp)
jne 0x184b79
movq 0x4b7458(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3914c1(%rip), %rsi    # 0x516013
leaq 0x3b6d81(%rip), %rdx    # 0x53b8da
leaq 0x3cfe63(%rip), %rcx    # 0x5549c3
leaq 0x3cfb49(%rip), %r8     # 0x5546b0
movl $0x82, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x184b7b
jmp 0x184b7d
movq 0x198(%rsp), %rdi
callq 0x81370
cmpq $0x0, %rax
jne 0x184bc8
movq 0x4b7409(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x391472(%rip), %rsi    # 0x516013
leaq 0x3cfe2b(%rip), %rdx    # 0x5549d3
leaq 0x3cfe14(%rip), %rcx    # 0x5549c3
leaq 0x3cfafa(%rip), %r8     # 0x5546b0
movl $0x84, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x184bca
movq 0x198(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x130(%rsp)
movq %rdx, 0x138(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x180(%rsp), %rdi
callq 0x16cc70
movl %eax, 0x16c(%rsp)
movq 0x180(%rsp), %rdi
callq 0x171b70
movq %rax, 0x150(%rsp)
movq $0x0, 0x148(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x144(%rsp)
movb %al, 0xa7(%rsp)
jne 0x184ca0
movq 0x148(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x198(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x98(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0xa7(%rsp)
movb 0xa7(%rsp), %al
testb $0x1, %al
jne 0x184cb0
jmp 0x1850b9
movq 0x198(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x178(%rsp)
movq 0x178(%rsp), %rdi
leaq 0x3c01ea(%rip), %rsi    # 0x544ec9
callq 0x16c040
cmpq $0x0, %rax
je 0x18509e
movq 0x178(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x118(%rsp)
movq %rdx, 0x120(%rsp)
movb $0x0, 0x117(%rsp)
movq $0x0, 0x128(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x144(%rsp)
movb %al, 0x97(%rsp)
jne 0x184d67
movq 0x128(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x198(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x88(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x97(%rsp)
movb 0x97(%rsp), %al
testb $0x1, %al
jne 0x184d77
jmp 0x184fc5
movq 0x198(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x108(%rsp)
movq 0x178(%rsp), %rax
cmpq 0x108(%rsp), %rax
jne 0x184dae
jmp 0x184fac
movq 0x108(%rsp), %rdi
callq 0x171cc0
movq %rax, 0xe0(%rsp)
movq %rdx, 0xe8(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x108(%rsp), %rdi
callq 0x16d430
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x3cfca1(%rip), %rdi    # 0x554ab8
callq 0x120930
movq %rax, %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
jne 0x184faa
leaq 0xf8(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x1075f0
testb $0x1, %al
jne 0x184e4e
jmp 0x184f1b
movq 0x1a0(%rsp), %rax
testb $0x1, 0x20(%rax)
je 0x184eaf
movq 0x178(%rsp), %rdi
callq 0x171b20
movl %eax, 0x74(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171a90
movq %rax, 0x78(%rsp)
movq 0x108(%rsp), %rdi
callq 0x171b20
movl 0x74(%rsp), %esi
movq 0x78(%rsp), %rdx
movl %eax, %ecx
leaq 0x3cfb59(%rip), %rdi    # 0x5549f7
movb $0x0, %al
callq 0x1267d0
movb $0x1, 0x117(%rsp)
jmp 0x184f16
movq 0x1a8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171b20
movl %eax, 0x64(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171a90
movq %rax, 0x68(%rsp)
movq 0x108(%rsp), %rdi
callq 0x171b20
movq 0x58(%rsp), %rdi
movl 0x64(%rsp), %edx
movq 0x68(%rsp), %rcx
movl %eax, %r8d
leaq 0x3cfaf3(%rip), %rsi    # 0x5549f7
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x144(%rsp) # imm = 0xFFFFFFFF
jmp 0x184fc5
movq 0x100(%rsp), %rax
addq $0x1, %rax
cmpq 0x118(%rsp), %rax
jne 0x184f60
movq 0x120(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x108(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x171e20
movb $0x1, 0x117(%rsp)
jmp 0x184fc5
movq 0xf8(%rsp), %rax
movq 0x120(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x184fa8
movq 0x118(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x108(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x171e20
movb $0x1, 0x117(%rsp)
jmp 0x184fc5
jmp 0x184faa
jmp 0x184fac
movq 0x128(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x128(%rsp)
jmp 0x184d1f
testb $0x1, 0x117(%rsp)
jne 0x18507a
cmpl $0x0, 0x144(%rsp)
jne 0x185078
movq 0x1a0(%rsp), %rax
testb $0x1, 0x20(%rax)
je 0x185024
movq 0x178(%rsp), %rdi
callq 0x171b20
movl %eax, 0x54(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171a90
movl 0x54(%rsp), %esi
movq %rax, %rdx
leaq 0x3cfa1c(%rip), %rdi    # 0x554a37
movb $0x0, %al
callq 0x1267d0
jmp 0x185076
movq 0x1a8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171b20
movl %eax, 0x50(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171a90
movq 0x48(%rsp), %rdi
movl 0x50(%rsp), %edx
movq %rax, %rcx
leaq 0x3cfa1e(%rip), %rsi    # 0x554a80
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x144(%rsp) # imm = 0xFFFFFFFF
jmp 0x1850b9
jmp 0x185078
jmp 0x18509c
movq 0x198(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x80cf0
movq 0x178(%rsp), %rdi
callq 0x173180
jmp 0x18509e
jmp 0x1850a0
movq 0x148(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x148(%rsp)
jmp 0x184c58
movq $0x1, 0x148(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x144(%rsp)
movb %al, 0x47(%rsp)
jne 0x185101
movq 0x148(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x198(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x18510e
jmp 0x18530b
movq 0x198(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x178(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171cc0
movq %rax, 0xb8(%rsp)
movq %rdx, 0xc0(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x107730
movq %rax, 0xa8(%rsp)
movq %rdx, 0xb0(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x178(%rsp), %rdi
callq 0x16cc70
movl %eax, 0xcc(%rsp)
movl 0xcc(%rsp), %eax
cmpl 0x16c(%rsp), %eax
je 0x18524f
movq 0x1a8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x1c0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171b20
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movl %eax, %ecx
movl 0xcc(%rsp), %eax
movl %eax, %esi
leaq 0x3ba525(%rip), %rax    # 0x53f73c
movsbl (%rax,%rsi), %r8d
movl 0x16c(%rsp), %eax
movl %eax, %esi
leaq 0x3ba510(%rip), %rax    # 0x53f73c
movsbl (%rax,%rsi), %r9d
leaq 0x3cf884(%rip), %rsi    # 0x554abc
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x144(%rsp) # imm = 0xFFFFFFFF
jmp 0x18530b
movl 0x16c(%rsp), %edi
movl 0xcc(%rsp), %esi
callq 0x11fee0
movl %eax, 0x16c(%rsp)
cmpl $0x0, 0x144(%rsp)
jne 0x1852f0
movq 0x150(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171b70
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x11e170
cmpl $0x0, %eax
je 0x1852f0
movq 0x1a8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x180(%rsp), %rdi
callq 0x171b20
movl %eax, 0x1c(%rsp)
movq 0x178(%rsp), %rdi
callq 0x171b20
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %edx
movl %eax, %ecx
leaq 0x3cf82d(%rip), %rsi    # 0x554b09
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x144(%rsp) # imm = 0xFFFFFFFF
jmp 0x18530b
jmp 0x1852f2
movq 0x148(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x148(%rsp)
jmp 0x1850c5
cmpl $0x0, 0x144(%rsp)
jne 0x185486
movq 0x150(%rsp), %rdi
movq 0x158(%rsp), %rdx
movq 0x160(%rsp), %rcx
movl 0x16c(%rsp), %r8d
leaq 0x3c7af2(%rip), %rsi    # 0x54ce32
callq 0x16c7e0
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rdi
movq 0x1c0(%rsp), %rdx
leaq 0x42a749(%rip), %rsi    # 0x5afaad
callq 0x16edb0
movq 0x188(%rsp), %rdi
movq 0x1c0(%rsp), %rdx
leaq 0x3cf4e3(%rip), %rsi    # 0x554863
callq 0x16edb0
movq 0x1a0(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x1c0(%rsp), %rsi
callq 0xe0f20
movq %rax, 0x170(%rsp)
cmpq $0x0, %rax
je 0x1853db
movq 0x170(%rsp), %rdi
callq 0x192b0
cmpq $0x0, %rax
jbe 0x1853db
movq 0x188(%rsp), %rdi
movq 0x170(%rsp), %rdx
leaq 0x3ef2d8(%rip), %rsi    # 0x5746ae
callq 0x16edb0
movq $0x0, 0x148(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x198(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x18546c
movq 0x198(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x178(%rsp)
movq 0x188(%rsp), %rax
movq %rax, (%rsp)
movq 0x178(%rsp), %rdi
callq 0x171410
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x16d010
movq 0x148(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x148(%rsp)
jmp 0x1853e7
movq 0x190(%rsp), %rdi
leaq 0x188(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
movl 0x144(%rsp), %eax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
nopw %cs:(%rax,%rax)