// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/targetbest_select_stream.c
// Function: select_targetbest
static void select_targetbest(GtFeatureNode *current_feature,
                              GtDlist *trees, GtHashmap *target_to_elem)
{
  GtUword num_of_targets;
  GtDlistelem *previous_elem;
  GtStr *first_target_id;
  const char *target;
  GT_UNUSED int had_err;
  gt_assert(current_feature && trees);
  target = gt_feature_node_get_attribute(current_feature, GT_GFF_TARGET);
  gt_assert(target);
  first_target_id = gt_str_new();
  had_err = gt_gff3_parser_parse_target_attributes(target, &num_of_targets,
                                                   first_target_id, NULL, NULL,
                                                   "", 0, NULL);
  gt_assert(!had_err);
  if (num_of_targets == 1) {
    GtStr *key = gt_str_new();
    build_key(key, current_feature, first_target_id);
    if (!(previous_elem = gt_hashmap_get(target_to_elem, gt_str_get(key)))) {
      /* element with this target_id not included yet -> include it */
      include_feature(trees, target_to_elem, current_feature, key);
    }
    else {
      GtFeatureNode *previous_feature = gt_dlistelem_get_data(previous_elem);
      /* element with this target_id included already -> compare them */
      if (gt_feature_node_get_score(current_feature) >
          gt_feature_node_get_score(previous_feature)) {
        /* current feature is better -> replace previous feature */
        replace_previous_elem(previous_elem, current_feature, trees,
                              target_to_elem, key);
      }
      else /* current feature is not better -> remove it */
        gt_genome_node_delete((GtGenomeNode*) current_feature);
    }
    gt_str_delete(key);
  }
  else
    gt_dlist_add(trees, current_feature);
  gt_str_delete(first_target_id);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x1ee453
cmpq $0x0, 0x68(%rsp)
jne 0x1ee48b
movq 0x44db46(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x327baf(%rip), %rsi    # 0x516013
leaq 0x37ab4c(%rip), %rdx    # 0x568fb7
leaq 0x37ab5e(%rip), %rcx    # 0x568fd0
leaq 0x37aadf(%rip), %r8     # 0x568f58
movl $0x58, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ee48d
movq 0x70(%rsp), %rdi
leaq 0x32f507(%rip), %rsi    # 0x51d9a0
callq 0x16c040
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x1ee4e3
movq 0x44daee(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x327b57(%rip), %rsi    # 0x516013
leaq 0x36bd41(%rip), %rdx    # 0x55a204
leaq 0x37ab06(%rip), %rcx    # 0x568fd0
leaq 0x37aa87(%rip), %r8     # 0x568f58
movl $0x5a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ee4e5
callq 0x11d4a0
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
leaq 0x58(%rsp), %rsi
xorl %eax, %eax
movl %eax, %r8d
leaq 0x3af11e(%rip), %r9     # 0x59d628
xorl %eax, %eax
movq %r8, %rcx
movl $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x1774b0
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
je 0x1ee567
movq 0x44da6a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x327ad3(%rip), %rsi    # 0x516013
leaq 0x35e6c0(%rip), %rdx    # 0x54cc07
leaq 0x37aa82(%rip), %rcx    # 0x568fd0
leaq 0x37aa03(%rip), %r8     # 0x568f58
movl $0x5f, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ee569
cmpq $0x1, 0x58(%rsp)
jne 0x1ee649
callq 0x11d4a0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x1ee670
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rdi
callq 0x11dee0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xe0f20
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
jne 0x1ee5da
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x30(%rsp), %rcx
callq 0x1ee730
jmp 0x1ee63d
movq 0x50(%rsp), %rdi
callq 0xa60d0
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rdi
callq 0x16df90
movss %xmm0, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
callq 0x16df90
movaps %xmm0, %xmm1
movss 0x1c(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1ee631
movq 0x50(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x30(%rsp), %r8
callq 0x1ee7a0
jmp 0x1ee63b
movq 0x70(%rsp), %rdi
callq 0x173180
jmp 0x1ee63d
movq 0x30(%rsp), %rdi
callq 0x11f560
jmp 0x1ee658
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0xa61a0
movq 0x48(%rsp), %rdi
callq 0x11f560
addq $0x78, %rsp
retq
nopw (%rax,%rax)