// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/binomlite.c
// Function: betaln
static double betaln(double a0, double b0)
{
/* -----------------------------------------------------------------------
 *     Evaluation of the logarithm of the beta function  ln(beta(a0,b0))
 * ----------------------------------------------------------------------- */

    static double e = .918938533204673;/* e == 0.5*LN(2*PI) */

    double
    a = fmin2(a0 ,b0),
    b = fmax2(a0, b0);

    if (a < 8.) {
    if (a < 1.) {
/* ----------------------------------------------------------------------- */
//                            A < 1
/* ----------------------------------------------------------------------- */
        if (b < 8.)
        return gamln(a) + (gamln(b) - gamln(a+b));
        else
        return gamln(a) + algdiv(a, b);
    }
    /* else */
/* ----------------------------------------------------------------------- */
//                1 <= A < 8
/* ----------------------------------------------------------------------- */
    double w;
    if (a < 2.) {
        if (b <= 2.) {
        return gamln(a) + gamln(b) - gsumln(a, b);
        }
        /* else */

        if (b < 8.) {
        w = 0.;
        goto L40;
        }
        return gamln(a) + algdiv(a, b);
    }
    // else L30:    REDUCTION OF A WHEN B <= 1000

    if (b <= 1e3) {
        int n = (int)(a - 1.);
        w = 1.;
        int i;
        for (i = 1; i <= n; ++i) {
        a += -1.;
        double h = a / b;
        w *= h / (h + 1.);
        }
        w = log(w);

        if (b >= 8.)
        return w + gamln(a) + algdiv(a, b);

        // else
    L40:
        //     1 < A <= B < 8 :  reduction of B
        n = (int)(b - 1.);
        double z = 1.;
        for (i = 1; i <= n; ++i) {
        b += -1.;
        z *= b / (a + b);
        }
        return w + log(z) + (gamln(a) + (gamln(b) - gsumln(a, b)));
    }
    else { // L50:    reduction of A when  B > 1000
        int i, n = (int)(a - 1.);
        w = 1.;
        for (i = 1; i <= n; ++i) {
        a += -1.;
        w *= a / (a / b + 1.);
        }
        return log(w) - n * log(b) + (gamln(a) + algdiv(a, b));
    }

    } else {
/* ----------------------------------------------------------------------- */
    // L60:            A >= 8
/* ----------------------------------------------------------------------- */

    double
        w = bcorr(a, b),
        h = a / b,
        u = -(a - 0.5) * log(h / (h + 1.)),
        v = b * alnrel(h);
    if (u > v)
        return log(b) * -0.5 + e + w - v - u;
    else
        return log(b) * -0.5 + e + w - u - v;
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd -0x10(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x26121
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
jmp 0x2612b
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jb 0x2614d
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
jmp 0x26157
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0xc707(%rip), %xmm0     # 0x32870
ucomisd -0x20(%rbp), %xmm0
jbe 0x2662b
movsd 0xb47c(%rip), %xmm0     # 0x315f8
ucomisd -0x20(%rbp), %xmm0
jbe 0x26228
movsd 0xc6e1(%rip), %xmm0     # 0x32870
ucomisd -0x28(%rbp), %xmm0
jbe 0x261ee
movsd -0x20(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0x88(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0x90(%rbp)
movsd -0x20(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
callq 0x27700
movsd -0x90(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x88(%rbp), %xmm0
subsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd -0x20(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0x98(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x26b40
movaps %xmm0, %xmm1
movsd -0x98(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd 0xaf90(%rip), %xmm0     # 0x311c0
ucomisd -0x20(%rbp), %xmm0
jbe 0x262fb
movsd 0xaf7d(%rip), %xmm0     # 0x311c0
ucomisd -0x28(%rbp), %xmm0
jb 0x262a5
movsd -0x20(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0xa8(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x27700
movaps %xmm0, %xmm1
movsd -0xa8(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x27940
movaps %xmm0, %xmm1
movsd -0xa0(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd 0xc5c3(%rip), %xmm0     # 0x32870
ucomisd -0x28(%rbp), %xmm0
jbe 0x262c1
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x26408
movsd -0x20(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0xb0(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x26b40
movaps %xmm0, %xmm1
movsd -0xb0(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd 0xc27d(%rip), %xmm0     # 0x32580
ucomisd -0x28(%rbp), %xmm0
jb 0x26508
movsd -0x20(%rbp), %xmm0
movsd 0xb2dd(%rip), %xmm1     # 0x315f8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x34(%rbp)
movsd 0xb2ca(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0x30(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jg 0x2638e
movsd 0xc52e(%rip), %xmm0     # 0x32878
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0xb288(%rip), %xmm1     # 0x315f8
addsd -0x40(%rbp), %xmm1
divsd %xmm1, %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2633a
movsd -0x30(%rbp), %xmm0
callq 0x2250
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
movsd 0xc4c6(%rip), %xmm1     # 0x32870
ucomisd %xmm1, %xmm0
jb 0x26406
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x27700
movaps %xmm0, %xmm1
movsd -0xc0(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x26b40
movaps %xmm0, %xmm1
movsd -0xb8(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
jmp 0x26408
movsd -0x28(%rbp), %xmm0
movsd 0xb1e3(%rip), %xmm1     # 0x315f8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x34(%rbp)
movsd 0xb1d0(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0x48(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jg 0x26476
movsd 0xc434(%rip), %xmm0     # 0x32878
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
addsd -0x28(%rbp), %xmm1
divsd %xmm1, %xmm0
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x26434
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x2250
movaps %xmm0, %xmm1
movsd -0xe0(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0xd0(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0xd8(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x27940
movsd -0xd8(%rbp), %xmm2
movsd -0xd0(%rbp), %xmm1
movaps %xmm0, %xmm3
movsd -0xc8(%rbp), %xmm0
subsd %xmm3, %xmm2
addsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd -0x20(%rbp), %xmm0
movsd 0xb0e3(%rip), %xmm1     # 0x315f8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x50(%rbp)
movsd 0xb0d0(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0x30(%rbp)
movl $0x1, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jg 0x26582
movsd 0xc334(%rip), %xmm0     # 0x32878
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
divsd -0x28(%rbp), %xmm1
movsd 0xb093(%rip), %xmm2     # 0x315f8
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x26534
movsd -0x30(%rbp), %xmm0
callq 0x2250
movsd %xmm0, -0x100(%rbp)
cvtsi2sdl -0x50(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x2250
movsd -0x100(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0xf8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x27700
movsd %xmm0, -0xf0(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x26b40
movsd -0xf0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0xe8(%rbp), %xmm0
addsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
callq 0x273f0
movsd %xmm0, -0x58(%rbp)
movsd -0x20(%rbp), %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x20(%rbp), %xmm0
movsd 0xafa5(%rip), %xmm1     # 0x31600
subsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0x60(%rbp), %xmm0
movsd 0xaf6d(%rip), %xmm1     # 0x315f8
addsd -0x60(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x2250
movaps %xmm0, %xmm1
movsd -0x110(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x108(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x25fc0
movaps %xmm0, %xmm1
movsd -0x108(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x68(%rbp), %xmm0
ucomisd -0x70(%rbp), %xmm0
jbe 0x2671c
movsd -0x28(%rbp), %xmm0
callq 0x2250
movsd 0x12e52(%rip), %xmm1    # 0x39548
movsd 0xc152(%rip), %xmm2     # 0x32850
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x58(%rbp), %xmm0
subsd -0x70(%rbp), %xmm0
subsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x26752
movsd -0x28(%rbp), %xmm0
callq 0x2250
movsd 0x12e1a(%rip), %xmm1    # 0x39548
movsd 0xc11a(%rip), %xmm2     # 0x32850
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x58(%rbp), %xmm0
subsd -0x68(%rbp), %xmm0
subsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq