#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 fabs(double);
double pow(double, int);
double sqrt(double);
double CND(double X) {
  double K, w;
  double a1 = 0.31938153;
  double a2 = -0.356563782;
  double a3 = 1.781477937;
  double a4 = -1.821255978;
  double a5 = 1.330274429;
  K = 1.0 / (1.0 + 0.2316419 * fabs(X));
  w = 1.0 / sqrt(2.0 * 3.14159265358979323846) * exp(-(X * X) / 2) *
      (a1 * K + a2 * K * K + a3 * pow(K, 3) + a4 * pow(K, 4) + a5 * pow(K, 5));
  return (X < 0.0) ? w : 0.95 - w;
}


x86 assembly (clang, -O0):
<CND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xec3(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe63(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe57(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe4e(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe36(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdfc(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1040 <pow@plt>
movsd  -0x78(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1306 <CND+0x1d6>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
jmp    131b <CND+0x1eb>
movsd  0xd3a(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CND>:
sub    $0x38,%rsp
movapd %xmm0,0x20(%rsp)
movapd 0xece(%rip),%xmm1
andpd  %xmm0,%xmm1
mulsd  0xed2(%rip),%xmm1
movsd  0xed2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm0,%xmm0
mulsd  0xec0(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xebb(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xeb5(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xea7(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
mov    $0x3,%edi
call   1040 <pow@plt>
mulsd  0xe8f(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
mulsd  0xe73(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
mulsd  0xe57(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  0xe4b(%rip),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm1,%xmm3
orpd   %xmm3,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @CND(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
store double %0, double* %2
store double 0x3FD470BF3A92F8EC, double* %5
store double 0xBFD6D1F0E5A8325B, double* %6
store double 0x3FFC80EF025F5E68, double* %7
store double 0xBFFD23DD4EF278D0, double* %8
store double 0x3FF548CDD6F42943, double* %9
%10 = load double, double* %2
%11 = call double @llvm.fabs.f64(double %10)
%12 = call double @llvm.fmuladd.f64(double 0x3FCDA6711871100E, double %11, double 1.000000e+00)
%13 = fdiv double 1.000000e+00, %12
store double %13, double* %3
%14 = call double @sqrt(double 0x401921FB54442D18)
%15 = fdiv double 1.000000e+00, %14
%16 = load double, double* %2
%17 = load double, double* %2
%18 = fmul double %16, %17
%19 = fneg double %18
%20 = fdiv double %19, 2.000000e+00
%21 = call double @exp(double %20)
%22 = fmul double %15, %21
%23 = load double, double* %5
%24 = load double, double* %3
%25 = load double, double* %6
%26 = load double, double* %3
%27 = fmul double %25, %26
%28 = load double, double* %3
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %23, double %24, double %29)
%31 = load double, double* %7
%32 = load double, double* %3
%33 = call double @pow(double %32, i32 3)
%34 = call double @llvm.fmuladd.f64(double %31, double %33, double %30)
%35 = load double, double* %8
%36 = load double, double* %3
%37 = call double @pow(double %36, i32 4)
%38 = call double @llvm.fmuladd.f64(double %35, double %37, double %34)
%39 = load double, double* %9
%40 = load double, double* %3
%41 = call double @pow(double %40, i32 5)
%42 = call double @llvm.fmuladd.f64(double %39, double %41, double %38)
%43 = fmul double %22, %42
store double %43, double* %4
%44 = load double, double* %2
%45 = fcmp olt double %44, 0.000000e+00
br i1 %45, label %46, label %48
46: ; preds = %1
%47 = load double, double* %4
br label %51
48: ; preds = %1
%49 = load double, double* %4
%50 = fsub double 0x3FEE666666666666, %49
br label %51
51: ; preds = %48, %46
%52 = phi double [ %47, %46 ], [ %50, %48 ]
ret double %52
}

LLVM IR (-O2):
define double @CND(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FCDA6711871100E, double 1.000000e+00)
%4 = fdiv double 1.000000e+00, %3
%5 = fneg double %0
%6 = fmul double %5, %0
%7 = fmul double %6, 5.000000e-01
%8 = tail call double @exp(double %7)
%9 = fmul double %8, 0x3FD9884533D43651
%10 = fmul double %4, 0xBFD6D1F0E5A8325B
%11 = fmul double %4, %10
%12 = tail call double @llvm.fmuladd.f64(double %4, double 0x3FD470BF3A92F8EC, double %11)
%13 = tail call double @pow(double %4, i32 3)
%14 = tail call double @llvm.fmuladd.f64(double %13, double 0x3FFC80EF025F5E68, double %12)
%15 = tail call double @pow(double %4, i32 4)
%16 = tail call double @llvm.fmuladd.f64(double %15, double 0xBFFD23DD4EF278D0, double %14)
%17 = tail call double @pow(double %4, i32 5)
%18 = tail call double @llvm.fmuladd.f64(double %17, double 0x3FF548CDD6F42943, double %16)
%19 = fmul double %9, %18
%20 = fcmp olt double %0, 0.000000e+00
%21 = fsub double 0x3FEE666666666666, %19
%22 = select i1 %20, double %19, double %21
ret double %22
}