// File: /workspace/github_c_makefile_star2_O1/c-zhou[P]yahs/binomlite.c
// Function: apser
static double apser(double a, double b, double x, double eps)
{
/* -----------------------------------------------------------------------
 *     apser() yields the incomplete beta ratio  I_{1-x}(b,a)  for
 *     a <= min(eps,eps*b), b*x <= 1, and x <= 0.5,  i.e., a is very small.
 *     Use only if above inequalities are satisfied.
 * ----------------------------------------------------------------------- */

    static double const g = .577215664901533;

    double tol, c, j, s, t, aj;
    double bx = b * x;

    t = x - bx;
    if (b * eps <= 0.02)
        c = log(x) + psi(b) + g + t;
    else // b > 2e13 : psi(b) ~= log(b)
        c = log(bx) + g + t;

    tol = eps * 5. * fabs(c);
    j = 1.;
    s = 0.;
    do {
        j += 1.;
        t *= x - bx / j;
        aj = t / j;
        s += aj;
    } while (fabs(aj) > tol);

    return -a * (c + s);
}

// Assembly:
subq $0x88, %rsp
movaps %xmm0, 0x70(%rsp)
movapd %xmm1, %xmm0
mulsd %xmm2, %xmm0
movapd %xmm2, %xmm3
subsd %xmm0, %xmm3
movsd %xmm3, (%rsp)
movsd 0xa7f9(%rip), %xmm3     # 0x228a0
mulsd %xmm1, %xmm3
movsd 0xa8a5(%rip), %xmm4     # 0x22958
ucomisd %xmm3, %xmm4
movsd %xmm2, 0x8(%rsp)
movapd %xmm0, 0x10(%rsp)
jae 0x180e7
callq 0x2240
movapd 0x10(%rsp), %xmm8
movsd 0x8(%rsp), %xmm7
movapd %xmm0, %xmm10
movsd (%rsp), %xmm9
jmp 0x18462
movapd %xmm2, %xmm0
movapd %xmm1, 0x60(%rsp)
callq 0x2240
movapd 0x60(%rsp), %xmm3
movapd %xmm0, %xmm10
xorpd %xmm4, %xmm4
movsd 0x90eb(%rip), %xmm0     # 0x211f8
ucomisd %xmm3, %xmm0
jbe 0x1826d
movapd 0xaeb1(%rip), %xmm0     # 0x22fd0
andpd %xmm3, %xmm0
movsd 0xa835(%rip), %xmm1     # 0x22960
ucomisd %xmm0, %xmm1
jae 0x18285
movapd 0xaea3(%rip), %xmm0     # 0x22fe0
xorpd %xmm3, %xmm0
movapd %xmm0, %xmm1
cmpnlesd %xmm3, %xmm1
andpd %xmm1, %xmm0
andnpd %xmm3, %xmm1
orpd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd 0xa806(%rip), %xmm1     # 0x22968
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
jae 0x1845d
xorl %ecx, %ecx
ucomisd %xmm0, %xmm3
setb %cl
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
subsd %xmm0, %xmm1
movsd 0xa7d8(%rip), %xmm0     # 0x22970
movapd %xmm1, %xmm2
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %eax
cvttpd2dq %xmm2, %xmm2
cvtdq2pd %xmm2, %xmm2
leaq 0xae3d(%rip), %rdx      # 0x22ff0
mulsd 0xa7bd(%rip), %xmm2     # 0x22978
addsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
movl %edi, %esi
sarl %esi
andl $-0x2, %edi
cmpl %eax, %edi
je 0x181e5
movsd 0x9453(%rip), %xmm0     # 0x21630
subsd %xmm2, %xmm0
movapd %xmm0, %xmm2
leal 0x3(%rax), %edi
testl %eax, %eax
cmovnsl %eax, %edi
movsd (%rdx,%rcx,8), %xmm1
sarl $0x2, %edi
addl %edi, %edi
cmpl %esi, %edi
je 0x18203
xorpd 0xaddd(%rip), %xmm1     # 0x22fe0
mulsd 0xa775(%rip), %xmm2     # 0x22980
leal 0x1(%rax), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %eax, %edx
incl %edx
sarl %edx
addl $0x4, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x2, %eax
addl %eax, %eax
cmpl %edx, %eax
jne 0x182b6
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x1823e
jnp 0x1845d
movapd %xmm2, %xmm0
movapd %xmm10, 0x40(%rsp)
movapd %xmm1, 0x30(%rsp)
movapd %xmm2, 0x50(%rsp)
callq 0x2250
movsd %xmm0, 0x28(%rsp)
movapd 0x50(%rsp), %xmm0
callq 0x2450
jmp 0x182e3
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
jmp 0x1832f
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm3
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
jne 0x182a8
jnp 0x1845d
movsd 0xa6a0(%rip), %xmm4     # 0x22950
divsd %xmm3, %xmm4
jmp 0x1831f
movapd %xmm2, %xmm0
movapd %xmm10, 0x40(%rsp)
movapd %xmm1, 0x30(%rsp)
movapd %xmm2, 0x50(%rsp)
callq 0x2450
movsd %xmm0, 0x28(%rsp)
movapd 0x50(%rsp), %xmm0
callq 0x2250
movapd 0x30(%rsp), %xmm4
movapd 0x60(%rsp), %xmm3
movapd 0x40(%rsp), %xmm10
movsd (%rsp), %xmm9
movapd 0x10(%rsp), %xmm8
movsd 0x8(%rsp), %xmm7
movsd 0x28(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0xa655(%rip), %xmm1     # 0x22970
mulsd %xmm1, %xmm4
movsd 0x9309(%rip), %xmm0     # 0x21630
subsd %xmm3, %xmm0
movapd %xmm0, %xmm3
movsd 0xa651(%rip), %xmm0     # 0x22988
ucomisd %xmm3, %xmm0
jae 0x183f8
movsd 0xa61f(%rip), %xmm0     # 0x22968
ucomisd %xmm3, %xmm0
movapd %xmm10, 0x40(%rsp)
jbe 0x183c7
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movsd 0x92ca(%rip), %xmm1     # 0x21630
divsd %xmm0, %xmm1
movsd 0xa63e(%rip), %xmm0     # 0x229b0
mulsd %xmm1, %xmm0
xorl %eax, %eax
leaq 0xad51(%rip), %rcx      # 0x230d0
leaq 0xad2a(%rip), %rdx      # 0x230b0
movapd %xmm1, %xmm2
addsd (%rax,%rcx), %xmm2
addsd 0x8(%rax,%rdx), %xmm0
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm0
addq $0x8, %rax
cmpq $0x18, %rax
jne 0x1838a
addsd 0xa609(%rip), %xmm2     # 0x229b8
divsd %xmm2, %xmm0
movsd 0xa4cd(%rip), %xmm1     # 0x22888
divsd %xmm3, %xmm1
addsd %xmm0, %xmm1
addsd %xmm1, %xmm4
movapd %xmm4, 0x30(%rsp)
movapd %xmm3, %xmm0
callq 0x2240
addsd 0x30(%rsp), %xmm0
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
movapd 0x40(%rsp), %xmm10
jmp 0x1845d
movsd 0xa590(%rip), %xmm0     # 0x22990
mulsd %xmm3, %xmm0
xorl %eax, %eax
leaq 0xac73(%rip), %rcx      # 0x23080
leaq 0xac2c(%rip), %rdx      # 0x23040
movapd %xmm3, %xmm1
addsd (%rax,%rcx), %xmm1
addsd 0x8(%rax,%rdx), %xmm0
mulsd %xmm3, %xmm1
mulsd %xmm3, %xmm0
addq $0x8, %rax
cmpq $0x28, %rax
jne 0x18418
addsd 0xa55b(%rip), %xmm0     # 0x22998
addsd 0xa55b(%rip), %xmm1     # 0x229a0
addsd 0xa55b(%rip), %xmm3     # 0x229a8
divsd %xmm1, %xmm0
mulsd %xmm0, %xmm3
addsd %xmm4, %xmm3
movapd %xmm3, %xmm0
addsd %xmm0, %xmm10
addsd 0xa555(%rip), %xmm10    # 0x229c0
addsd %xmm9, %xmm10
movapd 0xab58(%rip), %xmm0     # 0x22fd0
andpd %xmm10, %xmm0
mulsd 0xa543(%rip), %xmm0     # 0x229c8
movsd 0x91a3(%rip), %xmm2     # 0x21630
xorpd %xmm1, %xmm1
movapd 0xab37(%rip), %xmm3     # 0x22fd0
movapd %xmm2, %xmm4
addsd %xmm2, %xmm4
movapd %xmm8, %xmm5
divsd %xmm4, %xmm5
movapd %xmm7, %xmm6
subsd %xmm5, %xmm6
mulsd %xmm6, %xmm9
movapd %xmm9, %xmm5
divsd %xmm4, %xmm5
addsd %xmm5, %xmm1
andpd %xmm3, %xmm5
ucomisd %xmm0, %xmm5
ja 0x1849d
movapd 0x70(%rsp), %xmm0
xorpd 0xab04(%rip), %xmm0     # 0x22fe0
addsd %xmm1, %xmm10
mulsd %xmm0, %xmm10
movapd %xmm10, %xmm0
addq $0x88, %rsp
retq