int main() {
  int data[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, 2,  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}};
  int max_product = 0;
  for (int x = 0; x < 20; x++) {
    for (int y = 0; y < 20; y++) {
      int value = data[y][x];
      int vert_product = 0;
      int horz_product = 0;
      int bl_tr_product = 0;
      int tl_br_product = 0;
      if (2 < y)
        vert_product = value * data[y - 1][x] * data[y - 2][x] * data[y - 3][x];
      if (2 < x)
        horz_product = value * data[y][x - 1] * data[y][x - 2] * data[y][x - 3];
      if (x < 17) {
        if (y < 17)
          tl_br_product = value * data[y + 1][x + 1] * data[y + 2][x + 2] *
                          data[y + 3][x + 3];
        if (2 < y)
          bl_tr_product = value * data[y - 1][x + 1] * data[y - 2][x + 2] *
                          data[y - 3][x + 3];
      }
      if (max_product < vert_product)
        max_product = vert_product;
      if (max_product < horz_product)
        max_product = horz_product;
      if (max_product < bl_tr_product)
        max_product = bl_tr_product;
      if (max_product < tl_br_product)
        max_product = tl_br_product;
    }
  }
  printf("The largest product of four adjacent numbers is %d.\n", max_product);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x670,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x650(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x640,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x654(%rbp)
movl   $0x0,-0x658(%rbp)
cmpl   $0x14,-0x658(%rbp)
jge    14d5 <main+0x3b5>
movl   $0x0,-0x65c(%rbp)
cmpl   $0x14,-0x65c(%rbp)
jge    14bc <main+0x39c>
movslq -0x65c(%rbp),%rcx
lea    -0x650(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x658(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x660(%rbp)
movl   $0x0,-0x664(%rbp)
movl   $0x0,-0x668(%rbp)
movl   $0x0,-0x66c(%rbp)
movl   $0x0,-0x670(%rbp)
mov    $0x2,%eax
cmp    -0x65c(%rbp),%eax
jge    125b <main+0x13b>
mov    -0x660(%rbp),%eax
mov    -0x65c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
movslq -0x658(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x65c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
movslq -0x658(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x65c(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
movslq -0x658(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
mov    %eax,-0x664(%rbp)
mov    $0x2,%eax
cmp    -0x658(%rbp),%eax
jge    12e7 <main+0x1c7>
mov    -0x660(%rbp),%eax
movslq -0x65c(%rbp),%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
movslq -0x65c(%rbp),%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
sub    $0x2,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
movslq -0x65c(%rbp),%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
sub    $0x3,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    %eax,-0x668(%rbp)
cmpl   $0x11,-0x658(%rbp)
jge    142b <main+0x30b>
cmpl   $0x11,-0x65c(%rbp)
jge    138b <main+0x26b>
mov    -0x660(%rbp),%eax
mov    -0x65c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x65c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x65c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    %eax,-0x670(%rbp)
mov    $0x2,%eax
cmp    -0x65c(%rbp),%eax
jge    1426 <main+0x306>
mov    -0x660(%rbp),%eax
mov    -0x65c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x65c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    -0x65c(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rdx
lea    -0x650(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x658(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
imul   (%rcx,%rdx,4),%eax
mov    %eax,-0x66c(%rbp)
jmp    142b <main+0x30b>
mov    -0x654(%rbp),%eax
cmp    -0x664(%rbp),%eax
jge    1449 <main+0x329>
mov    -0x664(%rbp),%eax
mov    %eax,-0x654(%rbp)
mov    -0x654(%rbp),%eax
cmp    -0x668(%rbp),%eax
jge    1467 <main+0x347>
mov    -0x668(%rbp),%eax
mov    %eax,-0x654(%rbp)
mov    -0x654(%rbp),%eax
cmp    -0x66c(%rbp),%eax
jge    1485 <main+0x365>
mov    -0x66c(%rbp),%eax
mov    %eax,-0x654(%rbp)
mov    -0x654(%rbp),%eax
cmp    -0x670(%rbp),%eax
jge    14a3 <main+0x383>
mov    -0x670(%rbp),%eax
mov    %eax,-0x654(%rbp)
jmp    14a8 <main+0x388>
mov    -0x65c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x65c(%rbp)
jmp    1175 <main+0x55>
jmp    14c1 <main+0x3a1>
mov    -0x658(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x658(%rbp)
jmp    115e <main+0x3e>
mov    -0x654(%rbp),%esi
lea    0x115e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x670,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %r11d,%r11d
mov    $0xffffffff,%eax
mov    %rax,(%rsp)
mov    $0xfffffffe,%r10d
mov    $0xfffffffd,%r12d
lea    0xec3(%rip),%r13
xor    %edx,%edx
xor    %r15d,%r15d
jmp    1179 <main+0x69>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x4,%r11
mov    (%rsp),%rax
add    $0x1,%eax
mov    %rax,(%rsp)
add    $0x1,%r10d
add    $0x1,%r12d
mov    0x8(%rsp),%rax
mov    %rax,%rdx
cmp    $0x14,%rax
je     1339 <main+0x229>
mov    (%rsp),%rax
mov    %eax,%eax
mov    %rax,(%rsp)
mov    %r10d,%r10d
mov    %r12d,%r12d
lea    0x1(%rdx),%rax
mov    %rax,0x8(%rsp)
lea    0x2(%rdx),%rax
mov    %rax,0x18(%rsp)
lea    0x3(%rdx),%rax
mov    %rax,0x10(%rsp)
mov    %r13,%rcx
xor    %edi,%edi
mov    %r15d,%esi
mov    %rdx,0x20(%rsp)
jmp    11d5 <main+0xc5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rdi
add    $0x50,%rcx
mov    %r15d,%esi
cmp    $0x14,%rdi
je     1150 <main+0x40>
mov    (%rcx,%r11,1),%r8d
xor    %ebx,%ebx
mov    $0x0,%r14d
cmp    $0x3,%rdi
jb     1232 <main+0x122>
mov    $0xfffffffe,%eax
lea    (%rdi,%rax,1),%rbp
lea    0x1(%rbp),%eax
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
add    %r13,%rax
mov    (%rax,%rdx,4),%r14d
imul   %r8d,%r14d
mov    %ebp,%eax
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
add    %r13,%rax
imul   (%rax,%rdx,4),%r14d
add    $0xffffffff,%ebp
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
shl    $0x4,%rax
add    %r13,%rax
imul   (%rax,%rdx,4),%r14d
cmp    $0x3,%rdx
jb     125f <main+0x14f>
mov    (%rsp),%rax
mov    (%rcx,%rax,4),%ebx
imul   %r8d,%ebx
imul   (%rcx,%r10,4),%ebx
imul   (%rcx,%r12,4),%ebx
xor    %ebp,%ebp
mov    $0x0,%r15d
cmp    $0x10,%rdx
ja     12fe <main+0x1ee>
xor    %ebp,%ebp
mov    $0x0,%r15d
cmp    $0x10,%rdi
ja     1288 <main+0x178>
mov    0x54(%rcx,%r11,1),%r15d
imul   %r8d,%r15d
imul   0xa8(%rcx,%r11,1),%r15d
imul   0xfc(%rcx,%r11,1),%r15d
cmp    $0x3,%rdi
jb     12fe <main+0x1ee>
mov    $0xfffffffe,%eax
add    %rdi,%rax
lea    0x1(%rax),%ebp
lea    0x0(%rbp,%rbp,4),%rbp
shl    $0x4,%rbp
add    %r13,%rbp
mov    %r11,%rdx
mov    %r13,%r11
mov    %r12,%r13
mov    %r10,%r12
mov    0x8(%rsp),%r9
imul   0x0(%rbp,%r9,4),%r8d
mov    %r13,%r12
mov    %r11,%r13
mov    %rdx,%r11
mov    0x20(%rsp),%rdx
mov    %eax,%ebp
lea    0x0(%rbp,%rbp,4),%rbp
shl    $0x4,%rbp
add    %r13,%rbp
mov    0x18(%rsp),%r9
imul   0x0(%rbp,%r9,4),%r8d
add    $0xffffffff,%eax
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
add    %r13,%rax
mov    0x10(%rsp),%rbp
imul   (%rax,%rbp,4),%r8d
mov    %r8d,%ebp
cmp    %r14d,%esi
cmovl  %r14d,%esi
cmp    %ebx,%esi
jge    1320 <main+0x210>
cmp    %ebp,%ebx
jge    1326 <main+0x216>
cmp    %r15d,%ebp
jl     11c0 <main+0xb0>
jmp    1331 <main+0x221>
nopl   0x0(%rax,%rax,1)
mov    %esi,%ebx
cmp    %ebp,%ebx
jl     130d <main+0x1fd>
mov    %ebx,%ebp
cmp    %r15d,%ebp
jl     11c0 <main+0xb0>
mov    %ebp,%r15d
jmp    11c0 <main+0xb0>
lea    0x1300(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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