// File: /workspace/github_c_makefile_star2_O1/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, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x30(%rsp)
callq 0x4bca8
movq %rax, %rdi
movq %r14, %rsi
callq 0x49c1d
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
callq 0x41f3f
movq %rax, %rdi
callq 0x3c40b
movq %rax, %r12
movq %rbx, %rdi
callq 0x4186c
movq %rax, %r13
movq %rax, %rdi
callq 0x41a02
testq %rax, %rax
je 0x4be45
movb $0x1, %r15b
movq %rsp, %rbp
leaq 0x10(%rsp), %r14
movq %rax, %rdi
callq 0x41f83
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
testb $0x1, %r15b
je 0x4be24
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
jmp 0x4be38
movq %rbp, %rdi
movq %r14, %rsi
callq 0x7e16b
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq %r13, %rdi
callq 0x41a02
testq %rax, %rax
jne 0x4bdf4
movq %r13, %rdi
callq 0x41a94
movq 0x28(%rsp), %r15
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0x77109
testq %rax, %rax
je 0x4bea4
movq %rax, %r14
movq %rax, %rdi
callq 0x41f83
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %rsp, %rdi
callq 0x7e16b
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, %rdi
callq 0x41fe4
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x7c043
jmp 0x4bed1
movq %rbx, %rdi
callq 0x41f30
movl %eax, %ebp
movq %rbx, %rdi
callq 0x41f10
leaq 0x9dff4(%rip), %rsi     # 0xe9eb1
movq 0x20(%rsp), %rdi
movq %r12, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x3559f
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq