// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x14(%rsp)
testq %rsi, %rsi
je 0x20ed9b
testq %rdx, %rdx
je 0x20ed9b
movq %rcx, %r13
movq %rsi, %r15
movq %rdi, %r12
movl 0x14(%rsp), %edi
movq %rdx, 0x18(%rsp)
movq %rdx, %rsi
callq 0x20edb5
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x20ed96
movq %rax, %rdi
leaq (,%r13,2), %rax
cvtsi2sd %r13, %xmm0
movsd %xmm0, 0x28(%rsp)
imulq %r13, %r13
movq %r13, %xmm0
punpckldq 0x138da7(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x138daf(%rip), %xmm0   # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movl $0x2, %ebx
subq %rax, %rbx
movl $0x1, %ebp
xorl %r13d, %r13d
movq %r12, 0x20(%rsp)
leaq -0x1(%rbp), %rax
leaq (%rbx,%rbp), %r14
movl -0x4(%r15,%rbp,4), %ecx
movl %ecx, 0x18(%rdi)
movq %rax, 0x8(%rdi)
cmpq $0x1, %r14
je 0x20eb8c
cmpl %ecx, (%r15,%rbp,4)
je 0x20ed4d
testl %ecx, %ecx
je 0x20ebe4
cmpl $0x2, %ecx
jne 0x20ec90
movq %rbp, %rax
subq (%rdi), %rax
cmpq 0x40(%r12), %rax
jb 0x20eccd
cmpq 0x48(%r12), %rax
ja 0x20eccd
testq %r13, %r13
je 0x20ebd3
movq %r13, %rdi
leaq 0x1b1f02(%rip), %rsi    # 0x3c0ac6
movl $0x13e, %edx            # imm = 0x13E
callq 0x1045eb
movq 0x8(%rsp), %rdi
movq $0x0, 0x8(%rsp)
movq %rdi, %r13
jmp 0x20ed28
movq %rbp, %rcx
subq (%rdi), %rcx
cmpq 0x30(%r12), %rcx
jb 0x20ece9
cmpq 0x38(%r12), %rcx
ja 0x20ece9
movq %rax, %xmm0
punpckldq 0x138cd3(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x138cdb(%rip), %xmm0   # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
subsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
movapd 0x30(%rsp), %xmm2
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x10(%rdi)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movl $0x8, %edx
leaq 0x8(%rsp), %rsi
callq 0xd2410
testq %r13, %r13
je 0x20ecbf
movq 0x8(%rsp), %rax
movq (%rax), %rcx
subq 0x8(%r13), %rcx
movl 0x8c(%r12), %edx
cmpq %rdx, %rcx
jbe 0x20ed61
movq %r13, %rdi
leaq 0x1b1e3d(%rip), %rsi    # 0x3c0ac6
movl $0x157, %edx            # imm = 0x157
jmp 0x20ecba
testq %r13, %r13
leaq 0x1b1e2c(%rip), %rsi    # 0x3c0ac6
je 0x20ecb5
movq %r13, %rdi
movl $0x169, %edx            # imm = 0x169
callq 0x1045eb
leaq 0x1b1e16(%rip), %rsi    # 0x3c0ac6
movq 0x8(%rsp), %rdi
movl $0x16c, %edx            # imm = 0x16C
callq 0x1045eb
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
jmp 0x20ed28
leaq 0x1b1df2(%rip), %rsi    # 0x3c0ac6
movl $0x146, %edx            # imm = 0x146
callq 0x1045eb
movq $0x0, 0x8(%rsp)
jmp 0x20ed28
testq %r13, %r13
leaq 0x1b1dd3(%rip), %r12    # 0x3c0ac6
je 0x20ed0a
movq %r13, %rdi
movq %r12, %rsi
movl $0x160, %edx            # imm = 0x160
callq 0x1045eb
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movl $0x163, %edx            # imm = 0x163
callq 0x1045eb
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
movq 0x20(%rsp), %r12
cmpq $0x1, %r14
jne 0x20ed34
je 0x20ed73
xorl %edi, %edi
jmp 0x20ed53
movl 0x14(%rsp), %edi
movq 0x18(%rsp), %rsi
callq 0x20edb5
movq %rax, %rdi
movq %rax, 0x8(%rsp)
movq %rbp, (%rax)
cmpq $0x1, %r14
je 0x20ed6a
incq %rbp
testq %rdi, %rdi
jne 0x20eb68
jmp 0x20ed96
movq %r13, 0x20(%rax)
jmp 0x20ecbf
testq %rdi, %rdi
je 0x20ed73
incq 0x8(%rdi)
leaq 0x1b1d4c(%rip), %rsi    # 0x3c0ac6
movq %r13, %rdi
movl $0x17b, %edx            # imm = 0x17B
callq 0x1045eb
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x816ab
callq 0x81672