// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrdigest_ppt_visitor.c
// Function: gt_group_hits
static void gt_group_hits(GtLTRdigestPPTVisitor *lv,
                          unsigned int *decoded, GtPPTResults *results,
                          GtUword radius, GT_UNUSED const char *seq,
                          GtStrand strand)
{
  GtPPTHit *cur_hit = NULL,
           *potential_ubox = NULL;
  GtUword i = 0;

  gt_assert(decoded && results && strand != GT_STRAND_UNKNOWN);

  /* group hits into stretches */
  cur_hit = gt_ppt_hit_new(strand, results);
  for (i = 0; i < 2 * radius - 1; i++)
  {
    gt_assert(cur_hit != NULL);
    cur_hit->state = (GtPPTStates) decoded[i];
    cur_hit->rng.end = i;
    if (decoded[i+1] != decoded[i] || i + 2 == 2 * radius)
    {
      switch (cur_hit->state)
      {
        case PPT_UBOX:
          if (gt_ubox_ok(cur_hit, lv->ubox_len)) {
            if (potential_ubox != NULL) {
              gt_free(potential_ubox);
              potential_ubox = NULL;
            }
            potential_ubox = cur_hit;
            cur_hit = NULL;
          }
          else
          {
            gt_free(cur_hit);
            cur_hit = NULL;
          }
          break;
        case PPT_IN:
          if (gt_ppt_ok(cur_hit, lv->ppt_len))
          {
            cur_hit->score = gt_ppt_score(radius, cur_hit->rng.end);
            gt_array_add(results->hits, cur_hit);
            if (potential_ubox != NULL)
            {
              if (cur_hit->rng.start - potential_ubox->rng.end
                    <= (GtUword) lv->max_ubox_dist)
              {
                /* this PPT has a U-box, handle accordingly */
                cur_hit->ubox = potential_ubox;
              } else {
                gt_free(potential_ubox);
              }
              potential_ubox = NULL;
            }
            cur_hit = NULL;
          }
          else
          {
            if (potential_ubox != NULL) {
              gt_free(potential_ubox);
              potential_ubox = NULL;
            }
            gt_free(cur_hit);
            cur_hit = NULL;
          }
          break;
        default:
          if (potential_ubox != NULL) {
                gt_free(potential_ubox);
                potential_ubox = NULL;
          }
          gt_free(cur_hit);
          cur_hit = NULL;
          break;
      }
      if (i+2!=2*radius)
      {
        /* we assume that the current hit has been processed */
        gt_assert(cur_hit == NULL);
        cur_hit = gt_ppt_hit_new(strand, results);
        cur_hit->rng.start = i+1;
      }
    }
  }
  if (cur_hit != NULL)
    cur_hit->rng.end++;
  gt_free(potential_ubox);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x30cbe4
cmpq $0x0, 0x40(%rsp)
je 0x30cbe4
cmpl $0x3, 0x2c(%rsp)
jne 0x30cc1c
movq 0x32f3b5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x20941e(%rip), %rsi    # 0x516013
leaq 0x28728e(%rip), %rdx    # 0x593e8a
leaq 0x2872b9(%rip), %rcx    # 0x593ebc
leaq 0x28714c(%rip), %r8     # 0x593d56
movl $0x12e, %r9d            # imm = 0x12E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30cc1e
movl 0x2c(%rsp), %edi
movq 0x40(%rsp), %rsi
callq 0x30d040
movq %rax, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
shlq %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x30cf6e
jmp 0x30cc56
cmpq $0x0, 0x20(%rsp)
jne 0x30cc96
movq 0x32f33b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2093a4(%rip), %rsi    # 0x516013
leaq 0x287254(%rip), %rdx    # 0x593eca
leaq 0x28723f(%rip), %rcx    # 0x593ebc
leaq 0x2870d2(%rip), %r8     # 0x593d56
movl $0x134, %r9d            # imm = 0x134
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30cc98
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movq 0x48(%rsp), %rcx
movq 0x10(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x30ccf2
movq 0x10(%rsp), %rax
addq $0x2, %rax
movq 0x38(%rsp), %rcx
shlq %rcx
cmpq %rcx, %rax
jne 0x30cf59
movq 0x20(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x30cd94
jmp 0x30cd08
movl 0xc(%rsp), %eax
subl $0x2, %eax
jne 0x30ce93
jmp 0x30cd17
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
callq 0x30d0e0
testb $0x1, %al
jne 0x30cd34
jmp 0x30cd70
cmpq $0x0, 0x18(%rsp)
je 0x30cd5b
movq 0x18(%rsp), %rdi
leaq 0x28700e(%rip), %rsi    # 0x593d56
movl $0x13e, %edx            # imm = 0x13E
callq 0xe88c0
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
jmp 0x30cd8f
movq 0x20(%rsp), %rdi
leaq 0x286fda(%rip), %rsi    # 0x593d56
movl $0x146, %edx            # imm = 0x146
callq 0xe88c0
movq $0x0, 0x20(%rsp)
jmp 0x30ced9
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x38(%rax), %rdx
callq 0x30d1a0
testb $0x1, %al
jne 0x30cdb4
jmp 0x30ce4b
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x30d260
movq 0x20(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rdi
leaq 0x20(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
cmpq $0x0, 0x18(%rsp)
je 0x30ce40
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
subq 0x8(%rcx), %rax
movq 0x50(%rsp), %rcx
movl 0x8c(%rcx), %ecx
cmpq %rcx, %rax
ja 0x30ce21
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x30ce37
movq 0x18(%rsp), %rdi
leaq 0x286f29(%rip), %rsi    # 0x593d56
movl $0x157, %edx            # imm = 0x157
callq 0xe88c0
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
jmp 0x30ce91
cmpq $0x0, 0x18(%rsp)
je 0x30ce72
movq 0x18(%rsp), %rdi
leaq 0x286ef7(%rip), %rsi    # 0x593d56
movl $0x160, %edx            # imm = 0x160
callq 0xe88c0
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x286ed8(%rip), %rsi    # 0x593d56
movl $0x163, %edx            # imm = 0x163
callq 0xe88c0
movq $0x0, 0x20(%rsp)
jmp 0x30ced9
cmpq $0x0, 0x18(%rsp)
je 0x30ceba
movq 0x18(%rsp), %rdi
leaq 0x286eaf(%rip), %rsi    # 0x593d56
movl $0x169, %edx            # imm = 0x169
callq 0xe88c0
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x286e90(%rip), %rsi    # 0x593d56
movl $0x16c, %edx            # imm = 0x16C
callq 0xe88c0
movq $0x0, 0x20(%rsp)
movq 0x10(%rsp), %rax
addq $0x2, %rax
movq 0x38(%rsp), %rcx
shlq %rcx
cmpq %rcx, %rax
je 0x30cf57
jmp 0x30cef1
cmpq $0x0, 0x20(%rsp)
je 0x30cf31
movq 0x32f0a0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x209109(%rip), %rsi    # 0x516013
leaq 0x286fc9(%rip), %rdx    # 0x593eda
leaq 0x286fa4(%rip), %rcx    # 0x593ebc
leaq 0x286e37(%rip), %r8     # 0x593d56
movl $0x173, %r9d            # imm = 0x173
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30cf33
movl 0x2c(%rsp), %edi
movq 0x40(%rsp), %rsi
callq 0x30d040
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rcx
addq $0x1, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
jmp 0x30cf59
jmp 0x30cf5b
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x30cc3a
cmpq $0x0, 0x20(%rsp)
je 0x30cf87
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rdi
leaq 0x286dc3(%rip), %rsi    # 0x593d56
movl $0x17b, %edx            # imm = 0x17B
callq 0xe88c0
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)