// File: /workspace/github_c_makefile_star2_O3/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 0x66e2(%rip), %xmm1     # 0x23de0
andpd %xmm0, %xmm1
movsd 0x4b0e(%rip), %xmm0     # 0x22218
ucomisd %xmm1, %xmm0
jae 0x1d7d9
movsd 0x626c(%rip), %xmm0     # 0x23988
ucomisd %xmm1, %xmm0
jae 0x1d889
movsd 0x66a2(%rip), %xmm0     # 0x23dd0
ucomisd %xmm5, %xmm0
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
jae 0x1d92c
movsd 0x4f18(%rip), %xmm3     # 0x22660
movapd %xmm3, %xmm2
divsd %xmm0, %xmm2
movsd 0x63a0(%rip), %xmm0     # 0x23af8
mulsd %xmm2, %xmm0
addsd 0x639c(%rip), %xmm0     # 0x23b00
mulsd %xmm2, %xmm0
addsd 0x6398(%rip), %xmm0     # 0x23b08
mulsd %xmm2, %xmm0
addsd 0x6394(%rip), %xmm0     # 0x23b10
mulsd %xmm2, %xmm0
addsd 0x6390(%rip), %xmm0     # 0x23b18
movsd 0x6390(%rip), %xmm4     # 0x23b20
mulsd %xmm2, %xmm4
addsd 0x638c(%rip), %xmm4     # 0x23b28
mulsd %xmm2, %xmm4
addsd 0x6388(%rip), %xmm4     # 0x23b30
mulsd %xmm2, %xmm4
addsd 0x6384(%rip), %xmm4     # 0x23b38
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
mulsd %xmm2, %xmm0
divsd %xmm4, %xmm0
movsd 0x6374(%rip), %xmm2     # 0x23b40
subsd %xmm0, %xmm2
divsd %xmm1, %xmm2
jmp 0x1d905
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
movapd %xmm0, 0x10(%rsp)
movapd %xmm5, (%rsp)
callq 0x2550
movsd 0x623f(%rip), %xmm1     # 0x23a38
movapd 0x10(%rsp), %xmm4
mulsd %xmm4, %xmm1
addsd 0x6235(%rip), %xmm1     # 0x23a40
mulsd %xmm4, %xmm1
addsd 0x6231(%rip), %xmm1     # 0x23a48
mulsd %xmm4, %xmm1
addsd 0x622d(%rip), %xmm1     # 0x23a50
mulsd %xmm4, %xmm1
addsd 0x6229(%rip), %xmm1     # 0x23a58
movsd 0x4e29(%rip), %xmm2     # 0x22660
movsd 0x6221(%rip), %xmm3     # 0x23a60
mulsd %xmm4, %xmm3
addsd 0x621d(%rip), %xmm3     # 0x23a68
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm3
addsd 0x6215(%rip), %xmm3     # 0x23a70
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
divsd %xmm3, %xmm1
mulsd (%rsp), %xmm1
movsd 0x49a4(%rip), %xmm3     # 0x22218
movapd %xmm3, %xmm2
subsd %xmm1, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm0, %xmm2
jmp 0x1d939
movsd 0x61e7(%rip), %xmm2     # 0x23a78
mulsd %xmm1, %xmm2
addsd 0x61e3(%rip), %xmm2     # 0x23a80
movapd %xmm1, %xmm0
addsd 0x620f(%rip), %xmm0     # 0x23ab8
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm1, %xmm2
addpd 0x6843(%rip), %xmm2     # 0x24100
mulpd %xmm1, %xmm2
addpd 0x6847(%rip), %xmm2     # 0x24110
mulpd %xmm1, %xmm2
addpd 0x684b(%rip), %xmm2     # 0x24120
mulpd %xmm1, %xmm2
addpd 0x684f(%rip), %xmm2     # 0x24130
mulpd %xmm1, %xmm2
addpd 0x6853(%rip), %xmm2     # 0x24140
mulpd %xmm1, %xmm2
addpd 0x6857(%rip), %xmm2     # 0x24150
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
divsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm5, %xmm0
jbe 0x1d939
mulsd %xmm5, %xmm5
movapd %xmm5, %xmm0
movapd %xmm2, (%rsp)
callq 0x2550
addsd %xmm0, %xmm0
subsd (%rsp), %xmm0
jmp 0x1d93d
callq 0x2550
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x28, %rsp
retq
nop