// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x1ae573
movq 0x70(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1ae53b
jmp 0x1ae573
movq 0x48da5e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x367ac7(%rip), %rsi    # 0x516013
leaq 0x367c6c(%rip), %rdx    # 0x5161bf
leaq 0x3b0b16(%rip), %rcx    # 0x55f070
leaq 0x3b0ab0(%rip), %r8     # 0x55f011
movl $0x34, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ae575
jmp 0x1ae577
cmpq $0x0, 0x80(%rsp)
jne 0x1ae5ba
movq 0x48da17(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x367a80(%rip), %rsi    # 0x516013
leaq 0x3a8c96(%rip), %rdx    # 0x557230
leaq 0x3b0acf(%rip), %rcx    # 0x55f070
leaq 0x3b0a69(%rip), %r8     # 0x55f011
movl $0x35, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ae5bc
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rdi
callq 0x16d430
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xe0f20
movq %rax, 0x60(%rsp)
cmpq $0x0, %rax
je 0x1ae785
jmp 0x1ae5f5
movq 0x60(%rsp), %rdi
callq 0x16d430
movq %rax, 0x10(%rsp)
movq 0x80(%rsp), %rdi
callq 0x16d430
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
je 0x1ae656
movq 0x48d97b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3679e4(%rip), %rsi    # 0x516013
leaq 0x3b0a50(%rip), %rdx    # 0x55f086
leaq 0x3b0a33(%rip), %rcx    # 0x55f070
leaq 0x3b09cd(%rip), %r8     # 0x55f011
movl $0x3a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ae658
movq 0x60(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x106fa0
cmpl $0x0, %eax
jle 0x1ae6f7
movq 0x48d8da(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x367943(%rip), %rsi    # 0x516013
leaq 0x3b0a07(%rip), %rdx    # 0x55f0de
leaq 0x3b0992(%rip), %rcx    # 0x55f070
leaq 0x3b092c(%rip), %r8     # 0x55f011
movl $0x3f, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ae6f9
movq 0x58(%rsp), %rax
addq $0x1, %rax
cmpq 0x40(%rsp), %rax
jne 0x1ae760
movq 0x60(%rsp), %rdi
callq 0x16fb00
cmpq $0x0, %rax
jne 0x1ae760
movq 0x80(%rsp), %rdi
callq 0x16fb00
cmpq $0x0, %rax
jne 0x1ae760
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x16eb50
movq 0x60(%rsp), %rdi
callq 0x16ecf0
movq 0x68(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x80(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x16d430
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xe1030
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
movq 0x80(%rsp), %rdi
callq 0x16d430
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rdx
callq 0xe0fc0
xorl %eax, %eax
addq $0x88, %rsp
retq
nopl (%rax)