// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltr_cluster_stream.c
// Function: process_feature
static int process_feature(GtLTRClusterStream *lcs,
                           const char *feature,
                           GtError *err)
{
  GtArray *matches;
  GtMatchIterator *mi = NULL;
  GtMatch *match = NULL;
  GtMatchIteratorStatus status;
  GtEncseq *encseq;
  GtUword i;
  int had_err = 0;

  if (lcs->current_state != NULL) {
    char tmp[BUFSIZ];
    gt_free(*lcs->current_state);
    (void) snprintf(tmp, BUFSIZ, "Clustering feature: %s", feature);
    *lcs->current_state = gt_cstr_dup(tmp);
  }
  matches = gt_array_new(sizeof(GtMatch*));
  encseq = (GtEncseq*) gt_hashmap_get(lcs->feat_to_encseq, feature);
  gt_log_log("found encseq %p for feature %s", encseq, feature);
  if (!had_err) {
    mi = gt_match_iterator_last_new(encseq, encseq, lcs->match_score,
                                        lcs->mismatch_cost,
                                        lcs->gap_open_cost,
                                        lcs->gap_ext_cost,
                                        lcs->xdrop,
                                        lcs->ydrop,
                                        lcs->zdrop,
                                        lcs->k,
                                        lcs->mscoregapped,
                                        lcs->mscoregapless, err);
    if (mi != NULL) {
      while ((status = gt_match_iterator_next(mi, &match, err))
             != GT_MATCHER_STATUS_END) {
        if (status == GT_MATCHER_STATUS_OK) {
          gt_array_add(matches, match);
        } else {
          gt_assert(status == GT_MATCHER_STATUS_ERROR);
          had_err = -1;
          break;
        }
      }
    } else
      had_err = -1;
  }
  if (!had_err) {
    GtClusteredSet *cs;
    GtHashmap *seqdesc2seqnum;
    GtMatch *tmp_match;
    const char *description;
    char *output;
    GtUword desclen,
                  num_of_seq;

    seqdesc2seqnum = gt_hashmap_new(GT_HASH_STRING, free_hash, NULL);
    num_of_seq = gt_encseq_num_of_sequences(encseq);
    for (i = 0; i < num_of_seq; i++) {
      description = gt_encseq_description(encseq, &desclen, i);
      output = gt_calloc((size_t) (desclen + 1), sizeof (char));
      strncpy(output, description, (size_t) desclen);
      output[desclen] = '\0';
      gt_hashmap_add(seqdesc2seqnum, (void*) gt_cstr_dup(output),
                     (void*) (i + 1));
      gt_free(output);
    }
    cs = gt_clustered_set_union_find_new(num_of_seq, err);
    if (cs != NULL) {
      if (cluster_sequences(matches, cs, seqdesc2seqnum, (unsigned) lcs->psmall,
                            (unsigned) lcs->plarge, encseq, err) != 0) {
        had_err = -1;
      }
      if (!had_err) {
        (void) cluster_annotate_nodes(cs, encseq, feature, lcs->nodes, err);
      }
    } else
      had_err = -1;

    for (i = 0; i < gt_array_size(matches); i++) {
      tmp_match = *(GtMatch**) gt_array_get(matches, i);
      gt_match_delete(tmp_match);
    }
    gt_array_delete(matches);
    matches = NULL;
    gt_hashmap_delete(seqdesc2seqnum);
    gt_clustered_set_delete(cs, err);
  }
  gt_match_iterator_delete(mi);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
movq %rdi, 0x20d0(%rsp)
movq %rsi, 0x20c8(%rsp)
movq %rdx, 0x20c0(%rsp)
movq $0x0, 0x20b0(%rsp)
movq $0x0, 0x20a8(%rsp)
movl $0x0, 0x208c(%rsp)
movq 0x20d0(%rsp), %rax
cmpq $0x0, 0x80(%rax)
je 0x2ff8b2
movq 0x20d0(%rsp), %rax
movq 0x80(%rax), %rax
movq (%rax), %rdi
leaq 0x292e12(%rip), %rsi    # 0x592675
movl $0x192, %edx            # imm = 0x192
callq 0xe88c0
leaq 0x80(%rsp), %rdi
movq 0x20c8(%rsp), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0x292e09(%rip), %rdx    # 0x592692
movb $0x0, %al
callq 0x19b90
leaq 0x80(%rsp), %rdi
callq 0xa2db0
movq %rax, %rcx
movq 0x20d0(%rsp), %rax
movq 0x80(%rax), %rax
movq %rcx, (%rax)
movl $0x8, %edi
callq 0x80990
movq %rax, 0x20b8(%rsp)
movq 0x20d0(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x20c8(%rsp), %rsi
callq 0xe0f20
movq %rax, 0x2098(%rsp)
movq 0x2098(%rsp), %rsi
movq 0x20c8(%rsp), %rdx
leaq 0x292dad(%rip), %rdi    # 0x5926a9
movb $0x0, %al
callq 0xe7740
cmpl $0x0, 0x208c(%rsp)
jne 0x2ffa91
movq 0x2098(%rsp), %rdi
movq 0x2098(%rsp), %rsi
movq 0x20d0(%rsp), %rax
movl 0x58(%rax), %edx
movq 0x20d0(%rsp), %rax
movl 0x5c(%rax), %ecx
movq 0x20d0(%rsp), %rax
movl 0x60(%rax), %r8d
movq 0x20d0(%rsp), %rax
movl 0x64(%rax), %r9d
movq 0x20d0(%rsp), %rax
movl 0x68(%rax), %r15d
movq 0x20d0(%rsp), %rax
movl 0x6c(%rax), %r14d
movq 0x20d0(%rsp), %rax
movl 0x70(%rax), %ebp
movq 0x20d0(%rsp), %rax
movl 0x7c(%rax), %ebx
movq 0x20d0(%rsp), %rax
movl 0x74(%rax), %r11d
movq 0x20d0(%rsp), %rax
movl 0x78(%rax), %r10d
movq 0x20c0(%rsp), %rax
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movl %ebp, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x1a8d40
movq %rax, 0x20b0(%rsp)
cmpq $0x0, 0x20b0(%rsp)
je 0x2ffa84
jmp 0x2ff9db
movq 0x20b0(%rsp), %rdi
movq 0x20c0(%rsp), %rdx
leaq 0x20a8(%rsp), %rsi
callq 0x1a7950
movl %eax, 0x20a4(%rsp)
cmpl $0x1, %eax
je 0x2ffa82
cmpl $0x0, 0x20a4(%rsp)
jne 0x2ffa2a
movq 0x20b8(%rsp), %rdi
leaq 0x20a8(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
jmp 0x2ffa7d
jmp 0x2ffa2c
cmpl $0x2, 0x20a4(%rsp)
je 0x2ffa6e
movq 0x33c563(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2165cc(%rip), %rsi    # 0x516013
leaq 0x292c7a(%rip), %rdx    # 0x5926c8
leaq 0x292c95(%rip), %rcx    # 0x5926ea
leaq 0x292c19(%rip), %r8     # 0x592675
movl $0x1aa, %r9d            # imm = 0x1AA
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ffa70
movl $0xffffffff, 0x208c(%rsp) # imm = 0xFFFFFFFF
jmp 0x2ffa82
jmp 0x2ff9db
jmp 0x2ffa8f
movl $0xffffffff, 0x208c(%rsp) # imm = 0xFFFFFFFF
jmp 0x2ffa91
cmpl $0x0, 0x208c(%rsp)
jne 0x2ffd10
movl $0x1, %edi
leaq 0x295(%rip), %rsi       # 0x2ffd40
xorl %eax, %eax
movl %eax, %edx
callq 0xe0c40
movq %rax, 0x70(%rsp)
movq 0x2098(%rsp), %rdi
callq 0xa9d50
movq %rax, 0x48(%rsp)
movq $0x0, 0x2090(%rsp)
movq 0x2090(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x2ffbab
movq 0x2098(%rsp), %rdi
movq 0x2090(%rsp), %rdx
leaq 0x50(%rsp), %rsi
callq 0xb1b40
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rdi
addq $0x1, %rdi
movl $0x1, %esi
leaq 0x292b57(%rip), %rdx    # 0x592675
movl $0x1bf, %ecx            # imm = 0x1BF
callq 0xe83c0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x19330
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x70(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rdi
callq 0xa2db0
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movq 0x2090(%rsp), %rdx
addq $0x1, %rdx
callq 0xe0fc0
movq 0x58(%rsp), %rdi
leaq 0x292aed(%rip), %rsi    # 0x592675
movl $0x1c4, %edx            # imm = 0x1C4
callq 0xe88c0
movq 0x2090(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2090(%rsp)
jmp 0x2ffad7
movq 0x48(%rsp), %rdi
movq 0x20c0(%rsp), %rsi
callq 0x48c9d0
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x78(%rsp)
je 0x2ffc60
movq 0x20b8(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x20d0(%rsp), %rax
movq 0x40(%rax), %rax
movl %eax, %ecx
movq 0x20d0(%rsp), %rax
movq 0x48(%rax), %rax
movl %eax, %r8d
movq 0x2098(%rsp), %r9
movq 0x20c0(%rsp), %rax
movq %rax, (%rsp)
callq 0x2ffd60
cmpl $0x0, %eax
je 0x2ffc26
movl $0xffffffff, 0x208c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x208c(%rsp)
jne 0x2ffc5e
movq 0x78(%rsp), %rdi
movq 0x2098(%rsp), %rsi
movq 0x20c8(%rsp), %rdx
movq 0x20d0(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x20c0(%rsp), %r8
callq 0x300220
jmp 0x2ffc6b
movl $0xffffffff, 0x208c(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x2090(%rsp)
movq 0x2090(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x20b8(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x2ffcdb
movq 0x20b8(%rsp), %rdi
movq 0x2090(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x1a6fb0
movq 0x2090(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2090(%rsp)
jmp 0x2ffc77
movq 0x20b8(%rsp), %rdi
callq 0x81f80
movq $0x0, 0x20b8(%rsp)
movq 0x70(%rsp), %rdi
callq 0xe1770
movq 0x78(%rsp), %rdi
movq 0x20c0(%rsp), %rsi
callq 0x48bc40
movq 0x20b0(%rsp), %rdi
callq 0x1a7a70
movl 0x208c(%rsp), %eax
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)