#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 *output;
  iArray *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");
  for (i = 0; i < nr; i++)
    for (j = 0; j < nc; j++) {
      tempout = output[i][j];
      for (sr = 0; sr < wr; sr++)
        for (sc = 0; sc < wc; sc++)
          if (tempout > input[i + sr][j + sc])
            tempout = input[i + sr][j + sc];
      output[i][j] = tempout;
    }
  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    138e <main+0x24e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x36b0,-0xc(%rbp)
jge    137b <main+0x23b>
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xdac0,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1351 <main+0x211>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    133e <main+0x1fe>
mov    -0x18(%rbp),%eax
mov    -0x38(%rbp),%rcx
mov    -0x8(%rbp),%edx
add    -0x10(%rbp),%edx
movslq %edx,%rdx
imul   $0xdb00,%rdx,%rdx
add    %rdx,%rcx
mov    -0xc(%rbp),%edx
add    -0x14(%rbp),%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    132b <main+0x1eb>
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
imul   $0xdb00,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
jmp    1330 <main+0x1f0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12cf <main+0x18f>
jmp    1343 <main+0x203>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12be <main+0x17e>
mov    -0x18(%rbp),%edx
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xdac0,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    128e <main+0x14e>
jmp    1380 <main+0x240>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    127a <main+0x13a>
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4e20,-0x8(%rbp)
jge    1449 <main+0x309>
movl   $0x0,-0xc(%rbp)
cmpl   $0x36b0,-0xc(%rbp)
jge    1436 <main+0x2f6>
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     1423 <main+0x2e3>
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    0xc30(%rip),%rdi
mov    $0x1,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145e <main+0x31e>
jmp    1428 <main+0x2e8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13b7 <main+0x277>
jmp    143b <main+0x2fb>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13a3 <main+0x263>
lea    0xc14(%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   %r15
push   %r14
push   %rbx
mov    $0x42e31000,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1409 <main+0x2b9>
mov    %rax,%r14
mov    $0x42c1d800,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1409 <main+0x2b9>
mov    %rax,%r15
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x7f,%esi
mov    $0x42e31000,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
mov    $0x7f,%esi
mov    $0x42c1d800,%edx
call   1050 <memset@plt>
mov    %r14,%rax
add    $0x140,%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
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     11d0 <main+0x80>
lea    0x10(%rcx),%rdx
add    $0xdb000,%rax
cmp    $0x4e20,%rcx
mov    %rdx,%rcx
jb     11c0 <main+0x70>
lea    0xdfc(%rip),%rdi
call   1030 <puts@plt>
xor    %r8d,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
imul   $0xdac0,%r8,%rdi
add    %r15,%rdi
lea    (%rdi,%rdx,4),%rsi
mov    (%rdi,%rdx,4),%edi
add    $0x1,%rdx
mov    $0xfffffffffff25000,%rbx
nopl   0x0(%rax)
movdqu 0xdb000(%rcx,%rbx,1),%xmm0
movdqu 0xdb010(%rcx,%rbx,1),%xmm1
movdqu 0xdb020(%rcx,%rbx,1),%xmm2
movdqu 0xdb030(%rcx,%rbx,1),%xmm3
movdqa %xmm2,%xmm4
pcmpgtd %xmm0,%xmm4
pand   %xmm4,%xmm0
pandn  %xmm2,%xmm4
por    %xmm0,%xmm4
movdqa %xmm3,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm3,%xmm0
por    %xmm1,%xmm0
movdqa %xmm0,%xmm1
pcmpgtd %xmm4,%xmm1
pand   %xmm1,%xmm4
pandn  %xmm0,%xmm1
por    %xmm4,%xmm1
pshufd $0xee,%xmm1,%xmm0
movdqa %xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
pshufd $0x55,%xmm2,%xmm0
movdqa %xmm0,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm0,%xmm1
por    %xmm2,%xmm1
movd   %xmm1,%eax
cmp    %edi,%eax
cmovl  %eax,%edi
add    $0xdb00,%rbx
jne    1280 <main+0x130>
mov    %edi,(%rsi)
add    $0x4,%rcx
cmp    $0x36b0,%rdx
jne    1260 <main+0x110>
add    $0x1,%r8
add    $0xdb00,%r14
cmp    $0x4e20,%r8
jne    1250 <main+0x100>
lea    0xce9(%rip),%rdi
call   1030 <puts@plt>
xor    %esi,%esi
mov    $0x4,%edx
cs nopw 0x0(%rax,%rax,1)
mov    -0x10(%r15,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    13d2 <main+0x282>
mov    -0xc(%r15,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    13d8 <main+0x288>
mov    -0x8(%r15,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    13de <main+0x28e>
mov    -0x4(%r15,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    13e4 <main+0x294>
mov    (%r15,%rdx,4),%ecx
cmp    $0x1,%ecx
jne    13e8 <main+0x298>
add    $0x5,%rdx
cmp    $0x36b4,%rdx
jne    1370 <main+0x220>
add    $0x1,%rsi
add    $0xdac0,%r15
cmp    $0x4e20,%rsi
jne    1361 <main+0x211>
lea    0xc8b(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
jmp    1401 <main+0x2b1>
add    $0xfffffffffffffffc,%rdx
jmp    13e8 <main+0x298>
add    $0xfffffffffffffffd,%rdx
jmp    13e8 <main+0x298>
add    $0xfffffffffffffffe,%rdx
jmp    13e8 <main+0x298>
add    $0xffffffffffffffff,%rdx
lea    0xc11(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xc51(%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 = %130, %56
%59 = load i32, i32* %2
%60 = icmp slt i32 %59, 20000
br i1 %60, label %61, label %133
61: ; preds = %58
store i32 0, i32* %3
br label %62
62: ; preds = %126, %61
%63 = load i32, i32* %3
%64 = icmp slt i32 %63, 14000
br i1 %64, label %65, label %129
65: ; preds = %62
%66 = load [14000 x i32]*, [14000 x i32]** %11
%67 = load i32, i32* %2
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [14000 x i32], [14000 x i32]* %66, i64 %68
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [14000 x i32], [14000 x i32]* %69, i64 0, i64 %71
%73 = load i32, i32* %72
store i32 %73, i32* %6
store i32 0, i32* %4
br label %74
74: ; preds = %114, %65
%75 = load i32, i32* %4
%76 = icmp slt i32 %75, 16
br i1 %76, label %77, label %117
77: ; preds = %74
store i32 0, i32* %5
br label %78
78: ; preds = %110, %77
%79 = load i32, i32* %5
%80 = icmp slt i32 %79, 16
br i1 %80, label %81, label %113
81: ; preds = %78
%82 = load i32, i32* %6
%83 = load [14016 x i32]*, [14016 x i32]** %12
%84 = load i32, i32* %2
%85 = load i32, i32* %4
%86 = add nsw i32 %84, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [14016 x i32], [14016 x i32]* %83, i64 %87
%89 = load i32, i32* %3
%90 = load i32, i32* %5
%91 = add nsw i32 %89, %90
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [14016 x i32], [14016 x i32]* %88, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = icmp sgt i32 %82, %94
br i1 %95, label %96, label %109
96: ; preds = %81
%97 = load [14016 x i32]*, [14016 x i32]** %12
%98 = load i32, i32* %2
%99 = load i32, i32* %4
%100 = add nsw i32 %98, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [14016 x i32], [14016 x i32]* %97, i64 %101
%103 = load i32, i32* %3
%104 = load i32, i32* %5
%105 = add nsw i32 %103, %104
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [14016 x i32], [14016 x i32]* %102, i64 0, i64 %106
%108 = load i32, i32* %107
store i32 %108, i32* %6
br label %109
109: ; preds = %96, %81
br label %110
110: ; preds = %109
%111 = load i32, i32* %5
%112 = add nsw i32 %111, 1
store i32 %112, i32* %5
br label %78
113: ; preds = %78
br label %114
114: ; preds = %113
%115 = load i32, i32* %4
%116 = add nsw i32 %115, 1
store i32 %116, i32* %4
br label %74
117: ; preds = %74
%118 = load i32, i32* %6
%119 = load [14000 x i32]*, [14000 x i32]** %11
%120 = load i32, i32* %2
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [14000 x i32], [14000 x i32]* %119, i64 %121
%123 = load i32, i32* %3
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [14000 x i32], [14000 x i32]* %122, i64 0, i64 %124
store i32 %118, i32* %125
br label %126
126: ; preds = %117
%127 = load i32, i32* %3
%128 = add nsw i32 %127, 1
store i32 %128, i32* %3
br label %62
129: ; preds = %62
br label %130
130: ; preds = %129
%131 = load i32, i32* %2
%132 = add nsw i32 %131, 1
store i32 %132, i32* %2
br label %58
133: ; preds = %58
%134 = 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 %135
135: ; preds = %169, %133
%136 = load i32, i32* %2
%137 = icmp slt i32 %136, 20000
br i1 %137, label %138, label %172
138: ; preds = %135
store i32 0, i32* %3
br label %139
139: ; preds = %165, %138
%140 = load i32, i32* %3
%141 = icmp slt i32 %140, 14000
br i1 %141, label %142, label %168
142: ; preds = %139
%143 = load [14000 x i32]*, [14000 x i32]** %11
%144 = load i32, i32* %2
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [14000 x i32], [14000 x i32]* %143, i64 %145
%147 = load i32, i32* %3
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [14000 x i32], [14000 x i32]* %146, i64 0, i64 %148
%150 = load i32, i32* %149
%151 = icmp ne i32 %150, 1
br i1 %151, label %152, label %164
152: ; preds = %142
%153 = load i32, i32* %2
%154 = load i32, i32* %3
%155 = load [14000 x i32]*, [14000 x i32]** %11
%156 = load i32, i32* %2
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [14000 x i32], [14000 x i32]* %155, i64 %157
%159 = load i32, i32* %3
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [14000 x i32], [14000 x i32]* %158, i64 0, i64 %160
%162 = load i32, i32* %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %153, i32 %154, i32 %162, i32 1)
store i32 1, i32* %1
br label %174
164: ; preds = %142
br label %165
165: ; preds = %164
%166 = load i32, i32* %3
%167 = add nsw i32 %166, 1
store i32 %167, i32* %3
br label %139
168: ; preds = %139
br label %169
169: ; preds = %168
%170 = load i32, i32* %2
%171 = add nsw i32 %170, 1
store i32 %171, i32* %2
br label %135
172: ; preds = %135
%173 = 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 %174
174: ; preds = %172, %152
%175 = load i32, i32* %1
ret i32 %175
}

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, %63
%43 = phi i64 [ 0, %40 ], [ %64, %63 ]
br label %44
44: ; preds = %42, %61
%45 = phi i64 [ 0, %42 ], [ %48, %61 ]
%46 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %43, i64 %45
%47 = load i32, i32* %46
%48 = add nuw nsw i64 %45, 1
br label %49
49: ; preds = %44, %49
%50 = phi i64 [ 0, %44 ], [ %59, %49 ]
%51 = phi i32 [ %47, %44 ], [ %58, %49 ]
%52 = add nuw nsw i64 %50, %43
%53 = getelementptr inbounds [14016 x i32], [14016 x i32]* %2, i64 %52, i64 %45
%54 = bitcast i32* %53 to <16 x i32>*
%55 = load <16 x i32>, <16 x i32>* %54
%56 = call i32 @llvm.vector.reduce.smin.v16i32(<16 x i32> %55)
%57 = icmp slt i32 %56, %51
%58 = select i1 %57, i32 %56, i32 %51
%59 = add nuw nsw i64 %50, 1
%60 = icmp eq i64 %59, 16
br i1 %60, label %61, label %49
61: ; preds = %49
store i32 %58, i32* %46
%62 = icmp eq i64 %48, 14000
br i1 %62, label %63, label %44
63: ; preds = %61
%64 = add nuw nsw i64 %43, 1
%65 = icmp eq i64 %64, 20000
br i1 %65, label %66, label %42
66: ; preds = %63
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
br label %68
68: ; preds = %66, %104
%69 = phi i64 [ 0, %66 ], [ %105, %104 ]
br label %70
70: ; preds = %101, %68
%71 = phi i64 [ 0, %68 ], [ %102, %101 ]
%72 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %71
%73 = load i32, i32* %72
%74 = icmp eq i32 %73, 1
br i1 %74, label %81, label %75
75: ; preds = %96, %91, %86, %81, %70
%76 = phi i64 [ %71, %70 ], [ %82, %81 ], [ %87, %86 ], [ %92, %91 ], [ %97, %96 ]
%77 = phi i32 [ %73, %70 ], [ %84, %81 ], [ %89, %86 ], [ %94, %91 ], [ %99, %96 ]
%78 = trunc i64 %69 to i32
%79 = trunc i64 %76 to i32
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %78, i32 %79, i32 %77, i32 1)
br label %109
81: ; preds = %70
%82 = add nuw nsw i64 %71, 1
%83 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %82
%84 = load i32, i32* %83
%85 = icmp eq i32 %84, 1
br i1 %85, label %86, label %75
86: ; preds = %81
%87 = add nuw nsw i64 %71, 2
%88 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %87
%89 = load i32, i32* %88
%90 = icmp eq i32 %89, 1
br i1 %90, label %91, label %75
91: ; preds = %86
%92 = add nuw nsw i64 %71, 3
%93 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %92
%94 = load i32, i32* %93
%95 = icmp eq i32 %94, 1
br i1 %95, label %96, label %75
96: ; preds = %91
%97 = add nuw nsw i64 %71, 4
%98 = getelementptr inbounds [14000 x i32], [14000 x i32]* %9, i64 %69, i64 %97
%99 = load i32, i32* %98
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %75
101: ; preds = %96
%102 = add nuw nsw i64 %71, 5
%103 = icmp eq i64 %102, 14000
br i1 %103, label %104, label %70
104: ; preds = %101
%105 = add nuw nsw i64 %69, 1
%106 = icmp eq i64 %105, 20000
br i1 %106, label %107, label %68
107: ; preds = %104
%108 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.8, i64 0, i64 0))
br label %109
109: ; preds = %107, %75
%110 = phi i32 [ 1, %75 ], [ 0, %107 ]
ret i32 %110
}