#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 gauss_integral(double z) {
  double b1;
  double b2;
  double b3;
  double b4;
  double b5;
  double p;
  double c2;
  double a;
  double t;
  double b;
  double n;
  if (z > 6.0)
    return 1.0;
  if (z < -6.0)
    return 0.0;
  b1 = 0.31938153;
  b2 = -0.356563782;
  b3 = 1.781477937;
  b4 = -1.821255978;
  b5 = 1.330274429;
  p = 0.2316419;
  c2 = 0.3989423;
  a = fabs(z);
  t = 1.0 / (1.0 + a * p);
  b = c2 * exp((-z) * (z / 2.0));
  n = ((((b5 * t + b4) * t + b3) * t + b2) * t + b1) * t;
  n = 1.0 - b * n;
  if (z < 0.0)
    n = 1.0 - n;
  return n;
}


x86 assembly (clang, -O0):
<gauss_integral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <gauss_integral+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1309 <gauss_integral+0x1f9>
movsd  0xeba(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1166 <gauss_integral+0x56>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1309 <gauss_integral+0x1f9>
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe64(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xe93(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe24(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe18(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xde4(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd3a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    12ff <gauss_integral+0x1ef>
movsd  0xd1b(%rip),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_integral>:
sub    $0x28,%rsp
ucomisd 0xeec(%rip),%xmm0
jbe    112b <gauss_integral+0x1b>
movsd  0xeda(%rip),%xmm0
add    $0x28,%rsp
ret
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
ucomisd %xmm2,%xmm1
ja     120f <gauss_integral+0xff>
movapd 0xf13(%rip),%xmm0
andpd  %xmm2,%xmm0
mulsd  0xebf(%rip),%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xea9(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
call   1030 <exp@plt>
movsd  0xe96(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  0xe8c(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe88(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe84(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe80(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  0xe7c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe20(%rip),%xmm1
addsd  %xmm1,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
xorpd  %xmm1,%xmm1
movapd 0x10(%rsp),%xmm3
cmpltsd %xmm1,%xmm3
movapd %xmm3,%xmm1
andnpd %xmm0,%xmm1
andpd  %xmm2,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @gauss_integral(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
%13 = alloca double
%14 = alloca double
store double %0, double* %3
%15 = load double, double* %3
%16 = fcmp ogt double %15, 6.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %1
store double 1.000000e+00, double* %2
br label %63
18: ; preds = %1
%19 = load double, double* %3
%20 = fcmp olt double %19, -6.000000e+00
br i1 %20, label %21, label %22
21: ; preds = %18
store double 0.000000e+00, double* %2
br label %63
22: ; preds = %18
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 0x3FD9884548DF6CE3, double* %10
%23 = load double, double* %3
%24 = call double @llvm.fabs.f64(double %23)
store double %24, double* %11
%25 = load double, double* %11
%26 = load double, double* %9
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double 1.000000e+00)
%28 = fdiv double 1.000000e+00, %27
store double %28, double* %12
%29 = load double, double* %10
%30 = load double, double* %3
%31 = fneg double %30
%32 = load double, double* %3
%33 = fdiv double %32, 2.000000e+00
%34 = fmul double %31, %33
%35 = call double @exp(double %34)
%36 = fmul double %29, %35
store double %36, double* %13
%37 = load double, double* %8
%38 = load double, double* %12
%39 = load double, double* %7
%40 = call double @llvm.fmuladd.f64(double %37, double %38, double %39)
%41 = load double, double* %12
%42 = load double, double* %6
%43 = call double @llvm.fmuladd.f64(double %40, double %41, double %42)
%44 = load double, double* %12
%45 = load double, double* %5
%46 = call double @llvm.fmuladd.f64(double %43, double %44, double %45)
%47 = load double, double* %12
%48 = load double, double* %4
%49 = call double @llvm.fmuladd.f64(double %46, double %47, double %48)
%50 = load double, double* %12
%51 = fmul double %49, %50
store double %51, double* %14
%52 = load double, double* %13
%53 = load double, double* %14
%54 = fneg double %52
%55 = call double @llvm.fmuladd.f64(double %54, double %53, double 1.000000e+00)
store double %55, double* %14
%56 = load double, double* %3
%57 = fcmp olt double %56, 0.000000e+00
br i1 %57, label %58, label %61
58: ; preds = %22
%59 = load double, double* %14
%60 = fsub double 1.000000e+00, %59
store double %60, double* %14
br label %61
61: ; preds = %58, %22
%62 = load double, double* %14
store double %62, double* %2
br label %63
63: ; preds = %61, %21, %17
%64 = load double, double* %2
ret double %64
}

LLVM IR (-O2):
define double @gauss_integral(double %0) {
%2 = fcmp ogt double %0, 6.000000e+00
br i1 %2, label %23, label %3
3: ; preds = %1
%4 = fcmp olt double %0, -6.000000e+00
br i1 %4, label %23, label %5
5: ; preds = %3
%6 = tail call double @llvm.fabs.f64(double %0)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FCDA6711871100E, double 1.000000e+00)
%8 = fdiv double 1.000000e+00, %7
%9 = fneg double %0
%10 = fmul double %0, 5.000000e-01
%11 = fmul double %10, %9
%12 = tail call double @exp(double %11)
%13 = tail call double @llvm.fmuladd.f64(double %8, double 0x3FF548CDD6F42943, double 0xBFFD23DD4EF278D0)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %8, double 0x3FFC80EF025F5E68)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %8, double 0xBFD6D1F0E5A8325B)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %8, double 0x3FD470BF3A92F8EC)
%17 = fmul double %8, %16
%18 = fmul double %12, 0xBFD9884548DF6CE3
%19 = tail call double @llvm.fmuladd.f64(double %18, double %17, double 1.000000e+00)
%20 = fcmp olt double %0, 0.000000e+00
%21 = fsub double 1.000000e+00, %19
%22 = select i1 %20, double %21, double %19
br label %23
23: ; preds = %3, %1, %5
%24 = phi double [ %22, %5 ], [ 1.000000e+00, %1 ], [ 0.000000e+00, %3 ]
ret double %24
}