// File: /workspace/github_c_makefile_star2_O2/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 0xf31c8
movq %r12, %rdi
callq 0x89eb7
testb %al, %al
jne 0xf3368
testq %rbx, %rbx
je 0xf333e
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xda68b
xorl %ebp, %ebp
testb %al, %al
je 0xf32ef
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0xf32eb
callq 0xdd1f4
movq %rax, %r15
movq %rdx, %r13
movq %rbx, %rdi
callq 0xdd1f4
movq %rax, %rcx
subq %r13, %rax
jbe 0xf3231
cmpq $0x1, %rax
ja 0xf3253
movq 0x18(%r14), %rsi
leaq 0x231d2a(%rip), %rdi    # 0x324f4a
xorl %ebp, %ebp
movq %r13, %rdx
xorl %eax, %eax
callq 0xb2cd0
jmp 0xf32ef
movq %rdx, %r8
movq 0x18(%r14), %r9
leaq 0x231cb9(%rip), %rdi    # 0x324ef8
xorl %ebp, %ebp
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0xb2cd0
jmp 0xf32ef
movq %rcx, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq 0x28(%r14), %rdi
callq 0xd9d99
movl %eax, %r13d
movq %rbx, %rdi
callq 0xd9d99
cmpl %eax, %r13d
jne 0xf3300
movl %r13d, %r15d
movq 0x20(%r14), %rdi
callq 0xdd14a
movq %rax, %r12
movq 0x28(%r14), %rdi
callq 0xdd14a
movq %r12, %rdi
movq %rax, %rsi
callq 0xad39b
testl %eax, %eax
jne 0xf339e
movq %rbx, %rdi
callq 0xdd14a
movq %r12, %rdi
movq %rax, %rsi
callq 0xad39b
testl %eax, %eax
jne 0xf33c8
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %rcx
decq %rcx
movq 0x18(%r14), %rsi
movq %r12, %rdi
movl %r15d, %r8d
callq 0xd9acb
movq 0x20(%r14), %rdi
movq %rax, %rsi
callq 0xda055
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 0xdd108
movl %eax, %r15d
movq 0x28(%r14), %rdi
callq 0xdd108
movl %eax, %r14d
movq %rbx, %rdi
callq 0xdd0b5
leaq 0x231c58(%rip), %rsi    # 0x324f7e
movq %r12, %rdi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
jmp 0xf32ef
movq 0x344c23(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f1cc4(%rip), %rsi    # 0x2e5013
leaq 0x231b92(%rip), %rdx    # 0x324ee8
leaq 0x231b71(%rip), %rcx    # 0x324ece
leaq 0x231b22(%rip), %r8     # 0x324e86
pushq $0x31
jmp 0xf3390
movq 0x344bf9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f1c9a(%rip), %rsi    # 0x2e5013
leaq 0x1f1e3f(%rip), %rdx    # 0x2e51bf
leaq 0x231b47(%rip), %rcx    # 0x324ece
leaq 0x231af8(%rip), %r8     # 0x324e86
pushq $0x30
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x344bc3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f1c64(%rip), %rsi    # 0x2e5013
leaq 0x231c18(%rip), %rdx    # 0x324fce
leaq 0x231b11(%rip), %rcx    # 0x324ece
leaq 0x231ac2(%rip), %r8     # 0x324e86
pushq $0x64
jmp 0xf3390
movq 0x344b99(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f1c3a(%rip), %rsi    # 0x2e5013
leaq 0x231c49(%rip), %rdx    # 0x325029
leaq 0x231ae7(%rip), %rcx    # 0x324ece
leaq 0x231a98(%rip), %r8     # 0x324e86
pushq $0x67
jmp 0xf3390