#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int M_SQRT2;
double exp(double);
int fabs(double);
double kf_erfc(double x) {
  const double p0 = 220.2068679123761;
  const double p1 = 221.2135961699311;
  const double p2 = 112.0792914978709;
  const double p3 = 33.912866078383;
  const double p4 = 6.37396220353165;
  const double p5 = .7003830644436881;
  const double p6 = .03526249659989109;
  const double q0 = 440.4137358247522;
  const double q1 = 793.8265125199484;
  const double q2 = 637.3336333788311;
  const double q3 = 296.5642487796737;
  const double q4 = 86.78073220294608;
  const double q5 = 16.06417757920695;
  const double q6 = 1.755667163182642;
  const double q7 = .08838834764831844;
  double expntl, z, p;
  z = fabs(x) * M_SQRT2;
  if (z > 37.)
    return x > 0. ? 0. : 2.;
  expntl = exp(z * z * -.5);
  if (z < 10. / M_SQRT2)
    p = expntl *
        ((((((p6 * z + p5) * z + p4) * z + p3) * z + p2) * z + p1) * z + p0) /
        (((((((q7 * z + q6) * z + q5) * z + q4) * z + q3) * z + q2) * z + q1) *
             z +
         q0);
  else
    p = expntl / 2.506628274631001 /
        (z + 1. / (z + 2. / (z + 3. / (z + 4. / (z + .65)))));
  return x > 0. ? 2. * p : 2. * (1. - p);
}


