#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 fabs(double);
double NormalP(double x) {
  double d1 = 0.0498673470, d2 = 0.0211410061, d3 = 0.0032776263,
         d4 = 0.0000380036, d5 = 0.0000488906, d6 = 0.0000053830;
  double a = fabs(x);
  double t =
      1.0 + a * (d1 + a * (d2 + a * (d3 + a * (d4 + a * (d5 + a * d6)))));
  t *= t;
  t *= t;
  t *= t;
  t *= t;
  t = 1.0 / (t + t);
  if (x >= 0)
    t = 1.0 - t;
  return (t);
}


x86 assembly (clang, -O0):
<NormalP>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf1f(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xf0a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xedd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm6
movsd  -0x40(%rbp),%xmm5
movsd  -0x28(%rbp),%xmm8
movsd  -0x40(%rbp),%xmm7
movsd  -0x30(%rbp),%xmm10
movsd  -0x40(%rbp),%xmm9
movsd  -0x38(%rbp),%xmm11
mulsd  %xmm11,%xmm9
addsd  %xmm10,%xmm9
mulsd  %xmm9,%xmm7
addsd  %xmm8,%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
movsd  0xdc5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1268 <NormalP+0x168>
movsd  0xda2(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalP>:
movapd 0xef8(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xefc(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xef8(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xee8(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xee4(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
movapd %xmm2,%xmm3
divsd  %xmm1,%xmm3
subsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm3
andnpd %xmm2,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @NormalP(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
store double %0, double* %2
store double 0x3FA988368101AE67, double* %3
store double 0x3F95A5FCE7375559, double* %4
store double 0x3F6AD9AE388B577A, double* %5
store double 3.800360e-05, double* %6
store double 4.889060e-05, double* %7
store double 0x3ED693F3C5E88AA1, double* %8
%11 = load double, double* %2
%12 = call double @llvm.fabs.f64(double %11)
store double %12, double* %9
%13 = load double, double* %9
%14 = load double, double* %3
%15 = load double, double* %9
%16 = load double, double* %4
%17 = load double, double* %9
%18 = load double, double* %5
%19 = load double, double* %9
%20 = load double, double* %6
%21 = load double, double* %9
%22 = load double, double* %7
%23 = load double, double* %9
%24 = load double, double* %8
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double %22)
%26 = call double @llvm.fmuladd.f64(double %21, double %25, double %20)
%27 = call double @llvm.fmuladd.f64(double %19, double %26, double %18)
%28 = call double @llvm.fmuladd.f64(double %17, double %27, double %16)
%29 = call double @llvm.fmuladd.f64(double %15, double %28, double %14)
%30 = call double @llvm.fmuladd.f64(double %13, double %29, double 1.000000e+00)
store double %30, double* %10
%31 = load double, double* %10
%32 = load double, double* %10
%33 = fmul double %32, %31
store double %33, double* %10
%34 = load double, double* %10
%35 = load double, double* %10
%36 = fmul double %35, %34
store double %36, double* %10
%37 = load double, double* %10
%38 = load double, double* %10
%39 = fmul double %38, %37
store double %39, double* %10
%40 = load double, double* %10
%41 = load double, double* %10
%42 = fmul double %41, %40
store double %42, double* %10
%43 = load double, double* %10
%44 = load double, double* %10
%45 = fadd double %43, %44
%46 = fdiv double 1.000000e+00, %45
store double %46, double* %10
%47 = load double, double* %2
%48 = fcmp oge double %47, 0.000000e+00
br i1 %48, label %49, label %52
49: ; preds = %1
%50 = load double, double* %10
%51 = fsub double 1.000000e+00, %50
store double %51, double* %10
br label %52
52: ; preds = %49, %1
%53 = load double, double* %10
ret double %53
}

LLVM IR (-O2):
define double @NormalP(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3ED693F3C5E88AA1, double 4.889060e-05)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 3.800360e-05)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0x3F6AD9AE388B577A)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0x3F95A5FCE7375559)
%7 = tail call double @llvm.fmuladd.f64(double %2, double %6, double 0x3FA988368101AE67)
%8 = tail call double @llvm.fmuladd.f64(double %2, double %7, double 1.000000e+00)
%9 = fmul double %8, %8
%10 = fmul double %9, %9
%11 = fmul double %10, %10
%12 = fmul double %11, %11
%13 = fadd double %12, %12
%14 = fdiv double 1.000000e+00, %13
%15 = fcmp ult double %0, 0.000000e+00
%16 = fsub double 1.000000e+00, %14
%17 = select i1 %15, double %14, double %16
ret double %17
}