// File: /workspace/github_c_makefile_star2_O2/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, %r12
movq %rdi, %r13
leaq 0x26af5f(%rip), %rbx    # 0x32e24f
movq %rbx, %rdi
callq 0xacbd1
movq %rax, 0x18(%rsp)
leaq 0x27a051(%rip), %rdi    # 0x33d355
callq 0xacbd1
movq %rax, %r14
movq %rbx, %rdi
callq 0xacbd1
movq %rax, 0x60(%rsp)
callq 0xacb84
movq %rax, %rbx
leaq 0x2562d9(%rip), %rdi    # 0x319601
callq 0xacbd1
testq %r13, %r13
je 0xc387d
movq %rax, %rbp
movq %r13, %rdi
callq 0xc23dd
movq %rax, %rdi
callq 0xacbd1
movq %rax, %r15
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0xad289
movq %rax, 0x20(%rsp)
leaq 0x2562c2(%rip), %rsi    # 0x319627
movq %r15, %rdi
callq 0xacbfb
movq %r15, 0x90(%rsp)
movq %r15, %rdi
callq 0xad1fa
leaq 0x27058a(%rip), %rsi    # 0x33390e
movq %rax, %rdi
movq %r12, %rdx
callq 0x8ce05
movq %rax, 0x88(%rsp)
movq %rax, %rdi
callq 0xe64a1
movq %rax, 0x50(%rsp)
movq %rax, %rdi
callq 0xe65ab
leaq 0x224dd6(%rip), %rsi    # 0x2e8189
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
movq %rbx, 0x28(%rsp)
movq %rbx, %rdi
movq %rcx, %rdx
callq 0xd9acb
movq %rax, %rbx
movq %rax, %rdi
movq %rbp, %rsi
callq 0xd96be
movq $0x0, 0x8(%rsp)
pushq $0x20
popq %rcx
movq %rbp, 0x30(%rsp)
movq $0x0, (%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r12, 0x70(%rsp)
movq %r13, 0x68(%rsp)
testl %r14d, %r14d
jne 0xc35b6
cmpq 0x98(%r13), %rbp
jae 0xc35b6
movq 0x10(%r13), %rax
movq -0x8(%rax,%rcx), %r14
movq %rcx, 0x48(%rsp)
movl (%rax,%rcx), %eax
movq %rax, 0x40(%rsp)
cmpq %r14, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, 0x38(%rsp)
jbe 0xc344b
movq (%rsp), %rbx
pushq $0x1
popq %r14
movq %rdi, %r13
jmp 0xc34df
callq 0xde013
movq %r13, %rdi
movq %r14, %rsi
callq 0xc1180
movq %rax, %r15
movq %r13, %rdi
movq %rax, %rsi
callq 0xc1196
movq %rax, %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xc11d4
addq %rbx, %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
movq %r15, %rdx
callq 0xc11fb
movq %rax, %r15
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0xad357
movq 0x58(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xacd9e
movq %r12, %rdi
leaq 0x224ccd(%rip), %rsi    # 0x2e8189
pushq $0x1
popq %r14
movq %r14, %rdx
movq %r14, %rcx
pushq $0x2
popq %r8
callq 0xd9acb
movq %rax, %r13
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0xd96be
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0xad296
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
callq 0xace26
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0xad296
movq %rbp, %rdi
movq %r15, %rsi
callq 0xace26
movq %r12, %rdi
callq 0xad1fa
movq %r13, %rdi
leaq 0x27eeb2(%rip), %rsi    # 0x3423de
movq %rax, %rdx
callq 0xda48b
movq %rbp, %rdi
callq 0xad1fa
movq %r13, %rdi
leaq 0x2b74f1(%rip), %rsi    # 0x37aa37
movq %rax, %rdx
callq 0xda48b
movq 0x38(%rsp), %rdx
movq %rdx, %rax
subq %rbx, %rax
incq %rax
movq %rax, 0x78(%rsp)
movq 0x40(%rsp), %rcx
addq %rdx, %rcx
movq %rbx, (%rsp)
subq %rbx, %rcx
movq %rcx, 0x80(%rsp)
movq %r13, %rdi
leaq 0x78(%rsp), %rsi
callq 0xdd2bb
movq %r13, %rbx
movq %r13, %rdi
movq 0x50(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0xdd39c
movq %r15, %rbp
movl %eax, %r14d
incq %rbp
movq 0x48(%rsp), %rcx
addq $0x28, %rcx
movq 0x68(%rsp), %r13
jmp 0xc3400
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xad357
leaq 0x22636b(%rip), %rsi    # 0x2e9935
movq %r12, %rdi
callq 0xacbfb
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0xad357
leaq 0x258f0d(%rip), %rsi    # 0x31c4f3
movq %r15, %rdi
callq 0xacbfb
movq %r12, %rdi
callq 0xad289
movq %rax, 0x20(%rsp)
pushq $0x14
popq %rcx
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
movq (%rsp), %r12
movq 0x30(%rsp), %rsi
movq %rbx, %r15
testl %r14d, %r14d
jne 0xc3809
cmpq 0x70(%r13), %rbp
jae 0xc3809
movq 0x8(%r13), %rax
movq -0xc(%rax,%rcx), %r14
movq %r13, %rbx
movl -0x4(%rax,%rcx), %r13d
movq %rcx, 0x48(%rsp)
movl (%rax,%rcx), %eax
movq %rax, 0x40(%rsp)
cmpq %r14, 0x8(%rsp)
movq %r14, 0x38(%rsp)
jbe 0xc365f
movq %r12, (%rsp)
pushq $0x1
popq %r14
jmp 0xc36fb
movq %r15, %rdi
movq %rsi, %r12
callq 0xde013
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc1180
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0xc1196
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xc11d4
movq %r14, (%rsp)
addq %r14, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
movq %r15, %rdx
callq 0xc11fb
movq %rax, %r15
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xad357
movq 0x58(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xacd9e
movq %rbx, %rdi
leaq 0x224aaf(%rip), %rsi    # 0x2e8189
pushq $0x1
popq %r14
movq %r14, %rdx
movq %r14, %rcx
pushq $0x2
popq %r8
callq 0xd9acb
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0xd96be
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0xad296
movq %rbx, %rdi
movq %rbp, %r12
movq %rbp, %rsi
callq 0xace26
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0xad296
movq %rbp, %rdi
movq %r12, %rsi
callq 0xace26
movq %rbx, %rdi
callq 0xad1fa
movq %r15, %rdi
leaq 0x27ec96(%rip), %rsi    # 0x3423de
movq %rax, %rdx
callq 0xda48b
movq %rbp, %rdi
callq 0xad1fa
movq %r15, %rdi
leaq 0x2b72d5(%rip), %rsi    # 0x37aa37
movq %rax, %rdx
callq 0xda48b
movq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xad296
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0xace26
movq %rbx, %rdi
callq 0xad1fa
movq %r15, %rdi
leaq 0x255e94(%rip), %rsi    # 0x31962d
movq %rax, %rdx
callq 0xda48b
movq 0x38(%rsp), %rcx
movq %rcx, %rax
movq (%rsp), %rbx
subq %rbx, %rax
incq %rax
movq %rax, 0x78(%rsp)
addq %rcx, %r13
subq %rbx, %r13
movq %r13, 0x80(%rsp)
movq %r15, %rdi
leaq 0x78(%rsp), %rsi
callq 0xdd2bb
movq %r15, %rdi
movq 0x50(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0xdd39c
movq %r12, %rbp
movl %eax, %r14d
incq %rbp
movq 0x48(%rsp), %rcx
addq $0x20, %rcx
movq 0x30(%rsp), %rsi
movq 0x68(%rsp), %r13
movq %rbx, %r12
jmp 0xc3615
movq 0x88(%rsp), %rdi
movq %rsi, %rbx
callq 0x8da06
movq %r15, %rdi
callq 0xde013
movq 0x50(%rsp), %rdi
callq 0x10327a
movq 0x90(%rsp), %rdi
callq 0xae103
movq 0x18(%rsp), %rdi
callq 0xae103
movq 0x10(%rsp), %rdi
callq 0xae103
movq 0x60(%rsp), %rdi
callq 0xae103
movq 0x28(%rsp), %rdi
callq 0xae103
movq %rbx, %rdi
callq 0xae103
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3746e4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x221785(%rip), %rsi    # 0x2e5013
leaq 0x2556b4(%rip), %rdx    # 0x318f49
leaq 0x255d6f(%rip), %rcx    # 0x31960b
leaq 0x2556d1(%rip), %r8     # 0x318f74
movl $0x41a, %r9d            # imm = 0x41A
xorl %eax, %eax
callq 0x17a50
callq 0x17390