// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movsd %xmm3, -0x28(%rbp)
movsd %xmm4, -0x30(%rbp)
movsd %xmm5, -0x38(%rbp)
movl %edi, -0x3c(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movsd -0x28(%rbp), %xmm3
movl -0x3c(%rbp), %edi
callq 0x28bd0
movsd %xmm0, -0xd8(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x23816
movsd -0xd8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x23816
jp 0x23816
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x23b9d
movsd 0xddda(%rip), %xmm0     # 0x315f8
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x18(%rbp), %xmm0
divsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0xddb6(%rip), %xmm0     # 0x315f8
divsd -0x10(%rbp), %xmm0
movsd 0xdda9(%rip), %xmm1     # 0x315f8
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd 0xdd95(%rip), %xmm0     # 0x315f8
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd 0xdd78(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0x60(%rbp)
movsd 0xdd6b(%rip), %xmm0     # 0x315f8
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd 0xdd4e(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0xa8(%rbp)
movsd 0xdd3e(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0xb8(%rbp)
movsd -0x48(%rbp), %xmm0
divsd -0x90(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x90(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0xdd07(%rip), %xmm0     # 0x315f8
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
divsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
subsd -0x58(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x10(%rbp), %xmm0
divsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x60(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
addsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd -0x50(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd 0xdc84(%rip), %xmm0     # 0x315f8
addsd -0x78(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
addsd -0x78(%rbp), %xmm1
addsd -0x78(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x58(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
divsd -0x70(%rbp), %xmm0
addsd %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm3
movsd -0x58(%rbp), %xmm2
movsd -0xb0(%rbp), %xmm4
mulsd %xmm4, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd 0xdc1a(%rip), %xmm0     # 0x315f8
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0xd7d0(%rip), %xmm0     # 0x311c0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd -0xb8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd -0xc0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0xb8(%rbp), %xmm0
divsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm1
subsd -0x98(%rbp), %xmm1
movaps 0xf02c(%rip), %xmm0     # 0x32af0
pand %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x23ada
jmp 0x23b42
movsd -0xc0(%rbp), %xmm1
movsd -0xa0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0xc0(%rbp), %xmm1
movsd -0xa8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd 0xdad1(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0xc0(%rbp)
movsd 0xed51(%rip), %xmm0     # 0x32888
ucomisd -0x58(%rbp), %xmm0
ja 0x238e9
cmpl $0x0, -0x3c(%rbp)
je 0x23b7b
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0x68(%rbp), %xmm0
callq 0x2250
movaps %xmm0, %xmm1
movsd -0xe8(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe0(%rbp)
jmp 0x23b90
movsd -0xd8(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)