#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 scalar_t__ clock_t;

/* Variables and functions */
float CLOCKS_PER_SEC;
int atoi(char *);
scalar_t__ clock();
int /*<<< orphan*/ free_2d(float **);
int /*<<< orphan*/ init(float **, int, int);
float **malloc_2d(int, int);
int /*<<< orphan*/ printf(char *, float, float, ...);
int /*<<< orphan*/ update(float **, float **, float *, int, int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  float eps;
  float **u, **unew;
  float norm = 0e0, mlups = 0e0;
  int maxiter, nx, ny, iter, ndef = 2400;
  clock_t t_start, t_end;
  float dt;
  eps = 0.5e-3;
  maxiter = (int)(1e0 / eps);
  switch (argc) {
  case 1:
    nx = ndef;
    ny = nx;
    break;
  case 2:
    nx = atoi(argv[1]);
    ny = nx;
    break;
  case 3:
    nx = atoi(argv[1]);
    ny = atoi(argv[2]);
    break;
  default:
    usage(argv[0]);
    return -1;
  }
  printf("Stencil: nx,ny,maxiter,eps=%d %d %d %18.16f\n", nx, ny, maxiter, eps);
  u = malloc_2d(nx + 2, ny + 2);
  unew = malloc_2d(nx + 2, ny + 2);
#pragma acc data create(u [0:nx + 2] [0:ny + 2], unew [0:nx + 2] [0:ny + 2])
  {
    init(u, nx, ny);
    init(unew, nx, ny);
    t_start = clock();
    norm = eps + 1;
    iter = 0;
    while (iter <= maxiter && norm >= eps) {
      update(unew, u, NULL, nx, ny);
      update(u, unew, &norm, nx, ny);
      iter = iter + 2;
      if (iter % 100 == 0 || norm < eps) {
        printf("%d : norm, eps= %18.16f %18.16f\n", iter, norm, eps);
      }
    }
  }
  free_2d(u);
  free_2d(unew);
  mlups = 1.0e-6 * iter * nx * ny;
  t_end = clock();
  dt = ((float)(t_end - t_start)) / CLOCKS_PER_SEC;
  printf("Stencil: norm =%18.16f with iter = %d\n", norm, iter);
  printf("Stencil: Time =%18.16f sec, MLups/s=%18.16f\n", dt,
         (float)mlups / dt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x960,-0x44(%rbp)
movl   $0x3a03126f,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe3d(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x60(%rbp)
sub    $0x1,%eax
je     1204 <main+0x84>
jmp    11e2 <main+0x62>
mov    -0x60(%rbp),%eax
sub    $0x2,%eax
je     1215 <main+0x95>
jmp    11f3 <main+0x73>
mov    -0x60(%rbp),%eax
sub    $0x3,%eax
je     1230 <main+0xb0>
jmp    1255 <main+0xd5>
mov    -0x44(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    126d <main+0xed>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    126d <main+0xed>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x3c(%rbp)
jmp    126d <main+0xed>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1455 <main+0x2d5>
cvtsi2ssl -0x38(%rbp),%xmm0
cvtsi2ssl -0x3c(%rbp),%xmm1
mov    -0x34(%rbp),%esi
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xd8a(%rip),%rdi
mov    $0x3,%al
call   1060 <printf@plt>
mov    -0x38(%rbp),%edi
add    $0x2,%edi
mov    -0x3c(%rbp),%esi
add    $0x2,%esi
call   1040 <malloc_2d@plt>
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%edi
add    $0x2,%edi
mov    -0x3c(%rbp),%esi
add    $0x2,%esi
call   1040 <malloc_2d@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
call   1070 <init@plt>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
call   1070 <init@plt>
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,-0x50(%rbp)
movss  0xd24(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%ecx
xor    %eax,%eax
cmp    -0x34(%rbp),%ecx
mov    %al,-0x61(%rbp)
jg     131d <main+0x19d>
movss  -0x2c(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
setae  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    132d <main+0x1ad>
jmp    13b3 <main+0x233>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edx
call   1030 <update@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
lea    -0x2c(%rbp),%rdx
call   1030 <update@plt>
mov    -0x40(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     138d <main+0x20d>
movss  -0x2c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    13ae <main+0x22e>
cvtsi2ssl -0x40(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xc9a(%rip),%rdi
mov    $0x3,%al
call   1060 <printf@plt>
jmp    12fd <main+0x17d>
mov    -0x20(%rbp),%rdi
call   1080 <free_2d@plt>
mov    -0x28(%rbp),%rdi
call   1080 <free_2d@plt>
cvtsi2sdl -0x40(%rbp),%xmm1
movsd  0xc36(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
sub    -0x50(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    0x2bd8(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtsi2ssl -0x40(%rbp),%xmm1
lea    0xc38(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movss  -0x5c(%rbp),%xmm0
movss  -0x30(%rbp),%xmm1
divss  -0x5c(%rbp),%xmm1
lea    0xc42(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x1,%edi
je     11b5 <main+0x35>
mov    %rsi,%rbx
cmp    $0x3,%edi
je     11c3 <main+0x43>
cmp    $0x2,%edi
jne    13db <main+0x25b>
mov    0x8(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r14d
mov    %eax,%r15d
jmp    11db <main+0x5b>
mov    $0x960,%r14d
mov    $0x960,%r15d
jmp    11db <main+0x5b>
mov    0x8(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r15d
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r14d
cvtsi2ss %r15d,%xmm0
cvtsi2ss %r14d,%xmm1
lea    0xe28(%rip),%rdi
movsd  0xe0c(%rip),%xmm2
mov    $0x7cf,%esi
mov    $0x3,%al
call   1060 <printf@plt>
lea    0x2(%r15),%ebx
lea    0x2(%r14),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <malloc_2d@plt>
mov    %rax,%r12
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <malloc_2d@plt>
mov    %rax,%rbx
mov    %r12,0x20(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <init@plt>
mov    %rbx,0x18(%rsp)
mov    %rbx,%rdi
mov    %r15,0x28(%rsp)
mov    %r15d,%esi
mov    %r14,0x8(%rsp)
mov    %r14d,%edx
call   1070 <init@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <clock@plt>
mov    %rax,0x30(%rsp)
movl   $0x3f801062,0x4(%rsp)
3f
mov    $0x2,%r12w
mov    0x18(%rsp),%r14
mov    0x28(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,0x10(%rsp)
movzwl %r12w,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%eax
shr    $0x11,%eax
imul   $0x64,%eax,%r15d
mov    %r14,%rdi
mov    0x20(%rsp),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
mov    %r13d,%ecx
mov    0x8(%rsp),%rbp
mov    %ebp,%r8d
call   1030 <update@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%rbx
mov    %r14,%rsi
lea    0x4(%rsp),%rdx
mov    %r13d,%ecx
mov    %ebp,%r8d
call   1030 <update@plt>
lea    0x2(%rbx),%ebp
add    $0xfffffffe,%r15d
movss  0x4(%rsp),%xmm1
cmp    %bx,%r15w
je     12f1 <main+0x171>
movss  0xd24(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1314 <main+0x194>
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
lea    0xd42(%rip),%rdi
movsd  0xcf9(%rip),%xmm2
mov    $0x3,%al
call   1060 <printf@plt>
movss  0x4(%rsp),%xmm1
cmp    $0x7cd,%ebx
ja     132f <main+0x1af>
add    $0x2,%r12d
ucomiss 0xce9(%rip),%xmm1
mov    %ebp,%ebx
jae    1280 <main+0x100>
mov    0x20(%rsp),%rdi
call   1080 <free_2d@plt>
mov    0x18(%rsp),%rdi
call   1080 <free_2d@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xcb6(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x28(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdl 0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm0,0x10(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <clock@plt>
sub    0x30(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2c52(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
lea    0xcae(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x10(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
divss  %xmm0,%xmm1
lea    0xcb7(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
jmp    13e8 <main+0x268>
mov    (%rbx),%rdi
call   1090 <usage@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Stencil: nx,ny,maxiter,eps=%d %d %d %18.16f\0A\00"
@.str.1 = [33 x i8] c"%d : norm, eps= %18.16f %18.16f\0A\00"
@CLOCKS_PER_SEC = global float 0.000000e+00
@.str.2 = [39 x i8] c"Stencil: norm =%18.16f with iter = %d\0A\00"
@.str.3 = [45 x i8] c"Stencil: Time =%18.16f sec, MLups/s=%18.16f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float**
%8 = alloca float**
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64
%17 = alloca i64
%18 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %9
store float 0.000000e+00, float* %10
store i32 2400, i32* %15
store float 0x3F40624DE0000000, float* %6
%19 = load float, float* %6
%20 = fpext float %19 to double
%21 = fdiv double 1.000000e+00, %20
%22 = fptosi double %21 to i32
store i32 %22, i32* %11
%23 = load i32, i32* %4
switch i32 %23, label %42 [
i32 1, label %24
i32 2, label %27
i32 3, label %33
]
24: ; preds = %2
%25 = load i32, i32* %15
store i32 %25, i32* %12
%26 = load i32, i32* %12
store i32 %26, i32* %13
br label %47
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %12
%32 = load i32, i32* %12
store i32 %32, i32* %13
br label %47
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 @atoi(i8* %36)
store i32 %37, i32* %12
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %13
br label %47
42: ; preds = %2
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 0
%45 = load i8*, i8** %44
%46 = call i32 @usage(i8* %45)
store i32 -1, i32* %3
br label %146
47: ; preds = %33, %27, %24
%48 = load i32, i32* %12
%49 = sitofp i32 %48 to float
%50 = load i32, i32* %13
%51 = sitofp i32 %50 to float
%52 = load i32, i32* %11
%53 = load float, float* %6
%54 = fpext float %53 to double
%55 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), float %49, float %51, i32 %52, double %54)
%56 = load i32, i32* %12
%57 = add nsw i32 %56, 2
%58 = load i32, i32* %13
%59 = add nsw i32 %58, 2
%60 = call float** @malloc_2d(i32 %57, i32 %59)
store float** %60, float*** %7
%61 = load i32, i32* %12
%62 = add nsw i32 %61, 2
%63 = load i32, i32* %13
%64 = add nsw i32 %63, 2
%65 = call float** @malloc_2d(i32 %62, i32 %64)
store float** %65, float*** %8
%66 = load float**, float*** %7
%67 = load i32, i32* %12
%68 = load i32, i32* %13
%69 = call i32 @init(float** %66, i32 %67, i32 %68)
%70 = load float**, float*** %8
%71 = load i32, i32* %12
%72 = load i32, i32* %13
%73 = call i32 @init(float** %70, i32 %71, i32 %72)
%74 = call i64 (...) @clock()
store i64 %74, i64* %16
%75 = load float, float* %6
%76 = fadd float %75, 1.000000e+00
store float %76, float* %9
store i32 0, i32* %14
br label %77
77: ; preds = %114, %47
%78 = load i32, i32* %14
%79 = load i32, i32* %11
%80 = icmp sle i32 %78, %79
br i1 %80, label %81, label %85
81: ; preds = %77
%82 = load float, float* %9
%83 = load float, float* %6
%84 = fcmp oge float %82, %83
br label %85
85: ; preds = %81, %77
%86 = phi i1 [ false, %77 ], [ %84, %81 ]
br i1 %86, label %87, label %115
87: ; preds = %85
%88 = load float**, float*** %8
%89 = load float**, float*** %7
%90 = load i32, i32* %12
%91 = load i32, i32* %13
%92 = call i32 @update(float** %88, float** %89, float* null, i32 %90, i32 %91)
%93 = load float**, float*** %7
%94 = load float**, float*** %8
%95 = load i32, i32* %12
%96 = load i32, i32* %13
%97 = call i32 @update(float** %93, float** %94, float* %9, i32 %95, i32 %96)
%98 = load i32, i32* %14
%99 = add nsw i32 %98, 2
store i32 %99, i32* %14
%100 = load i32, i32* %14
%101 = srem i32 %100, 100
%102 = icmp eq i32 %101, 0
br i1 %102, label %107, label %103
103: ; preds = %87
%104 = load float, float* %9
%105 = load float, float* %6
%106 = fcmp olt float %104, %105
br i1 %106, label %107, label %114
107: ; preds = %103, %87
%108 = load i32, i32* %14
%109 = sitofp i32 %108 to float
%110 = load float, float* %9
%111 = load float, float* %6
%112 = fpext float %111 to double
%113 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), float %109, float %110, double %112)
br label %114
114: ; preds = %107, %103
br label %77
115: ; preds = %85
%116 = load float**, float*** %7
%117 = call i32 @free_2d(float** %116)
%118 = load float**, float*** %8
%119 = call i32 @free_2d(float** %118)
%120 = load i32, i32* %14
%121 = sitofp i32 %120 to double
%122 = fmul double 0x3EB0C6F7A0B5ED8D, %121
%123 = load i32, i32* %12
%124 = sitofp i32 %123 to double
%125 = fmul double %122, %124
%126 = load i32, i32* %13
%127 = sitofp i32 %126 to double
%128 = fmul double %125, %127
%129 = fptrunc double %128 to float
store float %129, float* %10
%130 = call i64 (...) @clock()
store i64 %130, i64* %17
%131 = load i64, i64* %17
%132 = load i64, i64* %16
%133 = sub nsw i64 %131, %132
%134 = sitofp i64 %133 to float
%135 = load float, float* @CLOCKS_PER_SEC
%136 = fdiv float %134, %135
store float %136, float* %18
%137 = load float, float* %9
%138 = load i32, i32* %14
%139 = sitofp i32 %138 to float
%140 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), float %137, float %139)
%141 = load float, float* %18
%142 = load float, float* %10
%143 = load float, float* %18
%144 = fdiv float %142, %143
%145 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), float %141, float %144)
store i32 0, i32* %3
br label %146
146: ; preds = %115, %42
%147 = load i32, i32* %3
ret i32 %147
}

LLVM IR (-O2):
@.str = [45 x i8] c"Stencil: nx,ny,maxiter,eps=%d %d %d %18.16f\0A\00"
@.str.1 = [33 x i8] c"%d : norm, eps= %18.16f %18.16f\0A\00"
@CLOCKS_PER_SEC = global float 0.000000e+00
@.str.2 = [39 x i8] c"Stencil: norm =%18.16f with iter = %d\0A\00"
@.str.3 = [45 x i8] c"Stencil: Time =%18.16f sec, MLups/s=%18.16f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
switch i32 %0, label %16 [
i32 1, label %19
i32 2, label %5
i32 3, label %9
]
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
br label %19
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
br label %19
16: ; preds = %2
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i8* %17)
br label %72
19: ; preds = %5, %9, %2
%20 = phi i32 [ %15, %9 ], [ %8, %5 ], [ 2400, %2 ]
%21 = phi i32 [ %12, %9 ], [ %8, %5 ], [ 2400, %2 ]
%22 = sitofp i32 %21 to float
%23 = sitofp i32 %20 to float
%24 = tail call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), float %22, float %23, i32 1999, double 0x3F40624DE0000000)
%25 = add nsw i32 %21, 2
%26 = add nsw i32 %20, 2
%27 = tail call float** @malloc_2d(i32 %25, i32 %26)
%28 = tail call float** @malloc_2d(i32 %25, i32 %26)
%29 = tail call i32 @init(float** %27, i32 %21, i32 %20)
%30 = tail call i32 @init(float** %28, i32 %21, i32 %20)
%31 = tail call i64 (...) @clock()
store float 0x3FF0020C40000000, float* %3
br label %32
32: ; preds = %19, %47
%33 = phi i32 [ %36, %47 ], [ 0, %19 ]
%34 = call i32 @update(float** %28, float** %27, float* null, i32 %21, i32 %20)
%35 = call i32 @update(float** %27, float** %28, float* %3, i32 %21, i32 %20)
%36 = add nuw nsw i32 %33, 2
%37 = trunc i32 %36 to i16
%38 = urem i16 %37, 100
%39 = icmp eq i16 %38, 0
%40 = load float, float* %3
%41 = fcmp olt float %40, 0x3F40624DE0000000
%42 = select i1 %39, i1 true, i1 %41
br i1 %42, label %43, label %47
43: ; preds = %32
%44 = sitofp i32 %36 to float
%45 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), float %44, float %40, double 0x3F40624DE0000000)
%46 = load float, float* %3
br label %47
47: ; preds = %32, %43
%48 = phi float [ %40, %32 ], [ %46, %43 ]
%49 = icmp ult i32 %33, 1998
%50 = fcmp oge float %48, 0x3F40624DE0000000
%51 = select i1 %49, i1 %50, i1 false
br i1 %51, label %32, label %52
52: ; preds = %47
%53 = call i32 @free_2d(float** %27)
%54 = call i32 @free_2d(float** %28)
%55 = sitofp i32 %36 to double
%56 = fmul double %55, 0x3EB0C6F7A0B5ED8D
%57 = sitofp i32 %21 to double
%58 = fmul double %56, %57
%59 = sitofp i32 %20 to double
%60 = fmul double %58, %59
%61 = fptrunc double %60 to float
%62 = call i64 (...) @clock()
%63 = sub nsw i64 %62, %31
%64 = sitofp i64 %63 to float
%65 = load float, float* @CLOCKS_PER_SEC
%66 = fdiv float %64, %65
%67 = load float, float* %3
%68 = sitofp i32 %36 to float
%69 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), float %67, float %68)
%70 = fdiv float %61, %66
%71 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), float %66, float %70)
br label %72
72: ; preds = %52, %16
%73 = phi i32 [ -1, %16 ], [ 0, %52 ]
ret i32 %73
}