// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movl $0x0, 0x144(%rsp)
movq $0x0, 0x128(%rsp)
movq $0x0, 0x120(%rsp)
movq $0x0, 0x118(%rsp)
movq $0x0, 0x108(%rsp)
leaq 0x41e81b(%rip), %rdi    # 0x5606a4
callq 0x11d510
movq %rax, 0x100(%rsp)
leaq 0x42dc27(%rip), %rdi    # 0x56fac4
callq 0x11d510
movq %rax, 0xf8(%rsp)
leaq 0x41e7f3(%rip), %rdi    # 0x5606a4
callq 0x11d510
movq %rax, 0xf0(%rsp)
callq 0x11d4a0
movq %rax, 0xe8(%rsp)
leaq 0x4096ff(%rip), %rdi    # 0x54b5d1
callq 0x11d510
movq %rax, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
cmpq $0x0, 0x150(%rsp)
jne 0x141f5e
movq 0x4fa073(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d40dc(%rip), %rsi    # 0x516013
leaq 0x408fdb(%rip), %rdx    # 0x54af19
leaq 0x409696(%rip), %rcx    # 0x54b5db
leaq 0x408ff8(%rip), %r8     # 0x54af44
movl $0x41a, %r9d            # imm = 0x41A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x141f60
movq 0x150(%rsp), %rdi
callq 0x1402f0
movq %rax, %rdi
callq 0x11d510
movq %rax, 0x108(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x11dfa0
movq %rax, 0x130(%rsp)
movq 0x108(%rsp), %rdi
leaq 0x409656(%rip), %rsi    # 0x54b5f7
callq 0x11d550
movq 0x108(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x148(%rsp), %rdx
leaq 0x423f00(%rip), %rsi    # 0x565ec5
callq 0xdd320
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x180280
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x180420
movq 0xe8(%rsp), %rdi
leaq 0x3d71e9(%rip), %rsi    # 0x5191fc
movl $0x1, %ecx
movl $0x2, %r8d
movq %rcx, %rdx
callq 0x16c7e0
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xe0(%rsp), %rsi
callq 0x16c170
movq $0x0, 0x138(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x144(%rsp)
movb %al, 0x4f(%rsp)
jne 0x14208d
movq 0x138(%rsp), %rax
movq 0x150(%rsp), %rcx
cmpq 0x98(%rcx), %rax
setb %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x14209a
jmp 0x142333
movq 0x150(%rsp), %rax
movq 0x10(%rax), %rsi
imulq $0x28, 0x138(%rsp), %rax
addq %rax, %rsi
leaq 0x80(%rsp), %rdi
movl $0x28, %edx
callq 0x19610
movq 0x118(%rsp), %rax
cmpq 0x98(%rsp), %rax
ja 0x1421f6
movq 0xb8(%rsp), %rdi
callq 0x173180
movq 0x150(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x13e420
movq %rax, 0x128(%rsp)
movq 0x150(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0x13e470
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x150(%rsp), %rdi
movq 0x128(%rsp), %rsi
movq 0x120(%rsp), %rdx
callq 0x13e500
movq %rax, %rcx
movq 0x40(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x118(%rsp)
movq 0x150(%rsp), %rdi
movq 0x128(%rsp), %rdx
leaq 0x110(%rsp), %rsi
callq 0x13e570
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x11e110
movq 0xe8(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x110(%rsp), %rdx
callq 0x11d830
movq 0xe8(%rsp), %rdi
leaq 0x3d7046(%rip), %rsi    # 0x5191fc
movl $0x1, %ecx
movl $0x2, %r8d
movq %rcx, %rdx
callq 0x16c7e0
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xe0(%rsp), %rsi
callq 0x16c170
movq 0xf8(%rsp), %rdi
movq 0x130(%rsp), %rsi
callq 0x11dfd0
movq 0xf8(%rsp), %rdi
movq 0x138(%rsp), %rsi
callq 0x11d930
movq 0x100(%rsp), %rdi
movl $0x1, %esi
callq 0x11dfd0
movq 0x100(%rsp), %rdi
movq 0x138(%rsp), %rsi
callq 0x11d930
movq 0xc0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x11dee0
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x43243e(%rip), %rsi    # 0x5746ae
callq 0x16d660
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x100(%rsp), %rdi
callq 0x11dee0
movq 0x38(%rsp), %rdi
movq %rax, %rdx
leaq 0x46d80f(%rip), %rsi    # 0x5afaad
callq 0x16d660
movq 0x98(%rsp), %rax
addq $0x1, %rax
subq 0x120(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x98(%rsp), %rax
movl 0xa0(%rsp), %ecx
addq %rcx, %rax
subq 0x120(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x171e20
movq 0xb8(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0x148(%rsp), %rdx
callq 0x171f90
movl %eax, 0x144(%rsp)
movq 0x138(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x138(%rsp)
jmp 0x14205f
movq 0xf8(%rsp), %rdi
callq 0x11e110
movq 0xf8(%rsp), %rdi
leaq 0x3d863e(%rip), %rsi    # 0x51a98d
callq 0x11d550
movq 0x100(%rsp), %rdi
callq 0x11e110
movq 0x100(%rsp), %rdi
leaq 0x40c323(%rip), %rsi    # 0x54e693
callq 0x11d550
movq 0xf8(%rsp), %rdi
callq 0x11dfa0
movq %rax, 0x130(%rsp)
movq $0x0, 0x118(%rsp)
movq $0x0, 0x138(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x144(%rsp)
movb %al, 0x2f(%rsp)
jne 0x1423cd
movq 0x138(%rsp), %rax
movq 0x150(%rsp), %rcx
cmpq 0x70(%rcx), %rax
setb %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x1423da
jmp 0x1426cb
movq 0x150(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x138(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, 0x58(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x60(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x68(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x60(%rsp), %rax
ja 0x142544
movq 0xb8(%rsp), %rdi
callq 0x173180
movq 0x150(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x13e420
movq %rax, 0x128(%rsp)
movq 0x150(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0x13e470
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x150(%rsp), %rdi
movq 0x128(%rsp), %rsi
movq 0x120(%rsp), %rdx
callq 0x13e500
movq %rax, %rcx
movq 0x20(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x118(%rsp)
movq 0x150(%rsp), %rdi
movq 0x128(%rsp), %rdx
leaq 0x110(%rsp), %rsi
callq 0x13e570
movq %rax, 0x50(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x11e110
movq 0xe8(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x110(%rsp), %rdx
callq 0x11d830
movq 0xe8(%rsp), %rdi
leaq 0x3d6cf8(%rip), %rsi    # 0x5191fc
movl $0x1, %ecx
movl $0x2, %r8d
movq %rcx, %rdx
callq 0x16c7e0
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xe0(%rsp), %rsi
callq 0x16c170
movq 0xf8(%rsp), %rdi
movq 0x130(%rsp), %rsi
callq 0x11dfd0
movq 0xf8(%rsp), %rdi
movq 0x138(%rsp), %rsi
callq 0x11d930
movq 0x100(%rsp), %rdi
movl $0x1, %esi
callq 0x11dfd0
movq 0x100(%rsp), %rdi
movq 0x138(%rsp), %rsi
callq 0x11d930
movq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x11dee0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x4320f0(%rip), %rsi    # 0x5746ae
callq 0x16d660
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x100(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x46d4c1(%rip), %rsi    # 0x5afaad
callq 0x16d660
movq 0xf0(%rsp), %rdi
movl $0x1, %esi
callq 0x11dfd0
movq 0xf0(%rsp), %rdi
movl 0x6c(%rsp), %eax
movl %eax, %esi
callq 0x11d930
movq 0xc0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x11dee0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
leaq 0x408fbe(%rip), %rsi    # 0x54b5fd
callq 0x16d660
movq 0x60(%rsp), %rax
addq $0x1, %rax
subq 0x120(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x60(%rsp), %rax
movl 0x68(%rsp), %ecx
addq %rcx, %rax
subq 0x120(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x171e20
movq 0xb8(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0x148(%rsp), %rdx
callq 0x171f90
movl %eax, 0x144(%rsp)
movq 0x138(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x138(%rsp)
jmp 0x1423a2
movq 0xd8(%rsp), %rdi
callq 0xde430
movq 0xb8(%rsp), %rdi
callq 0x173180
movq 0xc8(%rsp), %rdi
callq 0x1b29d0
movq 0x108(%rsp), %rdi
callq 0x11f560
movq 0x100(%rsp), %rdi
callq 0x11f560
movq 0xf8(%rsp), %rdi
callq 0x11f560
movq 0xf0(%rsp), %rdi
callq 0x11f560
movq 0xe8(%rsp), %rdi
callq 0x11f560
movq 0xe0(%rsp), %rdi
callq 0x11f560
movl 0x144(%rsp), %eax
addq $0x158, %rsp            # imm = 0x158
retq
nop