int main(int argc, char *argv[]) {
  int grid[20][20] = {
      {8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8},
      {49, 49, 99, 40, 17, 81, 18, 57, 60, 87,
       17, 40, 98, 43, 69, 48, 4,  56, 62, 0},
      {81, 49, 31, 73, 55, 79, 14, 29, 93, 71,
       40, 67, 53, 88, 30, 3,  49, 13, 36, 65},
      {52, 70, 95, 23, 4,  60, 11, 42, 69, 24,
       68, 56, 1,  32, 56, 71, 37, 02, 36, 91},
      {22, 31, 16, 71, 51, 67, 63, 89, 41, 92,
       36, 54, 22, 40, 40, 28, 66, 33, 13, 80},
      {24, 47, 32, 60, 99, 3,  45, 2,  44, 75,
       33, 53, 78, 36, 84, 20, 35, 17, 12, 50},
      {32, 98, 81, 28, 64, 23, 67, 10, 26, 38,
       40, 67, 59, 54, 70, 66, 18, 38, 64, 70},
      {67, 26, 20, 68, 2,  62, 12, 20, 95, 63,
       94, 39, 63, 8,  40, 91, 66, 49, 94, 21},
      {24, 55, 58, 5,  66, 73, 99, 26, 97, 17,
       78, 78, 96, 83, 14, 88, 34, 89, 63, 72},
      {21, 36, 23, 9,  75, 0,  76, 44, 20, 45,
       35, 14, 0,  61, 33, 97, 34, 31, 33, 95},
      {78, 17, 53, 28, 22, 75, 31, 67, 15, 94,
       3,  80, 4,  62, 16, 14, 9,  53, 56, 92},
      {16, 39, 5, 42, 96, 35, 31, 47, 55, 58,
       88, 24, 0, 17, 54, 24, 36, 29, 85, 57},
      {86, 56, 0,  48, 35, 71, 89, 7,  5,  44,
       44, 37, 44, 60, 21, 58, 51, 54, 17, 58},
      {19, 80, 81, 68, 5,  94, 47, 69, 28, 73,
       92, 13, 86, 52, 17, 77, 4,  89, 55, 40},
      {4,  52, 8,  83, 97, 35, 99, 16, 7,  97,
       57, 32, 16, 26, 26, 79, 33, 27, 98, 66},
      {88, 36, 68, 87, 57, 62, 20, 72, 3,  46,
       33, 67, 46, 55, 12, 32, 63, 93, 53, 69},
      {4,  42, 16, 73, 38, 25, 39, 11, 24, 94,
       72, 18, 8,  46, 29, 32, 40, 62, 76, 36},
      {20, 69, 36, 41, 72, 30, 23, 88, 34, 62,
       99, 69, 82, 67, 59, 85, 74, 4,  36, 16},
      {20, 73, 35, 29, 78, 31, 90, 1,  74, 31,
       49, 71, 48, 86, 81, 16, 23, 57, 5,  54},
      {1,  70, 54, 71, 83, 51, 54, 69, 16, 92,
       33, 48, 61, 43, 52, 1,  89, 19, 67, 48}};
  unsigned long highest = 0;
  unsigned long sum = 0;
  for (int i = 0; i < 20; ++i) {
    for (int j = 0; j < 20; ++j) {
      if (j < 20 - 3) {
        sum = grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3];
        if (sum > highest) {
          highest = sum;
        }
      }
      if (i < 20 - 3) {
        sum = grid[i][j] * grid[i + 1][j] * grid[i + 2][j] * grid[i + 3][j];
        if (sum > highest) {
          highest = sum;
        }
      }
      if (i < 20 - 3 && j < 20 - 3) {
        sum = grid[i][j] * grid[i + 1][j + 1] * grid[i + 2][j + 2] *
              grid[i + 3][j + 3];
        if (sum > highest) {
          highest = sum;
        }
      }
      if (i < 20 - 3 && j >= 3) {
        sum = grid[i][j] * grid[i + 1][j - 1] * grid[i + 2][j - 2] *
              grid[i + 3][j - 3];
        if (sum > highest) {
          highest = sum;
        }
      }
    }
  }
  printf("Highest sum: %lu\n", highest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x670,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x650(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x640,%edx
call   1040 <memcpy@plt>
movq   $0x0,-0x658(%rbp)
movq   $0x0,-0x660(%rbp)
movl   $0x0,-0x664(%rbp)
cmpl   $0x14,-0x664(%rbp)
jge    152b <main+0x40b>
movl   $0x0,-0x668(%rbp)
cmpl   $0x14,-0x668(%rbp)
jge    1512 <main+0x3f2>
cmpl   $0x11,-0x668(%rbp)
jge    1260 <main+0x140>
movslq -0x664(%rbp),%rcx
lea    -0x650(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x668(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x664(%rbp),%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
movslq -0x664(%rbp),%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
movslq -0x664(%rbp),%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
cltq
mov    %rax,-0x660(%rbp)
mov    -0x660(%rbp),%rax
cmp    -0x658(%rbp),%rax
jbe    125b <main+0x13b>
mov    -0x660(%rbp),%rax
mov    %rax,-0x658(%rbp)
jmp    1260 <main+0x140>
cmpl   $0x11,-0x664(%rbp)
jge    132b <main+0x20b>
movslq -0x664(%rbp),%rcx
lea    -0x650(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x668(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
movslq -0x668(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
movslq -0x668(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
movslq -0x668(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
cltq
mov    %rax,-0x660(%rbp)
mov    -0x660(%rbp),%rax
cmp    -0x658(%rbp),%rax
jbe    1326 <main+0x206>
mov    -0x660(%rbp),%rax
mov    %rax,-0x658(%rbp)
jmp    132b <main+0x20b>
cmpl   $0x11,-0x664(%rbp)
jge    1412 <main+0x2f2>
cmpl   $0x11,-0x668(%rbp)
jge    1412 <main+0x2f2>
movslq -0x664(%rbp),%rcx
lea    -0x650(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x668(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
cltq
mov    %rax,-0x660(%rbp)
mov    -0x660(%rbp),%rax
cmp    -0x658(%rbp),%rax
jbe    140d <main+0x2ed>
mov    -0x660(%rbp),%rax
mov    %rax,-0x658(%rbp)
jmp    1412 <main+0x2f2>
cmpl   $0x11,-0x664(%rbp)
jge    14f9 <main+0x3d9>
cmpl   $0x3,-0x668(%rbp)
jl     14f9 <main+0x3d9>
movslq -0x664(%rbp),%rcx
lea    -0x650(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x668(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
sub    $0x2,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x664(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x668(%rbp),%edx
sub    $0x3,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
cltq
mov    %rax,-0x660(%rbp)
mov    -0x660(%rbp),%rax
cmp    -0x658(%rbp),%rax
jbe    14f4 <main+0x3d4>
mov    -0x660(%rbp),%rax
mov    %rax,-0x658(%rbp)
jmp    14f9 <main+0x3d9>
jmp    14fe <main+0x3de>
mov    -0x668(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x668(%rbp)
jmp    1188 <main+0x68>
jmp    1517 <main+0x3f7>
mov    -0x664(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x664(%rbp)
jmp    1171 <main+0x51>
mov    -0x658(%rbp),%rsi
lea    0x1107(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x670,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xee1(%rip),%r11
xor    %r14d,%r14d
mov    %r11,%r15
xor    %esi,%esi
jmp    1141 <main+0x31>
nopl   0x0(%rax)
add    $0x50,%r15
mov    %r10,%r14
cmp    $0x14,%r10
je     125b <main+0x14b>
lea    0x1(%r14),%r10
lea    0x2(%r14),%r8
lea    0x3(%r14),%r9
mov    $0xfffffffd,%edi
xor    %eax,%eax
jmp    116e <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0x1,%rdi
cmp    $0x14,%rax
je     1130 <main+0x20>
cmp    $0x10,%rax
ja     119a <main+0x8a>
movslq (%r15,%rax,4),%rdx
movslq 0x4(%r15,%rax,4),%rbx
imul   %rdx,%rbx
movslq 0x8(%r15,%rax,4),%rdx
movslq 0xc(%r15,%rax,4),%rcx
imul   %rdx,%rcx
imul   %rbx,%rcx
cmp    %rcx,%rsi
cmovb  %rcx,%rsi
cmp    $0x10,%r14
ja     1160 <main+0x50>
movslq (%r15,%rax,4),%r12
movslq 0x50(%r15,%rax,4),%rcx
imul   %r12,%rcx
movslq 0xa0(%r15,%rax,4),%rdx
movslq 0xf0(%r15,%rax,4),%rbx
imul   %rdx,%rbx
imul   %rcx,%rbx
cmp    %rbx,%rsi
jb     11cd <main+0xbd>
mov    %rsi,%rbx
cmp    $0x10,%rax
ja     1209 <main+0xf9>
movslq 0x54(%r15,%rax,4),%rcx
imul   %r12,%rcx
movslq 0xa8(%r15,%rax,4),%rdx
movslq 0xfc(%r15,%rax,4),%rsi
imul   %rdx,%rsi
imul   %rcx,%rsi
cmp    %rsi,%rbx
jb     11fc <main+0xec>
mov    %rbx,%rsi
mov    %rsi,%rbx
cmp    $0x3,%rax
jb     1160 <main+0x50>
lea    0x2(%rdi),%ecx
lea    (%r10,%r10,4),%rdx
shl    $0x4,%rdx
add    %r11,%rdx
movslq (%rdx,%rcx,4),%rcx
imul   %r12,%rcx
lea    0x1(%rdi),%edx
lea    (%r8,%r8,4),%rsi
shl    $0x4,%rsi
add    %r11,%rsi
movslq (%rsi,%rdx,4),%r12
mov    %edi,%esi
lea    (%r9,%r9,4),%rdx
shl    $0x4,%rdx
add    %r11,%rdx
movslq (%rdx,%rsi,4),%rsi
imul   %r12,%rsi
imul   %rcx,%rsi
cmp    %rsi,%rbx
jb     1160 <main+0x50>
mov    %rbx,%rsi
jmp    1160 <main+0x50>
lea    0x13de(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.grid = [20 x [20 x i32]] [[20 x i32] [i32 8, i32 2, i32 22, i32 97, i32 38, i32 15, i32 0, i32 40, i32 0, i32 75, i32 4, i32 5, i32 7, i32 78, i32 52, i32 12, i32 50, i32 77, i32 91, i32 8], [20 x i32] [i32 49, i32 49, i32 99, i32 40, i32 17, i32 81, i32 18, i32 57, i32 60, i32 87, i32 17, i32 40, i32 98, i32 43, i32 69, i32 48, i32 4, i32 56, i32 62, i32 0], [20 x i32] [i32 81, i32 49, i32 31, i32 73, i32 55, i32 79, i32 14, i32 29, i32 93, i32 71, i32 40, i32 67, i32 53, i32 88, i32 30, i32 3, i32 49, i32 13, i32 36, i32 65], [20 x i32] [i32 52, i32 70, i32 95, i32 23, i32 4, i32 60, i32 11, i32 42, i32 69, i32 24, i32 68, i32 56, i32 1, i32 32, i32 56, i32 71, i32 37, i32 2, i32 36, i32 91], [20 x i32] [i32 22, i32 31, i32 16, i32 71, i32 51, i32 67, i32 63, i32 89, i32 41, i32 92, i32 36, i32 54, i32 22, i32 40, i32 40, i32 28, i32 66, i32 33, i32 13, i32 80], [20 x i32] [i32 24, i32 47, i32 32, i32 60, i32 99, i32 3, i32 45, i32 2, i32 44, i32 75, i32 33, i32 53, i32 78, i32 36, i32 84, i32 20, i32 35, i32 17, i32 12, i32 50], [20 x i32] [i32 32, i32 98, i32 81, i32 28, i32 64, i32 23, i32 67, i32 10, i32 26, i32 38, i32 40, i32 67, i32 59, i32 54, i32 70, i32 66, i32 18, i32 38, i32 64, i32 70], [20 x i32] [i32 67, i32 26, i32 20, i32 68, i32 2, i32 62, i32 12, i32 20, i32 95, i32 63, i32 94, i32 39, i32 63, i32 8, i32 40, i32 91, i32 66, i32 49, i32 94, i32 21], [20 x i32] [i32 24, i32 55, i32 58, i32 5, i32 66, i32 73, i32 99, i32 26, i32 97, i32 17, i32 78, i32 78, i32 96, i32 83, i32 14, i32 88, i32 34, i32 89, i32 63, i32 72], [20 x i32] [i32 21, i32 36, i32 23, i32 9, i32 75, i32 0, i32 76, i32 44, i32 20, i32 45, i32 35, i32 14, i32 0, i32 61, i32 33, i32 97, i32 34, i32 31, i32 33, i32 95], [20 x i32] [i32 78, i32 17, i32 53, i32 28, i32 22, i32 75, i32 31, i32 67, i32 15, i32 94, i32 3, i32 80, i32 4, i32 62, i32 16, i32 14, i32 9, i32 53, i32 56, i32 92], [20 x i32] [i32 16, i32 39, i32 5, i32 42, i32 96, i32 35, i32 31, i32 47, i32 55, i32 58, i32 88, i32 24, i32 0, i32 17, i32 54, i32 24, i32 36, i32 29, i32 85, i32 57], [20 x i32] [i32 86, i32 56, i32 0, i32 48, i32 35, i32 71, i32 89, i32 7, i32 5, i32 44, i32 44, i32 37, i32 44, i32 60, i32 21, i32 58, i32 51, i32 54, i32 17, i32 58], [20 x i32] [i32 19, i32 80, i32 81, i32 68, i32 5, i32 94, i32 47, i32 69, i32 28, i32 73, i32 92, i32 13, i32 86, i32 52, i32 17, i32 77, i32 4, i32 89, i32 55, i32 40], [20 x i32] [i32 4, i32 52, i32 8, i32 83, i32 97, i32 35, i32 99, i32 16, i32 7, i32 97, i32 57, i32 32, i32 16, i32 26, i32 26, i32 79, i32 33, i32 27, i32 98, i32 66], [20 x i32] [i32 88, i32 36, i32 68, i32 87, i32 57, i32 62, i32 20, i32 72, i32 3, i32 46, i32 33, i32 67, i32 46, i32 55, i32 12, i32 32, i32 63, i32 93, i32 53, i32 69], [20 x i32] [i32 4, i32 42, i32 16, i32 73, i32 38, i32 25, i32 39, i32 11, i32 24, i32 94, i32 72, i32 18, i32 8, i32 46, i32 29, i32 32, i32 40, i32 62, i32 76, i32 36], [20 x i32] [i32 20, i32 69, i32 36, i32 41, i32 72, i32 30, i32 23, i32 88, i32 34, i32 62, i32 99, i32 69, i32 82, i32 67, i32 59, i32 85, i32 74, i32 4, i32 36, i32 16], [20 x i32] [i32 20, i32 73, i32 35, i32 29, i32 78, i32 31, i32 90, i32 1, i32 74, i32 31, i32 49, i32 71, i32 48, i32 86, i32 81, i32 16, i32 23, i32 57, i32 5, i32 54], [20 x i32] [i32 1, i32 70, i32 54, i32 71, i32 83, i32 51, i32 54, i32 69, i32 16, i32 92, i32 33, i32 48, i32 61, i32 43, i32 52, i32 1, i32 89, i32 19, i32 67, i32 48]]
@.str = [18 x i8] c"Highest sum: %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %12
%4 = phi i64 [ 0, %2 ], [ %7, %12 ]
%5 = phi i64 [ 0, %2 ], [ %91, %12 ]
%6 = icmp ult i64 %4, 17
%7 = add nuw nsw i64 %4, 1
%8 = add nuw nsw i64 %4, 2
%9 = add nuw nsw i64 %4, 3
br label %14
10: ; preds = %12
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %91)
ret i32 0
12: ; preds = %90
%13 = icmp eq i64 %7, 20
br i1 %13, label %10, label %3
14: ; preds = %3, %90
%15 = phi i64 [ 0, %3 ], [ %92, %90 ]
%16 = phi i64 [ %5, %3 ], [ %91, %90 ]
%17 = icmp ult i64 %15, 17
br i1 %17, label %18, label %36
18: ; preds = %14
%19 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %4, i64 %15
%20 = load i32, i32* %19
%21 = add nuw nsw i64 %15, 1
%22 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %4, i64 %21
%23 = load i32, i32* %22
%24 = mul nsw i32 %23, %20
%25 = add nuw nsw i64 %15, 2
%26 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %4, i64 %25
%27 = load i32, i32* %26
%28 = mul nsw i32 %24, %27
%29 = add nuw nsw i64 %15, 3
%30 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %4, i64 %29
%31 = load i32, i32* %30
%32 = mul nsw i32 %28, %31
%33 = sext i32 %32 to i64
%34 = icmp ult i64 %16, %33
%35 = select i1 %34, i64 %33, i64 %16
br label %36
36: ; preds = %18, %14
%37 = phi i64 [ %16, %14 ], [ %35, %18 ]
br i1 %6, label %38, label %90
38: ; preds = %36
%39 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %4, i64 %15
%40 = load i32, i32* %39
%41 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %7, i64 %15
%42 = load i32, i32* %41
%43 = mul nsw i32 %42, %40
%44 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %8, i64 %15
%45 = load i32, i32* %44
%46 = mul nsw i32 %43, %45
%47 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %9, i64 %15
%48 = load i32, i32* %47
%49 = mul nsw i32 %46, %48
%50 = sext i32 %49 to i64
%51 = icmp ult i64 %37, %50
%52 = select i1 %51, i64 %50, i64 %37
br i1 %17, label %53, label %70
53: ; preds = %38
%54 = add nuw nsw i64 %15, 1
%55 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %7, i64 %54
%56 = load i32, i32* %55
%57 = mul nsw i32 %56, %40
%58 = add nuw nsw i64 %15, 2
%59 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %8, i64 %58
%60 = load i32, i32* %59
%61 = mul nsw i32 %57, %60
%62 = add nuw nsw i64 %15, 3
%63 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %9, i64 %62
%64 = load i32, i32* %63
%65 = mul nsw i32 %61, %64
%66 = sext i32 %65 to i64
%67 = icmp ult i64 %52, %66
%68 = select i1 %67, i64 %66, i64 %52
%69 = icmp ugt i64 %15, 2
br i1 %69, label %70, label %90
70: ; preds = %38, %53
%71 = phi i64 [ %68, %53 ], [ %52, %38 ]
%72 = add nuw i64 %15, 4294967295
%73 = and i64 %72, 4294967295
%74 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %7, i64 %73
%75 = load i32, i32* %74
%76 = mul nsw i32 %75, %40
%77 = add nuw i64 %15, 4294967294
%78 = and i64 %77, 4294967295
%79 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %8, i64 %78
%80 = load i32, i32* %79
%81 = mul nsw i32 %76, %80
%82 = add nuw i64 %15, 4294967293
%83 = and i64 %82, 4294967295
%84 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* @__const.main.grid, i64 0, i64 %9, i64 %83
%85 = load i32, i32* %84
%86 = mul nsw i32 %81, %85
%87 = sext i32 %86 to i64
%88 = icmp ult i64 %71, %87
%89 = select i1 %88, i64 %87, i64 %71
br label %90
90: ; preds = %36, %70, %53
%91 = phi i64 [ %68, %53 ], [ %89, %70 ], [ %37, %36 ]
%92 = add nuw nsw i64 %15, 1
%93 = icmp eq i64 %92, 20
br i1 %93, label %12, label %14
}