#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 */
double fabs(double);
double zcdf(double z) {
  double w;
  double x;
  double y;
  double result;
  if (z == 0.0)
    return 0.5;
  y = fabs(z) / 2.0;
  if (y >= 3.0)
    return 0.0;
  if (y < 1.0) {
    w = y * y;
    x = 0.000124818987;
    x = x * w - 0.001075204047;
    x = x * w + 0.005198775019;
    x = x * w - 0.019198292004;
    x = x * w + 0.059054035642;
    x = x * w - 0.151968751364;
    x = x * w + 0.319152932694;
    x = x * w - 0.531923007300;
    x = x * w + 0.797884560593;
    x = x * 2.0 * y;
  } else {
    y -= 2.0;
    x = -0.000045255659;
    x = x * y + 0.000152529290;
    x = x * y - 0.000019538132;
    x = x * y - 0.000676904986;
    x = x * y + 0.001390604284;
    x = x * y - 0.000794620820;
    x = x * y - 0.002034254874;
    x = x * y + 0.006549791214;
    x = x * y - 0.010557625006;
    x = x * y + 0.011630447319;
    x = x * y - 0.009279453341;
    x = x * y + 0.005353579108;
    x = x * y - 0.002141268741;
    x = x * y + 0.000535310849;
    x = x * y + 0.999936657524;
  }
  if (z > 0.0) {
    result = (x / 2.0) + 0.5;
  } else {
    result = (0.5 - (x / 2.0));
  }
  return result;
}


