// File: /workspace/github_c_makefile_star2_O3/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 0xa9c5(%rip), %xmm3     # 0x238d0
mulsd %xmm1, %xmm3
movsd 0xaa59(%rip), %xmm4     # 0x23970
ucomisd %xmm3, %xmm4
movsd %xmm2, 0x8(%rsp)
movapd %xmm0, 0x10(%rsp)
jae 0x18f4b
callq 0x2240
movapd 0x10(%rsp), %xmm8
movsd 0x8(%rsp), %xmm7
movapd %xmm0, %xmm10
movsd (%rsp), %xmm9
jmp 0x192f5
movapd %xmm2, %xmm0
movapd %xmm1, 0x60(%rsp)
callq 0x2240
movapd 0x60(%rsp), %xmm3
movapd %xmm0, %xmm10
xorpd %xmm4, %xmm4
movsd 0x92a7(%rip), %xmm0     # 0x22218
ucomisd %xmm3, %xmm0
jbe 0x190ef
movapd 0xae5d(%rip), %xmm0     # 0x23de0
andpd %xmm3, %xmm0
movsd 0xa9e9(%rip), %xmm1     # 0x23978
ucomisd %xmm0, %xmm1
jae 0x19107
movapd 0xae4f(%rip), %xmm0     # 0x23df0
xorpd %xmm3, %xmm0
movapd %xmm0, %xmm1
cmpnlesd %xmm3, %xmm1
andpd %xmm1, %xmm0
andnpd %xmm3, %xmm1
orpd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd 0xa9ba(%rip), %xmm1     # 0x23980
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
jae 0x192f0
xorl %eax, %eax
ucomisd %xmm0, %xmm3
setb %al
leaq 0xae41(%rip), %rcx      # 0x23e30
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
subsd %xmm0, %xmm1
movsd 0xa985(%rip), %xmm0     # 0x23988
movapd %xmm1, %xmm2
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %edx
cvttpd2dq %xmm2, %xmm2
cvtdq2pd %xmm2, %xmm4
mulsd 0xa971(%rip), %xmm4     # 0x23990
addsd %xmm1, %xmm4
mulsd %xmm0, %xmm4
leal 0x1(%rdx), %esi
movd %edx, %xmm0
movd %esi, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movdqa %xmm1, %xmm0
psrld $0x1f, %xmm0
paddd %xmm1, %xmm0
psrad $0x1, %xmm0
pshufd $0x55, %xmm0, %xmm2     # xmm2 = xmm0[1,1,1,1]
movd %xmm2, %esi
addl %esi, %esi
cmpl %edx, %esi
je 0x19067
movsd 0x9601(%rip), %xmm2     # 0x22660
subsd %xmm4, %xmm2
movapd %xmm2, %xmm4
movsd (%rcx,%rax,8), %xmm3
movdqa %xmm1, %xmm2
psrad $0x1f, %xmm2
psrld $0x1e, %xmm2
paddd %xmm1, %xmm2
psrad $0x2, %xmm2
paddd %xmm2, %xmm2
pcmpeqd %xmm0, %xmm2
pshufd $0x50, %xmm2, %xmm0     # xmm0 = xmm2[0,0,1,1]
movmskpd %xmm0, %eax
testb $0x2, %al
jne 0x190a0
xorpd 0xad50(%rip), %xmm3     # 0x23df0
mulsd 0xa8f0(%rip), %xmm4     # 0x23998
testb $0x1, %al
je 0x19138
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm4
jne 0x190c0
jnp 0x192f0
movapd %xmm4, %xmm0
movapd %xmm10, 0x40(%rsp)
movapd %xmm3, 0x30(%rsp)
movapd %xmm4, 0x50(%rsp)
callq 0x2250
movsd %xmm0, 0x28(%rsp)
movapd 0x50(%rsp), %xmm0
callq 0x2450
jmp 0x19165
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
jmp 0x191b1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm3
movsd 0x8(%rsp), %xmm7
movapd 0x10(%rsp), %xmm8
movsd (%rsp), %xmm9
jne 0x1912a
jnp 0x192f0
movsd 0xa836(%rip), %xmm4     # 0x23968
divsd %xmm3, %xmm4
jmp 0x191a1
movapd %xmm4, %xmm0
movapd %xmm10, 0x40(%rsp)
movapd %xmm3, 0x30(%rsp)
movapd %xmm4, 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 0xa7eb(%rip), %xmm1     # 0x23988
mulsd %xmm1, %xmm4
movsd 0x94b7(%rip), %xmm0     # 0x22660
subsd %xmm3, %xmm0
movapd %xmm0, %xmm3
movsd 0xa7e7(%rip), %xmm0     # 0x239a0
ucomisd %xmm3, %xmm0
jae 0x19283
movsd 0xa7b5(%rip), %xmm0     # 0x23980
ucomisd %xmm3, %xmm0
movapd %xmm10, 0x40(%rsp)
jbe 0x19252
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movsd 0x9478(%rip), %xmm1     # 0x22660
divsd %xmm0, %xmm1
movsd 0xa7c4(%rip), %xmm0     # 0x239b8
mulsd %xmm1, %xmm0
xorl %eax, %eax
leaq 0xafef(%rip), %rcx      # 0x241f0
leaq 0xafc8(%rip), %rdx      # 0x241d0
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 0x1920c
addsd 0xa78f(%rip), %xmm2     # 0x239c0
shufpd $0x2, 0xac16(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
divpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
subsd %xmm1, %xmm0
addsd %xmm0, %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 0x192f0
movsd 0xa71d(%rip), %xmm0     # 0x239a8
mulsd %xmm3, %xmm0
unpcklpd %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
movapd %xmm3, %xmm1
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
xorl %eax, %eax
leaq 0xaefc(%rip), %rcx      # 0x241a0
leaq 0xaeb5(%rip), %rdx      # 0x24160
movsd 0x8(%rax,%rdx), %xmm2
movhpd (%rax,%rcx), %xmm2      # xmm2 = xmm2[0],mem[0]
addpd %xmm2, %xmm0
mulpd %xmm1, %xmm0
addq $0x8, %rax
cmpq $0x28, %rax
jne 0x192ab
addpd 0xab70(%rip), %xmm0     # 0x23e40
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd 0xa6d0(%rip), %xmm3     # 0x239b0
divsd %xmm1, %xmm0
mulsd %xmm0, %xmm3
addsd %xmm4, %xmm3
movapd %xmm3, %xmm0
addsd %xmm0, %xmm10
addsd 0xa6ca(%rip), %xmm10    # 0x239c8
addsd %xmm9, %xmm10
movapd 0xaad5(%rip), %xmm0     # 0x23de0
andpd %xmm10, %xmm0
mulsd 0xa6b8(%rip), %xmm0     # 0x239d0
movsd 0x9340(%rip), %xmm2     # 0x22660
xorpd %xmm1, %xmm1
movapd 0xaab4(%rip), %xmm3     # 0x23de0
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 0x19330
movapd 0x70(%rsp), %xmm0
xorpd 0xaa81(%rip), %xmm0     # 0x23df0
addsd %xmm1, %xmm10
mulsd %xmm0, %xmm10
movapd %xmm10, %xmm0
addq $0x88, %rsp
retq