#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 */
typedef int /*<<< orphan*/ ans;

/* Variables and functions */
double CSPL_Stats_Normal_CDFfn(double, double, double);
double CSPL_Stats_Normal_Quantilefn(double, double, double);
int fabs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double, double);
int main(void) {
  long i;
  double ans;
  double nCDF_ans[7] = {0.001349898, 0.022750132, 0.15865525, 0.5,
                        0.84134475,  0.97724987,  0.9986501};
  double nCDF_ins[7] = {-3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0};
  double Quantile_ans[1] = {1.96};
  double Quantile_ins[1] = {0.975};
  for (i = 0; i < 7; i++) {
    ans = CSPL_Stats_Normal_CDFfn(nCDF_ins[i], 0.0, 1.0);
    printf("CSPL_Stats_Normal_CDFfn(%lf) %lf != %lf\n", nCDF_ins[i], ans,
           nCDF_ans[i]);
    {
      if ((fabs((ans) - (nCDF_ans[i])) < (1e-4)) == 0)
        return (1);
    };
  }
  for (i = 0; i < 1; i++) {
    ans = CSPL_Stats_Normal_Quantilefn(Quantile_ins[i], 0.0, 1.0);
    printf("CSPL_Stats_Normal_Quantilefn(%lf) %lf != %lf\n", Quantile_ins[i],
           ans, Quantile_ans[i]);
    {
      if ((fabs((ans) - (Quantile_ans[i])) < (1e-2)) == 0)
        return (1);
    };
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xed3(%rip),%rsi
mov    $0x38,%edx
call   1060 <memcpy@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1040 <memset@plt>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe56(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe41(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe2c(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe17(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    0xe4b(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xe45(%rip),%rax
mov    %rax,-0xa0(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x7,-0x10(%rbp)
jge    12c2 <main+0x162>
mov    -0x10(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
xorps  %xmm1,%xmm1
movsd  0xddb(%rip),%xmm2
call   1080 <CSPL_Stats_Normal_CDFfn@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm2
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  -0x50(%rbp,%rax,8),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdad(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    12ac <main+0x14c>
movl   $0x1,-0x4(%rbp)
jmp    1387 <main+0x227>
jmp    12b1 <main+0x151>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1212 <main+0xb2>
movq   $0x0,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jge    1380 <main+0x220>
mov    -0x10(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
xorps  %xmm1,%xmm1
movsd  0xd23(%rip),%xmm2
call   1070 <CSPL_Stats_Normal_Quantilefn@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  -0x98(%rbp,%rax,8),%xmm2
ff ff
lea    0xd94(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  -0x98(%rbp,%rax,8),%xmm0
ff ff
cvttsd2si %xmm0,%edi
call   1050 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xce7(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    136a <main+0x20a>
movl   $0x1,-0x4(%rbp)
jmp    1387 <main+0x227>
jmp    136f <main+0x20f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    12ca <main+0x16a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movsd  0xeb3(%rip),%xmm0
movsd  0xeb3(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xf4a(%rip),%rdi
movsd  0xe9a(%rip),%xmm2
movsd  0xe82(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe87(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
mov    $0x1,%ebx
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xe71(%rip),%xmm0
movsd  0xe51(%rip),%xmm2
xorpd  %xmm1,%xmm1
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xee7(%rip),%rdi
movsd  0xe4f(%rip),%xmm2
movsd  0xe3f(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe3c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xe2b(%rip),%xmm0
movsd  0xdf3(%rip),%xmm2
xorpd  %xmm1,%xmm1
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xe89(%rip),%rdi
movsd  0xe09(%rip),%xmm2
movsd  0xdf9(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xdf6(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xd9d(%rip),%xmm2
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xe2f(%rip),%rdi
movsd  0xdbf(%rip),%xmm2
xorpd  %xmm0,%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xdb0(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xd47(%rip),%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xdd9(%rip),%rdi
movsd  0xd79(%rip),%xmm2
movsd  0xd19(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xd66(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xd55(%rip),%xmm0
movsd  0xce5(%rip),%xmm2
xorpd  %xmm1,%xmm1
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xd7b(%rip),%rdi
movsd  0xd33(%rip),%xmm2
movsd  0xd23(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xd20(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xd0f(%rip),%xmm0
movsd  0xc87(%rip),%xmm2
xorpd  %xmm1,%xmm1
call   1060 <CSPL_Stats_Normal_CDFfn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xd1d(%rip),%rdi
movsd  0xced(%rip),%xmm2
movsd  0xcdd(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xcda(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
test   %eax,%eax
jg     1428 <main+0x2e8>
movsd  0xccd(%rip),%xmm0
movsd  0xc2d(%rip),%xmm2
xorpd  %xmm1,%xmm1
call   1050 <CSPL_Stats_Normal_Quantilefn@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
lea    0xcec(%rip),%rdi
movsd  0xcab(%rip),%xmm2
movsd  0xc9b(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xc98(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fabs@plt>
xor    %ebx,%ebx
test   %eax,%eax
setg   %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nCDF_ans = [7 x double] [double 0x3F561DE1F0D3F0B6, double 0x3F974BCF83ADC166, double 0x3FC44ED0B30B5AA7, double 5.000000e-01, double 0x3FEAEC4BD33D2956, double 0x3FEF45A184F572B3, double 0x3FEFF4F10DF4B549]
@__const.main.Quantile_ans = [1 x double] [double 1.960000e+00]
@__const.main.Quantile_ins = [1 x double] [double 0x3FEF333333333333]
@.str = [41 x i8] c"CSPL_Stats_Normal_CDFfn(%lf) %lf != %lf\0A\00"
@.str.1 = [46 x i8] c"CSPL_Stats_Normal_Quantilefn(%lf) %lf != %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca double
%4 = alloca [7 x double]
%5 = alloca [7 x double]
%6 = alloca [1 x double]
%7 = alloca [1 x double]
store i32 0, i32* %1
%8 = bitcast [7 x double]* %4 to i8*
%9 = bitcast [7 x double]* %5 to i8*
%10 = bitcast i8* %9 to [7 x double]*
%11 = getelementptr inbounds [7 x double], [7 x double]* %10, i32 0, i32 0
store double -3.000000e+00, double* %11
%12 = getelementptr inbounds [7 x double], [7 x double]* %10, i32 0, i32 1
store double -2.000000e+00, double* %12
%13 = getelementptr inbounds [7 x double], [7 x double]* %10, i32 0, i32 2
store double -1.000000e+00, double* %13
%14 = getelementptr inbounds [7 x double], [7 x double]* %10, i32 0, i32 4
store double 1.000000e+00, double* %14
%15 = getelementptr inbounds [7 x double], [7 x double]* %10, i32 0, i32 5
store double 2.000000e+00, double* %15
%16 = getelementptr inbounds [7 x double], [7 x double]* %10, i32 0, i32 6
store double 3.000000e+00, double* %16
%17 = bitcast [1 x double]* %6 to i8*
%18 = bitcast [1 x double]* %7 to i8*
store i64 0, i64* %2
br label %19
19: ; preds = %48, %0
%20 = load i64, i64* %2
%21 = icmp slt i64 %20, 7
br i1 %21, label %22, label %51
22: ; preds = %19
%23 = load i64, i64* %2
%24 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 %23
%25 = load double, double* %24
%26 = call double @CSPL_Stats_Normal_CDFfn(double %25, double 0.000000e+00, double 1.000000e+00)
store double %26, double* %3
%27 = load i64, i64* %2
%28 = getelementptr inbounds [7 x double], [7 x double]* %5, i64 0, i64 %27
%29 = load double, double* %28
%30 = load double, double* %3
%31 = load i64, i64* %2
%32 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 %31
%33 = load double, double* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %29, double %30, double %33)
%35 = load double, double* %3
%36 = load i64, i64* %2
%37 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 %36
%38 = load double, double* %37
%39 = fsub double %35, %38
%40 = fptosi double %39 to i32
%41 = call i32 @fabs(i32 %40)
%42 = sitofp i32 %41 to double
%43 = fcmp olt double %42, 1.000000e-04
%44 = zext i1 %43 to i32
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %22
store i32 1, i32* %1
br label %85
47: ; preds = %22
br label %48
48: ; preds = %47
%49 = load i64, i64* %2
%50 = add nsw i64 %49, 1
store i64 %50, i64* %2
br label %19
51: ; preds = %19
store i64 0, i64* %2
br label %52
52: ; preds = %81, %51
%53 = load i64, i64* %2
%54 = icmp slt i64 %53, 1
br i1 %54, label %55, label %84
55: ; preds = %52
%56 = load i64, i64* %2
%57 = getelementptr inbounds [1 x double], [1 x double]* %7, i64 0, i64 %56
%58 = load double, double* %57
%59 = call double @CSPL_Stats_Normal_Quantilefn(double %58, double 0.000000e+00, double 1.000000e+00)
store double %59, double* %3
%60 = load i64, i64* %2
%61 = getelementptr inbounds [1 x double], [1 x double]* %7, i64 0, i64 %60
%62 = load double, double* %61
%63 = load double, double* %3
%64 = load i64, i64* %2
%65 = getelementptr inbounds [1 x double], [1 x double]* %6, i64 0, i64 %64
%66 = load double, double* %65
%67 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), double %62, double %63, double %66)
%68 = load double, double* %3
%69 = load i64, i64* %2
%70 = getelementptr inbounds [1 x double], [1 x double]* %6, i64 0, i64 %69
%71 = load double, double* %70
%72 = fsub double %68, %71
%73 = fptosi double %72 to i32
%74 = call i32 @fabs(i32 %73)
%75 = sitofp i32 %74 to double
%76 = fcmp olt double %75, 1.000000e-02
%77 = zext i1 %76 to i32
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %55
store i32 1, i32* %1
br label %85
80: ; preds = %55
br label %81
81: ; preds = %80
%82 = load i64, i64* %2
%83 = add nsw i64 %82, 1
store i64 %83, i64* %2
br label %52
84: ; preds = %52
store i32 0, i32* %1
br label %85
85: ; preds = %84, %79, %46
%86 = load i32, i32* %1
ret i32 %86
}

LLVM IR (-O2):
@.str = [41 x i8] c"CSPL_Stats_Normal_CDFfn(%lf) %lf != %lf\0A\00"
@.str.1 = [46 x i8] c"CSPL_Stats_Normal_Quantilefn(%lf) %lf != %lf\0A\00"
define i32 @main() {
%1 = tail call double @CSPL_Stats_Normal_CDFfn(double -3.000000e+00, double 0.000000e+00, double 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double -3.000000e+00, double %1, double 0x3F561DE1F0D3F0B6)
%3 = fadd double %1, 0xBF561DE1F0D3F0B6
%4 = fptosi double %3 to i32
%5 = tail call i32 @fabs(i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %57, label %7
7: ; preds = %0
%8 = tail call double @CSPL_Stats_Normal_CDFfn(double -2.000000e+00, double 0.000000e+00, double 1.000000e+00)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double -2.000000e+00, double %8, double 0x3F974BCF83ADC166)
%10 = fadd double %8, 0xBF974BCF83ADC166
%11 = fptosi double %10 to i32
%12 = tail call i32 @fabs(i32 %11)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %57, label %14
14: ; preds = %7
%15 = tail call double @CSPL_Stats_Normal_CDFfn(double -1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double -1.000000e+00, double %15, double 0x3FC44ED0B30B5AA7)
%17 = fadd double %15, 0xBFC44ED0B30B5AA7
%18 = fptosi double %17 to i32
%19 = tail call i32 @fabs(i32 %18)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %57, label %21
21: ; preds = %14
%22 = tail call double @CSPL_Stats_Normal_CDFfn(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, double %22, double 5.000000e-01)
%24 = fadd double %22, -5.000000e-01
%25 = fptosi double %24 to i32
%26 = tail call i32 @fabs(i32 %25)
%27 = icmp sgt i32 %26, 0
br i1 %27, label %57, label %28
28: ; preds = %21
%29 = tail call double @CSPL_Stats_Normal_CDFfn(double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double %29, double 0x3FEAEC4BD33D2956)
%31 = fadd double %29, 0xBFEAEC4BD33D2956
%32 = fptosi double %31 to i32
%33 = tail call i32 @fabs(i32 %32)
%34 = icmp sgt i32 %33, 0
br i1 %34, label %57, label %35
35: ; preds = %28
%36 = tail call double @CSPL_Stats_Normal_CDFfn(double 2.000000e+00, double 0.000000e+00, double 1.000000e+00)
%37 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, double %36, double 0x3FEF45A184F572B3)
%38 = fadd double %36, 0xBFEF45A184F572B3
%39 = fptosi double %38 to i32
%40 = tail call i32 @fabs(i32 %39)
%41 = icmp sgt i32 %40, 0
br i1 %41, label %57, label %42
42: ; preds = %35
%43 = tail call double @CSPL_Stats_Normal_CDFfn(double 3.000000e+00, double 0.000000e+00, double 1.000000e+00)
%44 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double 3.000000e+00, double %43, double 0x3FEFF4F10DF4B549)
%45 = fadd double %43, 0xBFEFF4F10DF4B549
%46 = fptosi double %45 to i32
%47 = tail call i32 @fabs(i32 %46)
%48 = icmp sgt i32 %47, 0
br i1 %48, label %57, label %49
49: ; preds = %42
%50 = tail call double @CSPL_Stats_Normal_Quantilefn(double 0x3FEF333333333333, double 0.000000e+00, double 1.000000e+00)
%51 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), double 0x3FEF333333333333, double %50, double 1.960000e+00)
%52 = fadd double %50, -1.960000e+00
%53 = fptosi double %52 to i32
%54 = tail call i32 @fabs(i32 %53)
%55 = icmp sgt i32 %54, 0
%56 = zext i1 %55 to i32
br label %57
57: ; preds = %0, %7, %14, %21, %28, %35, %42, %49
%58 = phi i32 [ %56, %49 ], [ 1, %42 ], [ 1, %35 ], [ 1, %28 ], [ 1, %21 ], [ 1, %14 ], [ 1, %7 ], [ 1, %0 ]
ret i32 %58
}