#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 exp(double);
double pow(double, int);
double CDF(double value) {
  float b0;
  float b1 = 0.319381530;
  float b2 = -0.356563782;
  float b3 = 1.781477937;
  float b4 = -1.821255978;
  float b5 = 1.330274429;
  if (value >= 0) {
    b0 = 1 / (1 + 0.2316419 * value);
    value = 1 - 0.39894228 * exp(-0.5 * pow(value, 2)) * b0 *
                    (b0 * (b0 * (b0 * (b0 * b5 + b4) + b3) + b2) + b1);
  } else {
    b0 = 1 / (1 - 0.2316419 * value);
    value = 0.39894228 * exp(-0.5 * pow(value, 2)) * b0 *
            (b0 * (b0 * (b0 * (b0 * b5 + b4) + b3) + b2) + b1);
  }
  return value;
}


x86 assembly (clang, -O0):
<CDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeca(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xea8(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe97(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1273 <CDF+0x153>
movsd  -0x8(%rbp),%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe54(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe38(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm3
movss  -0xc(%rbp),%xmm4
movss  -0xc(%rbp),%xmm5
movss  -0x20(%rbp),%xmm6
movss  -0x1c(%rbp),%xmm2
mulss  %xmm6,%xmm5
addss  %xmm2,%xmm5
movss  -0x18(%rbp),%xmm2
mulss  %xmm5,%xmm4
addss  %xmm2,%xmm4
movss  -0x14(%rbp),%xmm2
mulss  %xmm4,%xmm3
addss  %xmm2,%xmm3
movss  -0x10(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdc3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    133e <CDF+0x21e>
movsd  -0x8(%rbp),%xmm1
movsd  0xdb0(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd9c(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd90(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd61(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xd45(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm3
movss  -0xc(%rbp),%xmm4
movss  -0xc(%rbp),%xmm5
movss  -0x20(%rbp),%xmm6
movss  -0x1c(%rbp),%xmm2
mulss  %xmm6,%xmm5
addss  %xmm2,%xmm5
movss  -0x18(%rbp),%xmm2
mulss  %xmm5,%xmm4
addss  %xmm2,%xmm4
movss  -0x14(%rbp),%xmm2
mulss  %xmm4,%xmm3
addss  %xmm2,%xmm3
movss  -0x10(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDF>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    11cd <CDF+0xad>
movsd  0xee9(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xec5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0xea6(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xeb1(%rip),%xmm0
movss  0x4(%rsp),%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
movss  0xea4(%rip),%xmm2
mulss  %xmm3,%xmm2
addss  0xe9c(%rip),%xmm2
mulsd  %xmm1,%xmm0
mulss  %xmm3,%xmm2
addss  0xe90(%rip),%xmm2
mulss  %xmm3,%xmm2
addss  0xe88(%rip),%xmm2
mulss  %xmm3,%xmm2
addss  0xe80(%rip),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xe2b(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe27(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0xe08(%rip),%xmm0
call   1030 <exp@plt>
movss  0xe1b(%rip),%xmm1
movss  0x4(%rsp),%xmm3
mulss  %xmm3,%xmm1
addss  0xe0d(%rip),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
mulss  %xmm3,%xmm1
addss  0xdfe(%rip),%xmm1
mulss  %xmm3,%xmm1
addss  0xdf6(%rip),%xmm1
mulss  %xmm3,%xmm1
addss  0xdee(%rip),%xmm1
mulsd  0xdbe(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xd9a(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @CDF(double %0) {
%2 = alloca double
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store double %0, double* %2
store float 0x3FD470BF40000000, float* %4
store float 0xBFD6D1F0E0000000, float* %5
store float 0x3FFC80EF00000000, float* %6
store float 0xBFFD23DD40000000, float* %7
store float 0x3FF548CDE0000000, float* %8
%9 = load double, double* %2
%10 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %11, label %40
11: ; preds = %1
%12 = load double, double* %2
%13 = call double @llvm.fmuladd.f64(double 0x3FCDA6711871100E, double %12, double 1.000000e+00)
%14 = fdiv double 1.000000e+00, %13
%15 = fptrunc double %14 to float
store float %15, float* %3
%16 = load double, double* %2
%17 = call double @pow(double %16, i32 2)
%18 = fmul double -5.000000e-01, %17
%19 = call double @exp(double %18)
%20 = fmul double 0x3FD988453365DE00, %19
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = fmul double %20, %22
%24 = load float, float* %3
%25 = load float, float* %3
%26 = load float, float* %3
%27 = load float, float* %3
%28 = load float, float* %8
%29 = load float, float* %7
%30 = call float @llvm.fmuladd.f32(float %27, float %28, float %29)
%31 = load float, float* %6
%32 = call float @llvm.fmuladd.f32(float %26, float %30, float %31)
%33 = load float, float* %5
%34 = call float @llvm.fmuladd.f32(float %25, float %32, float %33)
%35 = load float, float* %4
%36 = call float @llvm.fmuladd.f32(float %24, float %34, float %35)
%37 = fpext float %36 to double
%38 = fneg double %23
%39 = call double @llvm.fmuladd.f64(double %38, double %37, double 1.000000e+00)
store double %39, double* %2
br label %68
40: ; preds = %1
%41 = load double, double* %2
%42 = call double @llvm.fmuladd.f64(double 0xBFCDA6711871100E, double %41, double 1.000000e+00)
%43 = fdiv double 1.000000e+00, %42
%44 = fptrunc double %43 to float
store float %44, float* %3
%45 = load double, double* %2
%46 = call double @pow(double %45, i32 2)
%47 = fmul double -5.000000e-01, %46
%48 = call double @exp(double %47)
%49 = fmul double 0x3FD988453365DE00, %48
%50 = load float, float* %3
%51 = fpext float %50 to double
%52 = fmul double %49, %51
%53 = load float, float* %3
%54 = load float, float* %3
%55 = load float, float* %3
%56 = load float, float* %3
%57 = load float, float* %8
%58 = load float, float* %7
%59 = call float @llvm.fmuladd.f32(float %56, float %57, float %58)
%60 = load float, float* %6
%61 = call float @llvm.fmuladd.f32(float %55, float %59, float %60)
%62 = load float, float* %5
%63 = call float @llvm.fmuladd.f32(float %54, float %61, float %62)
%64 = load float, float* %4
%65 = call float @llvm.fmuladd.f32(float %53, float %63, float %64)
%66 = fpext float %65 to double
%67 = fmul double %52, %66
store double %67, double* %2
br label %68
68: ; preds = %40, %11
%69 = load double, double* %2
ret double %69
}

LLVM IR (-O2):
define double @CDF(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FCDA6711871100E, double 1.000000e+00)
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
%7 = tail call double @pow(double %0, i32 2)
%8 = fmul double %7, -5.000000e-01
%9 = tail call double @exp(double %8)
%10 = fpext float %6 to double
%11 = tail call float @llvm.fmuladd.f32(float %6, float 0x3FF548CDE0000000, float 0xBFFD23DD40000000)
%12 = tail call float @llvm.fmuladd.f32(float %6, float %11, float 0x3FFC80EF00000000)
%13 = tail call float @llvm.fmuladd.f32(float %6, float %12, float 0xBFD6D1F0E0000000)
%14 = tail call float @llvm.fmuladd.f32(float %6, float %13, float 0x3FD470BF40000000)
%15 = fpext float %14 to double
%16 = fmul double %9, 0xBFD988453365DE00
%17 = fmul double %16, %10
%18 = tail call double @llvm.fmuladd.f64(double %17, double %15, double 1.000000e+00)
br label %35
19: ; preds = %1
%20 = tail call double @llvm.fmuladd.f64(double %0, double 0xBFCDA6711871100E, double 1.000000e+00)
%21 = fdiv double 1.000000e+00, %20
%22 = fptrunc double %21 to float
%23 = tail call double @pow(double %0, i32 2)
%24 = fmul double %23, -5.000000e-01
%25 = tail call double @exp(double %24)
%26 = fmul double %25, 0x3FD988453365DE00
%27 = fpext float %22 to double
%28 = fmul double %26, %27
%29 = tail call float @llvm.fmuladd.f32(float %22, float 0x3FF548CDE0000000, float 0xBFFD23DD40000000)
%30 = tail call float @llvm.fmuladd.f32(float %22, float %29, float 0x3FFC80EF00000000)
%31 = tail call float @llvm.fmuladd.f32(float %22, float %30, float 0xBFD6D1F0E0000000)
%32 = tail call float @llvm.fmuladd.f32(float %22, float %31, float 0x3FD470BF40000000)
%33 = fpext float %32 to double
%34 = fmul double %28, %33
br label %35
35: ; preds = %19, %3
%36 = phi double [ %18, %3 ], [ %34, %19 ]
ret double %36
}