// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %edi
movq $-0x2, %rsi
xorl %edx, %edx
movq $-0x2, %rcx
callq 0x179740
movq %rax, %rbx
xorl %edi, %edi
movq %rax, %rsi
callq 0x1befe4
movq %rax, %r14
movq $0xbc179, 0x50(%rax)    # imm = 0xBC179
movq $0x7a0, 0x58(%rax)      # imm = 0x7A0
movl $0x1c2, %esi            # imm = 0x1C2
movq %rax, %rdi
callq 0x1bfd4a
cmpq $0x125f6d5a, %rax       # imm = 0x125F6D5A
jne 0x1c05b2
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rdi
callq 0x1bfd4a
cmpq $0xbe74a74, %rax        # imm = 0xBE74A74
jne 0x1c05db
movl $0x1db, %esi            # imm = 0x1DB
movq %r14, %rdi
callq 0x1bfd4a
movb $0x1, %bpl
cmpq $0x135b0172, %rax       # imm = 0x135B0172
je 0x1c0609
leaq 0x1a6faa(%rip), %rsi    # 0x36753a
leaq 0x1f2244(%rip), %rdx    # 0x3b27db
leaq 0x1f21fe(%rip), %rcx    # 0x3b279c
leaq 0x1f1f9b(%rip), %r8     # 0x3b2540
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x39c, %r9d            # imm = 0x39C
jmp 0x1c0602
leaq 0x1a6f81(%rip), %rsi    # 0x36753a
leaq 0x1f21b1(%rip), %rdx    # 0x3b2771
leaq 0x1f21d5(%rip), %rcx    # 0x3b279c
leaq 0x1f1f72(%rip), %r8     # 0x3b2540
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x39a, %r9d            # imm = 0x39A
jmp 0x1c0602
leaq 0x1a6f58(%rip), %rsi    # 0x36753a
leaq 0x1f21c7(%rip), %rdx    # 0x3b27b0
leaq 0x1f21ac(%rip), %rcx    # 0x3b279c
leaq 0x1f1f49(%rip), %r8     # 0x3b2540
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x39b, %r9d            # imm = 0x39B
xorl %eax, %eax
callq 0x1019cf
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rdi
callq 0x1bfd4a
movq %rax, %r12
xorl %r13d, %r13d
movl $0x12c, %esi            # imm = 0x12C
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rax, %r8
callq 0x1c0492
testb %bpl, %bpl
je 0x1c0687
divsd 0x1f1eeb(%rip), %xmm0   # 0x3b2528
ucomisd 0x196bab(%rip), %xmm0   # 0x3571f0
jbe 0x1c0658
movb $0x1, %r13b
movsd 0x1f1ebe(%rip), %xmm1   # 0x3b2510
ucomisd %xmm0, %xmm1
ja 0x1c0687
leaq 0x1a6edb(%rip), %rsi    # 0x36753a
leaq 0x1f21a0(%rip), %rdx    # 0x3b2806
leaq 0x1f212f(%rip), %rcx    # 0x3b279c
leaq 0x1f1ecc(%rip), %r8     # 0x3b2540
xorl %r13d, %r13d
movq %r15, %rdi
movl $0x3a4, %r9d            # imm = 0x3A4
xorl %eax, %eax
callq 0x1019cf
movl $0xd5, %esi
movl $0x19, %edx
movl $0x1, %ecx
movq %r14, %rdi
movq %r12, %r8
callq 0x1c0492
testb %r13b, %r13b
je 0x1c06fa
divsd 0x1f1e82(%rip), %xmm0   # 0x3b2530
ucomisd 0x196b3a(%rip), %xmm0   # 0x3571f0
jbe 0x1c06c9
movb $0x1, %r13b
movsd 0x1f1e4d(%rip), %xmm1   # 0x3b2510
ucomisd %xmm0, %xmm1
ja 0x1c06fd
leaq 0x1a6e6a(%rip), %rsi    # 0x36753a
leaq 0x1f212f(%rip), %rdx    # 0x3b2806
leaq 0x1f20be(%rip), %rcx    # 0x3b279c
leaq 0x1f1e5b(%rip), %r8     # 0x3b2540
xorl %r13d, %r13d
movq %r15, %rdi
movl $0x3a8, %r9d            # imm = 0x3A8
xorl %eax, %eax
callq 0x1019cf
jmp 0x1c06fd
xorl %r13d, %r13d
movl $0xce, %esi
movl $0x17, %edx
movl $0x1, %ecx
movq %r14, %rdi
movq %r12, %r8
callq 0x1c0492
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r13b, %r13b
je 0x1c0774
divsd 0x1f1e0f(%rip), %xmm0   # 0x3b2538
ucomisd 0x196abf(%rip), %xmm0   # 0x3571f0
jbe 0x1c0743
xorl %ebp, %ebp
movsd 0x1f1dd3(%rip), %xmm1   # 0x3b2510
ucomisd %xmm0, %xmm1
ja 0x1c0774
leaq 0x1a6df0(%rip), %rsi    # 0x36753a
leaq 0x1f20b5(%rip), %rdx    # 0x3b2806
leaq 0x1f2044(%rip), %rcx    # 0x3b279c
leaq 0x1f1de1(%rip), %r8     # 0x3b2540
movq %r15, %rdi
movl $0x3ac, %r9d            # imm = 0x3AC
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x1797c3
movq %r14, %rdi
callq 0x1befa8
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)