#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(int);
double fabs(double);
int pow(double, double);
double rq_pricing_cumul_norm_dist(double z) {
  double y = fabs(z);
  double cnd, e, sumA, sumB;
  if (y > 37)
    cnd = 0;
  else {
    e = exp(-pow(y, 2.0) / 2);
    if (y < 7.07106781186547) {
      sumA = 3.52624965998911E-02 * y + 0.700383064443688;
      sumA = sumA * y + 6.37396220353165;
      sumA = sumA * y + 33.912866078383;
      sumA = sumA * y + 112.079291497871;
      sumA = sumA * y + 221.213596169931;
      sumA = sumA * y + 220.206867912376;
      sumB = 8.83883476483184E-02 * y + 1.75566716318264;
      sumB = sumB * y + 16.064177579207;
      sumB = sumB * y + 86.7807322029461;
      sumB = sumB * y + 296.564248779674;
      sumB = sumB * y + 637.333633378831;
      sumB = sumB * y + 793.826512519948;
      sumB = sumB * y + 440.413735824752;
      cnd = e * sumA / sumB;
    } else {
      sumA = y + 0.65;
      sumA = y + 4 / sumA;
      sumA = y + 3 / sumA;
      sumA = y + 2 / sumA;
      sumA = y + 1 / sumA;
      cnd = e / (sumA * 2.506628274631);
    }
  }
  return (z > 0.0 ? 1.0 - cnd : cnd);
}