x86 assembly (clang, -O0):
<zcdf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1133 <zcdf+0x33>
jp     1133 <zcdf+0x33>
movsd  0xfaf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f5 <zcdf+0x3f5>
movsd  -0x10(%rbp),%xmm0
movaps 0xfa1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1178 <zcdf+0x78>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f5 <zcdf+0x3f5>
movsd  0xe90(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    12bb <zcdf+0x1bb>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xf2e(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xf0b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee4(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe96(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe48(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe21(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfa(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xd61(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1490 <zcdf+0x390>
movsd  -0x28(%rbp),%xmm0
movsd  0xd40(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdaf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd65(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd3e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd17(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcf0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcc9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xca2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc7b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc54(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc2d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc06(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbdf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbb8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb91(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14c9 <zcdf+0x3c9>
movsd  -0x20(%rbp),%xmm0
movsd  0xb59(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc1d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14eb <zcdf+0x3eb>
movsd  -0x20(%rbp),%xmm1
movsd  0xb32(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xbf6(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<zcdf>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1115 <zcdf+0x15>
jp     1115 <zcdf+0x15>
movsd  0xeec(%rip),%xmm0
ret
movapd 0xfc3(%rip),%xmm3
andpd  %xmm0,%xmm3
mulsd  0xed7(%rip),%xmm3
ucomisd 0xed7(%rip),%xmm3
jae    12ab <zcdf+0x1ab>
movsd  0xed1(%rip),%xmm1
ucomisd %xmm3,%xmm1
jbe    11c2 <zcdf+0xc2>
movapd %xmm3,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xf43(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf3f(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf3b(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf37(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf33(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf2f(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf2b(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf27(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xf23(%rip),%xmm2
addsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm2
jmp    127a <zcdf+0x17a>
addsd  0xe4e(%rip),%xmm3
movsd  0xe4e(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe4a(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe46(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe42(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe3e(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe3a(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe36(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe32(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe2e(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe2a(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe26(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe22(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe1e(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe1a(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe16(%rip),%xmm2
movsd  0xd7e(%rip),%xmm3
mulsd  %xmm3,%xmm2
movapd 0xe62(%rip),%xmm4
xorpd  %xmm2,%xmm4
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm4,%xmm1
orpd   %xmm2,%xmm1
addsd  %xmm3,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @zcdf(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
%8 = load double, double* %3
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %1
store double 5.000000e-01, double* %2
br label %111
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @llvm.fabs.f64(double %12)
%14 = fdiv double %13, 2.000000e+00
store double %14, double* %6
%15 = load double, double* %6
%16 = fcmp oge double %15, 3.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %11
store double 0.000000e+00, double* %2
br label %111
18: ; preds = %11
%19 = load double, double* %6
%20 = fcmp olt double %19, 1.000000e+00
br i1 %20, label %21, label %53
21: ; preds = %18
%22 = load double, double* %6
%23 = load double, double* %6
%24 = fmul double %22, %23
store double %24, double* %4
store double 0x3F205C3AEF25BECF, double* %5
%25 = load double, double* %5
%26 = load double, double* %4
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double 0xBF519DBB8DFA21CC)
store double %27, double* %5
%28 = load double, double* %5
%29 = load double, double* %4
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double 0x3F754B4F8AF94F71)
store double %30, double* %5
%31 = load double, double* %5
%32 = load double, double* %4
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double 0xBF93A8B7912F5918)
store double %33, double* %5
%34 = load double, double* %5
%35 = load double, double* %4
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double 0x3FAE3C549F8EF466)
store double %36, double* %5
%37 = load double, double* %5
%38 = load double, double* %4
%39 = call double @llvm.fmuladd.f64(double %37, double %38, double 0xBFC373B6488FA8B0)
store double %39, double* %5
%40 = load double, double* %5
%41 = load double, double* %4
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double 0x3FD46D006C15F74E)
store double %42, double* %5
%43 = load double, double* %5
%44 = load double, double* %4
%45 = call double @llvm.fmuladd.f64(double %43, double %44, double 0xBFE10583660AFDB3)
store double %45, double* %5
%46 = load double, double* %5
%47 = load double, double* %4
%48 = call double @llvm.fmuladd.f64(double %46, double %47, double 0x3FE9884533B75E55)
store double %48, double* %5
%49 = load double, double* %5
%50 = fmul double %49, 2.000000e+00
%51 = load double, double* %6
%52 = fmul double %50, %51
store double %52, double* %5
br label %98
53: ; preds = %18
%54 = load double, double* %6
%55 = fsub double %54, 2.000000e+00
store double %55, double* %6
store double 0xBF07BA1C9A586733, double* %5
%56 = load double, double* %5
%57 = load double, double* %6
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double 0x3F23FE089FDCE2C3)
store double %58, double* %5
%59 = load double, double* %5
%60 = load double, double* %6
%61 = call double @llvm.fmuladd.f64(double %59, double %60, double 0xBEF47CBA351AB72F)
store double %61, double* %5
%62 = load double, double* %5
%63 = load double, double* %6
%64 = call double @llvm.fmuladd.f64(double %62, double %63, double 0xBF462E4A6380D6A6)
store double %64, double* %5
%65 = load double, double* %5
%66 = load double, double* %6
%67 = call double @llvm.fmuladd.f64(double %65, double %66, double 0x3F56C89DFAF928DD)
store double %67, double* %5
%68 = load double, double* %5
%69 = load double, double* %6
%70 = call double @llvm.fmuladd.f64(double %68, double %69, double 0xBF4A09C337A1A6B4)
store double %70, double* %5
%71 = load double, double* %5
%72 = load double, double* %6
%73 = call double @llvm.fmuladd.f64(double %71, double %72, double 0xBF60AA2444FA5608)
store double %73, double* %5
%74 = load double, double* %5
%75 = load double, double* %6
%76 = call double @llvm.fmuladd.f64(double %74, double %75, double 0x3F7AD3F430F4C4F3)
store double %76, double* %5
%77 = load double, double* %5
%78 = load double, double* %6
%79 = call double @llvm.fmuladd.f64(double %77, double %78, double 0xBF859F3C70FE5D84)
store double %79, double* %5
%80 = load double, double* %5
%81 = load double, double* %6
%82 = call double @llvm.fmuladd.f64(double %80, double %81, double 0x3F87D1B436FBD04B)
store double %82, double* %5
%83 = load double, double* %5
%84 = load double, double* %6
%85 = call double @llvm.fmuladd.f64(double %83, double %84, double 0xBF83011B24FEACC1)
store double %85, double* %5
%86 = load double, double* %5
%87 = load double, double* %6
%88 = call double @llvm.fmuladd.f64(double %86, double %87, double 0x3F75EDA272F76F46)
store double %88, double* %5
%89 = load double, double* %5
%90 = load double, double* %6
%91 = call double @llvm.fmuladd.f64(double %89, double %90, double 0xBF618A90E6DD8762)
store double %91, double* %5
%92 = load double, double* %5
%93 = load double, double* %6
%94 = call double @llvm.fmuladd.f64(double %92, double %93, double 0x3F418A834B799E45)
store double %94, double* %5
%95 = load double, double* %5
%96 = load double, double* %6
%97 = call double @llvm.fmuladd.f64(double %95, double %96, double 0x3FEFFF7B29446363)
store double %97, double* %5
br label %98
98: ; preds = %53, %21
%99 = load double, double* %3
%100 = fcmp ogt double %99, 0.000000e+00
br i1 %100, label %101, label %105
101: ; preds = %98
%102 = load double, double* %5
%103 = fdiv double %102, 2.000000e+00
%104 = fadd double %103, 5.000000e-01
store double %104, double* %7
br label %109
105: ; preds = %98
%106 = load double, double* %5
%107 = fdiv double %106, 2.000000e+00
%108 = fsub double 5.000000e-01, %107
store double %108, double* %7
br label %109
109: ; preds = %105, %101
%110 = load double, double* %7
store double %110, double* %2
br label %111
111: ; preds = %109, %17, %10
%112 = load double, double* %2
ret double %112
}

LLVM IR (-O2):
define double @zcdf(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %44, label %3
3: ; preds = %1
%4 = tail call double @llvm.fabs.f64(double %0)
%5 = fmul double %4, 5.000000e-01
%6 = fcmp ult double %5, 3.000000e+00
br i1 %6, label %7, label %44
7: ; preds = %3
%8 = fcmp olt double %5, 1.000000e+00
br i1 %8, label %9, label %21
9: ; preds = %7
%10 = fmul double %5, %5
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0x3F205C3AEF25BECF, double 0xBF519DBB8DFA21CC)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %10, double 0x3F754B4F8AF94F71)
%13 = tail call double @llvm.fmuladd.f64(double %12, double %10, double 0xBF93A8B7912F5918)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %10, double 0x3FAE3C549F8EF466)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %10, double 0xBFC373B6488FA8B0)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %10, double 0x3FD46D006C15F74E)
%17 = tail call double @llvm.fmuladd.f64(double %16, double %10, double 0xBFE10583660AFDB3)
%18 = tail call double @llvm.fmuladd.f64(double %17, double %10, double 0x3FE9884533B75E55)
%19 = fmul double %18, 2.000000e+00
%20 = fmul double %5, %19
br label %37
21: ; preds = %7
%22 = fadd double %5, -2.000000e+00
%23 = tail call double @llvm.fmuladd.f64(double %22, double 0xBF07BA1C9A586733, double 0x3F23FE089FDCE2C3)
%24 = tail call double @llvm.fmuladd.f64(double %23, double %22, double 0xBEF47CBA351AB72F)
%25 = tail call double @llvm.fmuladd.f64(double %24, double %22, double 0xBF462E4A6380D6A6)
%26 = tail call double @llvm.fmuladd.f64(double %25, double %22, double 0x3F56C89DFAF928DD)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %22, double 0xBF4A09C337A1A6B4)
%28 = tail call double @llvm.fmuladd.f64(double %27, double %22, double 0xBF60AA2444FA5608)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %22, double 0x3F7AD3F430F4C4F3)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %22, double 0xBF859F3C70FE5D84)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %22, double 0x3F87D1B436FBD04B)
%32 = tail call double @llvm.fmuladd.f64(double %31, double %22, double 0xBF83011B24FEACC1)
%33 = tail call double @llvm.fmuladd.f64(double %32, double %22, double 0x3F75EDA272F76F46)
%34 = tail call double @llvm.fmuladd.f64(double %33, double %22, double 0xBF618A90E6DD8762)
%35 = tail call double @llvm.fmuladd.f64(double %34, double %22, double 0x3F418A834B799E45)
%36 = tail call double @llvm.fmuladd.f64(double %35, double %22, double 0x3FEFFF7B29446363)
br label %37
37: ; preds = %21, %9
%38 = phi double [ %20, %9 ], [ %36, %21 ]
%39 = fcmp ogt double %0, 0.000000e+00
%40 = fmul double %38, 5.000000e-01
%41 = fneg double %40
%42 = select i1 %39, double %40, double %41
%43 = fadd double %42, 5.000000e-01
br label %44
44: ; preds = %3, %1, %37
%45 = phi double [ %43, %37 ], [ 5.000000e-01, %1 ], [ 0.000000e+00, %3 ]
ret double %45
}