#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 */
struct KIrand {
  int dummy;
};

/* Variables and functions */
double KIrand_Gaussian(struct KIrand *);
int /*<<< orphan*/ KIrand_free(struct KIrand *);
struct KIrand *KIrand_init();
int /*<<< orphan*/ KIrand_init_genrand(struct KIrand *, unsigned long);
scalar_t__ compare_max(double, double, char *, int, double, double *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int check_KIrand_Gaussian(int verbose, double tiny) {
  if (verbose != 0) {
    fprintf(stdout, "==================================================\n"
                    "check_KIrand_Gaussian : start\n");
  }
  int check = 0;
  double max = 0.0;
  int n = 1000000;
  double *x0 = (double *)malloc(sizeof(double) * n);
  if (x0 == NULL) {
    fprintf(stderr, "check_KIrand_Gaussian"
                    " : malloc error for "
                    "x0"
                    "\n");
    exit(1);
  };
  int i;
  unsigned long seed = 0;
  struct KIrand *rng = KIrand_init();
  if (rng == NULL) {
    fprintf(stderr, "check_KIrand_Gaussian"
                    " : malloc error for "
                    "rng"
                    "\n");
    exit(1);
  };
  KIrand_init_genrand(rng, seed);
  for (i = 0; i < n; i++) {
    x0[i] = KIrand_Gaussian(rng);
  }
  KIrand_free(rng);
  double mean = 0.0;
  for (i = 0; i < n; i++) {
    mean += x0[i];
  }
  mean /= (double)n;
  double vari = 0.0;
  for (i = 0; i < n; i++) {
    vari += (x0[i] - mean) * (x0[i] - mean);
  }
  vari /= (double)n;
  check += compare_max(mean + 1.0, 1.0, " mean", verbose, tiny, &max);
  check += compare_max(vari, 1.0, " vari", verbose, tiny, &max);
  free(x0);
  if (verbose != 0) {
    fprintf(stdout, " max error = %e vs tiny = %e\n", max, tiny);
    if (check == 0)
      fprintf(stdout, " => PASSED\n\n");
    else
      fprintf(stdout, " => FAILED\n\n");
  }
  return (check);
}


x86 assembly (clang, -O0):
<check_KIrand_Gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11c1 <check_KIrand_Gaussian+0x31>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0xf4240,-0x24(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1216 <check_KIrand_Gaussian+0x86>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
lea    0xe55(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
movq   $0x0,-0x40(%rbp)
mov    $0x0,%al
call   1070 <KIrand_init@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1255 <check_KIrand_Gaussian+0xc5>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
lea    0xe43(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1060 <KIrand_init_genrand@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1299 <check_KIrand_Gaussian+0x109>
mov    -0x48(%rbp),%rdi
call   1040 <KIrand_Gaussian@plt>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1269 <check_KIrand_Gaussian+0xd9>
mov    -0x48(%rbp),%rdi
call   1050 <KIrand_free@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12e2 <check_KIrand_Gaussian+0x152>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12b1 <check_KIrand_Gaussian+0x121>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1354 <check_KIrand_Gaussian+0x1c4>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1304 <check_KIrand_Gaussian+0x174>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xc91(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x4(%rbp),%esi
movsd  -0x10(%rbp),%xmm2
movsd  0xc7c(%rip),%xmm1
lea    0xd2a(%rip),%rdi
lea    -0x20(%rbp),%rdx
call   1090 <compare_max@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x4(%rbp),%esi
movsd  -0x10(%rbp),%xmm2
movsd  0xc4a(%rip),%xmm1
lea    0xcfe(%rip),%rdi
lea    -0x20(%rbp),%rdx
call   1090 <compare_max@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x4(%rbp)
je     1449 <check_KIrand_Gaussian+0x2b9>
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xcc1(%rip),%rsi
mov    $0x2,%al
call   1080 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    142d <check_KIrand_Gaussian+0x29d>
mov    0x2bc0(%rip),%rax
mov    (%rax),%edi
lea    0xcbe(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1444 <check_KIrand_Gaussian+0x2b4>
mov    0x2ba4(%rip),%rax
mov    (%rax),%edi
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1449 <check_KIrand_Gaussian+0x2b9>
mov    -0x14(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_KIrand_Gaussian>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
mov    %edi,%r14d
test   %edi,%edi
je     11bd <check_KIrand_Gaussian+0x2d>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
movq   $0x0,0x8(%rsp)
mov    $0x7a1200,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     13a9 <check_KIrand_Gaussian+0x219>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <KIrand_init@plt>
test   %rax,%rax
je     13bb <check_KIrand_Gaussian+0x22b>
mov    %rax,%r15
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
call   1060 <KIrand_init_genrand@plt>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <KIrand_Gaussian@plt>
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0xf4240,%rbp
jne    1200 <check_KIrand_Gaussian+0x70>
mov    %r15,%rdi
call   1050 <KIrand_free@plt>
xorpd  %xmm0,%xmm0
mov    $0x7,%eax
nopl   0x0(%rax,%rax,1)
addsd  -0x38(%rbx,%rax,8),%xmm0
addsd  -0x30(%rbx,%rax,8),%xmm0
addsd  -0x28(%rbx,%rax,8),%xmm0
addsd  -0x20(%rbx,%rax,8),%xmm0
addsd  -0x18(%rbx,%rax,8),%xmm0
addsd  -0x10(%rbx,%rax,8),%xmm0
addsd  -0x8(%rbx,%rax,8),%xmm0
addsd  (%rbx,%rax,8),%xmm0
add    $0x8,%rax
cmp    $0xf4247,%rax
jne    1230 <check_KIrand_Gaussian+0xa0>
divsd  0xd8d(%rip),%xmm0
xorpd  %xmm4,%xmm4
mov    $0x4,%eax
movsd  (%rsp),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  -0x20(%rbx,%rax,8),%xmm1
movsd  -0x18(%rbx,%rax,8),%xmm3
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm4,%xmm1
subsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm3
addsd  %xmm1,%xmm3
movsd  -0x10(%rbx,%rax,8),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
movsd  -0x8(%rbx,%rax,8),%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm3
addsd  %xmm1,%xmm3
movsd  (%rbx,%rax,8),%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm4,%xmm4
addsd  %xmm3,%xmm4
add    $0x5,%rax
cmp    $0xf4244,%rax
jne    1290 <check_KIrand_Gaussian+0x100>
divsd  0xd03(%rip),%xmm4
movsd  %xmm4,0x10(%rsp)
movsd  0xcfd(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xda7(%rip),%rdi
lea    0x8(%rsp),%r15
mov    %r14d,%esi
mov    %r15,%rdx
call   1090 <compare_max@plt>
mov    %rax,%rbp
lea    0xd93(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0xcca(%rip),%xmm1
mov    %r14d,%esi
movsd  (%rsp),%xmm2
mov    %r15,%rdx
call   1090 <compare_max@plt>
add    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r14d,%r14d
je     139c <check_KIrand_Gaussian+0x20c>
mov    0x2c74(%rip),%rbx
mov    (%rbx),%edi
movsd  0x8(%rsp),%xmm0
lea    0xd56(%rip),%rsi
movsd  (%rsp),%xmm1
mov    $0x2,%al
call   1080 <fprintf@plt>
test   %ebp,%ebp
mov    (%rbx),%edi
lea    0xd5d(%rip),%rax
lea    0xd63(%rip),%rsi
cmove  %rax,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c30(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
jmp    13cb <check_KIrand_Gaussian+0x23b>
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
lea    0xcc4(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.KIrand = type { i32 }
@stdout = global i32 0
@.str = [82 x i8] c"==================================================\0Acheck_KIrand_Gaussian : start\0A\00"
@stderr = global i32 0
@.str.1 = [45 x i8] c"check_KIrand_Gaussian : malloc error for x0\0A\00"
@.str.2 = [46 x i8] c"check_KIrand_Gaussian : malloc error for rng\0A\00"
@.str.3 = [6 x i8] c" mean\00"
@.str.4 = [6 x i8] c" vari\00"
@.str.5 = [30 x i8] c" max error = %e vs tiny = %e\0A\00"
@.str.6 = [13 x i8] c" => PASSED\0A\0A\00"
@.str.7 = [13 x i8] c" => FAILED\0A\0A\00"
define i32 @check_KIrand_Gaussian(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i64
%11 = alloca %struct.KIrand*
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* @stdout
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %16, %2
store i32 0, i32* %5
store double 0.000000e+00, double* %6
store i32 1000000, i32* %7
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = mul i64 8, %21
%23 = trunc i64 %22 to i32
%24 = call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to double*
store double* %25, double** %8
%26 = load double*, double** %8
%27 = icmp eq double* %26, null
br i1 %27, label %28, label %32
28: ; preds = %19
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %19
store i64 0, i64* %10
%33 = call %struct.KIrand* (...) @KIrand_init()
store %struct.KIrand* %33, %struct.KIrand** %11
%34 = load %struct.KIrand*, %struct.KIrand** %11
%35 = icmp eq %struct.KIrand* %34, null
br i1 %35, label %36, label %40
36: ; preds = %32
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %32
%41 = load %struct.KIrand*, %struct.KIrand** %11
%42 = load i64, i64* %10
%43 = call i32 @KIrand_init_genrand(%struct.KIrand* %41, i64 %42)
store i32 0, i32* %9
br label %44
44: ; preds = %55, %40
%45 = load i32, i32* %9
%46 = load i32, i32* %7
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %58
48: ; preds = %44
%49 = load %struct.KIrand*, %struct.KIrand** %11
%50 = call double @KIrand_Gaussian(%struct.KIrand* %49)
%51 = load double*, double** %8
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
store double %50, double* %54
br label %55
55: ; preds = %48
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
br label %44
58: ; preds = %44
%59 = load %struct.KIrand*, %struct.KIrand** %11
%60 = call i32 @KIrand_free(%struct.KIrand* %59)
store double 0.000000e+00, double* %12
store i32 0, i32* %9
br label %61
61: ; preds = %73, %58
%62 = load i32, i32* %9
%63 = load i32, i32* %7
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %76
65: ; preds = %61
%66 = load double*, double** %8
%67 = load i32, i32* %9
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = load double, double* %12
%72 = fadd double %71, %70
store double %72, double* %12
br label %73
73: ; preds = %65
%74 = load i32, i32* %9
%75 = add nsw i32 %74, 1
store i32 %75, i32* %9
br label %61
76: ; preds = %61
%77 = load i32, i32* %7
%78 = sitofp i32 %77 to double
%79 = load double, double* %12
%80 = fdiv double %79, %78
store double %80, double* %12
store double 0.000000e+00, double* %13
store i32 0, i32* %9
br label %81
81: ; preds = %102, %76
%82 = load i32, i32* %9
%83 = load i32, i32* %7
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %105
85: ; preds = %81
%86 = load double*, double** %8
%87 = load i32, i32* %9
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
%90 = load double, double* %89
%91 = load double, double* %12
%92 = fsub double %90, %91
%93 = load double*, double** %8
%94 = load i32, i32* %9
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
%97 = load double, double* %96
%98 = load double, double* %12
%99 = fsub double %97, %98
%100 = load double, double* %13
%101 = call double @llvm.fmuladd.f64(double %92, double %99, double %100)
store double %101, double* %13
br label %102
102: ; preds = %85
%103 = load i32, i32* %9
%104 = add nsw i32 %103, 1
store i32 %104, i32* %9
br label %81
105: ; preds = %81
%106 = load i32, i32* %7
%107 = sitofp i32 %106 to double
%108 = load double, double* %13
%109 = fdiv double %108, %107
store double %109, double* %13
%110 = load double, double* %12
%111 = fadd double %110, 1.000000e+00
%112 = load i32, i32* %3
%113 = load double, double* %4
%114 = call i64 @compare_max(double %111, double 1.000000e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %112, double %113, double* %6)
%115 = load i32, i32* %5
%116 = sext i32 %115 to i64
%117 = add nsw i64 %116, %114
%118 = trunc i64 %117 to i32
store i32 %118, i32* %5
%119 = load double, double* %13
%120 = load i32, i32* %3
%121 = load double, double* %4
%122 = call i64 @compare_max(double %119, double 1.000000e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %120, double %121, double* %6)
%123 = load i32, i32* %5
%124 = sext i32 %123 to i64
%125 = add nsw i64 %124, %122
%126 = trunc i64 %125 to i32
store i32 %126, i32* %5
%127 = load double*, double** %8
%128 = call i32 @free(double* %127)
%129 = load i32, i32* %3
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %145
131: ; preds = %105
%132 = load i32, i32* @stdout
%133 = load double, double* %6
%134 = load double, double* %4
%135 = call i32 (i32, i8*, ...) @fprintf(i32 %132, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %133, double %134)
%136 = load i32, i32* %5
%137 = icmp eq i32 %136, 0
br i1 %137, label %138, label %141
138: ; preds = %131
%139 = load i32, i32* @stdout
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %144
141: ; preds = %131
%142 = load i32, i32* @stdout
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %144
144: ; preds = %141, %138
br label %145
145: ; preds = %144, %105
%146 = load i32, i32* %5
ret i32 %146
}

LLVM IR (-O2):
%struct.KIrand = type { i32 }
@stdout = global i32 0
@.str = [82 x i8] c"==================================================\0Acheck_KIrand_Gaussian : start\0A\00"
@stderr = global i32 0
@.str.1 = [45 x i8] c"check_KIrand_Gaussian : malloc error for x0\0A\00"
@.str.2 = [46 x i8] c"check_KIrand_Gaussian : malloc error for rng\0A\00"
@.str.3 = [6 x i8] c" mean\00"
@.str.4 = [6 x i8] c" vari\00"
@.str.5 = [30 x i8] c" max error = %e vs tiny = %e\0A\00"
@.str.6 = [13 x i8] c" => PASSED\0A\0A\00"
@.str.7 = [13 x i8] c" => FAILED\0A\0A\00"
define i32 @check_KIrand_Gaussian(i32 %0, double %1) {
%3 = alloca double
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
%9 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%10 = tail call i64 @malloc(i32 8000000)
%11 = inttoptr i64 %10 to double*
%12 = icmp eq i64 %10, 0
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %8
%18 = tail call %struct.KIrand* (...) @KIrand_init()
%19 = icmp eq %struct.KIrand* %18, null
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %17
%25 = tail call i32 @KIrand_init_genrand(%struct.KIrand* %18, i64 0)
br label %26
26: ; preds = %24, %26
%27 = phi i64 [ 0, %24 ], [ %30, %26 ]
%28 = tail call double @KIrand_Gaussian(%struct.KIrand* %18)
%29 = getelementptr inbounds double, double* %11, i64 %27
store double %28, double* %29
%30 = add nuw nsw i64 %27, 1
%31 = icmp eq i64 %30, 1000000
br i1 %31, label %32, label %26
32: ; preds = %26
%33 = tail call i32 @KIrand_free(%struct.KIrand* %18)
br label %34
34: ; preds = %34, %32
%35 = phi i64 [ 0, %32 ], [ %68, %34 ]
%36 = phi double [ 0.000000e+00, %32 ], [ %67, %34 ]
%37 = getelementptr inbounds double, double* %11, i64 %35
%38 = load double, double* %37
%39 = fadd double %36, %38
%40 = or i64 %35, 1
%41 = getelementptr inbounds double, double* %11, i64 %40
%42 = load double, double* %41
%43 = fadd double %39, %42
%44 = or i64 %35, 2
%45 = getelementptr inbounds double, double* %11, i64 %44
%46 = load double, double* %45
%47 = fadd double %43, %46
%48 = or i64 %35, 3
%49 = getelementptr inbounds double, double* %11, i64 %48
%50 = load double, double* %49
%51 = fadd double %47, %50
%52 = or i64 %35, 4
%53 = getelementptr inbounds double, double* %11, i64 %52
%54 = load double, double* %53
%55 = fadd double %51, %54
%56 = or i64 %35, 5
%57 = getelementptr inbounds double, double* %11, i64 %56
%58 = load double, double* %57
%59 = fadd double %55, %58
%60 = or i64 %35, 6
%61 = getelementptr inbounds double, double* %11, i64 %60
%62 = load double, double* %61
%63 = fadd double %59, %62
%64 = or i64 %35, 7
%65 = getelementptr inbounds double, double* %11, i64 %64
%66 = load double, double* %65
%67 = fadd double %63, %66
%68 = add nuw nsw i64 %35, 8
%69 = icmp eq i64 %68, 1000000
br i1 %69, label %70, label %34
70: ; preds = %34
%71 = fdiv double %67, 1.000000e+06
br label %72
72: ; preds = %72, %70
%73 = phi i64 [ 0, %70 ], [ %99, %72 ]
%74 = phi double [ 0.000000e+00, %70 ], [ %98, %72 ]
%75 = getelementptr inbounds double, double* %11, i64 %73
%76 = load double, double* %75
%77 = fsub double %76, %71
%78 = tail call double @llvm.fmuladd.f64(double %77, double %77, double %74)
%79 = add nuw nsw i64 %73, 1
%80 = getelementptr inbounds double, double* %11, i64 %79
%81 = load double, double* %80
%82 = fsub double %81, %71
%83 = tail call double @llvm.fmuladd.f64(double %82, double %82, double %78)
%84 = add nuw nsw i64 %73, 2
%85 = getelementptr inbounds double, double* %11, i64 %84
%86 = load double, double* %85
%87 = fsub double %86, %71
%88 = tail call double @llvm.fmuladd.f64(double %87, double %87, double %83)
%89 = add nuw nsw i64 %73, 3
%90 = getelementptr inbounds double, double* %11, i64 %89
%91 = load double, double* %90
%92 = fsub double %91, %71
%93 = tail call double @llvm.fmuladd.f64(double %92, double %92, double %88)
%94 = add nuw nsw i64 %73, 4
%95 = getelementptr inbounds double, double* %11, i64 %94
%96 = load double, double* %95
%97 = fsub double %96, %71
%98 = tail call double @llvm.fmuladd.f64(double %97, double %97, double %93)
%99 = add nuw nsw i64 %73, 5
%100 = icmp eq i64 %99, 1000000
br i1 %100, label %101, label %72
101: ; preds = %72
%102 = fdiv double %98, 1.000000e+06
%103 = fadd double %71, 1.000000e+00
%104 = call i64 @compare_max(double %103, double 1.000000e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %0, double %1, double* %3)
%105 = call i64 @compare_max(double %102, double 1.000000e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %0, double %1, double* %3)
%106 = add i64 %105, %104
%107 = trunc i64 %106 to i32
%108 = call i32 @free(double* %11)
br i1 %4, label %117, label %109
109: ; preds = %101
%110 = load i32, i32* @stdout
%111 = load double, double* %3
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %111, double %1)
%113 = icmp eq i32 %107, 0
%114 = load i32, i32* @stdout
%115 = select i1 %113, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0)
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* %115)
br label %117
117: ; preds = %109, %101
ret i32 %107
}