// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrdigest_pbs_visitor.c
// Function: gt_pbs_find
static GtPBSResults* gt_pbs_find(GtLTRdigestPBSVisitor *lv, const char *seq,
                          const char *rev_seq, GtError *err)
{
  GtSeq *seq_forward, *seq_rev;
  GtPBSResults *results;
  GtUword j;
  GtAlignment *ali;
  GtAlphabet *a = gt_alphabet_new_dna();
  GtScoreFunction *sf;
  gt_assert(lv && seq && rev_seq);

  sf = gt_dna_scorefunc_new(a, lv->ali_score_match, lv->ali_score_mismatch,
                            lv->ali_score_insertion, lv->ali_score_deletion);

  results = gt_pbs_results_new();

  seq_forward = gt_seq_new(seq + (lv->leftltrlen)
                               - (lv->radius),
                           (GtUword) (2 * lv->radius + 1),
                           a);

  seq_rev     = gt_seq_new(rev_seq + (lv->rightltrlen)
                                   - (lv->radius),
                           (GtUword) (2 * lv->radius + 1),
                           a);

  for (j = 0; j < gt_bioseq_number_of_sequences(lv->trna_lib); j++)
  {
    GtSeq *trna_seq, *trna_from3;
    char *trna_from3_full;
    GtUword trna_seqlen;

    trna_seq = gt_bioseq_get_seq(lv->trna_lib, j);
    trna_seqlen = gt_seq_length(trna_seq);

    trna_from3_full = gt_calloc((size_t) trna_seqlen, sizeof (char));
    memcpy(trna_from3_full, gt_seq_get_orig(trna_seq),
           sizeof (char) * trna_seqlen);
    (void) gt_reverse_complement(trna_from3_full, trna_seqlen, err);
    trna_from3 = gt_seq_new_own(trna_from3_full, trna_seqlen, a);

    ali = gt_swalign(seq_forward, trna_from3, sf);
    gt_pbs_add_hit(lv, results->hits, ali, trna_seqlen,
                   gt_seq_get_description(trna_seq), GT_STRAND_FORWARD,
                   results);
    gt_alignment_delete(ali);

    ali = gt_swalign(seq_rev, trna_from3, sf);
    gt_pbs_add_hit(lv, results->hits, ali, trna_seqlen,
                   gt_seq_get_description(trna_seq), GT_STRAND_REVERSE,
                   results);
    gt_alignment_delete(ali);

    gt_seq_delete(trna_seq);
    gt_seq_delete(trna_from3);
  }
  gt_seq_delete(seq_forward);
  gt_seq_delete(seq_rev);
  gt_score_function_delete(sf);
  gt_alphabet_delete(a);
  gt_array_sort(results->hits, gt_pbs_hit_compare);
  return results;
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
movq %rcx, 0xb8(%rsp)
callq 0x7e4b0
movq %rax, 0x88(%rsp)
cmpq $0x0, 0xd0(%rsp)
je 0x306235
cmpq $0x0, 0xc8(%rsp)
je 0x306235
cmpq $0x0, 0xc0(%rsp)
jne 0x30626d
movq 0x335d64(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x20fdcd(%rip), %rsi    # 0x516013
leaq 0x28d0b6(%rip), %rdx    # 0x593303
leaq 0x28d0c4(%rip), %rcx    # 0x593318
leaq 0x28d062(%rip), %r8     # 0x5932bd
movl $0x122, %r9d            # imm = 0x122
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30626f
movq 0x88(%rsp), %rdi
movq 0xd0(%rsp), %rax
movl 0x80(%rax), %esi
movq 0xd0(%rsp), %rax
movl 0x84(%rax), %edx
movq 0xd0(%rsp), %rax
movl 0x88(%rax), %ecx
movq 0xd0(%rsp), %rax
movl 0x8c(%rax), %r8d
callq 0x306b40
movq %rax, 0x80(%rsp)
callq 0x306c90
movq %rax, 0xa0(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rax
addq 0x38(%rax), %rdi
movq 0xd0(%rsp), %rax
movl 0x48(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rdi
movq 0xd0(%rsp), %rax
movl 0x48(%rax), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movq 0x88(%rsp), %rdx
callq 0x110410
movq %rax, 0xb0(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xd0(%rsp), %rax
addq 0x40(%rax), %rdi
movq 0xd0(%rsp), %rax
movl 0x48(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rdi
movq 0xd0(%rsp), %rax
movl 0x48(%rax), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movq 0x88(%rsp), %rdx
callq 0x110410
movq %rax, 0xa8(%rsp)
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xd0(%rsp), %rax
movq 0x90(%rax), %rdi
callq 0x85910
movq %rax, %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
jae 0x3065b9
movq 0xd0(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x98(%rsp), %rsi
callq 0x84b90
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0x1107d0
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movl $0x1, %esi
leaq 0x28ced0(%rip), %rdx    # 0x5932bd
movl $0x13c, %ecx            # imm = 0x13C
callq 0xe83c0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %rdi
callq 0x110670
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x60(%rsp), %rdx
shlq $0x0, %rdx
callq 0x19610
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0xb8(%rsp), %rdx
callq 0x1cb4f0
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x1104d0
movq %rax, 0x70(%rsp)
movq 0xb0(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x1eaed0
movq %rax, 0x90(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rdi
callq 0x110620
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq %rax, %r8
movq 0xa0(%rsp), %rax
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x306cd0
movq 0x90(%rsp), %rdi
callq 0x12c3e0
movq 0xa8(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x1eaed0
movq %rax, 0x90(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x78(%rsp), %rdi
callq 0x110620
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq %rax, %r8
movq 0xa0(%rsp), %rax
movl $0x1, %r9d
movq %rax, (%rsp)
callq 0x306cd0
movq 0x90(%rsp), %rdi
callq 0x12c3e0
movq 0x78(%rsp), %rdi
callq 0x110820
movq 0x70(%rsp), %rdi
callq 0x110820
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x30637a
movq 0xb0(%rsp), %rdi
callq 0x110820
movq 0xa8(%rsp), %rdi
callq 0x110820
movq 0x80(%rsp), %rdi
callq 0x10efa0
movq 0x88(%rsp), %rdi
callq 0x7e3d0
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
leaq 0xa31(%rip), %rsi       # 0x307030
callq 0x81500
movq 0xa0(%rsp), %rax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)