// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/tidy_region_node_visitor.c
// Function: tidy_region_node_visitor_feature_node
static int tidy_region_node_visitor_feature_node(GtNodeVisitor *nv,
                                                 GtFeatureNode *fn,
                                                 GT_UNUSED GtError *err)
{
  GtTidyRegionNodeVisitor *trnv;
  GtFeatureNodeIterator *fni;
  GtFeatureNode *node;
  GtGenomeNode *sr;
  GtRange range = {0, 0},
          sr_range,
          joined_range = {0, 0};
  bool first = true;
  int had_err = 0;
  const char *seqid;
  trnv = tidy_region_node_visitor_cast(nv);
  seqid = gt_str_get(gt_genome_node_get_seqid((GtGenomeNode*) fn));

  fni = gt_feature_node_iterator_new(fn);
  while ((node = gt_feature_node_iterator_next(fni))) {
    GtRange node_range = gt_genome_node_get_range((GtGenomeNode*) node);
    if (first) {
      range = node_range;
      first = false;
    }
    else
      range = gt_range_join(&range, &node_range);
  }
  gt_feature_node_iterator_delete(fni);

  sr = gt_hashmap_get(trnv->region_nodes, seqid);
  if (!sr) {
    gt_error_set(err, "seqid '%s' on line %u in file \"%s\" has not been "
                      "defined yet",
                 seqid,
                 gt_genome_node_get_line_number((GtGenomeNode*) fn),
                 gt_genome_node_get_filename((GtGenomeNode*) fn));
    had_err = -1;
  }

  if (!had_err) {
    gt_assert(sr);
    sr_range = gt_genome_node_get_range(sr);
    joined_range = gt_range_join(&range, &sr_range);
    gt_genome_node_set_range(sr, &joined_range);
    gt_queue_add(trnv->node_buffer, fn);
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %r13
movaps %xmm0, (%r13)
callq 0x28d38
movq %rax, %rdi
movq %r14, %rsi
callq 0x2603e
movq %rax, 0x30(%rsp)
movq %rbx, %rdi
callq 0x1c31a
movq %rax, %rdi
callq 0x143d2
movq %rax, %r12
movq %rbx, %rdi
callq 0x1b8e0
movq %rax, %rbp
movb $0x1, %r15b
leaq 0x18(%rsp), %r14
movq %rbp, %rdi
callq 0x1bb1e
testq %rax, %rax
je 0x28ef7
movq %rax, %rdi
callq 0x1c3c4
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
testb $0x1, %r15b
je 0x28ede
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x28ef2
movq %r13, %rdi
movq %r14, %rsi
callq 0x5d269
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
xorl %r15d, %r15d
jmp 0x28ea4
movq %rbp, %rdi
callq 0x1bbe1
movq 0x30(%rsp), %r15
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0x55ef6
testq %rax, %rax
je 0x28f56
movq %rax, %r14
movq %rax, %rdi
callq 0x1c3c4
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %rsp, %rdi
callq 0x5d269
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x1c48b
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x5b055
jmp 0x28f83
movq %rbx, %rdi
callq 0x1c2d8
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1c285
leaq 0xa9ee0(%rip), %rsi     # 0xd2e4f
movq 0x28(%rsp), %rdi
movq %r12, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xc007
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq