#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 clock();
double fabs(double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  double diff;
  int i, j, k;
  double mean;
  double u[500][500];
  double w[500][500];
  double start, stop;
  start = clock();
  mean = 0.0;
  for (i = 0; i < 500; i++) {
    u[i][0] = u[i][500 - 1] = u[0][i] = 100.0;
    u[500 - 1][i] = 0.0;
    mean += u[i][0] + u[i][500 - 1] + u[0][i] + u[500 - 1][i];
  }
  mean /= (4.0 * 500);
  for (i = 1; i < 500 - 1; i++)
    for (j = 1; j < 500 - 1; j++)
      u[i][j] = mean;
  for (;;) {
    diff = 0.0;
    for (i = 1; i < 500 - 1; i++)
      for (j = 1; j < 500 - 1; j++) {
        w[i][j] = (u[i - 1][j] + u[i + 1][j] + u[i][j - 1] + u[i][j + 1]) / 4.0;
        if (fabs(w[i][j] - u[i][j]) > diff)
          diff = fabs(w[i][j] - u[i][j]);
      }
    if (diff <= 0.01)
      break;
    for (i = 1; i < 500 - 1; i++)
      for (j = 1; j < 500 - 1; j++)
        u[i][j] = w[i][j];
  }
  stop = clock();
  for (i = 0; i < 500; i++) {
    for (j = 0; j < 500; j++)
      printf("%6.2f ", u[i][j]);
    putchar('\n');
  }
  printf("Time %f", (stop - start) / 1000000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0940,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x3d0938(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1f4,-0x1c(%rbp)
jge    1247 <main+0x117>
movslq -0x1c(%rbp),%rax
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0x1e84b0(%rbp,%rax,8)
e1 ff
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,0xf98(%rax)
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movsd  0xe55(%rip),%xmm0
movsd  %xmm0,(%rax)
movslq -0x1c(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xfd0(%rbp,%rax,8)
ff ff
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
addsd  0xf98(%rax),%xmm0
movslq -0x1c(%rbp),%rax
addsd  -0x1e84b0(%rbp,%rax,8),%xmm0
e1 ff
movslq -0x1c(%rbp),%rax
addsd  -0xfd0(%rbp,%rax,8),%xmm0
ff ff
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <main+0x37>
movsd  -0x30(%rbp),%xmm0
movsd  0xdac(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1f3,-0x1c(%rbp)
jge    12c9 <main+0x199>
movl   $0x1,-0x20(%rbp)
cmpl   $0x1f3,-0x20(%rbp)
jge    12b6 <main+0x186>
movsd  -0x30(%rbp),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1278 <main+0x148>
jmp    12bb <main+0x18b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1264 <main+0x134>
jmp    12ce <main+0x19e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1f3,-0x1c(%rbp)
jge    1478 <main+0x348>
movl   $0x1,-0x20(%rbp)
cmpl   $0x1f3,-0x20(%rbp)
jge    1465 <main+0x335>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xc86(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x3d0930(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x1c(%rbp),%rcx
lea    -0x3d0930(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xc39(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1452 <main+0x322>
movslq -0x1c(%rbp),%rcx
lea    -0x3d0930(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xbe7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1457 <main+0x327>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12f1 <main+0x1c1>
jmp    146a <main+0x33a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12dd <main+0x1ad>
movsd  0xb88(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1490 <main+0x360>
jmp    151a <main+0x3ea>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1f3,-0x1c(%rbp)
jge    1515 <main+0x3e5>
movl   $0x1,-0x20(%rbp)
cmpl   $0x1f3,-0x20(%rbp)
jge    1502 <main+0x3d2>
movslq -0x1c(%rbp),%rcx
lea    -0x3d0930(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    14ab <main+0x37b>
jmp    1507 <main+0x3d7>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1497 <main+0x367>
jmp    12ce <main+0x19e>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x3d0940(%rbp)
ff
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1f4,-0x1c(%rbp)
jge    15a1 <main+0x471>
movl   $0x0,-0x20(%rbp)
cmpl   $0x1f4,-0x20(%rbp)
jge    1589 <main+0x459>
movslq -0x1c(%rbp),%rcx
lea    -0x1e84b0(%rbp),%rax
imul   $0xfa0,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xaca(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1544 <main+0x414>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1530 <main+0x400>
movsd  -0x3d0940(%rbp),%xmm0
ff
subsd  -0x3d0938(%rbp),%xmm0
ff
movsd  0xa57(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xa83(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x3d0940,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3d0910,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm1,%xmm1
lea    0x10(%rsp),%rax
movabs $0x4059000000000000,%rcx
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,(%rax)
mov    %rcx,0xfa8(%rsp,%rbx,8)
mov    %rcx,0x10(%rsp,%rbx,8)
movq   $0x0,0x1e74e0(%rax)
movsd  0x10(%rsp,%rbx,8),%xmm2
addsd  0xfa8(%rsp,%rbx,8),%xmm2
addsd  (%rax),%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
add    $0x8,%rax
add    $0x1f4,%rbx
cmp    $0x3d090,%rbx
jne    1180 <main+0x40>
divsd  0xe2e(%rip),%xmm0
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    0x1028(%rsp),%rax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd %xmm1,-0x70(%rax,%rdx,8)
movupd %xmm1,-0x60(%rax,%rdx,8)
movupd %xmm1,-0x50(%rax,%rdx,8)
movupd %xmm1,-0x40(%rax,%rdx,8)
movupd %xmm1,-0x30(%rax,%rdx,8)
movupd %xmm1,-0x20(%rax,%rdx,8)
movupd %xmm1,-0x10(%rax,%rdx,8)
movupd %xmm1,(%rax,%rdx,8)
add    $0x10,%rdx
cmp    $0x1f0,%rdx
jne    1200 <main+0xc0>
imul   $0xfa0,%rcx,%rdx
movsd  %xmm0,0xf98(%rsp,%rdx,1)
movsd  %xmm0,0xfa0(%rsp,%rdx,1)
add    $0x1,%rcx
add    $0xfa0,%rax
cmp    $0x1f3,%rcx
jne    11f0 <main+0xb0>
lea    -0xf88(%rsp),%r15
ff
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
lea    0x1e8498(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0xd70(%rip),%xmm4
movapd 0xd80(%rip),%xmm5
imul   $0xfa0,%rax,%rcx
add    $0x1,%rax
movsd  0x10(%rsp,%rcx,1),%xmm2
movsd  0x18(%rsp,%rcx,1),%xmm1
lea    (%r15,%rcx,1),%rdx
add    %r12,%rcx
xor    %esi,%esi
movapd %xmm0,%xmm3
movsd  (%rdx,%rsi,8),%xmm0
addsd  0x1f40(%rdx,%rsi,8),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm1,%xmm2
movsd  0xfa8(%rdx,%rsi,8),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
subsd  %xmm2,%xmm0
andpd  %xmm5,%xmm0
maxsd  %xmm3,%xmm0
add    $0x1,%rsi
cmp    $0x1f2,%rsi
jne    12c0 <main+0x180>
cmp    $0x1f3,%rax
jne    12a0 <main+0x160>
movsd  0xcf7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    13ae <main+0x26e>
mov    $0x2ee8,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%rsp,%rbx,1),%r14
add    $0x10,%r14
lea    -0x1f30(%rsp,%rbx,1),%rdi
ff
lea    (%rsp,%rbx,1),%r13
add    $0x1e8490,%r13
lea    (%rsp,%rbx,1),%rsi
add    $0x1e6550,%rsi
mov    $0xf90,%edx
call   1060 <memcpy@plt>
lea    (%rsp,%rbx,1),%rdi
add    $0xfffffffffffff070,%rdi
lea    (%rsp,%rbx,1),%rsi
add    $0x1e74f0,%rsi
mov    $0xf90,%edx
call   1060 <memcpy@plt>
mov    $0xf90,%edx
mov    %r14,%rdi
mov    %r13,%rsi
call   1060 <memcpy@plt>
add    $0x2ee0,%rbx
cmp    $0x1e9428,%rbx
jne    1330 <main+0x1f0>
mov    $0x1,%eax
xorpd  %xmm0,%xmm0
jmp    1290 <main+0x150>
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,(%rsp)
lea    0x10(%rsp),%r12
lea    0xc67(%rip),%r15
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r12,%rbx,8),%xmm0
mov    %r15,%rdi
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x1f4,%rbx
jne    13e0 <main+0x2a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0xfa0,%r12
cmp    $0x1f4,%r14
jne    13d0 <main+0x290>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  0xbec(%rip),%xmm0
lea    0xc04(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x3d0910,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%6.2f \00"
@.str.1 = [8 x i8] c"Time %f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca [500 x [500 x double]]
%12 = alloca [500 x [500 x double]]
%13 = alloca double
%14 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = call double (...) @clock()
store double %15, double* %13
store double 0.000000e+00, double* %10
store i32 0, i32* %7
br label %16
16: ; preds = %61, %2
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 500
br i1 %18, label %19, label %64
19: ; preds = %16
%20 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 0
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [500 x double], [500 x double]* %20, i64 0, i64 %22
store double 1.000000e+02, double* %23
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %25
%27 = getelementptr inbounds [500 x double], [500 x double]* %26, i64 0, i64 499
store double 1.000000e+02, double* %27
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %29
%31 = getelementptr inbounds [500 x double], [500 x double]* %30, i64 0, i64 0
store double 1.000000e+02, double* %31
%32 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 499
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [500 x double], [500 x double]* %32, i64 0, i64 %34
store double 0.000000e+00, double* %35
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %37
%39 = getelementptr inbounds [500 x double], [500 x double]* %38, i64 0, i64 0
%40 = load double, double* %39
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %42
%44 = getelementptr inbounds [500 x double], [500 x double]* %43, i64 0, i64 499
%45 = load double, double* %44
%46 = fadd double %40, %45
%47 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 0
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [500 x double], [500 x double]* %47, i64 0, i64 %49
%51 = load double, double* %50
%52 = fadd double %46, %51
%53 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 499
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [500 x double], [500 x double]* %53, i64 0, i64 %55
%57 = load double, double* %56
%58 = fadd double %52, %57
%59 = load double, double* %10
%60 = fadd double %59, %58
store double %60, double* %10
br label %61
61: ; preds = %19
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %16
64: ; preds = %16
%65 = load double, double* %10
%66 = fdiv double %65, 2.000000e+03
store double %66, double* %10
store i32 1, i32* %7
br label %67
67: ; preds = %86, %64
%68 = load i32, i32* %7
%69 = icmp slt i32 %68, 499
br i1 %69, label %70, label %89
70: ; preds = %67
store i32 1, i32* %8
br label %71
71: ; preds = %82, %70
%72 = load i32, i32* %8
%73 = icmp slt i32 %72, 499
br i1 %73, label %74, label %85
74: ; preds = %71
%75 = load double, double* %10
%76 = load i32, i32* %7
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %77
%79 = load i32, i32* %8
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [500 x double], [500 x double]* %78, i64 0, i64 %80
store double %75, double* %81
br label %82
82: ; preds = %74
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
store i32 %84, i32* %8
br label %71
85: ; preds = %71
br label %86
86: ; preds = %85
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
br label %67
89: ; preds = %67
br label %90
90: ; preds = %217, %89
store double 0.000000e+00, double* %6
store i32 1, i32* %7
br label %91
91: ; preds = %181, %90
%92 = load i32, i32* %7
%93 = icmp slt i32 %92, 499
br i1 %93, label %94, label %184
94: ; preds = %91
store i32 1, i32* %8
br label %95
95: ; preds = %177, %94
%96 = load i32, i32* %8
%97 = icmp slt i32 %96, 499
br i1 %97, label %98, label %180
98: ; preds = %95
%99 = load i32, i32* %7
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %101
%103 = load i32, i32* %8
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [500 x double], [500 x double]* %102, i64 0, i64 %104
%106 = load double, double* %105
%107 = load i32, i32* %7
%108 = add nsw i32 %107, 1
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %109
%111 = load i32, i32* %8
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [500 x double], [500 x double]* %110, i64 0, i64 %112
%114 = load double, double* %113
%115 = fadd double %106, %114
%116 = load i32, i32* %7
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %117
%119 = load i32, i32* %8
%120 = sub nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [500 x double], [500 x double]* %118, i64 0, i64 %121
%123 = load double, double* %122
%124 = fadd double %115, %123
%125 = load i32, i32* %7
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %126
%128 = load i32, i32* %8
%129 = add nsw i32 %128, 1
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [500 x double], [500 x double]* %127, i64 0, i64 %130
%132 = load double, double* %131
%133 = fadd double %124, %132
%134 = fdiv double %133, 4.000000e+00
%135 = load i32, i32* %7
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %12, i64 0, i64 %136
%138 = load i32, i32* %8
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [500 x double], [500 x double]* %137, i64 0, i64 %139
store double %134, double* %140
%141 = load i32, i32* %7
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %12, i64 0, i64 %142
%144 = load i32, i32* %8
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [500 x double], [500 x double]* %143, i64 0, i64 %145
%147 = load double, double* %146
%148 = load i32, i32* %7
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %149
%151 = load i32, i32* %8
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [500 x double], [500 x double]* %150, i64 0, i64 %152
%154 = load double, double* %153
%155 = fsub double %147, %154
%156 = call double @llvm.fabs.f64(double %155)
%157 = load double, double* %6
%158 = fcmp ogt double %156, %157
br i1 %158, label %159, label %176
159: ; preds = %98
%160 = load i32, i32* %7
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %12, i64 0, i64 %161
%163 = load i32, i32* %8
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [500 x double], [500 x double]* %162, i64 0, i64 %164
%166 = load double, double* %165
%167 = load i32, i32* %7
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %168
%170 = load i32, i32* %8
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [500 x double], [500 x double]* %169, i64 0, i64 %171
%173 = load double, double* %172
%174 = fsub double %166, %173
%175 = call double @llvm.fabs.f64(double %174)
store double %175, double* %6
br label %176
176: ; preds = %159, %98
br label %177
177: ; preds = %176
%178 = load i32, i32* %8
%179 = add nsw i32 %178, 1
store i32 %179, i32* %8
br label %95
180: ; preds = %95
br label %181
181: ; preds = %180
%182 = load i32, i32* %7
%183 = add nsw i32 %182, 1
store i32 %183, i32* %7
br label %91
184: ; preds = %91
%185 = load double, double* %6
%186 = fcmp ole double %185, 1.000000e-02
br i1 %186, label %187, label %188
187: ; preds = %184
br label %218
188: ; preds = %184
store i32 1, i32* %7
br label %189
189: ; preds = %214, %188
%190 = load i32, i32* %7
%191 = icmp slt i32 %190, 499
br i1 %191, label %192, label %217
192: ; preds = %189
store i32 1, i32* %8
br label %193
193: ; preds = %210, %192
%194 = load i32, i32* %8
%195 = icmp slt i32 %194, 499
br i1 %195, label %196, label %213
196: ; preds = %193
%197 = load i32, i32* %7
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %12, i64 0, i64 %198
%200 = load i32, i32* %8
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [500 x double], [500 x double]* %199, i64 0, i64 %201
%203 = load double, double* %202
%204 = load i32, i32* %7
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %205
%207 = load i32, i32* %8
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [500 x double], [500 x double]* %206, i64 0, i64 %208
store double %203, double* %209
br label %210
210: ; preds = %196
%211 = load i32, i32* %8
%212 = add nsw i32 %211, 1
store i32 %212, i32* %8
br label %193
213: ; preds = %193
br label %214
214: ; preds = %213
%215 = load i32, i32* %7
%216 = add nsw i32 %215, 1
store i32 %216, i32* %7
br label %189
217: ; preds = %189
br label %90
218: ; preds = %187
%219 = call double (...) @clock()
store double %219, double* %14
store i32 0, i32* %7
br label %220
220: ; preds = %241, %218
%221 = load i32, i32* %7
%222 = icmp slt i32 %221, 500
br i1 %222, label %223, label %244
223: ; preds = %220
store i32 0, i32* %8
br label %224
224: ; preds = %236, %223
%225 = load i32, i32* %8
%226 = icmp slt i32 %225, 500
br i1 %226, label %227, label %239
227: ; preds = %224
%228 = load i32, i32* %7
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %11, i64 0, i64 %229
%231 = load i32, i32* %8
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds [500 x double], [500 x double]* %230, i64 0, i64 %232
%234 = load double, double* %233
%235 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %234)
br label %236
236: ; preds = %227
%237 = load i32, i32* %8
%238 = add nsw i32 %237, 1
store i32 %238, i32* %8
br label %224
239: ; preds = %224
%240 = call i32 @putchar(i8 signext 10)
br label %241
241: ; preds = %239
%242 = load i32, i32* %7
%243 = add nsw i32 %242, 1
store i32 %243, i32* %7
br label %220
244: ; preds = %220
%245 = load double, double* %14
%246 = load double, double* %13
%247 = fsub double %245, %246
%248 = fdiv double %247, 1.000000e+06
%249 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %248)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%6.2f \00"
@.str.1 = [8 x i8] c"Time %f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [500 x [500 x double]]
%4 = alloca [500 x [500 x double]]
%5 = bitcast [500 x [500 x double]]* %3 to i8*
%6 = bitcast [500 x [500 x double]]* %4 to i8*
%7 = tail call double (...) @clock()
br label %8
8: ; preds = %2, %8
%9 = phi i64 [ 0, %2 ], [ %22, %8 ]
%10 = phi double [ 0.000000e+00, %2 ], [ %21, %8 ]
%11 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 0, i64 %9
store double 1.000000e+02, double* %11
%12 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %9, i64 499
store double 1.000000e+02, double* %12
%13 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %9, i64 0
store double 1.000000e+02, double* %13
%14 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 499, i64 %9
store double 0.000000e+00, double* %14
%15 = load double, double* %13
%16 = load double, double* %12
%17 = fadd double %15, %16
%18 = load double, double* %11
%19 = fadd double %17, %18
%20 = fadd double %19, 0.000000e+00
%21 = fadd double %10, %20
%22 = add nuw nsw i64 %9, 1
%23 = icmp eq i64 %22, 500
br i1 %23, label %24, label %8
24: ; preds = %8
%25 = fdiv double %21, 2.000000e+03
%26 = insertelement <2 x double> poison, double %25, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = insertelement <2 x double> poison, double %25, i64 0
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
br label %30
30: ; preds = %56, %24
%31 = phi i64 [ 1, %24 ], [ %59, %56 ]
br label %32
32: ; preds = %32, %30
%33 = phi i64 [ 0, %30 ], [ %54, %32 ]
%34 = or i64 %33, 1
%35 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %31, i64 %34
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> %27, <2 x double>* %36
%37 = getelementptr inbounds double, double* %35, i64 2
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> %29, <2 x double>* %38
%39 = or i64 %33, 5
%40 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %31, i64 %39
%41 = bitcast double* %40 to <2 x double>*
store <2 x double> %27, <2 x double>* %41
%42 = getelementptr inbounds double, double* %40, i64 2
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %29, <2 x double>* %43
%44 = or i64 %33, 9
%45 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %31, i64 %44
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> %27, <2 x double>* %46
%47 = getelementptr inbounds double, double* %45, i64 2
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> %29, <2 x double>* %48
%49 = or i64 %33, 13
%50 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %31, i64 %49
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> %27, <2 x double>* %51
%52 = getelementptr inbounds double, double* %50, i64 2
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> %29, <2 x double>* %53
%54 = add nuw nsw i64 %33, 16
%55 = icmp eq i64 %54, 496
br i1 %55, label %56, label %32
56: ; preds = %32
%57 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %31, i64 497
store double %25, double* %57
%58 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %31, i64 498
store double %25, double* %58
%59 = add nuw nsw i64 %31, 1
%60 = icmp eq i64 %59, 499
br i1 %60, label %61, label %30
61: ; preds = %56, %94
%62 = phi i64 [ %95, %94 ], [ 1, %56 ]
%63 = phi double [ %96, %94 ], [ 0.000000e+00, %56 ]
%64 = add nsw i64 %62, -1
%65 = add nuw nsw i64 %62, 1
%66 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %62, i64 0
%67 = load double, double* %66
%68 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %62, i64 1
%69 = load double, double* %68
br label %70
70: ; preds = %61, %70
%71 = phi double [ %69, %61 ], [ %83, %70 ]
%72 = phi double [ %67, %61 ], [ %71, %70 ]
%73 = phi i64 [ 1, %61 ], [ %81, %70 ]
%74 = phi double [ %63, %61 ], [ %90, %70 ]
%75 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %64, i64 %73
%76 = load double, double* %75
%77 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %65, i64 %73
%78 = load double, double* %77
%79 = fadd double %76, %78
%80 = fadd double %79, %72
%81 = add nuw nsw i64 %73, 1
%82 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %62, i64 %81
%83 = load double, double* %82
%84 = fadd double %80, %83
%85 = fmul double %84, 2.500000e-01
%86 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %4, i64 0, i64 %62, i64 %73
store double %85, double* %86
%87 = fsub double %85, %71
%88 = tail call double @llvm.fabs.f64(double %87)
%89 = fcmp ogt double %88, %74
%90 = select i1 %89, double %88, double %74
%91 = icmp eq i64 %81, 499
br i1 %91, label %92, label %70
92: ; preds = %70
%93 = icmp eq i64 %65, 499
br i1 %93, label %97, label %94
94: ; preds = %99, %92
%95 = phi i64 [ %65, %92 ], [ 1, %99 ]
%96 = phi double [ %90, %92 ], [ 0.000000e+00, %99 ]
br label %61
97: ; preds = %92
%98 = fcmp ugt double %90, 1.000000e-02
br i1 %98, label %99, label %117
99: ; preds = %97, %99
%100 = phi i64 [ %111, %99 ], [ 0, %97 ]
%101 = add nuw nsw i64 %100, 1
%102 = getelementptr [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %101, i64 1
%103 = bitcast double* %102 to i8*
%104 = getelementptr [500 x [500 x double]], [500 x [500 x double]]* %4, i64 0, i64 %101, i64 1
%105 = bitcast double* %104 to i8*
%106 = add nuw nsw i64 %100, 2
%107 = getelementptr [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %106, i64 1
%108 = bitcast double* %107 to i8*
%109 = getelementptr [500 x [500 x double]], [500 x [500 x double]]* %4, i64 0, i64 %106, i64 1
%110 = bitcast double* %109 to i8*
%111 = add nuw nsw i64 %100, 3
%112 = getelementptr [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %111, i64 1
%113 = bitcast double* %112 to i8*
%114 = getelementptr [500 x [500 x double]], [500 x [500 x double]]* %4, i64 0, i64 %111, i64 1
%115 = bitcast double* %114 to i8*
%116 = icmp eq i64 %111, 498
br i1 %116, label %94, label %99
117: ; preds = %97
%118 = tail call double (...) @clock()
br label %119
119: ; preds = %117, %128
%120 = phi i64 [ 0, %117 ], [ %130, %128 ]
br label %121
121: ; preds = %119, %121
%122 = phi i64 [ 0, %119 ], [ %126, %121 ]
%123 = getelementptr inbounds [500 x [500 x double]], [500 x [500 x double]]* %3, i64 0, i64 %120, i64 %122
%124 = load double, double* %123
%125 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %124)
%126 = add nuw nsw i64 %122, 1
%127 = icmp eq i64 %126, 500
br i1 %127, label %128, label %121
128: ; preds = %121
%129 = tail call i32 @putchar(i8 signext 10)
%130 = add nuw nsw i64 %120, 1
%131 = icmp eq i64 %130, 500
br i1 %131, label %132, label %119
132: ; preds = %128
%133 = fsub double %118, %7
%134 = fdiv double %133, 1.000000e+06
%135 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %134)
ret i32 0
}