x86 assembly (clang, -O0):
<rq_pricing_cumul_norm_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xf87(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <rq_pricing_cumul_norm_dist+0x46>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    13f5 <rq_pricing_cumul_norm_dist+0x2d5>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9d(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6e(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1357 <rq_pricing_cumul_norm_dist+0x237>
movsd  -0x10(%rbp),%xmm0
movsd  0xef6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xef2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe75(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe27(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe01(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdce(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xda7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd80(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd59(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd32(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd0b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    13f0 <rq_pricing_cumul_norm_dist+0x2d0>
movsd  0xcd9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xcba(%rip),%xmm1
divsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xc97(%rip),%xmm1
divsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xc64(%rip),%xmm1
divsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xc59(%rip),%xmm1
divsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xc36(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    13f5 <rq_pricing_cumul_norm_dist+0x2d5>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    141e <rq_pricing_cumul_norm_dist+0x2fe>
movsd  0xc11(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1428 <rq_pricing_cumul_norm_dist+0x308>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_cumul_norm_dist>:
sub    $0x28,%rsp
movapd %xmm0,%xmm3
movapd 0xed0(%rip),%xmm2
andpd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd 0xed0(%rip),%xmm2
xorpd  %xmm1,%xmm1
ja     12a9 <rq_pricing_cumul_norm_dist+0x189>
movapd %xmm3,(%rsp)
movsd  0xec1(%rip),%xmm1
movapd %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
call   1040 <pow@plt>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
neg    %edi
call   1030 <exp@plt>
movapd 0x10(%rsp),%xmm3
movsd  0xe9c(%rip),%xmm1
ucomisd %xmm3,%xmm1
jbe    1244 <rq_pricing_cumul_norm_dist+0x124>
movsd  0xeba(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xeb6(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xeb2(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xeae(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xeaa(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xea6(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xea2(%rip),%xmm1
movsd  0xea2(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe9e(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe9a(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe96(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe92(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe8e(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe8a(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xe86(%rip),%xmm2
mulsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
jmp    12a0 <rq_pricing_cumul_norm_dist+0x180>
movsd  0xddc(%rip),%xmm1
addsd  %xmm3,%xmm1
movsd  0xdd8(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
movsd  0xdd0(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  0xda0(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
movsd  0xdb8(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
mulsd  0xdb0(%rip),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movapd (%rsp),%xmm3
movsd  0xd8f(%rip),%xmm2
subsd  %xmm1,%xmm2
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @rq_pricing_cumul_norm_dist(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = call double @llvm.fabs.f64(double %8)
store double %9, double* %3
%10 = load double, double* %3
%11 = fcmp ogt double %10, 3.700000e+01
br i1 %11, label %12, label %13
12: ; preds = %1
store double 0.000000e+00, double* %4
br label %88
13: ; preds = %1
%14 = load double, double* %3
%15 = call i32 @pow(double %14, double 2.000000e+00)
%16 = sub nsw i32 0, %15
%17 = sdiv i32 %16, 2
%18 = call double @exp(i32 %17)
store double %18, double* %5
%19 = load double, double* %3
%20 = fcmp olt double %19, 0x401C48C6001F0ABA
br i1 %20, label %21, label %64
21: ; preds = %13
%22 = load double, double* %3
%23 = call double @llvm.fmuladd.f64(double 0x3FA20DED0B57FBDE, double %22, double 0x3FE66989BE8EA71F)
store double %23, double* %6
%24 = load double, double* %6
%25 = load double, double* %3
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double 0x40197EEFF2A86F23)
store double %26, double* %6
%27 = load double, double* %6
%28 = load double, double* %3
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double 0x4040F4D8CBB02431)
store double %29, double* %6
%30 = load double, double* %6
%31 = load double, double* %3
%32 = call double @llvm.fmuladd.f64(double %30, double %31, double 0x405C05131CA58D3C)
store double %32, double* %6
%33 = load double, double* %6
%34 = load double, double* %3
%35 = call double @llvm.fmuladd.f64(double %33, double %34, double 0x406BA6D5C7A28CF2)
store double %35, double* %6
%36 = load double, double* %6
%37 = load double, double* %3
%38 = call double @llvm.fmuladd.f64(double %36, double %37, double 0x406B869EA974C7E5)
store double %38, double* %6
%39 = load double, double* %3
%40 = call double @llvm.fmuladd.f64(double 0x3FB6A09E667F3BCA, double %39, double 0x3FFC173673887D11)
store double %40, double* %7
%41 = load double, double* %7
%42 = load double, double* %3
%43 = call double @llvm.fmuladd.f64(double %41, double %42, double 0x4030106DF11BD49D)
store double %43, double* %7
%44 = load double, double* %7
%45 = load double, double* %3
%46 = call double @llvm.fmuladd.f64(double %44, double %45, double 0x4055B1F78433A59A)
store double %46, double* %7
%47 = load double, double* %7
%48 = load double, double* %3
%49 = call double @llvm.fmuladd.f64(double %47, double %48, double 0x4072890729BA7820)
store double %49, double* %7
%50 = load double, double* %7
%51 = load double, double* %3
%52 = call double @llvm.fmuladd.f64(double %50, double %51, double 0x4083EAAB47FA1777)
store double %52, double* %7
%53 = load double, double* %7
%54 = load double, double* %3
%55 = call double @llvm.fmuladd.f64(double %53, double %54, double 0x4088CE9CB298974A)
store double %55, double* %7
%56 = load double, double* %7
%57 = load double, double* %3
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double 0x407B869EA974C7E5)
store double %58, double* %7
%59 = load double, double* %5
%60 = load double, double* %6
%61 = fmul double %59, %60
%62 = load double, double* %7
%63 = fdiv double %61, %62
store double %63, double* %4
br label %87
64: ; preds = %13
%65 = load double, double* %3
%66 = fadd double %65, 6.500000e-01
store double %66, double* %6
%67 = load double, double* %3
%68 = load double, double* %6
%69 = fdiv double 4.000000e+00, %68
%70 = fadd double %67, %69
store double %70, double* %6
%71 = load double, double* %3
%72 = load double, double* %6
%73 = fdiv double 3.000000e+00, %72
%74 = fadd double %71, %73
store double %74, double* %6
%75 = load double, double* %3
%76 = load double, double* %6
%77 = fdiv double 2.000000e+00, %76
%78 = fadd double %75, %77
store double %78, double* %6
%79 = load double, double* %3
%80 = load double, double* %6
%81 = fdiv double 1.000000e+00, %80
%82 = fadd double %79, %81
store double %82, double* %6
%83 = load double, double* %5
%84 = load double, double* %6
%85 = fmul double %84, 0x40040D931FF62704
%86 = fdiv double %83, %85
store double %86, double* %4
br label %87
87: ; preds = %64, %21
br label %88
88: ; preds = %87, %12
%89 = load double, double* %2
%90 = fcmp ogt double %89, 0.000000e+00
br i1 %90, label %91, label %94
91: ; preds = %88
%92 = load double, double* %4
%93 = fsub double 1.000000e+00, %92
br label %96
94: ; preds = %88
%95 = load double, double* %4
br label %96
96: ; preds = %94, %91
%97 = phi double [ %93, %91 ], [ %95, %94 ]
ret double %97
}

LLVM IR (-O2):
define double @rq_pricing_cumul_norm_dist(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp ogt double %2, 3.700000e+01
br i1 %3, label %37, label %4
4: ; preds = %1
%5 = tail call i32 @pow(double %2, double 2.000000e+00)
%6 = sdiv i32 %5, -2
%7 = tail call double @exp(i32 %6)
%8 = fcmp olt double %2, 0x401C48C6001F0ABA
br i1 %8, label %9, label %25
9: ; preds = %4
%10 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FA20DED0B57FBDE, double 0x3FE66989BE8EA71F)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %2, double 0x40197EEFF2A86F23)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %2, double 0x4040F4D8CBB02431)
%13 = tail call double @llvm.fmuladd.f64(double %12, double %2, double 0x405C05131CA58D3C)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %2, double 0x406BA6D5C7A28CF2)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %2, double 0x406B869EA974C7E5)
%16 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FB6A09E667F3BCA, double 0x3FFC173673887D11)
%17 = tail call double @llvm.fmuladd.f64(double %16, double %2, double 0x4030106DF11BD49D)
%18 = tail call double @llvm.fmuladd.f64(double %17, double %2, double 0x4055B1F78433A59A)
%19 = tail call double @llvm.fmuladd.f64(double %18, double %2, double 0x4072890729BA7820)
%20 = tail call double @llvm.fmuladd.f64(double %19, double %2, double 0x4083EAAB47FA1777)
%21 = tail call double @llvm.fmuladd.f64(double %20, double %2, double 0x4088CE9CB298974A)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %2, double 0x407B869EA974C7E5)
%23 = fmul double %15, %7
%24 = fdiv double %23, %22
br label %37
25: ; preds = %4
%26 = fadd double %2, 6.500000e-01
%27 = fdiv double 4.000000e+00, %26
%28 = fadd double %2, %27
%29 = fdiv double 3.000000e+00, %28
%30 = fadd double %2, %29
%31 = fdiv double 2.000000e+00, %30
%32 = fadd double %2, %31
%33 = fdiv double 1.000000e+00, %32
%34 = fadd double %2, %33
%35 = fmul double %34, 0x40040D931FF62704
%36 = fdiv double %7, %35
br label %37
37: ; preds = %1, %9, %25
%38 = phi double [ %24, %9 ], [ %36, %25 ], [ 0.000000e+00, %1 ]
%39 = fcmp ogt double %0, 0.000000e+00
%40 = fsub double 1.000000e+00, %38
%41 = select i1 %39, double %40, double %38
ret double %41
}