x86 assembly (clang, -O0):
<kf_erfc>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xf40(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xf2b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xf16(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xf01(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xed7(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe59(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe2f(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe1a(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2dd9(%rip),%rcx
imul   (%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xdda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1261 <kf_erfc+0x141>
movsd  -0x10(%rbp),%xmm1
xorps  %xmm3,%xmm3
movsd  0xe58(%rip),%xmm2
movaps %xmm3,%xmm0
cmpltsd %xmm1,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1508 <kf_erfc+0x3e8>
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  0xe0f(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
mov    0x2d47(%rip),%rax
cvtsi2sdl (%rax),%xmm2
movsd  0xddb(%rip),%xmm0
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1418 <kf_erfc+0x2f8>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  0xd7d(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd79(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xd69(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xd59(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xd49(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xd39(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xd29(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x98(%rbp),%xmm1
ff
movsd  0xca1(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc9d(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xc8d(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xc7d(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xc6d(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xc5d(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xc4d(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xc3d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    14a8 <kf_erfc+0x388>
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xc90(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0x98(%rbp),%xmm4
ff
movsd  -0x98(%rbp),%xmm5
ff
movsd  0xc5c(%rip),%xmm6
addsd  -0x98(%rbp),%xmm6
ff
movsd  0xc44(%rip),%xmm2
divsd  %xmm6,%xmm2
addsd  %xmm2,%xmm5
movsd  0xc2c(%rip),%xmm2
divsd  %xmm5,%xmm2
addsd  %xmm2,%xmm4
movsd  0xc14(%rip),%xmm2
divsd  %xmm4,%xmm2
addsd  %xmm2,%xmm3
movsd  0xbfc(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14d7 <kf_erfc+0x3b7>
movsd  0xbd6(%rip),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    14fb <kf_erfc+0x3db>
movsd  0xbb1(%rip),%xmm1
subsd  -0xa0(%rbp),%xmm1
ff
movsd  0xba9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kf_erfc>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
mov    0x2eaa(%rip),%rbx
imul   (%rbx),%eax
cmp    $0x26,%eax
jl     1159 <kf_erfc+0x39>
xorpd  %xmm0,%xmm0
cmpltsd (%rsp),%xmm0
movsd  0xed8(%rip),%xmm1
andnpd %xmm1,%xmm0
jmp    12e4 <kf_erfc+0x1c4>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm0
mulsd  0xe8e(%rip),%xmm0
call   1040 <exp@plt>
movsd  0x8(%rsp),%xmm3
cvtsi2sdl (%rbx),%xmm1
movsd  0xe7f(%rip),%xmm2
divsd  %xmm1,%xmm2
ucomisd %xmm3,%xmm2
jbe    124d <kf_erfc+0x12d>
movsd  0xe91(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe8d(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe89(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe85(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe81(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe7d(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe79(%rip),%xmm1
movsd  0xe79(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe75(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe71(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe6d(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe69(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe65(%rip),%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm2
addsd  0xe5d(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe59(%rip),%xmm2
divsd  %xmm2,%xmm1
jmp    12b6 <kf_erfc+0x196>
movsd  0xdbb(%rip),%xmm1
addsd  %xmm3,%xmm1
movsd  0xdb7(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
movsd  0xdaf(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  0xda7(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
shufpd $0x2,0xe1e(%rip),%xmm0
movapd 0xe26(%rip),%xmm1
unpcklpd %xmm2,%xmm1
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm3
movsd  0xde5(%rip),%xmm2
subsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
cmpltsd %xmm3,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
addsd  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_SQRT2 = global i32 0
define double @kf_erfc(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
store double %0, double* %3
store double 0x406B869EA974C7E9, double* %4
store double 0x406BA6D5C7A28CF5, double* %5
store double 0x405C05131CA58D35, double* %6
store double 0x4040F4D8CBB02431, double* %7
store double 0x40197EEFF2A86F23, double* %8
store double 0x3FE66989BE8EA720, double* %9
store double 0x3FA20DED0B57FBDD, double* %10
store double 0x407B869EA974C7E9, double* %11
store double 0x4088CE9CB298974E, double* %12
store double 0x4083EAAB47FA1778, double* %13
store double 0x4072890729BA781A, double* %14
store double 0x4055B1F78433A599, double* %15
store double 0x4030106DF11BD48F, double* %16
store double 0x3FFC173673887D1A, double* %17
store double 0x3FB6A09E667F3BCD, double* %18
%22 = load double, double* %3
%23 = call i32 @fabs(double %22)
%24 = load i32, i32* @M_SQRT2
%25 = mul nsw i32 %23, %24
%26 = sitofp i32 %25 to double
store double %26, double* %20
%27 = load double, double* %20
%28 = fcmp ogt double %27, 3.700000e+01
br i1 %28, label %29, label %34
29: ; preds = %1
%30 = load double, double* %3
%31 = fcmp ogt double %30, 0.000000e+00
%32 = zext i1 %31 to i64
%33 = select i1 %31, double 0.000000e+00, double 2.000000e+00
store double %33, double* %2
br label %105
34: ; preds = %1
%35 = load double, double* %20
%36 = load double, double* %20
%37 = fmul double %35, %36
%38 = fmul double %37, -5.000000e-01
%39 = call double @exp(double %38)
store double %39, double* %19
%40 = load double, double* %20
%41 = load i32, i32* @M_SQRT2
%42 = sitofp i32 %41 to double
%43 = fdiv double 1.000000e+01, %42
%44 = fcmp olt double %40, %43
br i1 %44, label %45, label %75
45: ; preds = %34
%46 = load double, double* %19
%47 = load double, double* %20
%48 = call double @llvm.fmuladd.f64(double 0x3FA20DED0B57FBDD, double %47, double 0x3FE66989BE8EA720)
%49 = load double, double* %20
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double 0x40197EEFF2A86F23)
%51 = load double, double* %20
%52 = call double @llvm.fmuladd.f64(double %50, double %51, double 0x4040F4D8CBB02431)
%53 = load double, double* %20
%54 = call double @llvm.fmuladd.f64(double %52, double %53, double 0x405C05131CA58D35)
%55 = load double, double* %20
%56 = call double @llvm.fmuladd.f64(double %54, double %55, double 0x406BA6D5C7A28CF5)
%57 = load double, double* %20
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double 0x406B869EA974C7E9)
%59 = fmul double %46, %58
%60 = load double, double* %20
%61 = call double @llvm.fmuladd.f64(double 0x3FB6A09E667F3BCD, double %60, double 0x3FFC173673887D1A)
%62 = load double, double* %20
%63 = call double @llvm.fmuladd.f64(double %61, double %62, double 0x4030106DF11BD48F)
%64 = load double, double* %20
%65 = call double @llvm.fmuladd.f64(double %63, double %64, double 0x4055B1F78433A599)
%66 = load double, double* %20
%67 = call double @llvm.fmuladd.f64(double %65, double %66, double 0x4072890729BA781A)
%68 = load double, double* %20
%69 = call double @llvm.fmuladd.f64(double %67, double %68, double 0x4083EAAB47FA1778)
%70 = load double, double* %20
%71 = call double @llvm.fmuladd.f64(double %69, double %70, double 0x4088CE9CB298974E)
%72 = load double, double* %20
%73 = call double @llvm.fmuladd.f64(double %71, double %72, double 0x407B869EA974C7E9)
%74 = fdiv double %59, %73
store double %74, double* %21
br label %93
75: ; preds = %34
%76 = load double, double* %19
%77 = fdiv double %76, 0x40040D931FF62707
%78 = load double, double* %20
%79 = load double, double* %20
%80 = load double, double* %20
%81 = load double, double* %20
%82 = load double, double* %20
%83 = fadd double %82, 6.500000e-01
%84 = fdiv double 4.000000e+00, %83
%85 = fadd double %81, %84
%86 = fdiv double 3.000000e+00, %85
%87 = fadd double %80, %86
%88 = fdiv double 2.000000e+00, %87
%89 = fadd double %79, %88
%90 = fdiv double 1.000000e+00, %89
%91 = fadd double %78, %90
%92 = fdiv double %77, %91
store double %92, double* %21
br label %93
93: ; preds = %75, %45
%94 = load double, double* %3
%95 = fcmp ogt double %94, 0.000000e+00
br i1 %95, label %96, label %99
96: ; preds = %93
%97 = load double, double* %21
%98 = fmul double 2.000000e+00, %97
br label %103
99: ; preds = %93
%100 = load double, double* %21
%101 = fsub double 1.000000e+00, %100
%102 = fmul double 2.000000e+00, %101
br label %103
103: ; preds = %99, %96
%104 = phi double [ %98, %96 ], [ %102, %99 ]
store double %104, double* %2
br label %105
105: ; preds = %103, %29
%106 = load double, double* %2
ret double %106
}

LLVM IR (-O2):
@M_SQRT2 = global i32 0
define double @kf_erfc(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = load i32, i32* @M_SQRT2
%4 = mul nsw i32 %3, %2
%5 = sitofp i32 %4 to double
%6 = icmp sgt i32 %4, 37
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = fcmp ogt double %0, 0.000000e+00
%9 = select i1 %8, double 0.000000e+00, double 2.000000e+00
br label %55
10: ; preds = %1
%11 = fmul double %5, %5
%12 = fmul double %11, -5.000000e-01
%13 = tail call double @exp(double %12)
%14 = load i32, i32* @M_SQRT2
%15 = sitofp i32 %14 to double
%16 = fdiv double 1.000000e+01, %15
%17 = fcmp ogt double %16, %5
br i1 %17, label %18, label %34
18: ; preds = %10
%19 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FA20DED0B57FBDD, double 0x3FE66989BE8EA720)
%20 = tail call double @llvm.fmuladd.f64(double %19, double %5, double 0x40197EEFF2A86F23)
%21 = tail call double @llvm.fmuladd.f64(double %20, double %5, double 0x4040F4D8CBB02431)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %5, double 0x405C05131CA58D35)
%23 = tail call double @llvm.fmuladd.f64(double %22, double %5, double 0x406BA6D5C7A28CF5)
%24 = tail call double @llvm.fmuladd.f64(double %23, double %5, double 0x406B869EA974C7E9)
%25 = fmul double %24, %13
%26 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FB6A09E667F3BCD, double 0x3FFC173673887D1A)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %5, double 0x4030106DF11BD48F)
%28 = tail call double @llvm.fmuladd.f64(double %27, double %5, double 0x4055B1F78433A599)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %5, double 0x4072890729BA781A)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %5, double 0x4083EAAB47FA1778)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %5, double 0x4088CE9CB298974E)
%32 = tail call double @llvm.fmuladd.f64(double %31, double %5, double 0x407B869EA974C7E9)
%33 = fdiv double %25, %32
br label %49
34: ; preds = %10
%35 = fadd double %5, 6.500000e-01
%36 = fdiv double 4.000000e+00, %35
%37 = fadd double %36, %5
%38 = fdiv double 3.000000e+00, %37
%39 = fadd double %38, %5
%40 = fdiv double 2.000000e+00, %39
%41 = fadd double %40, %5
%42 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %13, i64 0
%43 = insertelement <2 x double> <double 0x40040D931FF62707, double poison>, double %41, i64 1
%44 = fdiv <2 x double> %42, %43
%45 = extractelement <2 x double> %44, i64 1
%46 = fadd double %45, %5
%47 = extractelement <2 x double> %44, i64 0
%48 = fdiv double %47, %46
br label %49
49: ; preds = %34, %18
%50 = phi double [ %33, %18 ], [ %48, %34 ]
%51 = fcmp ogt double %0, 0.000000e+00
%52 = fsub double 1.000000e+00, %50
%53 = select i1 %51, double %50, double %52
%54 = fmul double %53, 2.000000e+00
br label %55
55: ; preds = %49, %7
%56 = phi double [ %9, %7 ], [ %54, %49 ]
ret double %56
}