// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/binomlite.c
// Function: bfrac
static double bfrac(double a, double b, double x, double y, double lambda, double eps, int log_p)
{
/* -----------------------------------------------------------------------
       Continued fraction expansion for I_x(a,b) when a, b > 1.
       It is assumed that  lambda = (a + b)*y - b.
   -----------------------------------------------------------------------*/

    double c, e, n, p, r, s, t, w, c0, c1, r0, an, bn, yp1, anp1, bnp1, beta, alpha, brc;

    brc = brcomp(a, b, x, y, log_p);
    if (!log_p && brc == 0.) {
        return 0.;
    }
    c = lambda + 1.;
    c0 = b / a;
    c1 = 1. / a + 1.;
    yp1 = y + 1.;

    n = 0.;
    p = 1.;
    s = a + 1.;
    an = 0.;
    bn = 1.;
    anp1 = 1.;
    bnp1 = c / c1;
    r = c1 / c;

/*        CONTINUED FRACTION CALCULATION */

    do {
        n += 1.;
        t = n / a;
        w = n * (b - n) * x;
        e = a / s;
        alpha = p * (p + c0) * e * e * (w * x);
        e = (t + 1.) / (c1 + t + t);
        beta = n + w / s + e * (c + n * yp1);
        p = t + 1.;
        s += 2.;

        /* update an, bn, anp1, and bnp1 */

        t = alpha * an + beta * anp1;    an = anp1;    anp1 = t;
        t = alpha * bn + beta * bnp1;    bn = bnp1;    bnp1 = t;

        r0 = r;
        r = anp1 / bnp1;
        if (fabs(r - r0) <= eps * r)
            break;

        /* rescale an, bn, anp1, and bnp1 */

        an /= bnp1;
        bn /= bnp1;
        anp1 = r;
        bnp1 = 1.;
    } while (n < 10000);// arbitrary; had '1' --> infinite loop for  lambda = Inf
    return (log_p ? brc + log(r) : brc * r);
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movl %edi, %ebx
movsd %xmm4, 0x88(%rsp)
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm2
movapd %xmm2, 0x70(%rsp)
movapd %xmm1, 0x20(%rsp)
movapd %xmm0, 0x50(%rsp)
jne 0x1ac0c
jnp 0x1ac71
ucomisd %xmm4, %xmm3
jne 0x1ac14
jnp 0x1ac71
movapd %xmm0, %xmm5
cmplesd %xmm1, %xmm5
movapd %xmm5, %xmm4
andpd %xmm0, %xmm4
andnpd %xmm1, %xmm5
orpd %xmm4, %xmm5
movsd 0x8f43(%rip), %xmm4     # 0x23b78
ucomisd %xmm5, %xmm4
movapd %xmm3, 0x60(%rsp)
jbe 0x1ac86
movsd 0x8da7(%rip), %xmm0     # 0x239f0
ucomisd %xmm2, %xmm0
movapd %xmm5, 0x10(%rsp)
jae 0x1acca
ucomisd 0x8d93(%rip), %xmm3     # 0x239f0
jbe 0x1aeb0
movapd %xmm2, %xmm0
callq 0x2240
jmp 0x1aec1
testl %ebx, %ebx
je 0x1b0f0
movsd 0x8c2f(%rip), %xmm4     # 0x238b0
jmp 0x1b0f0
ucomisd %xmm0, %xmm1
movapd %xmm0, %xmm6
addsd %xmm1, %xmm6
jb 0x1acf0
movapd %xmm0, %xmm5
divsd %xmm1, %xmm5
movsd 0x79bc(%rip), %xmm4     # 0x22660
addsd %xmm5, %xmm4
movapd 0x91c0(%rip), %xmm7     # 0x23e70
unpcklpd %xmm5, %xmm7            # xmm7 = xmm7[0],xmm5[0]
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
divpd %xmm4, %xmm7
mulsd %xmm2, %xmm6
movapd %xmm0, %xmm4
subsd %xmm6, %xmm4
jmp 0x1ad21
movapd %xmm2, %xmm0
callq 0x2240
movsd %xmm0, (%rsp)
movapd 0x9110(%rip), %xmm0     # 0x23df0
xorpd 0x70(%rsp), %xmm0
callq 0x1c860
jmp 0x1aed1
movapd %xmm1, %xmm7
divsd %xmm0, %xmm7
movsd 0x7960(%rip), %xmm4     # 0x22660
addsd %xmm7, %xmm4
shufpd $0x2, 0x91a3(%rip), %xmm7 # xmm7 = xmm7[0],mem[1]
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
divpd %xmm4, %xmm7
mulsd %xmm3, %xmm6
subsd %xmm1, %xmm6
movapd %xmm6, %xmm4
movapd 0x90c7(%rip), %xmm1     # 0x23df0
movapd %xmm4, 0x10(%rsp)
xorpd %xmm4, %xmm1
divsd %xmm0, %xmm1
movapd 0x90a1(%rip), %xmm0     # 0x23de0
andpd %xmm1, %xmm0
ucomisd 0x8e45(%rip), %xmm0     # 0x23b90
movapd %xmm7, 0x30(%rsp)
movapd %xmm7, %xmm3
unpckhpd %xmm7, %xmm3            # xmm3 = xmm3[1],xmm7[1]
movapd %xmm3, 0x40(%rsp)
jbe 0x1ad83
movapd %xmm2, %xmm0
divsd %xmm3, %xmm0
movapd %xmm1, (%rsp)
callq 0x2240
movapd (%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
jmp 0x1ad91
movapd %xmm1, %xmm0
callq 0x1d23b
movapd %xmm0, (%rsp)
movapd 0x10(%rsp), %xmm2
divsd 0x20(%rsp), %xmm2
movapd 0x903b(%rip), %xmm0     # 0x23de0
andpd %xmm2, %xmm0
movsd 0x8ddf(%rip), %xmm1     # 0x23b90
ucomisd %xmm0, %xmm1
movapd 0x30(%rsp), %xmm1
jae 0x1adde
movapd 0x60(%rsp), %xmm0
divsd %xmm1, %xmm0
movapd %xmm2, 0x10(%rsp)
callq 0x2240
movapd 0x10(%rsp), %xmm2
subsd %xmm0, %xmm2
jmp 0x1adeb
movapd %xmm2, %xmm0
callq 0x1d23b
movapd %xmm0, %xmm2
movapd 0x20(%rsp), %xmm0
mulsd %xmm0, %xmm2
movapd 0x50(%rsp), %xmm3
movapd (%rsp), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
testl %ebx, %ebx
movapd 0x40(%rsp), %xmm2
je 0x1ae71
mulsd %xmm0, %xmm2
movapd %xmm2, %xmm0
movapd %xmm1, (%rsp)
callq 0x2240
mulsd 0x73ec(%rip), %xmm0     # 0x22218
addsd 0x8d64(%rip), %xmm0     # 0x23b98
subsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movapd 0x50(%rsp), %xmm0
movapd 0x20(%rsp), %xmm1
callq 0x1d360
movsd (%rsp), %xmm4
movapd 0x20(%rsp), %xmm6
subsd %xmm0, %xmm4
xorl %eax, %eax
movapd 0x60(%rsp), %xmm3
movapd 0x70(%rsp), %xmm2
jmp 0x1b2b7
xorpd 0x8f77(%rip), %xmm1     # 0x23df0
movapd %xmm1, %xmm0
callq 0x2550
movapd 0x40(%rsp), %xmm2
movapd 0x20(%rsp), %xmm1
movapd %xmm0, %xmm3
mulsd %xmm1, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jb 0x1b099
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x1b0b2
movapd 0x8f38(%rip), %xmm0     # 0x23df0
xorpd %xmm3, %xmm0
callq 0x1c860
movsd %xmm0, (%rsp)
movapd 0x60(%rsp), %xmm0
callq 0x2240
movapd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm0
movapd 0x50(%rsp), %xmm2
movsd (%rsp), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm0, %xmm4
movapd 0x10(%rsp), %xmm0
ucomisd 0x7764(%rip), %xmm0     # 0x22660
jae 0x1b011
movapd %xmm1, %xmm5
cmplesd %xmm2, %xmm5
movapd %xmm5, %xmm3
andpd %xmm2, %xmm3
andnpd %xmm1, %xmm5
orpd %xmm3, %xmm5
ucomisd 0x8c55(%rip), %xmm5     # 0x23b78
movapd %xmm5, 0x40(%rsp)
jae 0x1b042
movsd 0x7729(%rip), %xmm3     # 0x22660
ucomisd %xmm5, %xmm3
jae 0x1b125
movsd %xmm4, (%rsp)
callq 0x1cdd4
movapd 0x40(%rsp), %xmm4
movsd 0x8a0f(%rip), %xmm1     # 0x23968
addsd %xmm4, %xmm1
cvttsd2si %xmm1, %eax
testl %eax, %eax
movsd %xmm0, 0x30(%rsp)
jle 0x1afc6
movsd 0x89f5(%rip), %xmm5     # 0x23968
movapd 0x10(%rsp), %xmm3
movsd 0x76df(%rip), %xmm0     # 0x22660
addsd %xmm5, %xmm4
movapd %xmm3, %xmm1
addsd %xmm4, %xmm1
movapd %xmm4, %xmm2
divsd %xmm1, %xmm2
mulsd %xmm2, %xmm0
decl %eax
jne 0x1af81
movapd %xmm4, 0x40(%rsp)
callq 0x2240
movsd 0x30(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movapd 0x40(%rsp), %xmm1
addsd 0x89a2(%rip), %xmm1     # 0x23968
movapd 0x10(%rsp), %xmm2
movsd %xmm1, 0x80(%rsp)
addsd %xmm1, %xmm2
ucomisd 0x767f(%rip), %xmm2     # 0x22660
jbe 0x1b18b
movsd 0x8979(%rip), %xmm0     # 0x23968
addsd %xmm2, %xmm0
movsd %xmm2, 0x40(%rsp)
callq 0x1d093
addsd 0x765a(%rip), %xmm0     # 0x22660
divsd 0x40(%rsp), %xmm0
jmp 0x1b19c
movapd %xmm2, %xmm0
movsd %xmm4, (%rsp)
callq 0x1c8e0
movsd (%rsp), %xmm4
subsd %xmm0, %xmm4
testl %ebx, %ebx
jne 0x1b2a3
movapd %xmm4, %xmm0
callq 0x2550
movapd %xmm0, %xmm4
jmp 0x1b0e4
movsd %xmm4, (%rsp)
callq 0x1cdd4
movsd %xmm0, 0x30(%rsp)
movapd 0x10(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
callq 0x1cebd
movapd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
testl %ebx, %ebx
je 0x1b16e
movapd 0x10(%rsp), %xmm0
movsd %xmm1, 0x10(%rsp)
callq 0x2240
movsd (%rsp), %xmm4
subsd 0x10(%rsp), %xmm4
addsd %xmm0, %xmm4
jmp 0x1b2a3
movapd %xmm2, %xmm0
movsd %xmm3, (%rsp)
callq 0x24f0
movsd (%rsp), %xmm3
movapd 0x20(%rsp), %xmm1
mulsd 0x8ae6(%rip), %xmm0     # 0x23ba0
mulsd %xmm0, %xmm3
movsd %xmm3, (%rsp)
movapd 0x50(%rsp), %xmm0
callq 0x1d360
xorpd 0x8d1a(%rip), %xmm0     # 0x23df0
callq 0x2550
movapd %xmm0, %xmm4
mulsd (%rsp), %xmm4
movapd 0x60(%rsp), %xmm3
movapd 0x70(%rsp), %xmm2
testl %ebx, %ebx
sete %al
jne 0x1b2b1
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm4
movapd 0x20(%rsp), %xmm6
movapd 0x50(%rsp), %xmm8
jne 0x1b2be
jnp 0x1b49c
jmp 0x1b2be
testl %ebx, %ebx
je 0x1b4a5
movsd %xmm4, (%rsp)
addsd %xmm1, %xmm2
ucomisd 0x7522(%rip), %xmm2     # 0x22660
jbe 0x1b20c
movsd 0x881c(%rip), %xmm0     # 0x23968
addsd %xmm2, %xmm0
movapd %xmm2, 0x30(%rsp)
callq 0x1d093
addsd 0x74fd(%rip), %xmm0     # 0x22660
divsd 0x30(%rsp), %xmm0
jmp 0x1b21d
movsd (%rsp), %xmm0
subsd %xmm1, %xmm0
callq 0x2550
movapd 0x10(%rsp), %xmm4
mulsd %xmm0, %xmm4
jmp 0x1b0e4
movapd %xmm2, %xmm0
callq 0x1d093
addsd 0x74c4(%rip), %xmm0     # 0x22660
movsd %xmm0, 0x40(%rsp)
movsd (%rsp), %xmm0
subsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x80(%rsp), %xmm0
callq 0x1d093
movsd %xmm0, 0x30(%rsp)
testl %ebx, %ebx
je 0x1b4df
movapd 0x10(%rsp), %xmm0
callq 0x2240
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd 0x30(%rsp), %xmm0
callq 0x2220
addsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x40(%rsp), %xmm0
callq 0x2240
jmp 0x1b29a
movapd %xmm2, %xmm0
callq 0x1d093
addsd 0x7443(%rip), %xmm0     # 0x22660
movsd %xmm0, 0x30(%rsp)
movaps 0x50(%rsp), %xmm0
callq 0x1d093
movsd %xmm0, 0x80(%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x1d093
movsd 0x7417(%rip), %xmm1     # 0x22660
movsd 0x80(%rsp), %xmm2
addsd %xmm1, %xmm2
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
divsd 0x30(%rsp), %xmm0
movapd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
testl %ebx, %ebx
je 0x1b510
callq 0x2240
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movapd 0x10(%rsp), %xmm0
divsd 0x40(%rsp), %xmm0
callq 0x2220
movsd (%rsp), %xmm4
subsd %xmm0, %xmm4
xorl %eax, %eax
movapd 0x60(%rsp), %xmm3
movapd 0x70(%rsp), %xmm2
movapd 0x20(%rsp), %xmm6
movapd 0x50(%rsp), %xmm8
movsd %xmm4, (%rsp)
movsd 0x7394(%rip), %xmm9     # 0x22660
movsd 0x88(%rsp), %xmm5
addsd %xmm9, %xmm5
divsd %xmm8, %xmm6
movapd %xmm9, %xmm1
divsd %xmm8, %xmm1
addsd %xmm9, %xmm1
addsd %xmm9, %xmm3
movapd %xmm3, %xmm10
movapd %xmm8, %xmm3
addsd %xmm9, %xmm3
movapd %xmm5, %xmm4
divsd %xmm1, %xmm4
movapd %xmm1, %xmm0
movapd %xmm5, %xmm7
divsd %xmm5, %xmm0
movapd %xmm9, %xmm5
unpcklpd %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
movapd %xmm9, %xmm4
unpcklpd %xmm6, %xmm4            # xmm4 = xmm4[0],xmm6[0]
xorpd %xmm12, %xmm12
unpcklpd %xmm9, %xmm12           # xmm12 = xmm12[0],xmm9[0]
movapd 0x8b76(%rip), %xmm6     # 0x23eb0
movapd %xmm12, %xmm15
movapd %xmm4, %xmm11
addpd %xmm15, %xmm11
movapd %xmm11, %xmm13
divsd %xmm8, %xmm13
movapd 0x20(%rsp), %xmm14
subsd %xmm11, %xmm14
movapd 0x50(%rsp), %xmm8
divsd %xmm3, %xmm8
shufpd $0x2, %xmm15, %xmm14    # xmm14 = xmm14[0],xmm15[1]
movapd %xmm2, %xmm15
unpcklpd %xmm8, %xmm15           # xmm15 = xmm15[0],xmm8[0]
movapd %xmm1, %xmm8
addsd %xmm13, %xmm8
addsd %xmm13, %xmm8
movsd 0x72ce(%rip), %xmm2     # 0x22660
addsd %xmm2, %xmm13
movapd %xmm13, %xmm9
divsd %xmm8, %xmm9
movapd %xmm11, %xmm8
mulsd %xmm10, %xmm8
addsd %xmm7, %xmm8
mulsd %xmm9, %xmm8
movapd %xmm0, %xmm9
mulpd %xmm11, %xmm14
mulpd %xmm15, %xmm14
mulpd %xmm14, %xmm15
divsd %xmm3, %xmm14
addsd %xmm11, %xmm14
addsd %xmm14, %xmm8
movapd %xmm15, %xmm0
unpckhpd %xmm15, %xmm0           # xmm0 = xmm0[1],xmm15[1]
mulsd %xmm15, %xmm0
unpcklpd %xmm8, %xmm8            # xmm8 = xmm8[0,0]
mulpd %xmm5, %xmm8
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm12, %xmm0
addpd %xmm8, %xmm0
movapd %xmm0, %xmm12
unpckhpd %xmm0, %xmm12           # xmm12 = xmm12[1],xmm0[1]
divsd %xmm12, %xmm0
movapd %xmm0, %xmm8
subsd %xmm9, %xmm8
andpd 0x89bf(%rip), %xmm8     # 0x23de0
movapd %xmm0, %xmm9
mulsd 0x85c9(%rip), %xmm9     # 0x239f8
ucomisd %xmm8, %xmm9
movapd 0x50(%rsp), %xmm8
movapd 0x70(%rsp), %xmm2
jae 0x1b47b
addsd 0x85c5(%rip), %xmm3     # 0x23a10
divpd %xmm12, %xmm5
movsd 0x874f(%rip), %xmm9     # 0x23ba8
ucomisd %xmm11, %xmm9
movapd %xmm5, %xmm12
movapd %xmm6, %xmm5
movsd %xmm0, %xmm5            # xmm5 = xmm0[0],xmm5[1]
unpcklpd %xmm13, %xmm11          # xmm11 = xmm11[0],xmm13[0]
movapd %xmm11, %xmm15
ja 0x1b33f
testb %al, %al
je 0x1b48a
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x1b498
callq 0x2240
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x90, %rsp
popq %rbx
retq
movapd %xmm4, %xmm0
callq 0x2550
movapd 0x70(%rsp), %xmm2
movapd 0x60(%rsp), %xmm3
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jne 0x1b4ca
jnp 0x1b0f0
movapd %xmm0, %xmm4
movapd 0x20(%rsp), %xmm1
movapd 0x50(%rsp), %xmm2
jmp 0x1b12d
movsd (%rsp), %xmm0
callq 0x2550
movsd 0x30(%rsp), %xmm4
addsd 0x7169(%rip), %xmm4     # 0x22660
movapd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm1, %xmm4
divsd 0x40(%rsp), %xmm4
jmp 0x1b0e4
movsd (%rsp), %xmm4
mulsd %xmm0, %xmm4
divsd 0x40(%rsp), %xmm1
addsd 0x7139(%rip), %xmm1     # 0x22660
divsd %xmm1, %xmm4
jmp 0x1b0e4