// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]yahs/binomlite.c
// Function: erfc1
static double erfc1(int ind, double x)
{
/* ----------------------------------------------------------------------- */
/*         EVALUATION OF THE COMPLEMENTARY ERROR FUNCTION */

/*          ERFC1(IND,X) = ERFC(X)            IF IND = 0 */
/*          ERFC1(IND,X) = EXP(X*X)*ERFC(X)   OTHERWISE */
/* ----------------------------------------------------------------------- */

    /* Initialized data */

    static double c = .564189583547756;
    static double a[5] = { 7.7105849500132e-5,-.00133733772997339,
        .0323076579225834,.0479137145607681,.128379167095513 };
    static double b[3] = { .00301048631703895,.0538971687740286,
        .375795757275549 };
    static double p[8] = { -1.36864857382717e-7,.564195517478974,
        7.21175825088309,43.1622272220567,152.98928504694,
        339.320816734344,451.918953711873,300.459261020162 };
    static double q[8] = { 1.,12.7827273196294,77.0001529352295,
        277.585444743988,638.980264465631,931.35409485061,
        790.950925327898,300.459260956983 };
    static double r[5] = { 2.10144126479064,26.2370141675169,
        21.3688200555087,4.6580782871847,.282094791773523 };
    static double s[4] = { 94.153775055546,187.11481179959,
        99.0191814623914,18.0124575948747 };

    double ret_val;
    double e, t, w, bot, top;

    double ax = fabs(x);
    //                |X| <= 0.5 */
    if (ax <= 0.5) {
    double t = x * x,
        top = (((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4] + 1.,
        bot = ((b[0] * t + b[1]) * t + b[2]) * t + 1.;
    ret_val = 0.5 - x * (top / bot) + 0.5;
    if (ind != 0) {
        ret_val = exp(t) * ret_val;
    }
    return ret_val;
    }
    // else (L10:):        0.5 < |X| <= 4
    if (ax <= 4.) {
    top = ((((((p[0] * ax + p[1]) * ax + p[2]) * ax + p[3]) * ax + p[4]) * ax
        + p[5]) * ax + p[6]) * ax + p[7];
    bot = ((((((q[0] * ax + q[1]) * ax + q[2]) * ax + q[3]) * ax + q[4]) * ax
        + q[5]) * ax + q[6]) * ax + q[7];
    ret_val = top / bot;

    } else { //            |X| > 4
    // L20:
    if (x <= -5.6) {
        // L50:                LIMIT VALUE FOR "LARGE" NEGATIVE X
        ret_val = 2.;
        if (ind != 0) {
        ret_val = exp(x * x) * 2.;
        }
        return ret_val;
    }
    if (ind == 0 && (x > 100. || x * x > -exparg(1))) {
        // LIMIT VALUE FOR LARGE POSITIVE X   WHEN IND = 0
        // L60:
        return 0.;
    }

    // L30:
    t = 1. / (x * x);
    top = (((r[0] * t + r[1]) * t + r[2]) * t + r[3]) * t + r[4];
    bot = (((s[0] * t + s[1]) * t + s[2]) * t + s[3]) * t + 1.;
    ret_val = (c - t * top / bot) / ax;
    }

    // L40:                 FINAL ASSEMBLY
    if (ind != 0) {
    if (x < 0.)
        ret_val = exp(x * x) * 2. - ret_val;
    } else {
    // L41:  ind == 0 :
    w = x * x;
    t = w;
    e = w - t;
    ret_val = (0.5 - e + 0.5) * exp(-t) * ret_val;
    if (x < 0.)
        ret_val = 2. - ret_val;
    }
    return ret_val;

}

// Assembly:
subq $0x28, %rsp
movapd %xmm0, %xmm5
movapd 0x6f6d(%rip), %xmm1     # 0x1fcc0
andpd %xmm0, %xmm1
movsd 0x5481(%rip), %xmm0     # 0x1e1e0
ucomisd %xmm1, %xmm0
jae 0x18e2e
movsd 0x6a4f(%rip), %xmm0     # 0x1f7c0
ucomisd %xmm1, %xmm0
jae 0x18ede
movsd 0x6f2d(%rip), %xmm0     # 0x1fcb0
ucomisd %xmm5, %xmm0
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
jae 0x18f81
movsd 0x587b(%rip), %xmm3     # 0x1e618
movapd %xmm3, %xmm2
divsd %xmm0, %xmm2
movsd 0x6c83(%rip), %xmm0     # 0x1fa30
mulsd %xmm2, %xmm0
addsd 0x6c7f(%rip), %xmm0     # 0x1fa38
mulsd %xmm2, %xmm0
addsd 0x6c7b(%rip), %xmm0     # 0x1fa40
mulsd %xmm2, %xmm0
addsd 0x6c77(%rip), %xmm0     # 0x1fa48
mulsd %xmm2, %xmm0
addsd 0x6c73(%rip), %xmm0     # 0x1fa50
movsd 0x6c73(%rip), %xmm4     # 0x1fa58
mulsd %xmm2, %xmm4
addsd 0x6c6f(%rip), %xmm4     # 0x1fa60
mulsd %xmm2, %xmm4
addsd 0x6c6b(%rip), %xmm4     # 0x1fa68
mulsd %xmm2, %xmm4
addsd 0x6c67(%rip), %xmm4     # 0x1fa70
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
mulsd %xmm2, %xmm0
divsd %xmm4, %xmm0
movsd 0x6c57(%rip), %xmm2     # 0x1fa78
subsd %xmm0, %xmm2
divsd %xmm1, %xmm2
jmp 0x18f5a
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
movapd %xmm0, 0x10(%rsp)
movapd %xmm5, (%rsp)
callq 0x2550
movsd 0x6b22(%rip), %xmm1     # 0x1f970
movapd 0x10(%rsp), %xmm4
mulsd %xmm4, %xmm1
addsd 0x6b18(%rip), %xmm1     # 0x1f978
mulsd %xmm4, %xmm1
addsd 0x6b14(%rip), %xmm1     # 0x1f980
mulsd %xmm4, %xmm1
addsd 0x6b10(%rip), %xmm1     # 0x1f988
mulsd %xmm4, %xmm1
addsd 0x6b0c(%rip), %xmm1     # 0x1f990
movsd 0x578c(%rip), %xmm2     # 0x1e618
movsd 0x6b04(%rip), %xmm3     # 0x1f998
mulsd %xmm4, %xmm3
addsd 0x6b00(%rip), %xmm3     # 0x1f9a0
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm3
addsd 0x6af8(%rip), %xmm3     # 0x1f9a8
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
divsd %xmm3, %xmm1
mulsd (%rsp), %xmm1
movsd 0x5317(%rip), %xmm3     # 0x1e1e0
movapd %xmm3, %xmm2
subsd %xmm1, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm0, %xmm2
jmp 0x18f8e
movsd 0x6aca(%rip), %xmm2     # 0x1f9b0
mulsd %xmm1, %xmm2
addsd 0x6ac6(%rip), %xmm2     # 0x1f9b8
movapd %xmm1, %xmm0
addsd 0x6af2(%rip), %xmm0     # 0x1f9f0
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm1, %xmm2
addpd 0x70be(%rip), %xmm2     # 0x1ffd0
mulpd %xmm1, %xmm2
addpd 0x70c2(%rip), %xmm2     # 0x1ffe0
mulpd %xmm1, %xmm2
addpd 0x70c6(%rip), %xmm2     # 0x1fff0
mulpd %xmm1, %xmm2
addpd 0x70ca(%rip), %xmm2     # 0x20000
mulpd %xmm1, %xmm2
addpd 0x70ce(%rip), %xmm2     # 0x20010
mulpd %xmm1, %xmm2
addpd 0x70d2(%rip), %xmm2     # 0x20020
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
divsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm5, %xmm0
jbe 0x18f8e
mulsd %xmm5, %xmm5
movapd %xmm5, %xmm0
movapd %xmm2, (%rsp)
callq 0x2550
addsd %xmm0, %xmm0
subsd (%rsp), %xmm0
jmp 0x18f92
callq 0x2550
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x28, %rsp
retq
nop