// File: /workspace/github_c_makefile_star2_O3/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 0x1b7636
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1b7825
movl $0x1, %edi
movq $-0x2, %rsi
xorl %edx, %edx
movq $-0x2, %rcx
callq 0x17137c
movq %rax, %r14
xorl %edi, %edi
movq %rax, %rsi
callq 0x1b6564
movq %rax, %r15
movsd (%rax), %xmm0
ucomisd 0x1f18d4(%rip), %xmm0   # 0x3a8f40
jne 0x1b76c5
jp 0x1b76c5
movsd 0x18(%r15), %xmm0
ucomisd 0x1f18ca(%rip), %xmm0   # 0x3a8f48
jne 0x1b76ef
jp 0x1b76ef
movsd 0x8(%r15), %xmm0
movb $0x1, %r13b
ucomisd 0x1f18bd(%rip), %xmm0   # 0x3a8f50
jne 0x1b769b
jnp 0x1b771e
leaq 0x1a6d9c(%rip), %rsi    # 0x35e43e
leaq 0x1f1a2a(%rip), %rdx    # 0x3a90d3
leaq 0x1f19e0(%rip), %rcx    # 0x3a9090
leaq 0x1f18d9(%rip), %r8     # 0x3a8f90
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x28f, %r9d            # imm = 0x28F
jmp 0x1b7717
leaq 0x1a6d72(%rip), %rsi    # 0x35e43e
leaq 0x1f19df(%rip), %rdx    # 0x3a90b2
leaq 0x1f19b6(%rip), %rcx    # 0x3a9090
leaq 0x1f18af(%rip), %r8     # 0x3a8f90
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x28d, %r9d            # imm = 0x28D
jmp 0x1b7717
leaq 0x1a6d48(%rip), %rsi    # 0x35e43e
leaq 0x1f19c8(%rip), %rdx    # 0x3a90c5
leaq 0x1f198c(%rip), %rcx    # 0x3a9090
leaq 0x1f1885(%rip), %r8     # 0x3a8f90
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x28e, %r9d            # imm = 0x28E
xorl %eax, %eax
callq 0xfcb67
movq 0x70(%r15), %rdi
leaq 0x1f1867(%rip), %r12    # 0x3a8f90
movq %r12, %rsi
movl $0x7f, %edx
callq 0x1045eb
movq %r15, %rdi
movq %r12, %rsi
movl $0x80, %edx
callq 0x1045eb
movl $0x4, %edi
movq %r14, %rsi
callq 0x1b6564
movq %rax, %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r13b, %r13b
je 0x1b7804
movsd (%r15), %xmm1
divsd 0x1f17e7(%rip), %xmm1   # 0x3a8f58
ucomisd 0x196a47(%rip), %xmm1   # 0x34e1c0
movl $0x296, %r9d            # imm = 0x296
jbe 0x1b77d9
movsd 0x1f17d7(%rip), %xmm0   # 0x3a8f60
ucomisd %xmm1, %xmm0
jbe 0x1b77d9
movsd 0x18(%r15), %xmm1
divsd 0x1f17cb(%rip), %xmm1   # 0x3a8f68
ucomisd 0x196a1b(%rip), %xmm1   # 0x34e1c0
movl $0x298, %r9d            # imm = 0x298
jbe 0x1b77d9
ucomisd %xmm1, %xmm0
jbe 0x1b77d9
movsd 0x8(%r15), %xmm1
divsd 0x1f17af(%rip), %xmm1   # 0x3a8f70
ucomisd 0x1969f7(%rip), %xmm1   # 0x34e1c0
movl $0x29a, %r9d            # imm = 0x29A
jbe 0x1b77d9
xorl %ebp, %ebp
ucomisd %xmm1, %xmm0
ja 0x1b7804
leaq 0x1a6c5e(%rip), %rsi    # 0x35e43e
leaq 0x1f18fa(%rip), %rdx    # 0x3a90e1
leaq 0x1f18a2(%rip), %rcx    # 0x3a9090
leaq 0x1f179b(%rip), %r8     # 0x3a8f90
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x1b6528
movq %r14, %rdi
callq 0x1713ff
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x66aab