// File: /workspace/github_c_makefile_star2_O1/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 $0xa0, %rsp
movl %edi, %ebx
movsd %xmm4, 0x88(%rsp)
movapd %xmm1, %xmm9
movapd %xmm0, %xmm4
xorpd %xmm5, %xmm5
ucomisd %xmm5, %xmm2
movapd %xmm2, 0x90(%rsp)
movapd %xmm1, 0x20(%rsp)
movapd %xmm0, 0x40(%rsp)
jne 0x19de6
jnp 0x19e4d
ucomisd %xmm5, %xmm3
jne 0x19dee
jnp 0x19e4d
movapd %xmm4, %xmm1
cmplesd %xmm9, %xmm1
movapd %xmm1, %xmm0
andpd %xmm4, %xmm0
andnpd %xmm9, %xmm1
orpd %xmm0, %xmm1
movsd 0x8d5f(%rip), %xmm0     # 0x22b70
ucomisd %xmm1, %xmm0
movapd %xmm3, 0x30(%rsp)
jbe 0x19e62
movsd 0x8bc3(%rip), %xmm0     # 0x229e8
ucomisd %xmm2, %xmm0
movapd %xmm1, 0x70(%rsp)
jae 0x19ea7
ucomisd 0x8baf(%rip), %xmm3     # 0x229e8
jbe 0x1a06b
movapd %xmm2, %xmm0
callq 0x2240
jmp 0x1a07c
testl %ebx, %ebx
je 0x1a499
movsd 0x8a23(%rip), %xmm5     # 0x22880
jmp 0x1a499
ucomisd %xmm4, %xmm9
movapd %xmm4, %xmm0
addsd %xmm9, %xmm0
jb 0x19ed1
movapd %xmm4, %xmm5
divsd %xmm9, %xmm5
movsd 0x77ad(%rip), %xmm6     # 0x21630
movapd %xmm5, %xmm1
addsd %xmm6, %xmm1
divsd %xmm1, %xmm5
divsd %xmm1, %xmm6
movapd %xmm6, 0x60(%rsp)
mulsd %xmm2, %xmm0
movapd %xmm4, %xmm6
subsd %xmm0, %xmm6
jmp 0x19f05
movapd %xmm2, %xmm0
callq 0x2240
movsd %xmm0, 0x10(%rsp)
movapd 0x9122(%rip), %xmm0     # 0x22fe0
xorpd 0x90(%rsp), %xmm0
callq 0x1ba27
jmp 0x1a08d
movapd %xmm9, %xmm6
divsd %xmm4, %xmm6
movsd 0x774e(%rip), %xmm5     # 0x21630
movapd %xmm6, %xmm1
addsd %xmm5, %xmm1
divsd %xmm1, %xmm5
divsd %xmm1, %xmm6
movapd %xmm6, 0x60(%rsp)
mulsd %xmm3, %xmm0
subsd %xmm9, %xmm0
movapd %xmm0, %xmm6
movapd 0x90d3(%rip), %xmm1     # 0x22fe0
movapd %xmm6, 0x10(%rsp)
xorpd %xmm6, %xmm1
divsd %xmm4, %xmm1
movapd 0x90ad(%rip), %xmm0     # 0x22fd0
andpd %xmm1, %xmm0
ucomisd 0x8c59(%rip), %xmm0     # 0x22b88
movapd %xmm5, 0x70(%rsp)
jbe 0x19f54
movapd %xmm2, %xmm0
divsd %xmm5, %xmm0
movapd %xmm1, (%rsp)
callq 0x2240
movapd (%rsp), %xmm1
subsd %xmm0, %xmm1
jmp 0x19f61
movapd %xmm1, %xmm0
callq 0x1c47b
movapd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movapd 0x10(%rsp), %xmm2
divsd 0x20(%rsp), %xmm2
movapd 0x9056(%rip), %xmm0     # 0x22fd0
andpd %xmm2, %xmm0
movsd 0x8c02(%rip), %xmm1     # 0x22b88
ucomisd %xmm0, %xmm1
jae 0x19faf
movapd 0x30(%rsp), %xmm0
divsd 0x60(%rsp), %xmm0
movapd %xmm2, 0x10(%rsp)
callq 0x2240
movapd 0x10(%rsp), %xmm3
subsd %xmm0, %xmm3
jmp 0x19fbc
movapd %xmm2, %xmm0
callq 0x1c47b
movapd %xmm0, %xmm3
movapd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm3
movapd 0x40(%rsp), %xmm2
movapd (%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
xorpd 0x8fff(%rip), %xmm0     # 0x22fe0
testl %ebx, %ebx
jne 0x19ff6
callq 0x2550
movapd 0x40(%rsp), %xmm2
movapd 0x20(%rsp), %xmm1
movapd %xmm0, (%rsp)
movapd %xmm2, %xmm0
callq 0x1c5ac
movapd %xmm0, %xmm2
movapd 0x70(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm0
testl %ebx, %ebx
je 0x1a054
movapd %xmm2, 0x10(%rsp)
callq 0x2240
movapd 0x20(%rsp), %xmm9
mulsd 0x71c6(%rip), %xmm0     # 0x211f8
addsd 0x8b56(%rip), %xmm0     # 0x22b90
movapd (%rsp), %xmm5
addsd %xmm0, %xmm5
subsd 0x10(%rsp), %xmm5
movapd 0x30(%rsp), %xmm3
jmp 0x1a493
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1a259
sqrtsd %xmm0, %xmm0
jmp 0x1a26a
movapd 0x8f6d(%rip), %xmm0     # 0x22fe0
xorpd %xmm3, %xmm0
callq 0x1ba27
movsd %xmm0, 0x10(%rsp)
movapd 0x30(%rsp), %xmm0
callq 0x2240
movapd 0x20(%rsp), %xmm9
mulsd %xmm9, %xmm0
movapd 0x40(%rsp), %xmm4
movsd 0x10(%rsp), %xmm2
mulsd %xmm4, %xmm2
addsd %xmm0, %xmm2
movapd 0x70(%rsp), %xmm0
ucomisd 0x7575(%rip), %xmm0     # 0x21630
jae 0x1a1cb
movapd %xmm9, %xmm3
cmplesd %xmm4, %xmm3
movapd %xmm3, %xmm1
andpd %xmm4, %xmm1
andnpd %xmm9, %xmm3
orpd %xmm1, %xmm3
ucomisd 0x8a8c(%rip), %xmm3     # 0x22b70
movapd %xmm3, (%rsp)
jae 0x1a203
movsd 0x7539(%rip), %xmm1     # 0x21630
ucomisd %xmm3, %xmm1
jae 0x1a29f
movsd %xmm2, 0x10(%rsp)
callq 0x1bfbb
movapd (%rsp), %xmm4
movsd %xmm0, 0x60(%rsp)
movsd 0x8831(%rip), %xmm0     # 0x22950
addsd %xmm4, %xmm0
cvttsd2si %xmm0, %eax
testl %eax, %eax
jle 0x1a17c
movsd 0x881d(%rip), %xmm5     # 0x22950
movapd 0x70(%rsp), %xmm3
movsd 0x74ef(%rip), %xmm0     # 0x21630
addsd %xmm5, %xmm4
movapd %xmm3, %xmm1
addsd %xmm4, %xmm1
movapd %xmm4, %xmm2
divsd %xmm1, %xmm2
mulsd %xmm2, %xmm0
decl %eax
jne 0x1a141
movapd %xmm4, (%rsp)
callq 0x2240
movapd (%rsp), %xmm4
movsd 0x60(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x60(%rsp)
addsd 0x87cc(%rip), %xmm4     # 0x22950
movapd 0x70(%rsp), %xmm1
movapd %xmm4, (%rsp)
addsd %xmm4, %xmm1
ucomisd 0x7495(%rip), %xmm1     # 0x21630
jbe 0x1a342
movsd 0x87a7(%rip), %xmm0     # 0x22950
addsd %xmm1, %xmm0
movsd %xmm1, 0x58(%rsp)
callq 0x1c2db
addsd 0x7470(%rip), %xmm0     # 0x21630
divsd 0x58(%rsp), %xmm0
jmp 0x1a353
movapd %xmm4, %xmm0
movapd %xmm9, %xmm1
movsd %xmm2, 0x10(%rsp)
callq 0x1bac7
movsd 0x10(%rsp), %xmm5
subsd %xmm0, %xmm5
testl %ebx, %ebx
jne 0x1a486
movapd %xmm5, %xmm0
callq 0x2550
movapd %xmm0, %xmm5
jmp 0x1a486
movsd %xmm2, 0x10(%rsp)
callq 0x1bfbb
movsd %xmm0, 0x60(%rsp)
movapd 0x70(%rsp), %xmm0
movaps (%rsp), %xmm1
callq 0x1c11f
movapd %xmm0, %xmm1
addsd 0x60(%rsp), %xmm1
testl %ebx, %ebx
je 0x1a324
movapd 0x70(%rsp), %xmm0
movsd %xmm1, (%rsp)
callq 0x2240
movsd 0x10(%rsp), %xmm5
subsd (%rsp), %xmm5
addsd %xmm0, %xmm5
jmp 0x1a486
movapd %xmm2, 0x10(%rsp)
callq 0x24f0
movapd 0x10(%rsp), %xmm2
movapd (%rsp), %xmm1
mulsd 0x8921(%rip), %xmm0     # 0x22b98
mulsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
xorpd 0x8d58(%rip), %xmm2     # 0x22fe0
movapd %xmm2, %xmm0
callq 0x2550
movapd %xmm0, %xmm5
mulsd (%rsp), %xmm5
jmp 0x1a486
testl %ebx, %ebx
movapd 0x30(%rsp), %xmm3
jne 0x1a2c9
movapd %xmm2, %xmm0
callq 0x2550
movapd 0x40(%rsp), %xmm4
movapd 0x20(%rsp), %xmm9
movapd 0x30(%rsp), %xmm3
movapd %xmm0, %xmm2
testl %ebx, %ebx
jne 0x1a2e1
xorpd %xmm5, %xmm5
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x1a2e1
jnp 0x1a499
movsd %xmm2, 0x10(%rsp)
addsd %xmm9, %xmm4
ucomisd 0x733c(%rip), %xmm4     # 0x21630
jbe 0x1a3f3
movsd 0x864e(%rip), %xmm0     # 0x22950
addsd %xmm4, %xmm0
movapd %xmm4, 0x60(%rsp)
callq 0x1c2db
addsd 0x7317(%rip), %xmm0     # 0x21630
divsd 0x60(%rsp), %xmm0
jmp 0x1a404
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
callq 0x2550
movapd 0x70(%rsp), %xmm5
mulsd %xmm0, %xmm5
jmp 0x1a486
movapd %xmm1, %xmm0
callq 0x1c2db
addsd 0x72dd(%rip), %xmm0     # 0x21630
movsd %xmm0, 0x58(%rsp)
movsd 0x10(%rsp), %xmm0
subsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movaps (%rsp), %xmm0
callq 0x1c2db
movsd %xmm0, (%rsp)
testl %ebx, %ebx
je 0x1a3c2
movapd 0x70(%rsp), %xmm0
callq 0x2240
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movsd (%rsp), %xmm0
callq 0x2220
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x58(%rsp), %xmm0
callq 0x2240
movsd (%rsp), %xmm5
jmp 0x1a482
movsd 0x10(%rsp), %xmm0
callq 0x2550
movapd 0x70(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd (%rsp), %xmm5
addsd 0x724c(%rip), %xmm5     # 0x21630
mulsd %xmm1, %xmm5
divsd 0x58(%rsp), %xmm5
jmp 0x1a486
movapd %xmm4, %xmm0
callq 0x1c2db
addsd 0x722c(%rip), %xmm0     # 0x21630
movsd %xmm0, 0x60(%rsp)
movaps 0x40(%rsp), %xmm0
callq 0x1c2db
movsd %xmm0, 0x58(%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x1c2db
movsd 0x7203(%rip), %xmm1     # 0x21630
movsd 0x58(%rsp), %xmm2
addsd %xmm1, %xmm2
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
divsd 0x60(%rsp), %xmm0
movapd 0x70(%rsp), %xmm1
mulsd %xmm1, %xmm0
testl %ebx, %ebx
je 0x1a673
callq 0x2240
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movapd 0x70(%rsp), %xmm0
divsd (%rsp), %xmm0
callq 0x2220
movsd 0x10(%rsp), %xmm5
subsd %xmm0, %xmm5
movapd 0x30(%rsp), %xmm3
movapd 0x20(%rsp), %xmm9
movapd 0x40(%rsp), %xmm4
testl %ebx, %ebx
jne 0x1a4b1
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm5
jne 0x1a4b1
jnp 0x1a66a
movsd %xmm5, (%rsp)
movsd 0x7172(%rip), %xmm6     # 0x21630
movsd 0x88(%rsp), %xmm1
addsd %xmm6, %xmm1
divsd %xmm4, %xmm9
movapd %xmm6, %xmm7
divsd %xmm4, %xmm7
addsd %xmm6, %xmm7
addsd %xmm6, %xmm3
movapd %xmm3, 0x30(%rsp)
addsd %xmm6, %xmm4
movapd %xmm1, %xmm5
divsd %xmm7, %xmm5
movapd %xmm7, %xmm0
movapd %xmm1, %xmm3
divsd %xmm1, %xmm0
xorpd %xmm12, %xmm12
movapd %xmm6, %xmm13
movapd %xmm6, %xmm10
movapd %xmm6, %xmm1
xorpd %xmm11, %xmm11
addsd %xmm6, %xmm11
movapd %xmm9, %xmm2
addsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
movapd %xmm11, %xmm14
movapd 0x40(%rsp), %xmm15
divsd %xmm15, %xmm14
movapd 0x20(%rsp), %xmm8
subsd %xmm11, %xmm8
mulsd %xmm11, %xmm8
movapd 0x90(%rsp), %xmm1
mulsd %xmm1, %xmm8
divsd %xmm4, %xmm15
mulsd %xmm15, %xmm2
mulsd %xmm15, %xmm2
movapd %xmm8, %xmm15
mulsd %xmm1, %xmm15
mulsd %xmm2, %xmm15
movapd %xmm7, %xmm2
addsd %xmm14, %xmm2
addsd %xmm14, %xmm2
movapd %xmm14, %xmm1
addsd %xmm6, %xmm1
movapd %xmm1, %xmm14
divsd %xmm2, %xmm14
movapd %xmm11, %xmm2
mulsd 0x30(%rsp), %xmm2
addsd %xmm3, %xmm2
mulsd %xmm14, %xmm2
divsd %xmm4, %xmm8
addsd %xmm11, %xmm8
addsd %xmm8, %xmm2
movapd %xmm10, %xmm8
mulsd %xmm2, %xmm8
mulsd %xmm15, %xmm12
addsd %xmm8, %xmm12
mulsd %xmm13, %xmm15
movapd %xmm0, %xmm8
mulsd %xmm5, %xmm2
addsd %xmm2, %xmm15
movapd %xmm12, %xmm0
divsd %xmm15, %xmm0
movapd %xmm0, %xmm2
subsd %xmm8, %xmm2
andpd 0x89d4(%rip), %xmm2     # 0x22fd0
movapd %xmm0, %xmm8
mulsd 0x83e6(%rip), %xmm8     # 0x229f0
ucomisd %xmm2, %xmm8
jae 0x1a649
addsd 0x83ef(%rip), %xmm4     # 0x22a08
divsd %xmm15, %xmm10
divsd %xmm15, %xmm5
movsd 0x8575(%rip), %xmm2     # 0x22ba0
ucomisd %xmm11, %xmm2
movapd %xmm10, %xmm12
movapd %xmm5, %xmm13
movapd %xmm0, %xmm10
movapd %xmm6, %xmm5
ja 0x1a516
testl %ebx, %ebx
je 0x1a65d
callq 0x2240
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
jmp 0x1a666
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0xa0, %rsp
popq %rbx
retq
movsd 0x10(%rsp), %xmm5
mulsd %xmm0, %xmm5
divsd (%rsp), %xmm1
addsd 0x6fa6(%rip), %xmm1     # 0x21630
divsd %xmm1, %xmm5
jmp 0x1a486