#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 */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int const);
int /*<<< orphan*/ memset(int **, int, int const);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, j, sr, sc, tempout;
  const int nr = 20000;
  const int nc = 14000;
  const int wr = 16;
  const int wc = 16;
  typedef int oArray[14000];
  typedef int iArray[14000 + 16];
  oArray *restrict output;
  iArray *restrict input;
  if ((input = (iArray *)malloc(((nr + wr) * (nc + wc)) * sizeof(int))) == 0) {
    printf("malloc fail\n");
    exit(1);
  }
  if ((output = (oArray *)malloc((nr * nc) * sizeof(int))) == 0) {
    printf("malloc fail\n");
    exit(1);
  }
  printf("Begin init\n");
  memset(input, 0x7F, (nr + wr) * (nc + wc) * sizeof(int));
  memset(output, 0x7F, (nr * nc) * sizeof(int));
  for (i = 0; i < nr + wr; i += wr)
    for (j = 0; j < nc + wc; j += wc)
      input[i][j] = 1;
  printf("Begin compute\n");
#pragma acc kernels
  for (i = 0; i < nr; i++)
    for (j = 0; j < nc; j++)
      for (sr = 0; sr < wr; sr++)
        for (sc = 0; sc < wc; sc++)
          if (output[i + sr][j + sc] > input[i][j])
            output[i + sr][j + sc] = input[i][j];
  printf("Finished Compute\n");
  for (i = 0; i < nr; i++)
    for (j = 0; j < nc; j++)
      if (output[i][j] != 1) {
        printf("mismatch at %d,%d, was: %d should be: %d\n", i, j, output[i][j],
               1);
        return 1;
      }
  printf("Results pass\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4e20,-0x1c(%rbp)
movl   $0x36b0,-0x20(%rbp)
movl   $0x10,-0x24(%rbp)
movl   $0x10,-0x28(%rbp)
mov    $0x42e31000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    119b <main+0x5b>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x42c1d800,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11cb <main+0x8b>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    $0x7f,%esi
mov    $0x42e31000,%edx
call   1040 <memset@plt>
mov    -0x30(%rbp),%rdi
mov    $0x7f,%esi
mov    $0x42c1d800,%edx
call   1040 <memset@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4e30,-0x8(%rbp)
jge    1265 <main+0x125>
movl   $0x0,-0xc(%rbp)
cmpl   $0x36c0,-0xc(%rbp)
jge    1252 <main+0x112>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xdb00,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0xc(%rbp)
jmp    121a <main+0xda>
jmp    1257 <main+0x117>
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
jmp    1206 <main+0xc6>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4e20,-0x8(%rbp)
jge    1387 <main+0x247>
movl   $0x0,-0xc(%rbp)
cmpl   $0x36b0,-0xc(%rbp)
jge    1374 <main+0x234>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1361 <main+0x221>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    134e <main+0x20e>
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
imul   $0xdac0,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x38(%rbp),%rcx
movslq -0x8(%rbp),%rdx
imul   $0xdb00,%rdx,%rdx
add    %rdx,%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    133b <main+0x1fb>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xdb00,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
imul   $0xdac0,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1340 <main+0x200>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12b3 <main+0x173>
jmp    1353 <main+0x213>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12a2 <main+0x162>
jmp    1366 <main+0x226>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    128e <main+0x14e>
jmp    1379 <main+0x239>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    127a <main+0x13a>
lea    0xc9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4e20,-0x8(%rbp)
jge    1442 <main+0x302>
movl   $0x0,-0xc(%rbp)
cmpl   $0x36b0,-0xc(%rbp)
jge    142f <main+0x2ef>
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xdac0,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
je     141c <main+0x2dc>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xdac0,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xc37(%rip),%rdi
mov    $0x1,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1457 <main+0x317>
jmp    1421 <main+0x2e1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13b0 <main+0x270>
jmp    1434 <main+0x2f4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    139c <main+0x25c>
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    $0x42e31000,%edi
call   1060 <malloc@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     1602 <main+0x4b2>
mov    $0x42c1d800,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1602 <main+0x4b2>
mov    %rax,%r12
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7f,%esi
mov    $0x42e31000,%edx
call   1050 <memset@plt>
mov    %r12,%rdi
mov    $0x7f,%esi
mov    $0x42c1d800,%edx
call   1050 <memset@plt>
lea    0x140(%rbx),%rax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    $0xffffffffffffffa0,%rdx
nopw   0x0(%rax,%rax,1)
movl   $0x1,0x40(%rax,%rdx,4)
movl   $0x1,0x80(%rax,%rdx,4)
movl   $0x1,0xc0(%rax,%rdx,4)
movl   $0x1,0x100(%rax,%rdx,4)
movl   $0x1,0x140(%rax,%rdx,4)
movl   $0x1,0x180(%rax,%rdx,4)
add    $0x60,%rdx
cmp    $0x3660,%rdx
jb     11e0 <main+0x90>
lea    0x10(%rcx),%rdx
add    $0xdb000,%rax
cmp    $0x4e20,%rcx
mov    %rdx,%rcx
jb     11d0 <main+0x80>
lea    0xdec(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%r12),%r11
xor    %ecx,%ecx
jmp    127d <main+0x12d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
mov    0x10(%rsp),%r11
add    $0xdac0,%r11
cmp    $0x4e20,%rcx
je     154d <main+0x3fd>
mov    %r11,0x10(%rsp)
xor    %esi,%esi
jmp    12a9 <main+0x159>
cs nopw 0x0(%rax,%rax,1)
mov    0x18(%rsp),%r11
add    $0x4,%r11
mov    0x8(%rsp),%rax
mov    %rax,%rsi
cmp    $0x36b0,%rax
je     1260 <main+0x110>
lea    0x10(%rsi),%r9
imul   $0xdb00,%rcx,%rax
add    (%rsp),%rax
lea    (%rax,%rsi,4),%rdx
lea    0x1(%rsi),%rdi
mov    %rdi,0x8(%rsp)
lea    (%rax,%rsi,4),%rdi
add    $0x4,%rdi
lea    0x2(%rsi),%rax
mov    %rax,0x70(%rsp)
lea    0x3(%rsi),%rax
mov    %rax,0x68(%rsp)
lea    0x4(%rsi),%r10
lea    0x5(%rsi),%rax
mov    %rax,0x60(%rsp)
lea    0x6(%rsi),%rax
mov    %rax,0x58(%rsp)
lea    0x7(%rsi),%rax
mov    %rax,0x50(%rsp)
lea    0x8(%rsi),%r14
lea    0x9(%rsi),%rax
mov    %rax,0x48(%rsp)
lea    0xa(%rsi),%rax
mov    %rax,0x40(%rsp)
lea    0xb(%rsi),%rax
mov    %rax,0x38(%rsp)
lea    0xc(%rsi),%r13
lea    0xd(%rsi),%rax
mov    %rax,0x30(%rsp)
lea    0xe(%rsi),%rax
mov    %rax,0x28(%rsp)
lea    0xf(%rsi),%rax
mov    %rax,0x20(%rsp)
mov    %r11,0x18(%rsp)
xor    %r15d,%r15d
jmp    1365 <main+0x215>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15
add    $0xdac0,%r11
cmp    $0x10,%r15
je     1290 <main+0x140>
lea    (%rcx,%r15,1),%rax
imul   $0xdac0,%rax,%rbp
add    %r12,%rbp
lea    0x0(,%rsi,4),%rax
add    %rbp,%rax
cmp    %rdi,%rax
jae    13d0 <main+0x280>
lea    0x0(,%r9,4),%rax
add    %rbp,%rax
cmp    %rax,%rdx
jae    13d0 <main+0x280>
xor    %eax,%eax
jmp    13aa <main+0x25a>
nopw   0x0(%rax,%rax,1)
add    $0x2,%rax
cmp    $0x10,%rax
je     1350 <main+0x200>
mov    (%rdx),%ebp
cmp    %ebp,-0x4(%r11,%rax,4)
jle    13b8 <main+0x268>
mov    %ebp,-0x4(%r11,%rax,4)
mov    (%rdx),%ebp
cmp    %ebp,(%r11,%rax,4)
jle    13a0 <main+0x250>
mov    %ebp,(%r11,%rax,4)
jmp    13a0 <main+0x250>
cs nopw 0x0(%rax,%rax,1)
movdqu 0x0(%rbp,%rsi,4),%xmm0
mov    (%rdx),%r8d
movd   %r8d,%xmm1
pshufd $0x0,%xmm1,%xmm1
pcmpgtd %xmm1,%xmm0
movd   %xmm0,%eax
test   $0x1,%al
je     13f4 <main+0x2a4>
mov    %r8d,0x0(%rbp,%rsi,4)
pextrw $0x2,%xmm0,%eax
test   $0x1,%al
je     1407 <main+0x2b7>
mov    0x8(%rsp),%rax
mov    %r8d,0x0(%rbp,%rax,4)
pextrw $0x4,%xmm0,%eax
test   $0x1,%al
je     141a <main+0x2ca>
mov    0x70(%rsp),%rax
mov    %r8d,0x0(%rbp,%rax,4)
pextrw $0x6,%xmm0,%eax
test   $0x1,%al
je     142d <main+0x2dd>
mov    0x68(%rsp),%rax
mov    %r8d,0x0(%rbp,%rax,4)
movdqu 0x0(%rbp,%r10,4),%xmm0
mov    (%rdx),%eax
movd   %eax,%xmm1
pshufd $0x0,%xmm1,%xmm1
pcmpgtd %xmm1,%xmm0
movd   %xmm0,%ebx
test   $0x1,%bl
je     1451 <main+0x301>
mov    %eax,0x0(%rbp,%r10,4)
pextrw $0x2,%xmm0,%ebx
test   $0x1,%bl
je     1464 <main+0x314>
mov    0x60(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
pextrw $0x4,%xmm0,%ebx
test   $0x1,%bl
je     1477 <main+0x327>
mov    0x58(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
pextrw $0x6,%xmm0,%ebx
test   $0x1,%bl
je     148a <main+0x33a>
mov    0x50(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
movdqu 0x0(%rbp,%r14,4),%xmm0
mov    (%rdx),%eax
movd   %eax,%xmm1
pshufd $0x0,%xmm1,%xmm1
pcmpgtd %xmm1,%xmm0
movd   %xmm0,%ebx
test   $0x1,%bl
je     14ae <main+0x35e>
mov    %eax,0x0(%rbp,%r14,4)
pextrw $0x2,%xmm0,%ebx
test   $0x1,%bl
je     14c1 <main+0x371>
mov    0x48(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
pextrw $0x4,%xmm0,%ebx
test   $0x1,%bl
je     14d4 <main+0x384>
mov    0x40(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
pextrw $0x6,%xmm0,%ebx
test   $0x1,%bl
je     14e7 <main+0x397>
mov    0x38(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
movdqu 0x0(%rbp,%r13,4),%xmm0
mov    (%rdx),%eax
movd   %eax,%xmm1
pshufd $0x0,%xmm1,%xmm1
pcmpgtd %xmm1,%xmm0
movd   %xmm0,%ebx
test   $0x1,%bl
je     150b <main+0x3bb>
mov    %eax,0x0(%rbp,%r13,4)
pextrw $0x2,%xmm0,%ebx
test   $0x1,%bl
je     151e <main+0x3ce>
mov    0x30(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
pextrw $0x4,%xmm0,%ebx
test   $0x1,%bl
je     1531 <main+0x3e1>
mov    0x28(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
pextrw $0x6,%xmm0,%ebx
test   $0x1,%bl
je     1350 <main+0x200>
mov    0x20(%rsp),%rbx
mov    %eax,0x0(%rbp,%rbx,4)
jmp    1350 <main+0x200>
lea    0xaef(%rip),%rdi
call   1030 <puts@plt>
xor    %esi,%esi
mov    $0x4,%edx
mov    -0x10(%r12,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    15c2 <main+0x472>
mov    -0xc(%r12,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    15c8 <main+0x478>
mov    -0x8(%r12,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    15ce <main+0x47e>
mov    -0x4(%r12,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    15d4 <main+0x484>
mov    (%r12,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    15d8 <main+0x488>
add    $0x5,%rdx
cmp    $0x36b4,%rdx
jne    1560 <main+0x410>
add    $0x1,%rsi
add    $0xdac0,%r12
cmp    $0x4e20,%rsi
jne    155b <main+0x40b>
lea    0xa9b(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
jmp    15f1 <main+0x4a1>
add    $0xfffffffffffffffc,%rdx
jmp    15d8 <main+0x488>
add    $0xfffffffffffffffd,%rdx
jmp    15d8 <main+0x488>
add    $0xfffffffffffffffe,%rdx
jmp    15d8 <main+0x488>
add    $0xffffffffffffffff,%rdx
lea    0xa21(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa58(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"malloc fail\0A\00"
@.str.1 = [12 x i8] c"Begin init\0A\00"
@.str.2 = [15 x i8] c"Begin compute\0A\00"
@.str.3 = [18 x i8] c"Finished Compute\0A\00"
@.str.4 = [42 x i8] c"mismatch at %d,%d, was: %d should be: %d\0A\00"
@.str.5 = [14 x i8] c"Results pass\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [14000 x i32]*
%12 = alloca [14016 x i32]*
store i32 0, i32* %1
store i32 20000, i32* %7
store i32 14000, i32* %8
store i32 16, i32* %9
store i32 16, i32* %10
%13 = call i64 @malloc(i32 1122177024)
%14 = inttoptr i64 %13 to [14016 x i32]*
store [14016 x i32]* %14, [14016 x i32]** %12
%15 = icmp eq [14016 x i32]* %14, null
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %0
%20 = call i64 @malloc(i32 1120000000)
%21 = inttoptr i64 %20 to [14000 x i32]*
store [14000 x i32]* %21, [14000 x i32]** %11
%22 = icmp eq [14000 x i32]* %21, null
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%28 = load [14016 x i32]*, [14016 x i32]** %12
%29 = bitcast [14016 x i32]* %28 to i32**
%30 = call i32 @memset(i32** %29, i32 127, i32 1122177024)
%31 = load [14000 x i32]*, [14000 x i32]** %11
%32 = bitcast [14000 x i32]* %31 to i32**
%33 = call i32 @memset(i32** %32, i32 127, i32 1120000000)
store i32 0, i32* %2
br label %34
34: ; preds = %53, %26
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 20016
br i1 %36, label %37, label %56
37: ; preds = %34
store i32 0, i32* %3
br label %38
38: ; preds = %49, %37
%39 = load i32, i32* %3
%40 = icmp slt i32 %39, 14016
br i1 %40, label %41, label %52
41: ; preds = %38
%42 = load [14016 x i32]*, [14016 x i32]** %12
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [14016 x i32], [14016 x i32]* %42, i64 %44
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [14016 x i32], [14016 x i32]* %45, i64 0, i64 %47
store i32 1, i32* %48
br label %49
49: ; preds = %41
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 16
store i32 %51, i32* %3
br label %38
52: ; preds = %38
br label %53
53: ; preds = %52
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 16
store i32 %55, i32* %2
br label %34
56: ; preds = %34
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %58
58: ; preds = %128, %56
%59 = load i32, i32* %2
%60 = icmp slt i32 %59, 20000
br i1 %60, label %61, label %131
61: ; preds = %58
store i32 0, i32* %3
br label %62
62: ; preds = %124, %61
%63 = load i32, i32* %3
%64 = icmp slt i32 %63, 14000
br i1 %64, label %65, label %127
65: ; preds = %62
store i32 0, i32* %4
br label %66
66: ; preds = %120, %65
%67 = load i32, i32* %4
%68 = icmp slt i32 %67, 16
br i1 %68, label %69, label %123
69: ; preds = %66
store i32 0, i32* %5
br label %70
70: ; preds = %116, %69
%71 = load i32, i32* %5
%72 = icmp slt i32 %71, 16
br i1 %72, label %73, label %119
73: ; preds = %70
%74 = load [14000 x i32]*, [14000 x i32]** %11
%75 = load i32, i32* %2
%76 = load i32, i32* %4
%77 = add nsw i32 %75, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [14000 x i32], [14000 x i32]* %74, i64 %78
%80 = load i32, i32* %3
%81 = load i32, i32* %5
%82 = add nsw i32 %80, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [14000 x i32], [14000 x i32]* %79, i64 0, i64 %83
%85 = load i32, i32* %84
%86 = load [14016 x i32]*, [14016 x i32]** %12
%87 = load i32, i32* %2
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [14016 x i32], [14016 x i32]* %86, i64 %88
%90 = load i32, i32* %3
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [14016 x i32], [14016 x i32]* %89, i64 0, i64 %91
%93 = load i32, i32* %92
%94 = icmp sgt i32 %85, %93
br i1 %94, label %95, label %115
95: ; preds = %73
%96 = load [14016 x i32]*, [14016 x i32]** %12
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [14016 x i32], [14016 x i32]* %96, i64 %98
%100 = load i32, i32* %3
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [14016 x i32], [14016 x i32]* %99, i64 0, i64 %101
%103 = load i32, i32* %102
%104 = load [14000 x i32]*, [14000 x i32]** %11
%105 = load i32, i32* %2
%106 = load i32, i32* %4
%107 = add nsw i32 %105, %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [14000 x i32], [14000 x i32]* %104, i64 %108
%110 = load i32, i32* %3
%111 = load i32, i32* %5
%112 = add nsw i32 %110, %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [14000 x i32], [14000 x i32]* %109, i64 0, i64 %113
store i32 %103, i32* %114
br label %115
115: ; preds = %95, %73
br label %116
116: ; preds = %115
%117 = load i32, i32* %5
%118 = add nsw i32 %117, 1
store i32 %118, i32* %5
br label %70
119: ; preds = %70
br label %120
120: ; preds = %119
%121 = load i32, i32* %4
%122 = add nsw i32 %121, 1
store i32 %122, i32* %4
br label %66
123: ; preds = %66
br label %124
124: ; preds = %123
%125 = load i32, i32* %3
%126 = add nsw i32 %125, 1
store i32 %126, i32* %3
br label %62
127: ; preds = %62
br label %128
128: ; preds = %127
%129 = load i32, i32* %2
%130 = add nsw i32 %129, 1
store i32 %130, i32* %2
br label %58
131: ; preds = %58
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %133
133: ; preds = %167, %131
%134 = load i32, i32* %2
%135 = icmp slt i32 %134, 20000
br i1 %135, label %136, label %170
136: ; preds = %133
store i32 0, i32* %3
br label %137
137: ; preds = %163, %136
%138 = load i32, i32* %3
%139 = icmp slt i32 %138, 14000
br i1 %139, label %140, label %166
140: ; preds = %137
%141 = load [14000 x i32]*, [14000 x i32]** %11
%142 = load i32, i32* %2
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [14000 x i32], [14000 x i32]* %141, i64 %143
%145 = load i32, i32* %3
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [14000 x i32], [14000 x i32]* %144, i64 0, i64 %146
%148 = load i32, i32* %147
%149 = icmp ne i32 %148, 1
br i1 %149, label %150, label %162
150: ; preds = %140
%151 = load i32, i32* %2
%152 = load i32, i32* %3
%153 = load [14000 x i32]*, [14000 x i32]** %11
%154 = load i32, i32* %2
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [14000 x i32], [14000 x i32]* %153, i64 %155
%157 = load i32, i32* %3
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [14000 x i32], [14000 x i32]* %156, i64 0, i64 %158
%160 = load i32, i32* %159
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %151, i32 %152, i32 %160, i32 1)
store i32 1, i32* %1
br label %172
162: ; preds = %140
br label %163
163: ; preds = %162
%164 = load i32, i32* %3
%165 = add nsw i32 %164, 1
store i32 %165, i32* %3
br label %137
166: ; preds = %137
br label %167
167: ; preds = %166
%168 = load i32, i32* %2
%169 = add nsw i32 %168, 1
store i32 %169, i32* %2
br label %133
170: ; preds = %133
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %172
172: ; preds = %170, %150
%173 = load i32, i32* %1
ret i32 %173
}

LLVM IR (-O2):
@.str.4 = [42 x i8] c"mismatch at %d,%d, was: %d should be: %d\0A\00"
@str = [11 x i8] c"Begin init\00"
@str.6 = [14 x i8] c"Begin compute\00"
@str.7 = [17 x i8] c"Finished Compute\00"
@str.8 = [13 x i8] c"Results pass\00"
@str.10 = [12 x i8] c"malloc fail\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1122177024)
%2 = inttoptr i64 %1 to [14016 x i32]*
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.10, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = tail call i64 @malloc(i32 1120000000)
%9 = inttoptr i64 %8 to [14000 x i32]*
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.10, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %7
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%16 = inttoptr i64 %1 to i32**
%17 = tail call i32 @memset(i32** %16, i32 127, i32 1122177024)
%18 = inttoptr i64 %8 to i32**
%19 = tail call i32 @memset(i32** %18, i32 127, i32 1120000000)
br label %20
20: ; preds = %14, %37
%21 = phi i64 [ 0, %14 ], [ %38, %37 ]
br label %22
22: ; preds = %22, %20
%23 = phi i64 [ 0, %20 ], [ %35, %22 ]
%24 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %21, i64 %23
store i32 1, i32* %24
%25 = or i64 %23, 16
%26 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %21, i64 %25
store i32 1, i32* %26
%27 = add nuw nsw i64 %23, 32
%28 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %21, i64 %27
store i32 1, i32* %28
%29 = add nuw nsw i64 %23, 48
%30 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %21, i64 %29
store i32 1, i32* %30
%31 = add nuw nsw i64 %23, 64
%32 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %21, i64 %31
store i32 1, i32* %32
%33 = add nuw nsw i64 %23, 80
%34 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %21, i64 %33
store i32 1, i32* %34
%35 = add nuw nsw i64 %23, 96
%36 = icmp ult i64 %23, 13920
br i1 %36, label %22, label %37
37: ; preds = %22
%38 = add nuw nsw i64 %21, 16
%39 = icmp ult i64 %21, 20000
br i1 %39, label %20, label %40
40: ; preds = %37
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
br label %42
42: ; preds = %40, %192
%43 = phi i64 [ 0, %40 ], [ %193, %192 ]
br label %44
44: ; preds = %42, %189
%45 = phi i64 [ 0, %42 ], [ %190, %189 ]
%46 = add nuw i64 %45, 16
%47 = getelementptr [14016 x i32], [14016 x i32]* %2, i64 %43, i64 %45
%48 = add nuw i64 %45, 1
%49 = getelementptr [14016 x i32], [14016 x i32]* %2, i64 %43, i64 %48
%50 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %43, i64 %45
%51 = add nuw nsw i64 %45, 1
%52 = add nuw nsw i64 %45, 2
%53 = add nuw nsw i64 %45, 3
%54 = add nuw nsw i64 %45, 4
%55 = add nuw nsw i64 %45, 5
%56 = add nuw nsw i64 %45, 6
%57 = add nuw nsw i64 %45, 7
%58 = add nuw nsw i64 %45, 8
%59 = add nuw nsw i64 %45, 9
%60 = add nuw nsw i64 %45, 10
%61 = add nuw nsw i64 %45, 11
%62 = add nuw nsw i64 %45, 12
%63 = add nuw nsw i64 %45, 13
%64 = add nuw nsw i64 %45, 14
%65 = add nuw nsw i64 %45, 15
br label %66
66: ; preds = %44, %186
%67 = phi i64 [ 0, %44 ], [ %187, %186 ]
%68 = add nuw i64 %43, %67
%69 = add nuw nsw i64 %67, %43
%70 = getelementptr [14000 x i32], [14000 x i32]* %9, i64 %68, i64 %46
%71 = getelementptr [14000 x i32], [14000 x i32]* %9, i64 %68, i64 %45
%72 = icmp ult i32* %71, %49
%73 = icmp ult i32* %47, %70
%74 = and i1 %72, %73
br i1 %74, label %167, label %75
75: ; preds = %66
%76 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %45
%77 = bitcast i32* %76 to <4 x i32>*
%78 = load <4 x i32>, <4 x i32>* %77
%79 = load i32, i32* %50
%80 = insertelement <4 x i32> poison, i32 %79, i64 0
%81 = shufflevector <4 x i32> %80, <4 x i32> poison, <4 x i32> zeroinitializer
%82 = icmp sgt <4 x i32> %78, %81
%83 = extractelement <4 x i1> %82, i64 0
br i1 %83, label %84, label %86
84: ; preds = %75
%85 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %45
store i32 %79, i32* %85
br label %86
86: ; preds = %84, %75
%87 = extractelement <4 x i1> %82, i64 1
br i1 %87, label %88, label %90
88: ; preds = %86
%89 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %51
store i32 %79, i32* %89
br label %90
90: ; preds = %88, %86
%91 = extractelement <4 x i1> %82, i64 2
br i1 %91, label %92, label %94
92: ; preds = %90
%93 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %52
store i32 %79, i32* %93
br label %94
94: ; preds = %92, %90
%95 = extractelement <4 x i1> %82, i64 3
br i1 %95, label %96, label %98
96: ; preds = %94
%97 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %53
store i32 %79, i32* %97
br label %98
98: ; preds = %96, %94
%99 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %54
%100 = bitcast i32* %99 to <4 x i32>*
%101 = load <4 x i32>, <4 x i32>* %100
%102 = load i32, i32* %50
%103 = insertelement <4 x i32> poison, i32 %102, i64 0
%104 = shufflevector <4 x i32> %103, <4 x i32> poison, <4 x i32> zeroinitializer
%105 = icmp sgt <4 x i32> %101, %104
%106 = extractelement <4 x i1> %105, i64 0
br i1 %106, label %107, label %109
107: ; preds = %98
%108 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %54
store i32 %102, i32* %108
br label %109
109: ; preds = %107, %98
%110 = extractelement <4 x i1> %105, i64 1
br i1 %110, label %111, label %113
111: ; preds = %109
%112 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %55
store i32 %102, i32* %112
br label %113
113: ; preds = %111, %109
%114 = extractelement <4 x i1> %105, i64 2
br i1 %114, label %115, label %117
115: ; preds = %113
%116 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %56
store i32 %102, i32* %116
br label %117
117: ; preds = %115, %113
%118 = extractelement <4 x i1> %105, i64 3
br i1 %118, label %119, label %121
119: ; preds = %117
%120 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %57
store i32 %102, i32* %120
br label %121
121: ; preds = %119, %117
%122 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %58
%123 = bitcast i32* %122 to <4 x i32>*
%124 = load <4 x i32>, <4 x i32>* %123
%125 = load i32, i32* %50
%126 = insertelement <4 x i32> poison, i32 %125, i64 0
%127 = shufflevector <4 x i32> %126, <4 x i32> poison, <4 x i32> zeroinitializer
%128 = icmp sgt <4 x i32> %124, %127
%129 = extractelement <4 x i1> %128, i64 0
br i1 %129, label %130, label %132
130: ; preds = %121
%131 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %58
store i32 %125, i32* %131
br label %132
132: ; preds = %130, %121
%133 = extractelement <4 x i1> %128, i64 1
br i1 %133, label %134, label %136
134: ; preds = %132
%135 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %59
store i32 %125, i32* %135
br label %136
136: ; preds = %134, %132
%137 = extractelement <4 x i1> %128, i64 2
br i1 %137, label %138, label %140
138: ; preds = %136
%139 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %60
store i32 %125, i32* %139
br label %140
140: ; preds = %138, %136
%141 = extractelement <4 x i1> %128, i64 3
br i1 %141, label %142, label %144
142: ; preds = %140
%143 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %61
store i32 %125, i32* %143
br label %144
144: ; preds = %142, %140
%145 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %62
%146 = bitcast i32* %145 to <4 x i32>*
%147 = load <4 x i32>, <4 x i32>* %146
%148 = load i32, i32* %50
%149 = insertelement <4 x i32> poison, i32 %148, i64 0
%150 = shufflevector <4 x i32> %149, <4 x i32> poison, <4 x i32> zeroinitializer
%151 = icmp sgt <4 x i32> %147, %150
%152 = extractelement <4 x i1> %151, i64 0
br i1 %152, label %153, label %155
153: ; preds = %144
%154 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %62
store i32 %148, i32* %154
br label %155
155: ; preds = %153, %144
%156 = extractelement <4 x i1> %151, i64 1
br i1 %156, label %157, label %159
157: ; preds = %155
%158 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %63
store i32 %148, i32* %158
br label %159
159: ; preds = %157, %155
%160 = extractelement <4 x i1> %151, i64 2
br i1 %160, label %161, label %163
161: ; preds = %159
%162 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %64
store i32 %148, i32* %162
br label %163
163: ; preds = %161, %159
%164 = extractelement <4 x i1> %151, i64 3
br i1 %164, label %165, label %186
165: ; preds = %163
%166 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %65
store i32 %148, i32* %166
br label %186
167: ; preds = %66, %183
%168 = phi i64 [ %184, %183 ], [ 0, %66 ]
%169 = add nuw nsw i64 %168, %45
%170 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %169
%171 = load i32, i32* %170
%172 = load i32, i32* %50
%173 = icmp sgt i32 %171, %172
br i1 %173, label %174, label %175
174: ; preds = %167
store i32 %172, i32* %170
br label %175
175: ; preds = %167, %174
%176 = or i64 %168, 1
%177 = add nuw nsw i64 %176, %45
%178 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %177
%179 = load i32, i32* %178
%180 = load i32, i32* %50
%181 = icmp sgt i32 %179, %180
br i1 %181, label %182, label %183
182: ; preds = %175
store i32 %180, i32* %178
br label %183
183: ; preds = %182, %175
%184 = add nuw nsw i64 %168, 2
%185 = icmp eq i64 %184, 16
br i1 %185, label %186, label %167
186: ; preds = %183, %163, %165
%187 = add nuw nsw i64 %67, 1
%188 = icmp eq i64 %187, 16
br i1 %188, label %189, label %66
189: ; preds = %186
%190 = add nuw nsw i64 %45, 1
%191 = icmp eq i64 %190, 14000
br i1 %191, label %192, label %44
192: ; preds = %189
%193 = add nuw nsw i64 %43, 1
%194 = icmp eq i64 %193, 20000
br i1 %194, label %195, label %42
195: ; preds = %192
%196 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
br label %197
197: ; preds = %195, %233
%198 = phi i64 [ 0, %195 ], [ %234, %233 ]
br label %199
199: ; preds = %230, %197
%200 = phi i64 [ 0, %197 ], [ %231, %230 ]
%201 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %198, i64 %200
%202 = load i32, i32* %201
%203 = icmp eq i32 %202, 1
br i1 %203, label %210, label %204
204: ; preds = %225, %220, %215, %210, %199
%205 = phi i64 [ %200, %199 ], [ %211, %210 ], [ %216, %215 ], [ %221, %220 ], [ %226, %225 ]
%206 = phi i32 [ %202, %199 ], [ %213, %210 ], [ %218, %215 ], [ %223, %220 ], [ %228, %225 ]
%207 = trunc i64 %198 to i32
%208 = trunc i64 %205 to i32
%209 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %207, i32 %208, i32 %206, i32 1)
br label %238
210: ; preds = %199
%211 = add nuw nsw i64 %200, 1
%212 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %198, i64 %211
%213 = load i32, i32* %212
%214 = icmp eq i32 %213, 1
br i1 %214, label %215, label %204
215: ; preds = %210
%216 = add nuw nsw i64 %200, 2
%217 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %198, i64 %216
%218 = load i32, i32* %217
%219 = icmp eq i32 %218, 1
br i1 %219, label %220, label %204
220: ; preds = %215
%221 = add nuw nsw i64 %200, 3
%222 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %198, i64 %221
%223 = load i32, i32* %222
%224 = icmp eq i32 %223, 1
br i1 %224, label %225, label %204
225: ; preds = %220
%226 = add nuw nsw i64 %200, 4
%227 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %198, i64 %226
%228 = load i32, i32* %227
%229 = icmp eq i32 %228, 1
br i1 %229, label %230, label %204
230: ; preds = %225
%231 = add nuw nsw i64 %200, 5
%232 = icmp eq i64 %231, 14000
br i1 %232, label %233, label %199
233: ; preds = %230
%234 = add nuw nsw i64 %198, 1
%235 = icmp eq i64 %234, 20000
br i1 %235, label %236, label %197
236: ; preds = %233
%237 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.8, i64 0, i64 0))
br label %238
238: ; preds = %236, %204
%239 = phi i32 [ 1, %204 ], [ 0, %236 ]
ret i32 %239
}