// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/orf_finder_visitor.c
// Function: orf_attach_results_to_gff3
static void orf_attach_results_to_gff3(GtFeatureNode *gf,
                                       GtRange orf_rng, unsigned int orf_frame,
                                       GtStrand strand, GT_UNUSED GtError *err)
{
  GtGenomeNode *child;
  GtStr *tag;
  tag = gt_str_new_cstr(GT_ORF_FINDER_TAG);
  if (gt_feature_node_get_strand(gf) == GT_STRAND_REVERSE)
    strand = gt_strand_invert(strand);

  orf_rng.start++; orf_rng.end++;

  GtFeatureNodeIterator *gfi;
  GtFeatureNode *curnode = NULL, *parent_node = NULL;
  GtRange gfi_range;
  char frame_buf[3];
  sprintf(frame_buf, "%d", orf_frame);

  gfi = gt_feature_node_iterator_new(gf);

  while ((curnode = gt_feature_node_iterator_next(gfi))) {
    if (strcmp(gt_feature_node_get_type(curnode),
                                              (const char*) GT_ORF_TYPE) != 0) {
      gfi_range = gt_genome_node_get_range((GtGenomeNode*) curnode);
      if (gt_range_contains(&gfi_range, &orf_rng)) {
        parent_node = curnode;
      }
    }
  }
  if (parent_node) {
    child = gt_feature_node_new(gt_genome_node_get_seqid((GtGenomeNode*) gf),
                                GT_ORF_TYPE,
                                orf_rng.start,
                                orf_rng.end,
                                strand);
    gt_feature_node_set_source((GtFeatureNode*) child, tag);
    gt_feature_node_set_attribute((GtFeatureNode*) child, "frame", frame_buf);
    gt_feature_node_add_child(parent_node,(GtFeatureNode*) child);
  }
  gt_str_delete(tag);
  gt_feature_node_iterator_delete(gfi);
}

// Assembly:
subq $0x78, %rsp
movq %rsi, 0x68(%rsp)
movq %rdx, 0x70(%rsp)
movq %rdi, 0x60(%rsp)
movl %ecx, 0x5c(%rsp)
movl %r8d, 0x58(%rsp)
movq %r9, 0x50(%rsp)
leaq 0x3ac5a7(%rip), %rdi    # 0x5600ff
callq 0x11d510
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rdi
callq 0x16cc70
cmpl $0x1, %eax
jne 0x1b3b7e
movl 0x58(%rsp), %edi
callq 0x11fe40
movl %eax, 0x58(%rsp)
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x15(%rsp), %rdi
movl 0x5c(%rsp), %edx
leaq 0x3e98e6(%rip), %rsi    # 0x59d4a2
movb $0x0, %al
callq 0x19100
movq 0x60(%rsp), %rdi
callq 0x170b00
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x170e30
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x1b3c4e
movq 0x30(%rsp), %rdi
callq 0x16d430
movq %rax, %rdi
leaq 0x3ac4d7(%rip), %rsi    # 0x5600d2
callq 0x19980
cmpl $0x0, %eax
je 0x1b3c4c
movq 0x30(%rsp), %rdi
callq 0x171cc0
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq (%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x1075f0
testb $0x1, %al
jne 0x1b3c40
jmp 0x1b3c4a
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x1b3c4c
jmp 0x1b3bd2
cmpq $0x0, 0x28(%rsp)
je 0x1b3cb7
movq 0x60(%rsp), %rdi
callq 0x171b70
movq %rax, %rdi
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rcx
movl 0x58(%rsp), %r8d
leaq 0x3ac459(%rip), %rsi    # 0x5600d2
callq 0x16c7e0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x16c170
movq 0x48(%rsp), %rdi
leaq 0x15(%rsp), %rdx
leaq 0x3fd718(%rip), %rsi    # 0x5b13bb
callq 0x16d660
movq 0x28(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x16d010
movq 0x40(%rsp), %rdi
callq 0x11f560
movq 0x38(%rsp), %rdi
callq 0x170f50
addq $0x78, %rsp
retq