#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 CDFNormal(double x) {
  int invers = 0;
  double p, t = 1.28, y = x * x / 2;
  if (x < 0) {
    invers = 1;
    x = -x;
  }
  if (x < t)
    p = .5 - x * (.398942280444 -
                  .399903438504 * y /
                      (y + 5.75885480458 -
                       29.8213557808 / (y + 2.62433121679 +
                                        48.6959930692 / (y + 5.92885724438))));
  else {
    p = 0.398942280385 * exp(-y) /
        (x - 3.8052e-8 +
         1.00000615302 /
             (x + 3.98064794e-4 +
              1.98615381364 /
                  (x - 0.151679116635 +
                   5.29330324926 /
                       (x + 4.8385912808 -
                        15.1508972451 /
                            (x + 0.742380924027 +
                             30.789933034 / (x + 3.99019417011))))));
  }
  return (invers ? p : 1 - p);
}


x86 assembly (clang, -O0):
<CDFNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1182 <CDFNormal+0x72>
movl   $0x1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1230 <CDFNormal+0x120>
movsd  -0x8(%rbp),%xmm0
movsd  0xf05(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
movsd  0xef0(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  0xedb(%rip),%xmm4
addsd  -0x28(%rbp),%xmm4
movsd  0xec6(%rip),%xmm5
addsd  -0x28(%rbp),%xmm5
movsd  0xeb1(%rip),%xmm3
divsd  %xmm5,%xmm3
addsd  %xmm3,%xmm4
movsd  0xe99(%rip),%xmm3
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xe7d(%rip),%xmm1
subsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe4e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    130f <CDFNormal+0x1ff>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe0c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xdf3(%rip),%xmm2
subsd  %xmm2,%xmm1
movsd  0xddf(%rip),%xmm3
addsd  -0x8(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm4
movsd  0xdc5(%rip),%xmm2
subsd  %xmm2,%xmm4
movsd  0xdb1(%rip),%xmm5
addsd  -0x8(%rbp),%xmm5
movsd  0xd9c(%rip),%xmm6
addsd  -0x8(%rbp),%xmm6
movsd  0xd87(%rip),%xmm7
addsd  -0x8(%rbp),%xmm7
movsd  0xd72(%rip),%xmm2
divsd  %xmm7,%xmm2
addsd  %xmm2,%xmm6
movsd  0xd5a(%rip),%xmm2
divsd  %xmm6,%xmm2
subsd  %xmm2,%xmm5
movsd  0xd42(%rip),%xmm2
divsd  %xmm5,%xmm2
addsd  %xmm2,%xmm4
movsd  0xd2a(%rip),%xmm2
divsd  %xmm4,%xmm2
addsd  %xmm2,%xmm3
movsd  0xd12(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1328 <CDFNormal+0x218>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    133a <CDFNormal+0x22a>
movsd  0xd80(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDFNormal>:
sub    $0x28,%rsp
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm0
mulsd  0xedc(%rip),%xmm0
movapd 0xf84(%rip),%xmm1
xorpd  %xmm5,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm5,%xmm6
cmpltsd %xmm2,%xmm6
andpd  %xmm6,%xmm1
andnpd %xmm5,%xmm6
orpd   %xmm1,%xmm6
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm6,%xmm1
jbe    11c4 <CDFNormal+0xb4>
movsd  0xf11(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xf0d(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0xf09(%rip),%xmm3
addsd  %xmm0,%xmm3
addsd  0xf05(%rip),%xmm0
movsd  0xf05(%rip),%xmm4
divsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0xefd(%rip),%xmm0
divsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
addsd  0xef1(%rip),%xmm1
mulsd  %xmm6,%xmm1
movsd  0xe45(%rip),%xmm0
subsd  %xmm1,%xmm0
jmp    128f <CDFNormal+0x17f>
xorpd  0xee4(%rip),%xmm0
movapd %xmm5,0x10(%rsp)
movapd %xmm6,(%rsp)
call   1030 <exp@plt>
mulsd  0xe2c(%rip),%xmm0
movsd  0xe2c(%rip),%xmm1
movapd (%rsp),%xmm6
addsd  %xmm6,%xmm1
movsd  0xe23(%rip),%xmm2
addsd  %xmm6,%xmm2
movsd  0xe1f(%rip),%xmm3
addsd  %xmm6,%xmm3
movsd  0xe1b(%rip),%xmm4
addsd  %xmm6,%xmm4
movsd  0xe17(%rip),%xmm5
addsd  %xmm6,%xmm5
movapd %xmm6,%xmm7
movsd  0xe0f(%rip),%xmm6
addsd  %xmm7,%xmm6
movsd  0xe0b(%rip),%xmm7
divsd  %xmm6,%xmm7
addsd  %xmm5,%xmm7
movsd  0xe03(%rip),%xmm5
divsd  %xmm7,%xmm5
addsd  %xmm4,%xmm5
movsd  0xdfb(%rip),%xmm4
divsd  %xmm5,%xmm4
movapd 0x10(%rsp),%xmm5
addsd  %xmm3,%xmm4
movsd  0xded(%rip),%xmm3
divsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  0xde5(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movsd  0xe11(%rip),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm5
movapd %xmm5,%xmm2
andnpd %xmm1,%xmm2
andpd  %xmm0,%xmm5
orpd   %xmm2,%xmm5
movapd %xmm5,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @CDFNormal(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
store i32 0, i32* %3
store double 1.280000e+00, double* %5
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fdiv double %9, 2.000000e+00
store double %10, double* %6
%11 = load double, double* %2
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %1
store i32 1, i32* %3
%14 = load double, double* %2
%15 = fneg double %14
store double %15, double* %2
br label %16
16: ; preds = %13, %1
%17 = load double, double* %2
%18 = load double, double* %5
%19 = fcmp olt double %17, %18
br i1 %19, label %20, label %38
20: ; preds = %16
%21 = load double, double* %2
%22 = load double, double* %6
%23 = fmul double 0x3FD99804977BB02A, %22
%24 = load double, double* %6
%25 = fadd double %24, 0x401709113BE05594
%26 = load double, double* %6
%27 = fadd double %26, 0x4004FEA15D6FE126
%28 = load double, double* %6
%29 = fadd double %28, 0x4017B7265A7D0F22
%30 = fdiv double 0x404859164D073A74, %29
%31 = fadd double %27, %30
%32 = fdiv double 0x403DD2445F58EAA3, %31
%33 = fsub double %25, %32
%34 = fdiv double %23, %33
%35 = fsub double 0x3FD9884533DFE9B9, %34
%36 = fneg double %21
%37 = call double @llvm.fmuladd.f64(double %36, double %35, double 5.000000e-01)
store double %37, double* %4
br label %66
38: ; preds = %16
%39 = load double, double* %6
%40 = fneg double %39
%41 = call double @exp(double %40)
%42 = fmul double 0x3FD9884533CFB1F8, %41
%43 = load double, double* %2
%44 = fsub double %43, 3.805200e-08
%45 = load double, double* %2
%46 = fadd double %45, 0x3F3A166B459C7B69
%47 = load double, double* %2
%48 = fsub double %47, 0x3FC36A38A6B77CC0
%49 = load double, double* %2
%50 = fadd double %49, 0x40135AB7AC36FCAD
%51 = load double, double* %2
%52 = fadd double %51, 0x3FE7C195A3BBD8E3
%53 = load double, double* %2
%54 = fadd double %53, 0x400FEBEAEBCA7F9D
%55 = fdiv double 0x403ECA390D230F60, %54
%56 = fadd double %52, %55
%57 = fdiv double 0x402E4D42675985A1, %56
%58 = fsub double %50, %57
%59 = fdiv double 0x40152C57AFDD8769, %58
%60 = fadd double %48, %59
%61 = fdiv double 0x3FFFC74938A68D3A, %60
%62 = fadd double %46, %61
%63 = fdiv double 0x3FF0000673B05093, %62
%64 = fadd double %44, %63
%65 = fdiv double %42, %64
store double %65, double* %4
br label %66
66: ; preds = %38, %20
%67 = load i32, i32* %3
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = load double, double* %4
br label %74
71: ; preds = %66
%72 = load double, double* %4
%73 = fsub double 1.000000e+00, %72
br label %74
74: ; preds = %71, %69
%75 = phi double [ %70, %69 ], [ %73, %71 ]
ret double %75
}

LLVM IR (-O2):
define double @CDFNormal(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, 5.000000e-01
%4 = fcmp olt double %0, 0.000000e+00
%5 = fneg double %0
%6 = select i1 %4, double %5, double %0
%7 = fcmp olt double %6, 1.280000e+00
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = fmul double %3, 0x3FD99804977BB02A
%10 = fadd double %3, 0x401709113BE05594
%11 = fadd double %3, 0x4004FEA15D6FE126
%12 = fadd double %3, 0x4017B7265A7D0F22
%13 = fdiv double 0x404859164D073A74, %12
%14 = fadd double %11, %13
%15 = fdiv double 0x403DD2445F58EAA3, %14
%16 = fsub double %10, %15
%17 = fdiv double %9, %16
%18 = fsub double 0x3FD9884533DFE9B9, %17
%19 = fneg double %6
%20 = tail call double @llvm.fmuladd.f64(double %19, double %18, double 5.000000e-01)
br label %42
21: ; preds = %1
%22 = fneg double %3
%23 = tail call double @exp(double %22)
%24 = fmul double %23, 0x3FD9884533CFB1F8
%25 = fadd double %6, -3.805200e-08
%26 = fadd double %6, 0x3F3A166B459C7B69
%27 = fadd double %6, 0xBFC36A38A6B77CC0
%28 = fadd double %6, 0x40135AB7AC36FCAD
%29 = fadd double %6, 0x3FE7C195A3BBD8E3
%30 = fadd double %6, 0x400FEBEAEBCA7F9D
%31 = fdiv double 0x403ECA390D230F60, %30
%32 = fadd double %29, %31
%33 = fdiv double 0x402E4D42675985A1, %32
%34 = fsub double %28, %33
%35 = fdiv double 0x40152C57AFDD8769, %34
%36 = fadd double %27, %35
%37 = fdiv double 0x3FFFC74938A68D3A, %36
%38 = fadd double %26, %37
%39 = fdiv double 0x3FF0000673B05093, %38
%40 = fadd double %25, %39
%41 = fdiv double %24, %40
br label %42
42: ; preds = %21, %8
%43 = phi double [ %20, %8 ], [ %41, %21 ]
%44 = fsub double 1.000000e+00, %43
%45 = select i1 %4, double %43, double %44
ret double %45
}