// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
movq %rsi, %rbx
movq 0x70(%rdi), %rax
testq %rax, %rax
je 0x1bfdb7
movq 0x68(%rdi), %rcx
shlq $0x4, %rcx
addq %rax, %rcx
addq $-0x10, %rcx
cmpq %rcx, %rax
ja 0x1c00fd
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
shlq $0x4, %rdx
leaq (%rax,%rdx), %rsi
cmpq %rbx, (%rax,%rdx)
jbe 0x1bfd9b
addq $-0x10, %rsi
movb $0x1, %dl
movq %rsi, %rcx
jmp 0x1bfdae
jae 0x1bfda8
addq $0x10, %rsi
movb $0x1, %dl
movq %rsi, %rax
jmp 0x1bfdae
movq 0x8(%rsi), %r14
xorl %edx, %edx
testb %dl, %dl
jne 0x1bfd6f
jmp 0x1c00ef
testq %rdi, %rdi
je 0x1c0105
movq 0x58(%rdi), %r15
cmpq $-0x1, %r15
je 0x1c010a
movq 0x50(%rdi), %r14
cmpq $-0x1, %r14
je 0x1c010f
movq %r14, %rax
imulq %rbx, %rax
movq %rax, %xmm0
movq 0x190af0(%rip), %xmm4   # 0x3508e0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x190af4(%rip), %xmm5   # 0x3508f0
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 0x1bfe49
xorl %eax, %eax
jmp 0x1c00e1
movsd 0x20(%rdi), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x28(%rdi), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x10(%rdi), %xmm0
movsd %xmm0, 0x20(%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 0x1bfece
sqrtsd %xmm0, %xmm0
jmp 0x1bfef9
movapd %xmm3, (%rsp)
movapd %xmm6, 0x10(%rsp)
callq 0x175e0
movapd 0x10(%rsp), %xmm6
movapd 0x190a04(%rip), %xmm5   # 0x3508f0
movq 0x1909ec(%rip), %xmm4   # 0x3508e0
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 0x198b20(%rip), %xmm1   # 0x358a80
movapd %xmm1, 0x40(%rsp)
xorpd %xmm1, %xmm1
xorl %ebp, %ebp
xorpd %xmm2, %xmm2
movsd %xmm1, 0x38(%rsp)
movapd %xmm2, 0x10(%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), %xmm2
addsd 0x20(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
ucomisd %xmm2, %xmm0
jae 0x1bffce
movapd %xmm2, %xmm3
movsd 0x38(%rsp), %xmm1
jmp 0x1bfff5
movapd %xmm0, %xmm1
subsd %xmm2, %xmm1
movsd 0x18f24a(%rip), %xmm3   # 0x34f228
ucomisd %xmm1, %xmm3
jae 0x1c0030
movapd (%rsp), %xmm3
ucomisd %xmm3, %xmm2
jne 0x1bfff1
jnp 0x1c0038
movapd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1c0001
ucomisd %xmm0, %xmm3
jae 0x1c0019
movapd %xmm3, %xmm0
testl %ebp, %ebp
je 0x1c0019
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
mulsd 0x19ee5f(%rip), %xmm0   # 0x35ee78
decl %ebp
movapd %xmm0, %xmm2
cmpl $-0x14, %ebp
jne 0x1bff70
xorl %eax, %eax
movapd %xmm1, %xmm2
jmp 0x1c003a
movb $0x1, %al
movaps (%rsp), %xmm3
jmp 0x1c003a
xorl %eax, %eax
testb %al, %al
je 0x1c00c2
movapd %xmm2, 0x10(%rsp)
movapd %xmm2, %xmm0
movapd %xmm3, (%rsp)
callq 0x17100
movapd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jae 0x1c0069
movapd 0x10(%rsp), %xmm2
jmp 0x1c00c2
movapd 0x60(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm0, (%rsp)
movapd 0x40(%rsp), %xmm0
mulsd (%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x17610
movsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
mulsd %xmm1, %xmm0
addsd 0x28(%rsp), %xmm0
ucomisd (%rsp), %xmm0
movsd (%rsp), %xmm0
movapd 0x10(%rsp), %xmm2
jb 0x1c00c2
movapd %xmm0, %xmm2
cvttsd2si %xmm2, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0x190c4a(%rip), %xmm2   # 0x350d20
cvttsd2si %xmm2, %rax
andq %rdx, %rax
orq %rcx, %rax
subq %rax, %rbx
imulq %rax, %r15
subq %r15, %r14
imulq %rbx, %r14
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x681a2
callq 0x6826a
callq 0x68231
callq 0x681f8