#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 */
scalar_t__ EOF;
int /*<<< orphan*/ free_vector(float *, int, int);
float gasdev(long *);
int /*<<< orphan*/ ks2d2s(float *, float *, unsigned long, float *, float *,
                          unsigned long, float *, float *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, ...);
float *vector(int, int);
int main(void) {
  long idum;
  unsigned long j, jtrial, n1, n2, ntrial;
  float d, prob, shrink, u, v;
  float *x1, *y1, *x2, *y2;
  x1 = vector(1, 1000);
  y1 = vector(1, 1000);
  x2 = vector(1, 1000);
  y2 = vector(1, 1000);
  for (;;) {
    printf("Input N1,N2\n");
    if (scanf("%lu %lu", &n1, &n2) == EOF)
      break;
    if (n1 > 1000) {
      printf("n1 too large.\n");
      continue;
    }
    if (n2 > 1000) {
      printf("n2 too large.\n");
      continue;
    }
    printf("What shrinkage?\n");
    if (scanf("%f", &shrink) == EOF)
      break;
    printf("How many trials?\n");
    if (scanf("%lu", &ntrial) == EOF)
      break;
    if (ntrial > 1000) {
      printf("Too many trials.\n");
      continue;
    }
    idum = -287 - ntrial - n1 - n2;
    for (jtrial = 1; jtrial <= ntrial; jtrial++) {
      for (j = 1; j <= n1; j++) {
        u = gasdev(&idum);
        v = gasdev(&idum) * shrink;
        x1[j] = u + v;
        y1[j] = u - v;
      }
      for (j = 1; j <= n2; j++) {
        u = gasdev(&idum) * shrink;
        v = gasdev(&idum);
        x2[j] = u + v;
        y2[j] = u - v;
      }
      ks2d2s(x1, y1, n1, x2, y2, n2, &d, &prob);
      printf("d, prob= %12.6f %12.6f\n", d, prob);
    }
  }
  free_vector(y2, 1, 1000);
  free_vector(x2, 1, 1000);
  free_vector(y1, 1, 1000);
  free_vector(x1, 1, 1000);
  printf("Normal completion\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1060 <vector@plt>
mov    %rax,-0x58(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1060 <vector@plt>
mov    %rax,-0x60(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1060 <vector@plt>
mov    %rax,-0x68(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1060 <vector@plt>
mov    %rax,-0x70(%rbp)
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3a(%rip),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1070 <scanf@plt>
mov    0x2dff(%rip),%rcx
cmp    (%rcx),%rax
jne    11f7 <main+0x97>
jmp    1441 <main+0x2e1>
cmpq   $0x3e8,-0x28(%rbp)
jbe    1218 <main+0xb8>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11be <main+0x5e>
cmpq   $0x3e8,-0x30(%rbp)
jbe    1239 <main+0xd9>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11be <main+0x5e>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdf6(%rip),%rdi
lea    -0x44(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    0x2d88(%rip),%rcx
cmp    (%rcx),%rax
jne    126e <main+0x10e>
jmp    1441 <main+0x2e1>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd8e(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    0x2d53(%rip),%rcx
cmp    (%rcx),%rax
jne    12a3 <main+0x143>
jmp    1441 <main+0x2e1>
cmpq   $0x3e8,-0x38(%rbp)
jbe    12c4 <main+0x164>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11be <main+0x5e>
mov    $0xfffffffffffffee1,%rax
sub    -0x38(%rbp),%rax
sub    -0x28(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x38(%rbp),%rax
ja     143c <main+0x2dc>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     1367 <main+0x207>
lea    -0x10(%rbp),%rdi
call   1080 <gasdev@plt>
movss  %xmm0,-0x48(%rbp)
lea    -0x10(%rbp),%rdi
call   1080 <gasdev@plt>
mulss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x48(%rbp),%xmm0
addss  -0x4c(%rbp),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x48(%rbp),%xmm0
subss  -0x4c(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    12f9 <main+0x199>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
ja     13dd <main+0x27d>
lea    -0x10(%rbp),%rdi
call   1080 <gasdev@plt>
mulss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
lea    -0x10(%rbp),%rdi
call   1080 <gasdev@plt>
movss  %xmm0,-0x4c(%rbp)
movss  -0x48(%rbp),%xmm0
addss  -0x4c(%rbp),%xmm0
mov    -0x68(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x48(%rbp),%xmm0
subss  -0x4c(%rbp),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    136f <main+0x20f>
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x3c(%rbp),%r10
lea    -0x40(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <ks2d2s@plt>
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x40(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc47(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    12e3 <main+0x183>
jmp    11be <main+0x5e>
mov    -0x70(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1050 <free_vector@plt>
mov    -0x68(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1050 <free_vector@plt>
mov    -0x60(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1050 <free_vector@plt>
mov    -0x58(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1050 <free_vector@plt>
lea    0xbef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1070 <vector@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1070 <vector@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1070 <vector@plt>
mov    %rax,%r12
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1070 <vector@plt>
mov    %rax,%r14
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
lea    0xe27(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x2df7(%rip),%rcx
cmp    (%rcx),%rax
jne    125b <main+0xeb>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1060 <free_vector@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1060 <free_vector@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1060 <free_vector@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1060 <free_vector@plt>
lea    0xe1c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x40(%rsp),%rbp
jmp    12a9 <main+0x139>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1030 <puts@plt>
lea    0xda7(%rip),%rdi
call   1030 <puts@plt>
lea    0xd78(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x2d48(%rip),%rcx
cmp    (%rcx),%rax
je     11f6 <main+0x86>
cmpq   $0x3e9,0x10(%rsp)
lea    0xdc8(%rip),%rdi
jae    1270 <main+0x100>
cmpq   $0x3e8,0x18(%rsp)
lea    0xda8(%rip),%rdi
ja     1270 <main+0x100>
lea    0xd5b(%rip),%rdi
call   1030 <puts@plt>
lea    0xd28(%rip),%rdi
lea    0x24(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x2cf5(%rip),%rcx
cmp    (%rcx),%rax
je     11f6 <main+0x86>
lea    0xd3c(%rip),%rdi
call   1030 <puts@plt>
lea    0xcf5(%rip),%rdi
lea    0x38(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x2cc6(%rip),%rcx
cmp    (%rcx),%rax
je     11f6 <main+0x86>
mov    0x38(%rsp),%rcx
lea    0xd19(%rip),%rdi
cmp    $0x3e8,%rcx
ja     1270 <main+0x100>
mov    0x10(%rsp),%rax
lea    (%rcx,%rax,1),%rdx
add    0x18(%rsp),%rdx
mov    $0xfffffffffffffee1,%rsi
sub    %rdx,%rsi
mov    %rsi,0x40(%rsp)
test   %rcx,%rcx
je     1275 <main+0x105>
mov    $0x1,%ecx
mov    %rcx,0x30(%rsp)
test   %rax,%rax
je     1450 <main+0x2e0>
nopl   (%rax)
mov    $0x1,%r13d
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1090 <gasdev@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbp,%rdi
call   1090 <gasdev@plt>
mulss  0x24(%rsp),%xmm0
movss  0xc(%rsp),%xmm2
movaps %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rbx,%r13,4)
subss  %xmm0,%xmm2
movss  %xmm2,(%r15,%r13,4)
add    $0x1,%r13
mov    0x10(%rsp),%rdx
cmp    %rdx,%r13
jbe    1390 <main+0x220>
cmpq   $0x0,0x18(%rsp)
je     145a <main+0x2ea>
mov    %rbx,%r13
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1090 <gasdev@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbp,%rdi
call   1090 <gasdev@plt>
movss  0xc(%rsp),%xmm2
movaps %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%r12,%rbx,4)
subss  %xmm0,%xmm2
movss  %xmm2,(%r14,%rbx,4)
add    $0x1,%rbx
mov    0x18(%rsp),%r9
cmp    %r9,%rbx
jbe    13f0 <main+0x280>
mov    0x10(%rsp),%rdx
mov    %r13,%rbx
jmp    145d <main+0x2ed>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
cmpq   $0x0,0x18(%rsp)
jne    13df <main+0x26f>
xor    %r9d,%r9d
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rcx
mov    %r14,%r8
lea    0x28(%rsp),%rax
push   %rax
lea    0x34(%rsp),%rax
push   %rax
call   1040 <ks2d2s@plt>
add    $0x10,%rsp
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x28(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xb72(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    0x30(%rsp),%rax
add    $0x1,%rax
cmp    0x38(%rsp),%rax
ja     1275 <main+0x105>
mov    %rax,0x30(%rsp)
mov    0x10(%rsp),%rax
test   %rax,%rax
jne    1380 <main+0x210>
jmp    1450 <main+0x2e0>

LLVM IR (-O0):
@.str = [13 x i8] c"Input N1,N2\0A\00"
@.str.1 = [8 x i8] c"%lu %lu\00"
@EOF = global i64 0
@.str.2 = [15 x i8] c"n1 too large.\0A\00"
@.str.3 = [15 x i8] c"n2 too large.\0A\00"
@.str.4 = [17 x i8] c"What shrinkage?\0A\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [18 x i8] c"How many trials?\0A\00"
@.str.7 = [4 x i8] c"%lu\00"
@.str.8 = [18 x i8] c"Too many trials.\0A\00"
@.str.9 = [24 x i8] c"d, prob= %12.6f %12.6f\0A\00"
@.str.10 = [19 x i8] c"Normal completion\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
store i32 0, i32* %1
%17 = call float* @vector(i32 1, i32 1000)
store float* %17, float** %13
%18 = call float* @vector(i32 1, i32 1000)
store float* %18, float** %14
%19 = call float* @vector(i32 1, i32 1000)
store float* %19, float** %15
%20 = call float* @vector(i32 1, i32 1000)
store float* %20, float** %16
br label %21
21: ; preds = %131, %52, %35, %30, %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%23 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64* %5, i64* %6)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %27
26: ; preds = %21
br label %132
27: ; preds = %21
%28 = load i64, i64* %5
%29 = icmp ugt i64 %28, 1000
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %21
32: ; preds = %27
%33 = load i64, i64* %6
%34 = icmp ugt i64 %33, 1000
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %21
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%39 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %10)
%40 = load i64, i64* @EOF
%41 = icmp eq i64 %39, %40
br i1 %41, label %42, label %43
42: ; preds = %37
br label %132
43: ; preds = %37
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%45 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64* %7)
%46 = load i64, i64* @EOF
%47 = icmp eq i64 %45, %46
br i1 %47, label %48, label %49
48: ; preds = %43
br label %132
49: ; preds = %43
%50 = load i64, i64* %7
%51 = icmp ugt i64 %50, 1000
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %21
54: ; preds = %49
%55 = load i64, i64* %7
%56 = sub i64 -287, %55
%57 = load i64, i64* %5
%58 = sub i64 %56, %57
%59 = load i64, i64* %6
%60 = sub i64 %58, %59
store i64 %60, i64* %2
store i64 1, i64* %4
br label %61
61: ; preds = %128, %54
%62 = load i64, i64* %4
%63 = load i64, i64* %7
%64 = icmp ule i64 %62, %63
br i1 %64, label %65, label %131
65: ; preds = %61
store i64 1, i64* %3
br label %66
66: ; preds = %87, %65
%67 = load i64, i64* %3
%68 = load i64, i64* %5
%69 = icmp ule i64 %67, %68
br i1 %69, label %70, label %90
70: ; preds = %66
%71 = call float @gasdev(i64* %2)
store float %71, float* %11
%72 = call float @gasdev(i64* %2)
%73 = load float, float* %10
%74 = fmul float %72, %73
store float %74, float* %12
%75 = load float, float* %11
%76 = load float, float* %12
%77 = fadd float %75, %76
%78 = load float*, float** %13
%79 = load i64, i64* %3
%80 = getelementptr inbounds float, float* %78, i64 %79
store float %77, float* %80
%81 = load float, float* %11
%82 = load float, float* %12
%83 = fsub float %81, %82
%84 = load float*, float** %14
%85 = load i64, i64* %3
%86 = getelementptr inbounds float, float* %84, i64 %85
store float %83, float* %86
br label %87
87: ; preds = %70
%88 = load i64, i64* %3
%89 = add i64 %88, 1
store i64 %89, i64* %3
br label %66
90: ; preds = %66
store i64 1, i64* %3
br label %91
91: ; preds = %112, %90
%92 = load i64, i64* %3
%93 = load i64, i64* %6
%94 = icmp ule i64 %92, %93
br i1 %94, label %95, label %115
95: ; preds = %91
%96 = call float @gasdev(i64* %2)
%97 = load float, float* %10
%98 = fmul float %96, %97
store float %98, float* %11
%99 = call float @gasdev(i64* %2)
store float %99, float* %12
%100 = load float, float* %11
%101 = load float, float* %12
%102 = fadd float %100, %101
%103 = load float*, float** %15
%104 = load i64, i64* %3
%105 = getelementptr inbounds float, float* %103, i64 %104
store float %102, float* %105
%106 = load float, float* %11
%107 = load float, float* %12
%108 = fsub float %106, %107
%109 = load float*, float** %16
%110 = load i64, i64* %3
%111 = getelementptr inbounds float, float* %109, i64 %110
store float %108, float* %111
br label %112
112: ; preds = %95
%113 = load i64, i64* %3
%114 = add i64 %113, 1
store i64 %114, i64* %3
br label %91
115: ; preds = %91
%116 = load float*, float** %13
%117 = load float*, float** %14
%118 = load i64, i64* %5
%119 = load float*, float** %15
%120 = load float*, float** %16
%121 = load i64, i64* %6
%122 = call i32 @ks2d2s(float* %116, float* %117, i64 %118, float* %119, float* %120, i64 %121, float* %8, float* %9)
%123 = load float, float* %8
%124 = fpext float %123 to double
%125 = load float, float* %9
%126 = fpext float %125 to double
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), double %124, double %126)
br label %128
128: ; preds = %115
%129 = load i64, i64* %4
%130 = add i64 %129, 1
store i64 %130, i64* %4
br label %61
131: ; preds = %61
br label %21
132: ; preds = %48, %42, %26
%133 = load float*, float** %16
%134 = call i32 @free_vector(float* %133, i32 1, i32 1000)
%135 = load float*, float** %15
%136 = call i32 @free_vector(float* %135, i32 1, i32 1000)
%137 = load float*, float** %14
%138 = call i32 @free_vector(float* %137, i32 1, i32 1000)
%139 = load float*, float** %13
%140 = call i32 @free_vector(float* %139, i32 1, i32 1000)
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%lu %lu\00"
@EOF = global i64 0
@.str.5 = [3 x i8] c"%f\00"
@.str.7 = [4 x i8] c"%lu\00"
@.str.9 = [24 x i8] c"d, prob= %12.6f %12.6f\0A\00"
@str = [12 x i8] c"Input N1,N2\00"
@str.11 = [16 x i8] c"What shrinkage?\00"
@str.12 = [17 x i8] c"How many trials?\00"
@str.13 = [17 x i8] c"Too many trials.\00"
@str.14 = [18 x i8] c"Normal completion\00"
@str.15 = [14 x i8] c"n2 too large.\00"
@str.16 = [14 x i8] c"n1 too large.\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = bitcast i64* %1 to i8*
%9 = bitcast i64* %2 to i8*
%10 = bitcast i64* %3 to i8*
%11 = bitcast i64* %4 to i8*
%12 = bitcast float* %5 to i8*
%13 = bitcast float* %6 to i8*
%14 = bitcast float* %7 to i8*
%15 = tail call float* @vector(i32 1, i32 1000)
%16 = tail call float* @vector(i32 1, i32 1000)
%17 = tail call float* @vector(i32 1, i32 1000)
%18 = tail call float* @vector(i32 1, i32 1000)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%20 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
%21 = load i64, i64* @EOF
%22 = icmp eq i64 %20, %21
br i1 %22, label %107, label %23
23: ; preds = %0, %29
%24 = load i64, i64* %2
%25 = icmp ugt i64 %24, 1000
br i1 %25, label %26, label %34
26: ; preds = %23, %47, %34
%27 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.15, i64 0, i64 0), %34 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0), %47 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.16, i64 0, i64 0), %23 ]
%28 = call i32 @puts(i8* dereferenceable(1) %27)
br label %29
29: ; preds = %93, %26, %50
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%31 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
%32 = load i64, i64* @EOF
%33 = icmp eq i64 %31, %32
br i1 %33, label %107, label %23
34: ; preds = %23
%35 = load i64, i64* %3
%36 = icmp ugt i64 %35, 1000
br i1 %36, label %26, label %37
37: ; preds = %34
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
%39 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %7)
%40 = load i64, i64* @EOF
%41 = icmp eq i64 %39, %40
br i1 %41, label %107, label %42
42: ; preds = %37
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0))
%44 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64* %4)
%45 = load i64, i64* @EOF
%46 = icmp eq i64 %44, %45
br i1 %46, label %107, label %47
47: ; preds = %42
%48 = load i64, i64* %4
%49 = icmp ugt i64 %48, 1000
br i1 %49, label %26, label %50
50: ; preds = %47
%51 = load i64, i64* %2
%52 = load i64, i64* %3
%53 = add i64 %48, %51
%54 = add i64 %53, %52
%55 = sub i64 -287, %54
store i64 %55, i64* %1
%56 = icmp eq i64 %48, 0
br i1 %56, label %29, label %57
57: ; preds = %50, %105
%58 = phi i64 [ %106, %105 ], [ %51, %50 ]
%59 = phi i64 [ %102, %105 ], [ 1, %50 ]
%60 = icmp eq i64 %58, 0
br i1 %60, label %61, label %65
61: ; preds = %65, %57
%62 = phi i64 [ 0, %57 ], [ %76, %65 ]
%63 = load i64, i64* %3
%64 = icmp eq i64 %63, 0
br i1 %64, label %93, label %78
65: ; preds = %57, %65
%66 = phi i64 [ %75, %65 ], [ 1, %57 ]
%67 = call float @gasdev(i64* %1)
%68 = call float @gasdev(i64* %1)
%69 = load float, float* %7
%70 = fmul float %68, %69
%71 = fadd float %67, %70
%72 = getelementptr inbounds float, float* %15, i64 %66
store float %71, float* %72
%73 = fsub float %67, %70
%74 = getelementptr inbounds float, float* %16, i64 %66
store float %73, float* %74
%75 = add i64 %66, 1
%76 = load i64, i64* %2
%77 = icmp ugt i64 %75, %76
br i1 %77, label %61, label %65
78: ; preds = %61, %78
%79 = phi i64 [ %88, %78 ], [ 1, %61 ]
%80 = call float @gasdev(i64* %1)
%81 = load float, float* %7
%82 = fmul float %80, %81
%83 = call float @gasdev(i64* %1)
%84 = fadd float %82, %83
%85 = getelementptr inbounds float, float* %17, i64 %79
store float %84, float* %85
%86 = fsub float %82, %83
%87 = getelementptr inbounds float, float* %18, i64 %79
store float %86, float* %87
%88 = add i64 %79, 1
%89 = load i64, i64* %3
%90 = icmp ugt i64 %88, %89
br i1 %90, label %91, label %78
91: ; preds = %78
%92 = load i64, i64* %2
br label %93
93: ; preds = %91, %61
%94 = phi i64 [ %62, %61 ], [ %92, %91 ]
%95 = phi i64 [ 0, %61 ], [ %89, %91 ]
%96 = call i32 @ks2d2s(float* %15, float* %16, i64 %94, float* %17, float* %18, i64 %95, float* %5, float* %6)
%97 = load float, float* %5
%98 = fpext float %97 to double
%99 = load float, float* %6
%100 = fpext float %99 to double
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), double %98, double %100)
%102 = add i64 %59, 1
%103 = load i64, i64* %4
%104 = icmp ugt i64 %102, %103
br i1 %104, label %29, label %105
105: ; preds = %93
%106 = load i64, i64* %2
br label %57
107: ; preds = %29, %37, %42, %0
%108 = call i32 @free_vector(float* %18, i32 1, i32 1000)
%109 = call i32 @free_vector(float* %17, i32 1, i32 1000)
%110 = call i32 @free_vector(float* %16, i32 1, i32 1000)
%111 = call i32 @free_vector(float* %15, i32 1, i32 1000)
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.14, i64 0, i64 0))
ret i32 0
}