// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/karlin_altschul_stat.c
// Function: gt_karlin_altschul_stat_unit_test
int gt_karlin_altschul_stat_unit_test(GtError *err)
{
  GtKarlinAltschulStat *ka;
  GtScoreHandler *scorehandler;
  double q;
  unsigned int numofchars = 0;

  int had_err = 0;
  gt_error_check(err);

  scorehandler = gt_scorehandler_new(1,-2,0,-2);

  /* check function for gapped alignments */
  ka = gt_karlin_altschul_stat_new(0, scorehandler); /* unit test */
  gt_ensure(ka->lambda == 1.19);
  gt_ensure(ka->H == 0.66);
  gt_ensure(ka->K == 0.34);
  gt_karlin_altschul_stat_delete(ka);

  /* check function for ungapped alignments */
  numofchars = 4;
  ka = gt_karlin_altschul_stat_new(numofchars, scorehandler); /* unit test */
  q = ka->lambda/1.33; /* lambda = 1.33 */
  gt_ensure(0.99 < q && q < 1.01);
  q = ka->H/1.12; /* H = 1.12 */
  gt_ensure(0.99 < q && q < 1.01);
  q = ka->K/0.621; /* K = 0.621 */
  gt_ensure(0.99 < q && q < 1.01);
  gt_karlin_altschul_stat_delete(ka);

  gt_scorehandler_delete(scorehandler);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x166023
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x1661da
pushq $0x1
popq %rdi
pushq $-0x2
popq %rcx
movq %rcx, %rsi
xorl %edx, %edx
callq 0x1148f4
movq %rax, %r14
xorl %edi, %edi
movq %rax, %rsi
callq 0x164cf6
movq %rax, %r15
movsd (%rax), %xmm0
ucomisd 0x1e3281(%rip), %xmm0   # 0x3492d0
jne 0x1660a7
jp 0x1660a7
movsd 0x18(%r15), %xmm0
ucomisd 0x1e3277(%rip), %xmm0   # 0x3492d8
jne 0x1660d0
jp 0x1660d0
movsd 0x8(%r15), %xmm0
movb $0x1, %bpl
ucomisd 0x1e326a(%rip), %xmm0   # 0x3492e0
jne 0x16607e
jnp 0x1660fe
leaq 0x19836d(%rip), %rsi    # 0x2fe3f2
leaq 0x1e33d7(%rip), %rdx    # 0x349463
leaq 0x1e338d(%rip), %rcx    # 0x349420
leaq 0x1e3286(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x28f, %r9d            # imm = 0x28F
jmp 0x1660f7
leaq 0x198344(%rip), %rsi    # 0x2fe3f2
leaq 0x1e338d(%rip), %rdx    # 0x349442
leaq 0x1e3364(%rip), %rcx    # 0x349420
leaq 0x1e325d(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x28d, %r9d            # imm = 0x28D
jmp 0x1660f7
leaq 0x19831b(%rip), %rsi    # 0x2fe3f2
leaq 0x1e3377(%rip), %rdx    # 0x349455
leaq 0x1e333b(%rip), %rcx    # 0x349420
leaq 0x1e3234(%rip), %r8     # 0x349320
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x28e, %r9d            # imm = 0x28E
xorl %eax, %eax
callq 0x89dbb
movq %r15, %rdi
callq 0x164cbc
pushq $0x4
popq %rdi
movq %r14, %rsi
callq 0x164cf6
movq %rax, %r15
pushq $-0x1
popq %r12
testb %bpl, %bpl
je 0x1661bc
movsd (%r15), %xmm1
divsd 0x1e31ba(%rip), %xmm1   # 0x3492e8
ucomisd 0x18808a(%rip), %xmm1   # 0x2ee1c0
movl $0x296, %r9d            # imm = 0x296
jbe 0x166196
movsd 0x1e31aa(%rip), %xmm0   # 0x3492f0
ucomisd %xmm1, %xmm0
jbe 0x166196
movsd 0x18(%r15), %xmm1
divsd 0x1e319e(%rip), %xmm1   # 0x3492f8
ucomisd 0x18805e(%rip), %xmm1   # 0x2ee1c0
movl $0x298, %r9d            # imm = 0x298
jbe 0x166196
ucomisd %xmm1, %xmm0
jbe 0x166196
movsd 0x8(%r15), %xmm1
divsd 0x1e3182(%rip), %xmm1   # 0x349300
ucomisd 0x18803a(%rip), %xmm1   # 0x2ee1c0
movl $0x29a, %r9d            # imm = 0x29A
jbe 0x166196
xorl %ebp, %ebp
ucomisd %xmm1, %xmm0
ja 0x1661bf
leaq 0x198255(%rip), %rsi    # 0x2fe3f2
leaq 0x1e32cd(%rip), %rdx    # 0x349471
leaq 0x1e3275(%rip), %rcx    # 0x349420
leaq 0x1e316e(%rip), %r8     # 0x349320
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
movl %r12d, %ebp
movq %r15, %rdi
callq 0x164cbc
movq %r14, %rdi
callq 0x114a03
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d1d87(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17ee28(%rip), %rsi    # 0x2e5013
leaq 0x17efcd(%rip), %rdx    # 0x2e51bf
leaq 0x1e3227(%rip), %rcx    # 0x349420
leaq 0x1e3120(%rip), %r8     # 0x349320
movl $0x287, %r9d            # imm = 0x287
xorl %eax, %eax
callq 0x17a50
callq 0x17390