// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/ltr/ltrdigest_pbs_visitor.c
// Function: gt_pbs_add_hit
static void gt_pbs_add_hit(GtLTRdigestPBSVisitor *lv, GtArray *hitlist,
                           GtAlignment *ali, GtUword trna_seqlen,
                           const char *desc, GtStrand strand, GtPBSResults *r)
{
  GtUword dist;
  GtPBSHit *hit;
  GtUword offset, alilen;
  GtRange urange, vrange;
  gt_assert(hitlist && desc);

  if (!ali) return;
  gt_assert(ali);

  dist = gt_alignment_eval(ali);
  urange = gt_alignment_get_urange(ali);
  vrange = gt_alignment_get_vrange(ali);
  offset = gt_ulongabs((GtUword) lv->radius, urange.start);
  alilen = gt_ulongabs(urange.end, urange.start)+1;

  if (dist <= (GtUword) lv->max_edist
        && offset <= lv->offsetlen.end
        && offset >= lv->offsetlen.start
        && alilen <= lv->alilen.end
        && alilen >= lv->alilen.start
        && vrange.start <= lv->trnaoffsetlen.end
        && vrange.start >= lv->trnaoffsetlen.start)
  {
    hit = gt_pbs_hit_new(alilen,
                         strand,
                         desc,
                         vrange.start,
                         urange.start,
                         urange.end,
                         offset,
                         dist,
                         gt_pbs_score_func(dist,
                                           offset,
                                           urange.end-urange.start + 1,
                                           trna_seqlen,
                                           vrange.start),
                         r);
    gt_array_add(hitlist, hit);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x1c(%rsp)
movq %rcx, 0x20(%rsp)
testq %rsi, %rsi
je 0x21533b
movq %r8, %r14
testq %r8, %r8
je 0x21533b
movq %rdx, %r15
testq %rdx, %rdx
je 0x21532c
movq %rsi, %rbx
movq %rdi, %rbp
movq %r15, %rdi
callq 0x126f96
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x126c78
movq %rax, %r12
movq %rdx, %r13
movq %r15, %rdi
callq 0x126cc7
movl 0x48(%rbp), %ecx
movq %r12, %r15
subq %rcx, %r15
jne 0x215192
xorl %r15d, %r15d
jmp 0x21519a
jae 0x21519a
subq %r12, %rcx
movq %rcx, %r15
movq 0x8(%rsp), %rcx
movq %r13, 0x10(%rsp)
subq %r12, %r13
jne 0x2151ae
xorl %r13d, %r13d
jmp 0x2151b8
ja 0x2151b8
movq %r12, %r13
subq 0x10(%rsp), %r13
movl 0x4c(%rbp), %edx
cmpq %rdx, %rcx
ja 0x21532c
cmpq 0x68(%rbp), %r15
ja 0x21532c
cmpq 0x60(%rbp), %r15
jb 0x21532c
incq %r13
cmpq 0x58(%rbp), %r13
ja 0x21532c
cmpq 0x50(%rbp), %r13
jb 0x21532c
cmpq 0x78(%rbp), %rax
ja 0x21532c
cmpq 0x70(%rbp), %rax
jb 0x21532c
movq 0x10(%rsp), %rdx
subq %r12, %rdx
movq 0x13b6cd(%rip), %xmm2   # 0x3508e0
movapd 0x13b6d5(%rip), %xmm1   # 0x3508f0
movsd 0x13a005(%rip), %xmm0   # 0x34f228
movapd %xmm0, %xmm3
testq %r15, %r15
je 0x21524e
cvtsi2sd %rcx, %xmm4
movq %r15, %xmm5
punpckldq %xmm2, %xmm5    # xmm5 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
subpd %xmm1, %xmm5
movapd %xmm5, %xmm3
unpckhpd %xmm5, %xmm3            # xmm3 = xmm3[1],xmm5[1]
addsd %xmm5, %xmm3
mulsd %xmm4, %xmm3
incq %rdx
testq %rcx, %rcx
je 0x21525a
movapd %xmm3, %xmm0
movq %rdx, %xmm3
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
subpd %xmm1, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
movq 0x20(%rsp), %rcx
movq %rcx, %xmm3
subq %rax, %rcx
movq %rcx, %xmm5
punpckldq %xmm2, %xmm5    # xmm5 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
subpd %xmm1, %xmm5
movapd %xmm5, %xmm6
unpckhpd %xmm5, %xmm6            # xmm6 = xmm6[1],xmm5[1]
addsd %xmm5, %xmm6
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
subpd %xmm1, %xmm3
movapd %xmm3, %xmm1
unpckhpd %xmm3, %xmm1            # xmm1 = xmm1[1],xmm3[1]
addsd %xmm3, %xmm1
divsd %xmm1, %xmm6
mulsd %xmm4, %xmm6
divsd %xmm0, %xmm6
movapd %xmm6, 0x20(%rsp)
leaq 0x1b44a3(%rip), %rsi    # 0x3c9769
movl $0x50, %edi
movq %rax, %rbp
movl $0x5a, %edx
callq 0x1092b2
movq %r13, 0x28(%rax)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x30(%rax)
movq %r14, 0x40(%rax)
movq %rbp, 0x20(%rax)
movq %r12, (%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq %r15, 0x18(%rax)
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movaps 0x20(%rsp), %xmm0
movsd %xmm0, 0x38(%rax)
movq 0x70(%rsp), %rcx
movq %rcx, 0x48(%rax)
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movl $0x8, %edx
movq %rbx, %rdi
callq 0xd49ce
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x82be5