// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1c0137
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0x1c0326
movl $0x1, %edi
movq $-0x2, %rsi
xorl %edx, %edx
movq $-0x2, %rcx
callq 0x179740
movq %rax, %r14
xorl %edi, %edi
movq %rax, %rsi
callq 0x1befe4
movq %rax, %r15
movsd (%rax), %xmm0
ucomisd 0x1f2383(%rip), %xmm0   # 0x3b24f0
jne 0x1c01c6
jp 0x1c01c6
movsd 0x18(%r15), %xmm0
ucomisd 0x1f2379(%rip), %xmm0   # 0x3b24f8
jne 0x1c01f0
jp 0x1c01f0
movsd 0x8(%r15), %xmm0
movb $0x1, %r13b
ucomisd 0x1f236c(%rip), %xmm0   # 0x3b2500
jne 0x1c019c
jnp 0x1c021f
leaq 0x1a7397(%rip), %rsi    # 0x36753a
leaq 0x1f24d9(%rip), %rdx    # 0x3b2683
leaq 0x1f248f(%rip), %rcx    # 0x3b2640
leaq 0x1f2388(%rip), %r8     # 0x3b2540
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x28f, %r9d            # imm = 0x28F
jmp 0x1c0218
leaq 0x1a736d(%rip), %rsi    # 0x36753a
leaq 0x1f248e(%rip), %rdx    # 0x3b2662
leaq 0x1f2465(%rip), %rcx    # 0x3b2640
leaq 0x1f235e(%rip), %r8     # 0x3b2540
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x28d, %r9d            # imm = 0x28D
jmp 0x1c0218
leaq 0x1a7343(%rip), %rsi    # 0x36753a
leaq 0x1f2477(%rip), %rdx    # 0x3b2675
leaq 0x1f243b(%rip), %rcx    # 0x3b2640
leaq 0x1f2334(%rip), %r8     # 0x3b2540
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x28e, %r9d            # imm = 0x28E
xorl %eax, %eax
callq 0x1019cf
movq 0x70(%r15), %rdi
leaq 0x1f2316(%rip), %r12    # 0x3b2540
movq %r12, %rsi
movl $0x7f, %edx
callq 0x109670
movq %r15, %rdi
movq %r12, %rsi
movl $0x80, %edx
callq 0x109670
movl $0x4, %edi
movq %r14, %rsi
callq 0x1befe4
movq %rax, %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r13b, %r13b
je 0x1c0305
movsd (%r15), %xmm1
divsd 0x1f2296(%rip), %xmm1   # 0x3b2508
ucomisd 0x196f76(%rip), %xmm1   # 0x3571f0
movl $0x296, %r9d            # imm = 0x296
jbe 0x1c02da
movsd 0x1f2286(%rip), %xmm0   # 0x3b2510
ucomisd %xmm1, %xmm0
jbe 0x1c02da
movsd 0x18(%r15), %xmm1
divsd 0x1f227a(%rip), %xmm1   # 0x3b2518
ucomisd 0x196f4a(%rip), %xmm1   # 0x3571f0
movl $0x298, %r9d            # imm = 0x298
jbe 0x1c02da
ucomisd %xmm1, %xmm0
jbe 0x1c02da
movsd 0x8(%r15), %xmm1
divsd 0x1f225e(%rip), %xmm1   # 0x3b2520
ucomisd 0x196f26(%rip), %xmm1   # 0x3571f0
movl $0x29a, %r9d            # imm = 0x29A
jbe 0x1c02da
xorl %ebp, %ebp
ucomisd %xmm1, %xmm0
ja 0x1c0305
leaq 0x1a7259(%rip), %rsi    # 0x36753a
leaq 0x1f23a9(%rip), %rdx    # 0x3b2691
leaq 0x1f2351(%rip), %rcx    # 0x3b2640
leaq 0x1f224a(%rip), %r8     # 0x3b2540
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x1befa8
movq %r14, %rdi
callq 0x1797c3
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x682a3