#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 pnorm(double x) {
  double b1 = 0.319381530;
  double b2 = -0.356563782;
  double b3 = 1.781477937;
  double b4 = -1.821255978;
  double b5 = 1.330274429;
  double p = 0.2316419;
  double c = 0.39894228;
  if (x >= 0.0) {
    double t = 1.0 / (1.0 + p * x);
    return (1.0 - c * exp(-x * x / 2.0) * t *
                      (t * (t * (t * (t * b5 + b4) + b3) + b2) + b1));
  }
  double t = 1.0 / (1.0 - p * x);
  return (c * exp(-x * x / 2.0) * t *
          (t * (t * (t * (t * b5 + b4) + b3) + b2) + b1));
}


x86 assembly (clang, -O0):
<pnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xf0b(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xef6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb7(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xea2(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1280 <pnorm+0x170>
movsd  -0x40(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe94(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe50(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm6
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm6,%xmm5
addsd  %xmm2,%xmm5
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm5,%xmm4
addsd  %xmm2,%xmm4
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdce(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1365 <pnorm+0x255>
movsd  -0x40(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xd93(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd87(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xd43(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm4
movsd  -0x58(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm6
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm6,%xmm5
addsd  %xmm2,%xmm5
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm5,%xmm4
addsd  %xmm2,%xmm4
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnorm>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    11a0 <pnorm+0x90>
movsd  0xf21(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
mulsd  %xmm0,%xmm0
mulsd  0xec4(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xef7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  0xeae(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeaa(%rip),%xmm1
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
addsd  0xea2(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe9e(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xe58(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe54(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
mulsd  %xmm0,%xmm0
mulsd  0xe43(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xe3e(%rip),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  0xe35(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe31(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe2d(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe29(%rip),%xmm1
mulsd  0xe29(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xde1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pnorm(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
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %3
store double 0x3FD470BF3A92F8EC, double* %4
store double 0xBFD6D1F0E5A8325B, double* %5
store double 0x3FFC80EF025F5E68, double* %6
store double 0xBFFD23DD4EF278D0, double* %7
store double 0x3FF548CDD6F42943, double* %8
store double 0x3FCDA6711871100E, double* %9
store double 0x3FD988453365DE00, double* %10
%13 = load double, double* %3
%14 = fcmp oge double %13, 0.000000e+00
br i1 %14, label %15, label %45
15: ; preds = %1
%16 = load double, double* %9
%17 = load double, double* %3
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double 1.000000e+00)
%19 = fdiv double 1.000000e+00, %18
store double %19, double* %11
%20 = load double, double* %10
%21 = load double, double* %3
%22 = fneg double %21
%23 = load double, double* %3
%24 = fmul double %22, %23
%25 = fdiv double %24, 2.000000e+00
%26 = call double @exp(double %25)
%27 = fmul double %20, %26
%28 = load double, double* %11
%29 = fmul double %27, %28
%30 = load double, double* %11
%31 = load double, double* %11
%32 = load double, double* %11
%33 = load double, double* %11
%34 = load double, double* %8
%35 = load double, double* %7
%36 = call double @llvm.fmuladd.f64(double %33, double %34, double %35)
%37 = load double, double* %6
%38 = call double @llvm.fmuladd.f64(double %32, double %36, double %37)
%39 = load double, double* %5
%40 = call double @llvm.fmuladd.f64(double %31, double %38, double %39)
%41 = load double, double* %4
%42 = call double @llvm.fmuladd.f64(double %30, double %40, double %41)
%43 = fneg double %29
%44 = call double @llvm.fmuladd.f64(double %43, double %42, double 1.000000e+00)
store double %44, double* %2
br label %75
45: ; preds = %1
%46 = load double, double* %9
%47 = load double, double* %3
%48 = fneg double %46
%49 = call double @llvm.fmuladd.f64(double %48, double %47, double 1.000000e+00)
%50 = fdiv double 1.000000e+00, %49
store double %50, double* %12
%51 = load double, double* %10
%52 = load double, double* %3
%53 = fneg double %52
%54 = load double, double* %3
%55 = fmul double %53, %54
%56 = fdiv double %55, 2.000000e+00
%57 = call double @exp(double %56)
%58 = fmul double %51, %57
%59 = load double, double* %12
%60 = fmul double %58, %59
%61 = load double, double* %12
%62 = load double, double* %12
%63 = load double, double* %12
%64 = load double, double* %12
%65 = load double, double* %8
%66 = load double, double* %7
%67 = call double @llvm.fmuladd.f64(double %64, double %65, double %66)
%68 = load double, double* %6
%69 = call double @llvm.fmuladd.f64(double %63, double %67, double %68)
%70 = load double, double* %5
%71 = call double @llvm.fmuladd.f64(double %62, double %69, double %70)
%72 = load double, double* %4
%73 = call double @llvm.fmuladd.f64(double %61, double %71, double %72)
%74 = fmul double %60, %73
store double %74, double* %2
br label %75
75: ; preds = %45, %15
%76 = load double, double* %2
ret double %76
}

LLVM IR (-O2):
define double @pnorm(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %17, 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 = fneg double %0
%7 = fmul double %6, %0
%8 = fmul double %7, 5.000000e-01
%9 = tail call double @exp(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FF548CDD6F42943, double 0xBFFD23DD4EF278D0)
%11 = tail call double @llvm.fmuladd.f64(double %5, double %10, double 0x3FFC80EF025F5E68)
%12 = tail call double @llvm.fmuladd.f64(double %5, double %11, double 0xBFD6D1F0E5A8325B)
%13 = tail call double @llvm.fmuladd.f64(double %5, double %12, double 0x3FD470BF3A92F8EC)
%14 = fmul double %9, 0xBFD988453365DE00
%15 = fmul double %5, %14
%16 = tail call double @llvm.fmuladd.f64(double %15, double %13, double 1.000000e+00)
br label %31
17: ; preds = %1
%18 = tail call double @llvm.fmuladd.f64(double %0, double 0xBFCDA6711871100E, double 1.000000e+00)
%19 = fdiv double 1.000000e+00, %18
%20 = fneg double %0
%21 = fmul double %20, %0
%22 = fmul double %21, 5.000000e-01
%23 = tail call double @exp(double %22)
%24 = fmul double %23, 0x3FD988453365DE00
%25 = fmul double %19, %24
%26 = tail call double @llvm.fmuladd.f64(double %19, double 0x3FF548CDD6F42943, double 0xBFFD23DD4EF278D0)
%27 = tail call double @llvm.fmuladd.f64(double %19, double %26, double 0x3FFC80EF025F5E68)
%28 = tail call double @llvm.fmuladd.f64(double %19, double %27, double 0xBFD6D1F0E5A8325B)
%29 = tail call double @llvm.fmuladd.f64(double %19, double %28, double 0x3FD470BF3A92F8EC)
%30 = fmul double %29, %25
br label %31
31: ; preds = %17, %3
%32 = phi double [ %16, %3 ], [ %30, %17 ]
ret double %32
}