// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/condenseq.c
// Function: gt_condenseq_output_to_gff3
int gt_condenseq_output_to_gff3(const GtCondenseq *condenseq,
                                GtError *err)
{
  int had_err = 0;
  GtUword idx,
          name_len,
          seqnum = 0, seqstart = 0, seqend = 0,
          desclen;
  GtStr *filename = NULL,
        *id = gt_str_new_cstr("U"),
        *name = gt_str_new_cstr("unique"),
        *parent_unique = gt_str_new_cstr("U"),
        *seqid = gt_str_new(),
        *source = gt_str_new_cstr("Condenseq");
  GtFile *outfile = NULL;
  GtGFF3Visitor *gffv = NULL;
  GtNodeVisitor *nodev = NULL;
  GtFeatureNode *fnode = NULL;
  GtGenomeNode *node = NULL;
  GtRange range;

  gt_assert(condenseq != NULL);

  filename = gt_str_new_cstr(gt_condenseq_basefilename(condenseq));

  name_len = gt_str_length(name);
  gt_str_append_cstr(filename, ".gff3");
  outfile = gt_file_new(gt_str_get(filename), "w", err);
  nodev = gt_gff3_visitor_new(outfile);
  gffv = (GtGFF3Visitor *) nodev;
  gt_gff3_visitor_retain_id_attributes(gffv);

  node = gt_feature_node_new(seqid, "experimental_feature", (GtUword) 1,
                             (GtUword) 1, GT_STRAND_BOTH);
  fnode = (GtFeatureNode*) node;
  gt_feature_node_set_source(fnode, source);
  for (idx = 0; !had_err && idx < condenseq->uds_nelems; ++idx) {
    GtCondenseqUnique uq = condenseq->uniques[idx];
    if (seqend <= uq.orig_startpos) {
      const char *desc;
      gt_genome_node_delete(node);
      seqnum = gt_condenseq_pos2seqnum(condenseq, uq.orig_startpos);
      seqstart = gt_condenseq_seqstartpos(condenseq, seqnum);
      seqend = seqstart + condenseq_seqlength_help(condenseq, seqnum, seqstart);
      desc = gt_condenseq_description(condenseq, &desclen, seqnum);
      gt_str_reset(seqid);
      gt_str_append_cstr_nt(seqid, desc, desclen);
      node = gt_feature_node_new(seqid, "experimental_feature", (GtUword) 1,
                                 (GtUword) 1, GT_STRAND_BOTH);
      fnode = (GtFeatureNode*) node;
      gt_feature_node_set_source(fnode, source);
    }
    gt_str_set_length(name, name_len);
    gt_str_append_uword(name, idx);
    gt_str_set_length(id, (GtUword) 1);
    gt_str_append_uword(id, idx);
    gt_feature_node_set_attribute(fnode, "Name", gt_str_get(name));
    gt_feature_node_set_attribute(fnode, "ID", gt_str_get(id));
    /* 1 Based coordinates! */
    range.start = uq.orig_startpos + 1 - seqstart;
    range.end = uq.orig_startpos + uq.len - seqstart;
    gt_genome_node_set_range(node, &range);
    had_err = gt_genome_node_accept(node, nodev, err);
  }
  gt_str_reset(name);
  gt_str_append_cstr(name, "link");
  gt_str_reset(id);
  gt_str_append_cstr(id, "L");
  name_len = gt_str_length(name);
  seqend = 0;
  for (idx = 0; !had_err && idx < condenseq->lds_nelems; ++idx) {
    GtCondenseqLink link = condenseq->links[idx];
    if (seqend <= link.orig_startpos) {
      const char *desc;
      gt_genome_node_delete(node);
      seqnum = gt_condenseq_pos2seqnum(condenseq, link.orig_startpos);
      seqstart = gt_condenseq_seqstartpos(condenseq, seqnum);
      seqend = seqstart + condenseq_seqlength_help(condenseq, seqnum, seqstart);
      desc = gt_condenseq_description(condenseq, &desclen, seqnum);
      gt_str_reset(seqid);
      gt_str_append_cstr_nt(seqid, desc, desclen);
      node = gt_feature_node_new(seqid, "experimental_feature", (GtUword) 1,
                                 (GtUword) 1, GT_STRAND_BOTH);
      fnode = (GtFeatureNode*) node;
      gt_feature_node_set_source(fnode, source);
    }
    gt_str_set_length(name, name_len);
    gt_str_append_uword(name, idx);
    gt_str_set_length(id, (GtUword) 1);
    gt_str_append_uword(id, idx);
    gt_feature_node_set_attribute(fnode, "Name", gt_str_get(name));
    gt_feature_node_set_attribute(fnode, "ID", gt_str_get(id));
    gt_str_set_length(parent_unique, (GtUword) 1);
    gt_str_append_uword(parent_unique, link.unique_id);
    gt_feature_node_set_attribute(fnode, "Derives_from",
                                  gt_str_get(parent_unique));
    /* 1 Based coordinates! */
    range.start = link.orig_startpos + 1 - seqstart;
    range.end = link.orig_startpos + link.len - seqstart;
    gt_genome_node_set_range(node, &range);
    had_err = gt_genome_node_accept(node, nodev, err);
  }
  gt_file_delete(outfile);
  gt_genome_node_delete(node);
  gt_node_visitor_delete(nodev);
  gt_str_delete(filename);
  gt_str_delete(id);
  gt_str_delete(name);
  gt_str_delete(parent_unique);
  gt_str_delete(seqid);
  gt_str_delete(source);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r13
movq %rdi, %r15
leaq 0x260430(%rip), %rbx    # 0x38de5f
movq %rbx, %rdi
callq 0x11acc9
movq %rax, 0x40(%rsp)
leaq 0x26f5b2(%rip), %rdi    # 0x39cff5
callq 0x11acc9
movq %rax, %r14
movq %rbx, %rdi
callq 0x11acc9
movq %rax, 0x60(%rsp)
callq 0x11ac6c
movq %rax, %rbx
leaq 0x24b84c(%rip), %rdi    # 0x3792b3
callq 0x11acc9
movq %r15, %rdi
testq %r15, %r15
je 0x12e060
movq %rax, %r15
movq %rdi, 0x10(%rsp)
callq 0x12cf45
movq %rax, %rdi
callq 0x11acc9
movq %rax, %r12
movq %r14, 0x30(%rsp)
movq %r14, %rdi
callq 0x11b0ca
movq %rax, 0x28(%rsp)
leaq 0x24b830(%rip), %rsi    # 0x3792d9
movq %r12, %rdi
callq 0x11acf3
movq %r12, 0x88(%rsp)
movq %r12, %rdi
callq 0x11b0a1
leaq 0x265aed(%rip), %rsi    # 0x3935b5
movq %rax, %rdi
movq %r13, %rdx
callq 0xfea8a
movq %rax, 0x80(%rsp)
movq %rax, %rdi
callq 0x14badb
movq %rax, 0x48(%rsp)
movq %rax, %rdi
callq 0x14bbee
leaq 0x21a692(%rip), %rsi    # 0x348189
movl $0x1, %edx
movl $0x1, %ecx
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
movl $0x2, %r8d
callq 0x1422f4
movq %r13, %rbx
movq %rax, %r13
movq %rax, %rdi
movq %r15, 0x18(%rsp)
movq %r15, %rsi
callq 0x141fb5
movl $0x20, %ebp
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
movq $0x0, 0x38(%rsp)
movq %rbx, 0x68(%rsp)
movq 0x10(%rsp), %r15
cmpq 0x98(%r15), %r12
jae 0x12dd31
movq 0x10(%r15), %rax
movq -0x8(%rax,%rbp), %rbx
movl (%rax,%rbp), %r14d
cmpq %rbx, 0x38(%rsp)
movq %rbx, 0x50(%rsp)
jbe 0x12db7c
movq %r13, %rbx
jmp 0x12dc6a
movq %r13, %rdi
callq 0x1451a0
cmpq $0x2, 0x80(%r15)
movq %r15, %rdi
jb 0x12dbc1
movq %rdi, %r13
movq 0x28(%rdi), %rdi
movq %rbx, %rsi
callq 0x1567b9
testq %rax, %rax
je 0x12dbcf
movq %rax, %r15
movq 0x28(%r13), %rdi
movq %rax, %rsi
decq %rsi
callq 0x15673b
incq %rax
movq %rax, 0x8(%rsp)
jmp 0x12dbdb
xorl %r15d, %r15d
movq $0x0, 0x8(%rsp)
jmp 0x12dbde
xorl %r15d, %r15d
movq $0x0, 0x8(%rsp)
movq %r13, %rdi
movq 0x80(%rdi), %rax
decq %rax
cmpq %r15, %rax
jbe 0x12dc05
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rdi
movq %r15, %rsi
callq 0x15673b
movq 0x10(%rsp), %rdi
jmp 0x12dc09
movq 0x78(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x58(%rsp), %rsi
movq %r15, %rdx
callq 0x12bb9d
movq %rax, %r15
movq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x11b132
movq 0x58(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x11ae1b
movl $0x1, %edx
movl $0x1, %ecx
movq %r13, %rdi
leaq 0x21a53a(%rip), %rsi    # 0x348189
movl $0x2, %r8d
callq 0x1422f4
movq %rax, %rbx
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x141fb5
movq 0x30(%rsp), %r15
movq %r15, %rdi
movq 0x28(%rsp), %rsi
callq 0x11b0d7
movq %r15, %rdi
movq %r12, %rsi
callq 0x11ae72
movl $0x1, %esi
movq 0x40(%rsp), %r13
movq %r13, %rdi
callq 0x11b0d7
movq %r13, %rdi
movq %r12, %rsi
callq 0x11ae72
movq %r15, %rdi
callq 0x11b0a1
movq %rbx, %rdi
leaq 0x274438(%rip), %rsi    # 0x3a20ee
movq %rax, %rdx
callq 0x142a0f
movq %r13, %rdi
callq 0x11b0a1
movq %rbx, %rdi
leaq 0x2ac947(%rip), %rsi    # 0x3da617
movq %rax, %rdx
callq 0x142a0f
movq 0x50(%rsp), %rdx
movq %rdx, %rax
movq 0x8(%rsp), %rcx
subq %rcx, %rax
incq %rax
movq %rax, 0x70(%rsp)
addq %rdx, %r14
subq %rcx, %r14
movq %r14, 0x78(%rsp)
movq %rbx, %rdi
leaq 0x70(%rsp), %rsi
callq 0x1446da
movq %rbx, %r13
movq %rbx, %rdi
movq 0x48(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x14472c
incq %r12
addq $0x28, %rbp
testl %eax, %eax
je 0x12db49
movl %eax, %r12d
jmp 0x12dd34
xorl %r12d, %r12d
movq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x11b132
leaq 0x21bbed(%rip), %rsi    # 0x349935
movq %r14, %rdi
callq 0x11acf3
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x11b132
leaq 0x24e384(%rip), %rsi    # 0x37c0e8
movq %rbx, %rdi
callq 0x11acf3
movq %r14, %rdi
callq 0x11b0ca
testl %r12d, %r12d
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %r15
jne 0x12dff3
movq %rax, 0x90(%rsp)
movl $0x14, %ebx
xorl %r12d, %r12d
movq $0x0, 0x28(%rsp)
movq %r13, %rdi
movq 0x10(%rsp), %rcx
cmpq 0x70(%rcx), %r12
jae 0x12dfde
movq 0x8(%rcx), %rax
movq -0xc(%rax,%rbx), %r13
movl -0x4(%rax,%rbx), %ebp
movl (%rax,%rbx), %eax
movq %rax, 0x38(%rsp)
cmpq %r13, 0x28(%rsp)
movq %r13, 0x50(%rsp)
jbe 0x12dddb
movq %rdi, %r13
jmp 0x12dec9
movq %rcx, %r14
callq 0x1451a0
cmpq $0x2, 0x80(%r14)
movq %r14, %rdi
jb 0x12de20
movq %rdi, %r15
movq 0x28(%rdi), %rdi
movq %r13, %rsi
callq 0x1567b9
testq %rax, %rax
je 0x12de2e
movq %rax, %r14
movq 0x28(%r15), %rdi
movq %rax, %rsi
decq %rsi
callq 0x15673b
incq %rax
movq %rax, 0x8(%rsp)
jmp 0x12de3a
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
jmp 0x12de3d
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
movq %r15, %rdi
movq 0x80(%rdi), %rax
decq %rax
cmpq %r14, %rax
jbe 0x12de64
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rdi
movq %r14, %rsi
callq 0x15673b
movq 0x10(%rsp), %rdi
jmp 0x12de68
movq 0x78(%rdi), %rax
movq %rax, 0x28(%rsp)
leaq 0x58(%rsp), %rsi
movq %r14, %rdx
callq 0x12bb9d
movq %rax, %r14
movq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x11b132
movq 0x58(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x11ae1b
movl $0x1, %edx
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x21a2db(%rip), %rsi    # 0x348189
movl $0x2, %r8d
callq 0x1422f4
movq %rax, %r13
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x141fb5
movq 0x30(%rsp), %r15
movq %r15, %rdi
movq 0x90(%rsp), %rsi
callq 0x11b0d7
movq %r15, %rdi
movq %r12, %rsi
callq 0x11ae72
movl $0x1, %esi
movq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x11b0d7
movq %r14, %rdi
movq %r12, %rsi
callq 0x11ae72
movq %r15, %rdi
callq 0x11b0a1
movq %r13, %rdi
leaq 0x2741d6(%rip), %rsi    # 0x3a20ee
movq %rax, %rdx
callq 0x142a0f
movq %r14, %rdi
callq 0x11b0a1
movq %r13, %rdi
leaq 0x2ac6e5(%rip), %rsi    # 0x3da617
movq %rax, %rdx
callq 0x142a0f
movl $0x1, %esi
movq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x11b0d7
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0x11ae72
movq %r14, %rdi
callq 0x11b0a1
movq %r13, %rdi
leaq 0x24b374(%rip), %rsi    # 0x3792df
movq %rax, %rdx
callq 0x142a0f
movq 0x50(%rsp), %rdx
movq %rdx, %rax
movq 0x8(%rsp), %rcx
subq %rcx, %rax
incq %rax
movq %rax, 0x70(%rsp)
addq %rdx, %rbp
subq %rcx, %rbp
movq %rbp, 0x78(%rsp)
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
callq 0x1446da
movq %r13, %rdi
movq 0x48(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x14472c
incq %r12
addq $0x20, %rbx
testl %eax, %eax
movq %r13, %rdi
je 0x12dda3
movq %rdi, %r13
movl %eax, %r12d
movq 0x30(%rsp), %r14
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %r15
jmp 0x12dff3
movq %rdi, %r13
movq 0x30(%rsp), %r14
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %r15
xorl %r12d, %r12d
movq 0x80(%rsp), %rdi
callq 0xff22c
movq %r13, %rdi
callq 0x1451a0
movq 0x48(%rsp), %rdi
callq 0x1632f2
movq 0x88(%rsp), %rdi
callq 0x11bdbf
movq 0x40(%rsp), %rdi
callq 0x11bdbf
movq %r14, %rdi
callq 0x11bdbf
movq 0x60(%rsp), %rdi
callq 0x11bdbf
movq %rbx, %rdi
callq 0x11bdbf
movq %r15, %rdi
callq 0x11bdbf
movl %r12d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3d924