// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
callq 0x4b04c
movq %rax, %rdi
movq %r14, %rsi
callq 0x48fc5
movq %rax, %r15
movq %rbx, %rdi
callq 0x415a1
movq %rax, %rdi
callq 0x3bb5d
movq %rax, %r12
movq %rbx, %rdi
callq 0x40ee0
movq %rax, %r13
movq %rax, %rdi
callq 0x41076
testq %rax, %rax
je 0x4b1f3
movq %rax, %rdi
callq 0x415e5
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r13, %rdi
callq 0x41076
testq %rax, %rax
je 0x4b1f3
leaq 0x10(%rsp), %rbp
movq %rsp, %r14
movq %rax, %rdi
callq 0x415e5
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x7e2af
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
movq %r13, %rdi
callq 0x41076
testq %rax, %rax
jne 0x4b1c0
movq %r13, %rdi
callq 0x41108
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0x775ed
testq %rax, %rax
je 0x4b24d
movq %rax, %r14
movq %rax, %rdi
callq 0x415e5
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
leaq 0x10(%rsp), %rdi
callq 0x7e2af
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x41646
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x7c47f
jmp 0x4b27a
movq %rbx, %rdi
callq 0x41592
movl %eax, %ebp
movq %rbx, %rdi
callq 0x41572
leaq 0x9ebf9(%rip), %rsi     # 0xe9e5f
movq 0x20(%rsp), %rdi
movq %r12, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x34f1f
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq