#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 normp(double z) {
  static double p[7] = {220.2068679123761,   221.2135961699311,
                        112.079291497870,    33.91286607838300,
                        6.37396220353165,    0.7003830644436881,
                        0.352624965998910e-1};
  static double q[8] = {440.4137358247522, 793.8265125199484,
                        637.3336333788311, 296.5642487796737,
                        86.78073220294608, 16.06417757920695,
                        1.755667163182642, 0.8838834764831844e-1};
  static double cutoff = 7.071, root2pi = 2.506628274631001;
  double zabs, expntl;
  double pee, queue, pdf;
  zabs = fabs(z);
  if (zabs > 37.0) {
    pdf = 0.0;
    if (z > 0.0) {
      pee = 1.0;
      queue = 0.0;
    } else {
      pee = 0.0;
      queue = 1.0;
    }
    return pee;
  }
  expntl = exp(-0.5 * zabs * zabs);
  pdf = expntl / root2pi;
  if (zabs < cutoff)
    pee =
        expntl *
        ((((((p[6] * zabs + p[5]) * zabs + p[4]) * zabs + p[3]) * zabs + p[2]) *
              zabs +
          p[1]) *
             zabs +
         p[0]) /
        (((((((q[7] * zabs + q[6]) * zabs + q[5]) * zabs + q[4]) * zabs +
            q[3]) *
               zabs +
           q[2]) *
              zabs +
          q[1]) *
             zabs +
         q[0]);
  else
    pee = pdf /
          (zabs +
           1.0 / (zabs + 2.0 / (zabs + 3.0 / (zabs + 4.0 / (zabs + 0.65)))));
  if (z < 0.0)
    queue = 1.0 - pee;
  else {
    queue = pee;
    pee = 1.0 - queue;
  }
  return pee;
}


x86 assembly (clang, -O0):
<normp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xf17(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a1 <normp+0x91>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    117d <normp+0x6d>
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1192 <normp+0x82>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13d8 <normp+0x2c8>
movsd  0xe5f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  0x2eee(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0x2ed4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    131e <normp+0x20e>
movsd  -0x20(%rbp),%xmm0
movsd  0x2e6d(%rip),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2e58(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2e3b(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2e1e(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2e01(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2de4(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2dc7(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x2e2b(%rip),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2e16(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2df9(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2ddc(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2dbf(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2da2(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2d85(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0x2d68(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    138d <normp+0x27d>
movsd  -0x38(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  0xcf1(%rip),%xmm6
addsd  -0x18(%rbp),%xmm6
movsd  0xcdc(%rip),%xmm2
divsd  %xmm6,%xmm2
addsd  %xmm2,%xmm5
movsd  0xcc4(%rip),%xmm2
divsd  %xmm5,%xmm2
addsd  %xmm2,%xmm4
movsd  0xcac(%rip),%xmm2
divsd  %xmm4,%xmm2
addsd  %xmm2,%xmm3
movsd  0xc94(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    13b2 <normp+0x2a2>
movsd  0xc6d(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    13ce <normp+0x2be>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xc4c(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normp>:
sub    $0x28,%rsp
movapd 0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
ucomisd 0xf08(%rip),%xmm1
jbe    1144 <normp+0x34>
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xfa5(%rip),%xmm0
andpd  %xmm1,%xmm0
add    $0x28,%rsp
ret
movapd %xmm0,(%rsp)
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm1,0x10(%rsp)
call   1030 <exp@plt>
movapd 0x10(%rsp),%xmm3
movsd  0xece(%rip),%xmm1
ucomisd %xmm3,%xmm1
jbe    1232 <normp+0x122>
movsd  0xee4(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xee0(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xedc(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xed8(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xed4(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xed0(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xecc(%rip),%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xec8(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xec4(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xec0(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xebc(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xeb8(%rip),%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm2
addsd  0xeb0(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xeac(%rip),%xmm2
divsd  %xmm2,%xmm1
jmp    129b <normp+0x18b>
movsd  0xe0e(%rip),%xmm1
addsd  %xmm3,%xmm1
movsd  0xe0a(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
movsd  0xe02(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  0xdfa(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
shufpd $0x2,0xd99(%rip),%xmm0
movapd 0xda1(%rip),%xmm1
unpcklpd %xmm2,%xmm1
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movapd (%rsp),%xmm0
movsd  0xe38(%rip),%xmm3
subsd  %xmm1,%xmm3
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
movapd %xmm0,%xmm2
andnpd %xmm3,%xmm2
andpd  %xmm1,%xmm0
orpd   %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@normp.p = internal global [7 x double] [double 0x406B869EA974C7E9, double 0x406BA6D5C7A28CF5, double 0x405C05131CA58CF6, double 0x4040F4D8CBB02431, double 0x40197EEFF2A86F23, double 0x3FE66989BE8EA720, double 0x3FA20DED0B57FBD0]
@normp.q = internal global [8 x double] [double 0x407B869EA974C7E9, double 0x4088CE9CB298974E, double 0x4083EAAB47FA1778, double 0x4072890729BA781A, double 0x4055B1F78433A599, double 0x4030106DF11BD48F, double 0x3FFC173673887D1A, double 0x3FB6A09E667F3BCD]
@normp.cutoff = internal global double 7.071000e+00
@normp.root2pi = internal global double 0x40040D931FF62707
define double @normp(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
%9 = load double, double* %3
%10 = call double @llvm.fabs.f64(double %9)
store double %10, double* %4
%11 = load double, double* %4
%12 = fcmp ogt double %11, 3.700000e+01
br i1 %12, label %13, label %20
13: ; preds = %1
store double 0.000000e+00, double* %8
%14 = load double, double* %3
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
store double 1.000000e+00, double* %6
store double 0.000000e+00, double* %7
br label %18
17: ; preds = %13
store double 0.000000e+00, double* %6
store double 1.000000e+00, double* %7
br label %18
18: ; preds = %17, %16
%19 = load double, double* %6
store double %19, double* %2
br label %106
20: ; preds = %1
%21 = load double, double* %4
%22 = fmul double -5.000000e-01, %21
%23 = load double, double* %4
%24 = fmul double %22, %23
%25 = call double @exp(double %24)
store double %25, double* %5
%26 = load double, double* %5
%27 = load double, double* @normp.root2pi
%28 = fdiv double %26, %27
store double %28, double* %8
%29 = load double, double* %4
%30 = load double, double* @normp.cutoff
%31 = fcmp olt double %29, %30
br i1 %31, label %32, label %77
32: ; preds = %20
%33 = load double, double* %5
%34 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 6)
%35 = load double, double* %4
%36 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 5)
%37 = call double @llvm.fmuladd.f64(double %34, double %35, double %36)
%38 = load double, double* %4
%39 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 4)
%40 = call double @llvm.fmuladd.f64(double %37, double %38, double %39)
%41 = load double, double* %4
%42 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 3)
%43 = call double @llvm.fmuladd.f64(double %40, double %41, double %42)
%44 = load double, double* %4
%45 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 2)
%46 = call double @llvm.fmuladd.f64(double %43, double %44, double %45)
%47 = load double, double* %4
%48 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 1)
%49 = call double @llvm.fmuladd.f64(double %46, double %47, double %48)
%50 = load double, double* %4
%51 = load double, double* getelementptr inbounds ([7 x double], [7 x double]* @normp.p, i64 0, i64 0)
%52 = call double @llvm.fmuladd.f64(double %49, double %50, double %51)
%53 = fmul double %33, %52
%54 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 7)
%55 = load double, double* %4
%56 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 6)
%57 = call double @llvm.fmuladd.f64(double %54, double %55, double %56)
%58 = load double, double* %4
%59 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 5)
%60 = call double @llvm.fmuladd.f64(double %57, double %58, double %59)
%61 = load double, double* %4
%62 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 4)
%63 = call double @llvm.fmuladd.f64(double %60, double %61, double %62)
%64 = load double, double* %4
%65 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 3)
%66 = call double @llvm.fmuladd.f64(double %63, double %64, double %65)
%67 = load double, double* %4
%68 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 2)
%69 = call double @llvm.fmuladd.f64(double %66, double %67, double %68)
%70 = load double, double* %4
%71 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 1)
%72 = call double @llvm.fmuladd.f64(double %69, double %70, double %71)
%73 = load double, double* %4
%74 = load double, double* getelementptr inbounds ([8 x double], [8 x double]* @normp.q, i64 0, i64 0)
%75 = call double @llvm.fmuladd.f64(double %72, double %73, double %74)
%76 = fdiv double %53, %75
store double %76, double* %6
br label %94
77: ; preds = %20
%78 = load double, double* %8
%79 = load double, double* %4
%80 = load double, double* %4
%81 = load double, double* %4
%82 = load double, double* %4
%83 = load double, double* %4
%84 = fadd double %83, 6.500000e-01
%85 = fdiv double 4.000000e+00, %84
%86 = fadd double %82, %85
%87 = fdiv double 3.000000e+00, %86
%88 = fadd double %81, %87
%89 = fdiv double 2.000000e+00, %88
%90 = fadd double %80, %89
%91 = fdiv double 1.000000e+00, %90
%92 = fadd double %79, %91
%93 = fdiv double %78, %92
store double %93, double* %6
br label %94
94: ; preds = %77, %32
%95 = load double, double* %3
%96 = fcmp olt double %95, 0.000000e+00
br i1 %96, label %97, label %100
97: ; preds = %94
%98 = load double, double* %6
%99 = fsub double 1.000000e+00, %98
store double %99, double* %7
br label %104
100: ; preds = %94
%101 = load double, double* %6
store double %101, double* %7
%102 = load double, double* %7
%103 = fsub double 1.000000e+00, %102
store double %103, double* %6
br label %104
104: ; preds = %100, %97
%105 = load double, double* %6
store double %105, double* %2
br label %106
106: ; preds = %104, %18
%107 = load double, double* %2
ret double %107
}

LLVM IR (-O2):
define double @normp(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp ogt double %2, 3.700000e+01
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = fcmp ogt double %0, 0.000000e+00
%6 = select i1 %5, double 1.000000e+00, double 0.000000e+00
br label %48
7: ; preds = %1
%8 = fmul double %2, -5.000000e-01
%9 = fmul double %2, %8
%10 = tail call double @exp(double %9)
%11 = fcmp olt double %2, 7.071000e+00
br i1 %11, label %12, label %28
12: ; preds = %7
%13 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FA20DED0B57FBD0, double 0x3FE66989BE8EA720)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %2, double 0x40197EEFF2A86F23)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %2, double 0x4040F4D8CBB02431)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %2, double 0x405C05131CA58CF6)
%17 = tail call double @llvm.fmuladd.f64(double %16, double %2, double 0x406BA6D5C7A28CF5)
%18 = tail call double @llvm.fmuladd.f64(double %17, double %2, double 0x406B869EA974C7E9)
%19 = fmul double %18, %10
%20 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FB6A09E667F3BCD, double 0x3FFC173673887D1A)
%21 = tail call double @llvm.fmuladd.f64(double %20, double %2, double 0x4030106DF11BD48F)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %2, double 0x4055B1F78433A599)
%23 = tail call double @llvm.fmuladd.f64(double %22, double %2, double 0x4072890729BA781A)
%24 = tail call double @llvm.fmuladd.f64(double %23, double %2, double 0x4083EAAB47FA1778)
%25 = tail call double @llvm.fmuladd.f64(double %24, double %2, double 0x4088CE9CB298974E)
%26 = tail call double @llvm.fmuladd.f64(double %25, double %2, double 0x407B869EA974C7E9)
%27 = fdiv double %19, %26
br label %43
28: ; preds = %7
%29 = fadd double %2, 6.500000e-01
%30 = fdiv double 4.000000e+00, %29
%31 = fadd double %2, %30
%32 = fdiv double 3.000000e+00, %31
%33 = fadd double %2, %32
%34 = fdiv double 2.000000e+00, %33
%35 = fadd double %2, %34
%36 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %10, i64 0
%37 = insertelement <2 x double> <double 0x40040D931FF62707, double poison>, double %35, i64 1
%38 = fdiv <2 x double> %36, %37
%39 = extractelement <2 x double> %38, i64 1
%40 = fadd double %2, %39
%41 = extractelement <2 x double> %38, i64 0
%42 = fdiv double %41, %40
br label %43
43: ; preds = %28, %12
%44 = phi double [ %27, %12 ], [ %42, %28 ]
%45 = fcmp olt double %0, 0.000000e+00
%46 = fsub double 1.000000e+00, %44
%47 = select i1 %45, double %44, double %46
br label %48
48: ; preds = %43, %4
%49 = phi double [ %6, %4 ], [ %47, %43 ]
ret double %49
}