// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/inter_feature_visitor.c
// Function: inter_feature_in_children
static int inter_feature_in_children(GtFeatureNode *current_feature, void *data,
                                     GtError *err)
{
  GtInterFeatureVisitor *aiv = (GtInterFeatureVisitor*) data;
  GtFeatureNode *inter_node;
  GtRange previous_range, current_range, inter_range;
  GtStrand previous_strand, current_strand, inter_strand;
  GtStr *parent_seqid;
  gt_error_check(err);
  gt_assert(current_feature);
  if (gt_feature_node_has_type(current_feature, aiv->outside_type)) {
    if (aiv->previous_feature) {
      /* determine inter range */
      previous_range = gt_genome_node_get_range((GtGenomeNode*)
                                                aiv->previous_feature);
      current_range = gt_genome_node_get_range((GtGenomeNode*) current_feature);
      if (previous_range.end >= current_range.start) {
        gt_warning("overlapping boundary features " GT_WU "-" GT_WU " and "
                   GT_WU "-" GT_WU ", " "not placing '%s' inter-feature",
                   previous_range.start,
                   previous_range.end,
                   current_range.start,
                   current_range.end,
                   aiv->inter_type);
        return 0;
      }
      if (current_range.start - previous_range.end < 2) {
        gt_warning("no space for inter-feature '%s' between " GT_WU " and "
                   GT_WU,
                   aiv->inter_type,
                   previous_range.end,
                   current_range.start);
        return 0;
      }
      inter_range.start = previous_range.end + 1;
      inter_range.end = current_range.start - 1;

      /* determine inter strand */
      previous_strand = gt_feature_node_get_strand(aiv->previous_feature);
      current_strand = gt_feature_node_get_strand(current_feature);
      if (previous_strand != current_strand)
      {
        GtUword curr_ln = gt_genome_node_get_line_number((GtGenomeNode*)
                                                         current_feature);
        GtUword prev_ln = gt_genome_node_get_line_number((GtGenomeNode*)
                                                         aiv->previous_feature);
        const char *filename = gt_genome_node_get_filename((GtGenomeNode*)
                                                           current_feature);
        gt_error_set(err, "feature on line " GT_WU " of '%s' has a different "
                     "strand than the feature on line " GT_WU, curr_ln,
                     filename, prev_ln);
        return -1;
      }
      inter_strand = previous_strand;

      /* determine sequence id */
      parent_seqid =
        gt_genome_node_get_seqid((GtGenomeNode*) aiv->parent_feature);
      gt_assert(!gt_str_cmp(parent_seqid,
                            gt_genome_node_get_seqid((GtGenomeNode*)
                                                     aiv->previous_feature)));
      gt_assert(!gt_str_cmp(parent_seqid,
                            gt_genome_node_get_seqid((GtGenomeNode*)
                                                     current_feature)));

      /* create inter feature */
      inter_node = (GtFeatureNode*)
                   gt_feature_node_new(parent_seqid, aiv->inter_type,
                                       inter_range.start, inter_range.end,
                                       inter_strand);
      gt_feature_node_add_child(aiv->parent_feature, inter_node);
    }
    aiv->previous_feature = current_feature;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
testq %rdx, %rdx
je 0x15e05a
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0x15e1d7
testq %rbx, %rbx
je 0x15e1d2
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x149d45
xorl %ebp, %ebp
testb %al, %al
je 0x15e181
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x15e17d
callq 0x14b8df
movq %rax, %r15
movq %rdx, %r13
movq %rbx, %rdi
callq 0x14b8df
movq %rax, %rcx
subq %r13, %rax
jbe 0x15e0c3
cmpq $0x1, %rax
ja 0x15e0e5
movq 0x18(%r14), %rsi
leaq 0x22fe50(%rip), %rdi    # 0x38df02
xorl %ebp, %ebp
movq %r13, %rdx
xorl %eax, %eax
callq 0x125448
jmp 0x15e181
movq %rdx, %r8
movq 0x18(%r14), %r9
leaq 0x22fddf(%rip), %rdi    # 0x38deb0
xorl %ebp, %ebp
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x125448
jmp 0x15e181
movq %rcx, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq 0x28(%r14), %rdi
callq 0x14970e
movl %eax, %r13d
movq %rbx, %rdi
callq 0x14970e
cmpl %eax, %r13d
jne 0x15e192
movl %r13d, %r15d
movq 0x20(%r14), %rdi
callq 0x14b89b
movq %rax, %r12
movq 0x28(%r14), %rdi
callq 0x14b89b
movq %r12, %rdi
movq %rax, %rsi
callq 0x120dc8
testl %eax, %eax
jne 0x15e1dc
movq %rbx, %rdi
callq 0x14b89b
movq %r12, %rdi
movq %rax, %rsi
callq 0x120dc8
testl %eax, %eax
jne 0x15e1e1
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %rcx
decq %rcx
movq 0x18(%r14), %rsi
movq %r12, %rdi
movl %r15d, %r8d
callq 0x14952c
movq 0x20(%r14), %rdi
movq %rax, %rsi
callq 0x149997
movq %rbx, 0x28(%r14)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x14b88c
movl %eax, %r15d
movq 0x28(%r14), %rdi
callq 0x14b88c
movl %eax, %r14d
movq %rbx, %rdi
callq 0x14b86c
leaq 0x22fd7e(%rip), %rsi    # 0x38df36
movq %r12, %rdi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x15e181
callq 0x4a5e8
callq 0x4a543
callq 0x4a57a
callq 0x4a5b1