// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/karlin_altschul_stat.c
// Function: gt_evalue_searchspace
GtUword gt_evalue_searchspace(const GtKarlinAltschulStat *ka,
                              GtUword query_idx_length)
{
  if (ka->searchspace_store != NULL)
  {
    return gt_searchspace_store_find(ka->searchspace_store,
                                     ka->different_lengths,
                                     query_idx_length);
  } else
  {
    GtUword actual_db_length,
            num_of_db_seqs,
            effective_db_length,
            effective_query_length,
            length_adjustment;
    double alpha_div_lambda, beta, K, logK;

    gt_assert(ka != NULL);
    alpha_div_lambda = gt_karlin_altschul_stat_get_alphadlambda(ka);

    beta = gt_karlin_altschul_stat_get_beta(ka);
    K = gt_karlin_altschul_stat_get_K(ka);
    logK = gt_karlin_altschul_stat_get_logK(ka);

    num_of_db_seqs = gt_karlin_altschul_get_num_of_db_seqs(ka);
    actual_db_length = gt_karlin_altschul_get_actual_length_db(ka);
    length_adjustment = gt_evalue_length_adjustment(query_idx_length,
                                                    actual_db_length,
                                                    num_of_db_seqs,
                                                    alpha_div_lambda,
                                                    beta,
                                                    K,
                                                    logK);

    effective_query_length = query_idx_length - length_adjustment;
    effective_db_length
      = actual_db_length - (num_of_db_seqs * length_adjustment);

    return effective_query_length * effective_db_length;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq 0x70(%rdi), %rax
testq %rax, %rax
je 0x1b72ec
movq 0x68(%rdi), %rcx
shlq $0x4, %rcx
addq %rax, %rcx
addq $-0x10, %rcx
cmpq %rax, %rcx
jb 0x1b72db
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x5, %rsi
shlq $0x4, %rsi
leaq (%rax,%rsi), %rdx
cmpq %rbx, (%rax,%rsi)
jbe 0x1b72cd
addq $-0x10, %rdx
movq %rdx, %rcx
jmp 0x1b72d6
jae 0x1b72e3
addq $0x10, %rdx
movq %rdx, %rax
cmpq %rcx, %rax
jbe 0x1b72ac
movq %rbx, %rdi
callq 0x669e3
movq 0x8(%rdx), %r14
jmp 0x1b75f8
movq 0x58(%rdi), %r15
cmpq $-0x1, %r15
je 0x1b7609
movq 0x50(%rdi), %r14
cmpq $-0x1, %r14
je 0x1b760e
movq %r14, %rax
imulq %rbx, %rax
movq %rax, %xmm0
movq 0x1905c4(%rip), %xmm4   # 0x3478e0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x1905c8(%rip), %xmm5   # 0x3478f0
subpd %xmm5, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
cmpq %r14, %rbx
movq %r14, %rax
cmovaq %rbx, %rax
movq %rax, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm5, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x8(%rdi), %xmm1
subsd %xmm1, %xmm3
xorpd %xmm1, %xmm1
ucomisd %xmm3, %xmm1
jbe 0x1b7375
xorl %eax, %eax
jmp 0x1b75ea
movsd 0x20(%rdi), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x28(%rdi), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x10(%rdi), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %r15, %rax
imulq %rbx, %rax
addq %r14, %rax
movq %rax, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm5, %xmm0
movapd %xmm0, %xmm6
unpckhpd %xmm0, %xmm6            # xmm6 = xmm6[1],xmm0[1]
addsd %xmm0, %xmm6
leaq (,%r15,4), %rax
movq %rax, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm5, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd %xmm3, %xmm2
addsd %xmm3, %xmm3
movapd %xmm6, %xmm0
mulsd %xmm6, %xmm0
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1b73fa
sqrtsd %xmm0, %xmm0
jmp 0x1b7425
movapd %xmm3, (%rsp)
movapd %xmm6, 0x10(%rsp)
callq 0x175e0
movapd 0x10(%rsp), %xmm6
movapd 0x1904d8(%rip), %xmm5   # 0x3478f0
movq 0x1904c0(%rip), %xmm4   # 0x3478e0
movapd (%rsp), %xmm3
addsd %xmm6, %xmm0
divsd %xmm0, %xmm3
movq %rbx, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm5, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movq %r14, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm5, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movq %r15, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm5, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
xorpd 0x1985c4(%rip), %xmm1   # 0x34fa50
movapd %xmm1, 0x40(%rsp)
pxor %xmm4, %xmm4
xorl %ebp, %ebp
xorpd %xmm2, %xmm2
movapd %xmm2, 0x10(%rsp)
movdqa %xmm4, 0x70(%rsp)
movapd %xmm3, (%rsp)
movapd 0x60(%rsp), %xmm1
subsd %xmm2, %xmm1
movapd 0x40(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x17610
movapd 0x10(%rsp), %xmm4
addsd 0x28(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
ucomisd %xmm4, %xmm0
jae 0x1b74fa
movapd %xmm4, %xmm3
movapd 0x70(%rsp), %xmm4
jmp 0x1b7521
movapd %xmm0, %xmm1
subsd %xmm4, %xmm1
movsd 0x18ed1e(%rip), %xmm2   # 0x346228
ucomisd %xmm1, %xmm2
jae 0x1b7556
movapd (%rsp), %xmm3
ucomisd %xmm3, %xmm4
jne 0x1b7521
jnp 0x1b75cb
ucomisd %xmm4, %xmm0
jb 0x1b752d
ucomisd %xmm0, %xmm3
jae 0x1b7545
movapd %xmm3, %xmm0
testl %ebp, %ebp
je 0x1b7545
movapd %xmm3, %xmm0
addsd %xmm4, %xmm0
mulsd 0x19e903(%rip), %xmm0   # 0x355e48
decl %ebp
movapd %xmm0, %xmm2
cmpl $-0x14, %ebp
jne 0x1b749c
jmp 0x1b75cb
movapd %xmm4, %xmm0
callq 0x17100
movapd %xmm0, %xmm2
movapd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jae 0x1b7575
movaps 0x10(%rsp), %xmm4
jmp 0x1b75cb
movapd 0x60(%rsp), %xmm1
subsd %xmm2, %xmm1
movapd 0x40(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm2, (%rsp)
callq 0x17610
movsd (%rsp), %xmm2
movsd 0x28(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
mulsd %xmm1, %xmm0
addsd 0x30(%rsp), %xmm0
ucomisd %xmm2, %xmm0
movaps 0x10(%rsp), %xmm4
jb 0x1b75cb
movapd %xmm2, %xmm4
cvttsd2si %xmm4, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0x190741(%rip), %xmm4   # 0x347d20
cvttsd2si %xmm4, %rax
andq %rdx, %rax
orq %rcx, %rax
subq %rax, %rbx
imulq %rax, %r15
subq %r15, %r14
imulq %rbx, %r14
movq %r14, %rax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x66a72
callq 0x66a39