// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/karlin_altschul_stat.c
// Function: gt_evalue_unit_test
int gt_evalue_unit_test(GT_UNUSED GtError *err)
{
  GtKarlinAltschulStat *ka;
  GtScoreHandler *scorehandler;
  GtUword searchspace;
  double evalue_variance;
  const unsigned int numchars = 0; /* means gapped case */
  int had_err = 0;

  scorehandler = gt_scorehandler_new(1,-2,0,-2);
  ka = gt_karlin_altschul_stat_new(numchars,scorehandler); /* unit test */
  ka->actual_length_db = 772376 - (1952 - 1);
  ka->num_of_db_seqs = 1952;

  /* checks searchspace calculation */
  gt_ensure(gt_evalue_searchspace(ka, 450)== 308243802);
  gt_ensure(gt_evalue_searchspace(ka, 300)== 199707252);
  gt_ensure(gt_evalue_searchspace(ka, 475)== 324731250);

  searchspace = gt_evalue_searchspace(ka, 300);

  /* checks evalue calculation */
  evalue_variance
    = gt_evalue_from_eop_count(ka, 300, 0, 0, searchspace)
      /(6.148125 * pow(10,-148));
  gt_ensure(evalue_variance > 0.99 && evalue_variance < 1.01);
  evalue_variance
    = gt_evalue_from_eop_count(ka, 213, 25, 1, searchspace)
      /(4.220782 * pow(10,-76));
  gt_ensure(evalue_variance > 0.99 && evalue_variance < 1.01);
  evalue_variance
    = gt_evalue_from_eop_count(ka, 206, 23, 1, searchspace)
      /(1.499078 * pow(10,-74));
  gt_ensure(evalue_variance > 0.99 && evalue_variance < 1.01);

  gt_scorehandler_delete(scorehandler);
  gt_karlin_altschul_stat_delete(ka);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $-0x2
popq %rcx
movq %rcx, %rsi
xorl %edx, %edx
callq 0x1148f4
movq %rax, %rbx
xorl %edi, %edi
movq %rax, %rsi
callq 0x164cf6
movq %rax, %r14
movq $0xbc179, 0x50(%rax)    # imm = 0xBC179
movq $0x7a0, 0x58(%rax)      # imm = 0x7A0
movl $0x1c2, %esi            # imm = 0x1C2
movq %rax, %rdi
callq 0x165bbe
cmpq $0x125f6d5a, %rax       # imm = 0x125F6D5A
jne 0x16655e
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rdi
callq 0x165bbe
cmpq $0xbe74a74, %rax        # imm = 0xBE74A74
jne 0x166587
movl $0x1db, %esi            # imm = 0x1DB
movq %r14, %rdi
callq 0x165bbe
movb $0x1, %bpl
cmpq $0x135b0172, %rax       # imm = 0x135B0172
je 0x1665b5
leaq 0x197eb6(%rip), %rsi    # 0x2fe3f2
leaq 0x1e3062(%rip), %rdx    # 0x3495a5
leaq 0x1e301c(%rip), %rcx    # 0x349566
leaq 0x1e2dcf(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x39c, %r9d            # imm = 0x39C
jmp 0x1665ae
leaq 0x197e8d(%rip), %rsi    # 0x2fe3f2
leaq 0x1e2fcf(%rip), %rdx    # 0x34953b
leaq 0x1e2ff3(%rip), %rcx    # 0x349566
leaq 0x1e2da6(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x39a, %r9d            # imm = 0x39A
jmp 0x1665ae
leaq 0x197e64(%rip), %rsi    # 0x2fe3f2
leaq 0x1e2fe5(%rip), %rdx    # 0x34957a
leaq 0x1e2fca(%rip), %rcx    # 0x349566
leaq 0x1e2d7d(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x39b, %r9d            # imm = 0x39B
xorl %eax, %eax
callq 0x89dbb
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rdi
callq 0x165bbe
movq %rax, %r12
xorl %r13d, %r13d
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rax, %r8
callq 0x166450
testb %bpl, %bpl
je 0x166633
divsd 0x1e2d1f(%rip), %xmm0   # 0x349308
ucomisd 0x187bcf(%rip), %xmm0   # 0x2ee1c0
jbe 0x166604
movb $0x1, %r13b
movsd 0x1e2cf2(%rip), %xmm1   # 0x3492f0
ucomisd %xmm0, %xmm1
ja 0x166633
leaq 0x197de7(%rip), %rsi    # 0x2fe3f2
leaq 0x1e2fbe(%rip), %rdx    # 0x3495d0
leaq 0x1e2f4d(%rip), %rcx    # 0x349566
leaq 0x1e2d00(%rip), %r8     # 0x349320
xorl %r13d, %r13d
movq %r15, %rdi
movl $0x3a4, %r9d            # imm = 0x3A4
xorl %eax, %eax
callq 0x89dbb
pushq $0x19
popq %rdx
pushq $0x1
popq %rcx
movl $0xd5, %esi
movq %r14, %rdi
movq %r12, %r8
callq 0x166450
testb %r13b, %r13b
je 0x1666a1
divsd 0x1e2cba(%rip), %xmm0   # 0x349310
ucomisd 0x187b62(%rip), %xmm0   # 0x2ee1c0
jbe 0x166671
movb $0x1, %bpl
movsd 0x1e2c85(%rip), %xmm1   # 0x3492f0
ucomisd %xmm0, %xmm1
ja 0x1666a3
leaq 0x197d7a(%rip), %rsi    # 0x2fe3f2
leaq 0x1e2f51(%rip), %rdx    # 0x3495d0
leaq 0x1e2ee0(%rip), %rcx    # 0x349566
leaq 0x1e2c93(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x3a8, %r9d            # imm = 0x3A8
xorl %eax, %eax
callq 0x89dbb
jmp 0x1666a3
xorl %ebp, %ebp
pushq $0x17
popq %rdx
pushq $0x1
popq %rcx
movl $0xce, %esi
movq %r14, %rdi
movq %r12, %r8
callq 0x166450
pushq $-0x1
popq %r12
testb %bpl, %bpl
je 0x166710
divsd 0x1e2c4e(%rip), %xmm0   # 0x349318
ucomisd 0x187aee(%rip), %xmm0   # 0x2ee1c0
jbe 0x1666e4
xorl %ebp, %ebp
movsd 0x1e2c12(%rip), %xmm1   # 0x3492f0
ucomisd %xmm0, %xmm1
ja 0x166713
leaq 0x197d07(%rip), %rsi    # 0x2fe3f2
leaq 0x1e2ede(%rip), %rdx    # 0x3495d0
leaq 0x1e2e6d(%rip), %rcx    # 0x349566
leaq 0x1e2c20(%rip), %r8     # 0x349320
movq %r15, %rdi
movl $0x3ac, %r9d            # imm = 0x3AC
xorl %eax, %eax
callq 0x89dbb
movl %r12d, %ebp
movq %rbx, %rdi
callq 0x114a03
movq %r14, %rdi
callq 0x164cbc
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq