// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
leaq 0x90(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xb2d0
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xb2d0
movb $0x1, 0x6f(%rsp)
movl $0x0, 0x68(%rsp)
callq 0x38a00
movq %rax, %rdi
movq 0xd0(%rsp), %rsi
callq 0x34d50
movq %rax, 0xb8(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x258a0
movq %rax, %rdi
callq 0x19940
movq %rax, 0x60(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x248a0
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x24bd0
movq %rax, 0xa8(%rsp)
cmpq $0x0, %rax
je 0x38c92
movq 0xa8(%rsp), %rdi
callq 0x259f0
movq %rax, 0x50(%rsp)
movq %rdx, 0x58(%rsp)
testb $0x1, 0x6f(%rsp)
je 0x38c57
movq 0x50(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x98(%rsp)
movb $0x0, 0x6f(%rsp)
jmp 0x38c8d
leaq 0x90(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x93fe0
movq %rax, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x98(%rsp)
jmp 0x38bfd
movq 0xb0(%rsp), %rdi
callq 0x24cf0
movq 0xb8(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x60(%rsp), %rsi
callq 0x86470
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x38d24
movq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x25850
movl %eax, 0x1c(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x257c0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl 0x1c(%rsp), %ecx
movq %rax, %r8
leaq 0x12e300(%rip), %rsi    # 0x167015
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x68(%rsp)
jne 0x38e05
jmp 0x38d31
cmpq $0x0, 0xa0(%rsp)
jne 0x38d74
movq 0x17b295(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x125319(%rip), %rsi    # 0x15e066
leaq 0x12b0b1(%rip), %rdx    # 0x163e05
leaq 0x12e2f6(%rip), %rcx    # 0x167051
leaq 0x12e28b(%rip), %r8     # 0x166fed
movl $0x5a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x38d76
movq 0xa0(%rsp), %rdi
callq 0x259f0
movq %rax, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x93fe0
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xa0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x25b50
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0xc8(%rsp), %rsi
callq 0x909d0
xorl %eax, %eax
addq $0xd8, %rsp
retq
nop