// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/merge_feature_visitor.c
// Function: mergefeat_in_children
static int mergefeat_in_children(GtFeatureNode *current_feature, void *data,
                                 GT_UNUSED GtError *err)
{
  GtMergeFeatureVisitor *v = (GtMergeFeatureVisitor*) data;
  GtFeatureNode *previous_feature;
  GtRange previous_range, current_range;
  gt_error_check(err);
  gt_assert(current_feature);
  if ((previous_feature =
        gt_hashmap_get(v->hm, gt_feature_node_get_type(current_feature)))) {
    /* previous feature found -> check if merging is necessary */
    gt_assert(gt_feature_node_get_type(previous_feature) ==
              gt_feature_node_get_type(current_feature));
    previous_range = gt_genome_node_get_range((GtGenomeNode*)
                                              previous_feature);
    current_range = gt_genome_node_get_range((GtGenomeNode*) current_feature);
    /* sorted */
    gt_assert(gt_range_compare(&previous_range, &current_range) <= 0);
    /* merge only adjacent features without children */
    if (previous_range.end + 1 == current_range.start &&
        !gt_feature_node_number_of_children(previous_feature) &&
        !gt_feature_node_number_of_children(current_feature)) {
      /* merge nodes */
      gt_feature_node_set_end(previous_feature, current_range.end);
      /* XXX: compute average score ? */
      gt_feature_node_unset_score(previous_feature);
      gt_array_add(v->nodes_to_remove, current_feature);
    }
    /* remove previous feature */
    gt_hashmap_remove(v->hm, gt_feature_node_get_type(previous_feature));
  }
  /* add current feature */
  gt_hashmap_add(v->hm, (char*) gt_feature_node_get_type(current_feature),
                 current_feature);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, (%rsp)
testq %rdx, %rdx
je 0x1008ca
movq %rdx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x100a07
testq %r14, %r14
je 0x1009dd
movq 0x18(%rbx), %r15
movq %r14, %rdi
callq 0xda338
movq %r15, %rdi
movq %rax, %rsi
callq 0x8f482
testq %rax, %rax
je 0x1009b4
movq %rax, %r15
movq %rax, %rdi
callq 0xda338
movq %rax, %r12
movq %r14, %rdi
callq 0xda338
cmpq %rax, %r12
jne 0x100a31
movq %r15, %rdi
callq 0xdd1f4
leaq 0x18(%rsp), %r12
movq %rax, (%r12)
movq %rdx, 0x8(%r12)
movq %r14, %rdi
callq 0xdd1f4
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r12, %rdi
callq 0xa3058
testl %eax, %eax
jg 0x100a5b
movq 0x20(%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jne 0x100999
movq %r15, %rdi
callq 0xdbcc5
testq %rax, %rax
jne 0x100999
movq %r14, %rdi
callq 0xdbcc5
testq %rax, %rax
jne 0x100999
movq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0xdb24f
movq %r15, %rdi
callq 0xdb321
movq 0x20(%rbx), %rdi
movq %rsp, %rsi
pushq $0x8
popq %rdx
callq 0x5851d
movq 0x18(%rbx), %r14
movq %r15, %rdi
callq 0xda338
movq %r14, %rdi
movq %rax, %rsi
callq 0x8f4fb
movq (%rsp), %r14
movq 0x18(%rbx), %rbx
movq %r14, %rdi
callq 0xda338
movq (%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8f4bd
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x337584(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e4625(%rip), %rsi    # 0x2e5013
leaq 0x2244f3(%rip), %rdx    # 0x324ee8
leaq 0x22c264(%rip), %rcx    # 0x32cc60
leaq 0x22c1fe(%rip), %r8     # 0x32cc01
pushq $0x35
jmp 0x100a83
movq 0x33755a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e45fb(%rip), %rsi    # 0x2e5013
leaq 0x1e47a0(%rip), %rdx    # 0x2e51bf
leaq 0x22c23a(%rip), %rcx    # 0x32cc60
leaq 0x22c1d4(%rip), %r8     # 0x32cc01
pushq $0x34
jmp 0x100a83
movq 0x337530(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e45d1(%rip), %rsi    # 0x2e5013
leaq 0x22c22d(%rip), %rdx    # 0x32cc76
leaq 0x22c210(%rip), %rcx    # 0x32cc60
leaq 0x22c1aa(%rip), %r8     # 0x32cc01
pushq $0x3a
jmp 0x100a83
movq 0x337506(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e45a7(%rip), %rsi    # 0x2e5013
leaq 0x22c25b(%rip), %rdx    # 0x32ccce
leaq 0x22c1e6(%rip), %rcx    # 0x32cc60
leaq 0x22c180(%rip), %r8     # 0x32cc01
pushq $0x3f
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nopl (%rax)