// File: /workspace/github_c_makefile_star2_O3/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 0x1564a6
movq %r12, %rdi
callq 0xfcc32
testb %al, %al
jne 0x156623
testq %rbx, %rbx
je 0x15661e
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x142b18
xorl %ebp, %ebp
testb %al, %al
je 0x1565cd
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x1565c9
callq 0x144679
movq %rax, %r15
movq %rdx, %r13
movq %rbx, %rdi
callq 0x144679
movq %rax, %rcx
subq %r13, %rax
jbe 0x15650f
cmpq $0x1, %rax
ja 0x156531
movq 0x18(%r14), %rsi
leaq 0x22e631(%rip), %rdi    # 0x384b2f
xorl %ebp, %ebp
movq %r13, %rdx
xorl %eax, %eax
callq 0x11f68c
jmp 0x1565cd
movq %rdx, %r8
movq 0x18(%r14), %r9
leaq 0x22e5c0(%rip), %rdi    # 0x384add
xorl %ebp, %ebp
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x11f68c
jmp 0x1565cd
movq %rcx, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq 0x28(%r14), %rdi
callq 0x1424d6
movl %eax, %r13d
movq %rbx, %rdi
callq 0x1424d6
cmpl %eax, %r13d
jne 0x1565de
movl %r13d, %r15d
movq 0x20(%r14), %rdi
callq 0x144635
movq %rax, %r12
movq 0x28(%r14), %rdi
callq 0x144635
movq %r12, %rdi
movq %rax, %rsi
callq 0x11b146
testl %eax, %eax
jne 0x156628
movq %rbx, %rdi
callq 0x144635
movq %r12, %rdi
movq %rax, %rsi
callq 0x11b146
testl %eax, %eax
jne 0x15662d
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %rcx
decq %rcx
movq 0x18(%r14), %rsi
movq %r12, %rdi
movl %r15d, %r8d
callq 0x1422f4
movq 0x20(%r14), %rdi
movq %rax, %rsi
callq 0x14275f
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 0x144626
movl %eax, %r15d
movq 0x28(%r14), %rdi
callq 0x144626
movl %eax, %r14d
movq %rbx, %rdi
callq 0x144606
leaq 0x22e55f(%rip), %rsi    # 0x384b63
movq %r12, %rdi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1565cd
callq 0x497d5
callq 0x49730
callq 0x49767
callq 0x4979e