// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/binomlite.c
// Function: gamln
static double gamln(double a)
{
/* -----------------------------------------------------------------------
 *            Evaluation of  ln(gamma(a))  for positive a
 * ----------------------------------------------------------------------- */
/*     Written by Alfred H. Morris */
/*          Naval Surface Warfare Center */
/*          Dahlgren, Virginia */
/* ----------------------------------------------------------------------- */

    static double d = .418938533204673;/* d == 0.5*(LN(2*PI) - 1) */

    static double c0 = .0833333333333333;
    static double c1 = -.00277777777760991;
    static double c2 = 7.9365066682539e-4;
    static double c3 = -5.9520293135187e-4;
    static double c4 = 8.37308034031215e-4;
    static double c5 = -.00165322962780713;

    if (a <= 0.8)
    return gamln1(a) - log(a); /* ln(G(a+1)) - ln(a) == ln(G(a+1)/a) = ln(G(a)) */
    else if (a <= 2.25)
    return gamln1(a - 0.5 - 0.5);

    else if (a < 10.) {
    int i, n = (int)(a - 1.25);
    double t = a;
    double w = 1.;
    for (i = 1; i <= n; ++i) {
        t += -1.;
        w *= t;
    }
    return gamln1(t - 1.) + log(w);
    }
    else { /* a >= 10 */
    double t = 1. / (a * a);
    double w = (((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t + c0) / a;
    return d + w + (a - 0.5) * (log(a) - 1.);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movsd %xmm0, -0x10(%rbp)
movsd 0xb393(%rip), %xmm0     # 0x32aa8
ucomisd -0x10(%rbp), %xmm0
jb 0x2774b
movsd -0x10(%rbp), %xmm0
callq 0x268c0
movsd %xmm0, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x2250
movaps %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x2792c
movsd 0xb35d(%rip), %xmm0     # 0x32ab0
ucomisd -0x10(%rbp), %xmm0
jb 0x27786
movsd -0x10(%rbp), %xmm0
movsd 0x9e99(%rip), %xmm1     # 0x31600
subsd %xmm1, %xmm0
movsd 0x9e8d(%rip), %xmm1     # 0x31600
subsd %xmm1, %xmm0
callq 0x268c0
movsd %xmm0, -0x8(%rbp)
jmp 0x2792c
movsd 0x9a3a(%rip), %xmm0     # 0x311c8
ucomisd -0x10(%rbp), %xmm0
jbe 0x2783e
movsd -0x10(%rbp), %xmm0
movsd 0xb312(%rip), %xmm1     # 0x32ab8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x9e35(%rip), %xmm0     # 0x315f8
movsd %xmm0, -0x28(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0x27803
movsd 0xb099(%rip), %xmm0     # 0x32878
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x277cf
movsd -0x20(%rbp), %xmm0
movsd 0x9de8(%rip), %xmm1     # 0x315f8
subsd %xmm1, %xmm0
callq 0x268c0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x2250
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x2792c
movsd -0x10(%rbp), %xmm1
mulsd -0x10(%rbp), %xmm1
movsd 0x9da8(%rip), %xmm0     # 0x315f8
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x11d1f(%rip), %xmm0    # 0x39580
movsd -0x30(%rbp), %xmm2
movsd 0x11d0a(%rip), %xmm1    # 0x39578
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd 0x11ced(%rip), %xmm1    # 0x39570
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd 0x11cd0(%rip), %xmm1    # 0x39568
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd 0x11cb3(%rip), %xmm1    # 0x39560
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd 0x11c96(%rip), %xmm1    # 0x39558
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x11c74(%rip), %xmm0    # 0x39550
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x9d0d(%rip), %xmm1     # 0x31600
subsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x2250
movsd -0x58(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
movsd 0x9cdd(%rip), %xmm3     # 0x315f8
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)