// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/gtf_visitor.c
// Function: gtf_show_transcript
static int gtf_show_transcript(GtFeatureNode *feature_node,
                               GtGTFVisitor *gtf_visitor, GtError *err)
{
  GtFeatureNode *fn;
  GtUword i;
  int had_err;
  gt_error_check(err);
  gt_assert(feature_node && gtf_visitor);
  gt_array_reset(gtf_visitor->exon_features);
  gt_array_reset(gtf_visitor->CDS_features);
  had_err = gt_feature_node_traverse_direct_children(feature_node, gtf_visitor,
                                                     save_exon_node, err);
  if (gt_array_size(gtf_visitor->exon_features)) {
    /* sort exon features */
    qsort(gt_array_get_space(gtf_visitor->exon_features),
          gt_array_size(gtf_visitor->exon_features), sizeof (GtGenomeNode*),
          (GtCompare) gt_genome_node_compare);
    /* show exon features */
    gtf_visitor->transcript_id++;
    for (i = 0; i < gt_array_size(gtf_visitor->exon_features); i++) {
      fn = *(GtFeatureNode**) gt_array_get(gtf_visitor->exon_features, i);
      gt_gff3_output_leading(fn, gtf_visitor->outfp);
      gt_file_xprintf(gtf_visitor->outfp, "gene_id \""GT_WU"\"; transcript_id "
                      "\""GT_WU"."GT_WU"\";\n", gtf_visitor->gene_id,
                      gtf_visitor->gene_id, gtf_visitor->transcript_id);
    }
  }
  if (gt_array_size(gtf_visitor->CDS_features)) {
    /* sort CDS features */
    qsort(gt_array_get_space(gtf_visitor->CDS_features),
          gt_array_size(gtf_visitor->CDS_features), sizeof (GtGenomeNode*),
          (GtCompare) gt_genome_node_compare);
    /* show start_codon feature */
    /* fn = *(GtFeatureNode**) */ (void) gt_array_get(gtf_visitor->CDS_features,
                                                      0);
    /* XXX: to be done */

    /* show CDS features */
    for (i = 0; i < gt_array_size(gtf_visitor->CDS_features); i++) {
      fn = *(GtFeatureNode**) gt_array_get(gtf_visitor->CDS_features, i);
      gt_gff3_output_leading(fn, gtf_visitor->outfp);
      gt_file_xprintf(gtf_visitor->outfp, "gene_id \""GT_WU"\"; transcript_id "
                      "\""GT_WU"."GT_WU"\";\n", gtf_visitor->gene_id,
                      gtf_visitor->gene_id, gtf_visitor->transcript_id);
    }
    /* XXX: show stop_codon feature and shorten last CDS feature */
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rdx, %rdx
je 0xe96d0
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0xe9861
testq %r15, %r15
je 0xe9837
testq %rbx, %rbx
je 0xe9837
movq 0x20(%rbx), %rdi
callq 0x5876c
movq 0x28(%rbx), %rdi
callq 0x5876c
leaq 0x19c(%rip), %rdx       # 0xe9897
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0xdbc10
movl %eax, %ebp
movq 0x20(%rbx), %rdi
callq 0x586a4
testq %rax, %rax
je 0xe9795
movq 0x20(%rbx), %rdi
callq 0x584c7
movq %rax, %r14
movq 0x20(%rbx), %rdi
callq 0x586a4
leaq -0xc2e9(%rip), %rcx     # 0xdd44c
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x17ed0
incq 0x18(%rbx)
leaq 0x2392b4(%rip), %r14    # 0x322a02
xorl %r15d, %r15d
movq 0x20(%rbx), %rdi
callq 0x586a4
cmpq %rax, %r15
jae 0xe9795
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x581aa
movq (%rax), %rdi
movq 0x30(%rbx), %rsi
callq 0x29bb4c
movq 0x30(%rbx), %rdi
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %r8
movq %r14, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x8d432
incq %r15
jmp 0xe9751
movq 0x28(%rbx), %rdi
callq 0x586a4
testq %rax, %rax
je 0xe982a
movq 0x28(%rbx), %rdi
callq 0x584c7
movq %rax, %r14
movq 0x28(%rbx), %rdi
callq 0x586a4
leaq -0xc377(%rip), %rcx     # 0xdd44c
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x17ed0
movq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x581aa
leaq 0x23921f(%rip), %r14    # 0x322a02
xorl %r15d, %r15d
movq 0x28(%rbx), %rdi
callq 0x586a4
cmpq %rax, %r15
jae 0xe982a
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq 0x581aa
movq (%rax), %rdi
movq 0x30(%rbx), %rsi
callq 0x29bb4c
movq 0x30(%rbx), %rdi
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %r8
movq %r14, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x8d432
incq %r15
jmp 0xe97e6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x34e72a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fb7cb(%rip), %rsi    # 0x2e5013
leaq 0x239197(%rip), %rdx    # 0x3229e6
leaq 0x23917c(%rip), %rcx    # 0x3229d2
leaq 0x2390e9(%rip), %r8     # 0x322946
pushq $0x50
jmp 0xe9889
movq 0x34e700(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fb7a1(%rip), %rsi    # 0x2e5013
leaq 0x1fb946(%rip), %rdx    # 0x2e51bf
leaq 0x239152(%rip), %rcx    # 0x3229d2
leaq 0x2390bf(%rip), %r8     # 0x322946
pushq $0x4f
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390