// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltr_classify_stream.c
// Function: classify_ltrs
static int classify_ltrs(GtArray *candidates, GtHashmap *features,
                         const char *famprefix, char **current_state,
                         GtUword *progress, GtError *err)
{
  GtBittab *group,
           *new_group;
  GtArray *groups;
  GtGenomeNode *candidate;
  bool sorted;
  int had_err = 0;
  GtUword i, j, num_of_cands;

  gt_error_check(err);
  gt_assert(candidates);

  add_fnmap_to_candidates(candidates);
  num_of_cands = gt_array_size(candidates);
  groups = gt_array_new(sizeof(GtBittab*));

  if (current_state != NULL) {
    gt_free(*current_state);
    *current_state = gt_cstr_dup("Assigning candidates to families");
  }

  for (i = 0; i < num_of_cands; i++) {
    sorted = false;
    candidate = *(GtGenomeNode**) gt_array_get(candidates, i);
    if (gt_feature_node_try_cast(candidate) == NULL)
      continue;
    for (j = 0; j < gt_array_size(groups); j++) {
      group = *(GtBittab**) gt_array_get(groups, j);
      if (!sorted && ltr_group_compatible(candidates, candidate, group,
                                          features, err)) {
        gt_bittab_set_bit(group, i);
        sorted = true;
        break;
      }
    }
    if (!sorted) {
      new_group = gt_bittab_new(num_of_cands);
      gt_bittab_set_bit(new_group, i);
      gt_array_add(groups, new_group);
    }
    if (progress != NULL)
      *progress = *progress + 1;
  }
  if (current_state != NULL) {
    gt_free(*current_state);
    *current_state = gt_cstr_dup("Checking for ambiguity");
  }
  had_err = check_ambiguous_candidates(candidates, groups, features,
                                       progress, err);

  if (!had_err)
    had_err = annotate_nodes(candidates, groups, famprefix, err);

  for (i = 0; i < gt_array_size(groups); i++) {
    gt_bittab_delete(*(GtBittab**) gt_array_get(groups, i));
  }
  gt_array_delete(groups);
  remove_fnmap_from_candidates(candidates);

  return had_err;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
movl $0x0, 0x30(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x2fe100
movq 0x58(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2fe0c8
jmp 0x2fe100
movq 0x33ded1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x217f3a(%rip), %rsi    # 0x516013
leaq 0x2180df(%rip), %rdx    # 0x5161bf
leaq 0x294447(%rip), %rcx    # 0x59252e
leaq 0x294422(%rip), %r8     # 0x592510
movl $0x143, %r9d            # imm = 0x143
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2fe102
jmp 0x2fe104
cmpq $0x0, 0x80(%rsp)
jne 0x2fe147
movq 0x33de8a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x217ef3(%rip), %rsi    # 0x516013
leaq 0x230bcc(%rip), %rdx    # 0x52ecf3
leaq 0x294400(%rip), %rcx    # 0x59252e
leaq 0x2943db(%rip), %r8     # 0x592510
movl $0x144, %r9d            # imm = 0x144
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2fe149
movq 0x80(%rsp), %rdi
callq 0x2fe400
movq 0x80(%rsp), %rdi
callq 0x81370
movq %rax, 0x18(%rsp)
movl $0x8, %edi
callq 0x80990
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x2fe1af
movq 0x68(%rsp), %rax
movq (%rax), %rdi
leaq 0x294382(%rip), %rsi    # 0x592510
movl $0x14b, %edx            # imm = 0x14B
callq 0xe88c0
leaq 0x29439d(%rip), %rdi    # 0x59253c
callq 0xa2db0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x2fe300
movb $0x0, 0x37(%rsp)
movq 0x80(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x170450
cmpq $0x0, %rax
jne 0x2fe1fc
jmp 0x2fe2ed
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x2fe296
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x50(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x2fe281
movq 0x80(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x78(%rsp), %rcx
movq 0x58(%rsp), %r8
callq 0x2fe5e0
testb $0x1, %al
jne 0x2fe26b
jmp 0x2fe281
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x89b00
movb $0x1, 0x37(%rsp)
jmp 0x2fe296
jmp 0x2fe283
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2fe205
testb $0x1, 0x37(%rsp)
jne 0x2fe2cf
movq 0x18(%rsp), %rdi
callq 0x89a20
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x89b00
movq 0x40(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
cmpq $0x0, 0x60(%rsp)
je 0x2fe2eb
movq 0x60(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq 0x60(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2fe2ed
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2fe1b8
cmpq $0x0, 0x68(%rsp)
je 0x2fe338
movq 0x68(%rsp), %rax
movq (%rax), %rdi
leaq 0x2941f9(%rip), %rsi    # 0x592510
movl $0x166, %edx            # imm = 0x166
callq 0xe88c0
leaq 0x294235(%rip), %rdi    # 0x59255d
callq 0xa2db0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x80(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %r8
callq 0x2fe770
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
jne 0x2fe384
movq 0x80(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x58(%rsp), %rcx
callq 0x2fea10
movl %eax, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x2fe3d5
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x80b60
movq (%rax), %rdi
callq 0x8af40
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2fe38d
movq 0x40(%rsp), %rdi
callq 0x81f80
movq 0x80(%rsp), %rdi
callq 0x2fed90
movl 0x30(%rsp), %eax
addq $0x88, %rsp
retq
nopl (%rax,%rax)