// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrdigest_ppt_visitor.c
// Function: gt_ppt_find
static GtPPTResults* gt_ppt_find(GtLTRdigestPPTVisitor *v,
                                 const char *seq, const char *rev_seq,
                                 GtUword seqlen,
                                 GtRange rightltrrng,
                                 GtRange leftltrrng)
{
  unsigned int *encoded_seq = NULL,
               *decoded = NULL;
  GtPPTResults *results = NULL;
  GtUword i = 0,
                radius = 0,
                ltrlen = 0;

  gt_assert(seq && rev_seq && v);

  results = gt_ppt_results_new(leftltrrng, rightltrrng);

    /* do PPT finding on forward strand
     -------------------------------- */
  ltrlen = gt_range_length(&rightltrrng);
  /* make sure that we do not cross the LTR boundary */
  radius = GT_MIN((GtUword) v->radius, ltrlen-1);
  /* encode sequence */
  encoded_seq = gt_malloc(sizeof (unsigned int) * seqlen);
  for (i = 0; i < seqlen; i++) {
    encoded_seq[i] = (unsigned int) gt_alphabet_encode(v->alpha, seq[i]);
  }
  /* use Viterbi algorithm to decode emissions within radius */
  decoded = gt_malloc(sizeof (unsigned int) * (2 * radius + 1));
  gt_hmm_decode(v->hmm, decoded,
                encoded_seq + (seqlen-1) - (ltrlen-1) - radius - 1,
                (unsigned int) (2 * radius + 1));
  gt_group_hits(v, decoded, results, radius,
                seq + (seqlen - 1) - (ltrlen - 1) - radius - 1,
                GT_STRAND_FORWARD);
  /* radius length may change in the next strand, so reallocate */
  gt_free(decoded);

  /* do PPT finding on reverse strand
     -------------------------------- */
  ltrlen = gt_range_length(&leftltrrng);
  /* make sure that we do not cross the LTR boundary */
  radius = GT_MIN((GtUword) v->radius, ltrlen - 1);
  /* encode sequence */
  for (i = 0; i < seqlen; i++) {
    encoded_seq[i] = (unsigned int) gt_alphabet_encode(v->alpha, rev_seq[i]);
  }
  /* use Viterbi algorithm to decode emissions within radius */
  decoded = gt_malloc(sizeof (unsigned int) * (2 * radius + 1));
  gt_hmm_decode(v->hmm, decoded,
                encoded_seq + (seqlen - 1) - (ltrlen - 1) - radius - 1,
                (unsigned int) (2 * radius + 1));
  gt_group_hits(v, decoded, results, radius,
                rev_seq + (seqlen - 1) - (ltrlen - 1) - radius - 1,
                GT_STRAND_REVERSE);

  /* rank hits by descending score */
  gt_array_sort(results->hits, gt_ppt_hit_cmp);

  gt_free(encoded_seq);
  gt_free(decoded);

  return results;
}

// Assembly:
subq $0x78, %rsp
leaq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r8, 0x68(%rsp)
movq %r9, 0x70(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x30c3ad
cmpq $0x0, 0x50(%rsp)
je 0x30c3ad
cmpq $0x0, 0x60(%rsp)
jne 0x30c3e5
movq 0x32fbec(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x209c55(%rip), %rsi    # 0x516013
leaq 0x287aa5(%rip), %rdx    # 0x593e6a
leaq 0x287ab2(%rip), %rcx    # 0x593e7e
leaq 0x287983(%rip), %r8     # 0x593d56
movl $0x18b, %r9d            # imm = 0x18B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30c3e7
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rcx
callq 0x30cb10
movq %rax, 0x30(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x107320
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movl 0x88(%rax), %eax
movq 0x18(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x30c441
movq 0x60(%rsp), %rax
movl 0x88(%rax), %eax
movq %rax, 0x8(%rsp)
jmp 0x30c44f
movq 0x18(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
shlq $0x2, %rdi
leaq 0x2878ed(%rip), %rsi    # 0x593d56
movl $0x195, %edx            # imm = 0x195
callq 0xe80f0
movq %rax, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x30c4c9
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x58(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %esi
callq 0x7f6f0
movzbl %al, %edx
movq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x30c481
movq 0x20(%rsp), %rdi
shlq %rdi
addq $0x1, %rdi
shlq $0x2, %rdi
leaq 0x287876(%rip), %rsi    # 0x593d56
movl $0x19a, %edx            # imm = 0x19A
callq 0xe80f0
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rax
subq $0x1, %rax
shlq $0x2, %rax
addq %rax, %rdx
movq 0x18(%rsp), %rcx
subq $0x1, %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rdx
xorl %eax, %eax
subq 0x20(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdx
addq $-0x4, %rdx
movq 0x20(%rsp), %rax
shlq %rax
addq $0x1, %rax
movl %eax, %ecx
callq 0x18b8f0
movq 0x60(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x48(%rsp), %rax
subq $0x1, %rax
addq %rax, %r8
movq 0x18(%rsp), %r9
subq $0x1, %r9
xorl %eax, %eax
subq %r9, %rax
addq %rax, %r8
xorl %eax, %eax
subq 0x20(%rsp), %rax
addq %rax, %r8
addq $-0x1, %r8
xorl %r9d, %r9d
callq 0x30cb90
movq 0x38(%rsp), %rdi
leaq 0x2877b2(%rip), %rsi    # 0x593d56
movl $0x1a2, %edx            # imm = 0x1A2
callq 0xe88c0
movq 0x10(%rsp), %rdi
callq 0x107320
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movl 0x88(%rax), %eax
movq 0x18(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x30c5e7
movq 0x60(%rsp), %rax
movl 0x88(%rax), %eax
movq %rax, (%rsp)
jmp 0x30c5f4
movq 0x18(%rsp), %rax
subq $0x1, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x30c64e
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %esi
callq 0x7f6f0
movzbl %al, %edx
movq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x30c606
movq 0x20(%rsp), %rdi
shlq %rdi
addq $0x1, %rdi
shlq $0x2, %rdi
leaq 0x2876f1(%rip), %rsi    # 0x593d56
movl $0x1ae, %edx            # imm = 0x1AE
callq 0xe80f0
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rax
subq $0x1, %rax
shlq $0x2, %rax
addq %rax, %rdx
movq 0x18(%rsp), %rcx
subq $0x1, %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rdx
xorl %eax, %eax
subq 0x20(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdx
addq $-0x4, %rdx
movq 0x20(%rsp), %rax
shlq %rax
addq $0x1, %rax
movl %eax, %ecx
callq 0x18b8f0
movq 0x60(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0x48(%rsp), %rax
subq $0x1, %rax
addq %rax, %r8
movq 0x18(%rsp), %r9
subq $0x1, %r9
xorl %eax, %eax
subq %r9, %rax
addq %rax, %r8
xorl %eax, %eax
subq 0x20(%rsp), %rax
addq %rax, %r8
addq $-0x1, %r8
movl $0x1, %r9d
callq 0x30cb90
movq 0x30(%rsp), %rax
movq (%rax), %rdi
leaq 0x881(%rip), %rsi       # 0x30cfb0
callq 0x81500
movq 0x40(%rsp), %rdi
leaq 0x287616(%rip), %rsi    # 0x593d56
movl $0x1b9, %edx            # imm = 0x1B9
callq 0xe88c0
movq 0x38(%rsp), %rdi
leaq 0x287600(%rip), %rsi    # 0x593d56
movl $0x1ba, %edx            # imm = 0x1BA
callq 0xe88c0
movq 0x30(%rsp), %rax
addq $0x78, %rsp
retq
nopw (%rax,%rax)