#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*/ printf(char *, ...);
main() {
  int i, j, k, l, m, n, iton, sum, mod15;
  int result[15][7];
  for (i = 0; i < 15; i++) {
    result[i][0] = 1300;
  }
  for (i = 0; i <= 16; i++) {
    for (j = 0; j <= 8; j++) {
      for (k = 0; k <= 3; k++) {
        for (l = 0; l <= 2; l++) {
          for (m = 0; m <= 2; m++) {
            for (n = 0; n <= 1; n++) {
              iton = i + j + k + l + m + n;
              if ((1 <= iton) && (iton <= 16)) {
                sum = i * 66 + j * 146 + k * 370 + l * 450 + m * 672 + n * 754 +
                      16 - iton;
                mod15 = sum % 15;
                if (sum < result[mod15][0]) {
                  result[mod15][0] = sum;
                  result[mod15][1] = i;
                  result[mod15][2] = j;
                  result[mod15][3] = k;
                  result[mod15][4] = l;
                  result[mod15][5] = m;
                  result[mod15][6] = n;
                }
              }
            }
          }
        }
      }
    }
  }
  printf("\nMod   Sum   66  146  370  450  672  754\n   |\n");
  for (i = 0; i < 15; i++) {
    printf("%2d | %4d", i, result[i][0]);
    for (j = 1; j <= 6; j++) {
      printf("%5d", result[i][j]);
    }
    printf("\n   |\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    1159 <main+0x49>
movslq -0x8(%rbp),%rcx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rcx,%rcx
add    %rcx,%rax
movl   $0x514,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jg     136f <main+0x25f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     135c <main+0x24c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     1349 <main+0x239>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jg     1336 <main+0x226>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jg     1323 <main+0x213>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jg     1310 <main+0x200>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x1,%eax
cmp    -0x20(%rbp),%eax
jg     12fd <main+0x1ed>
cmpl   $0x10,-0x20(%rbp)
jg     12fd <main+0x1ed>
imul   $0x42,-0x8(%rbp),%eax
imul   $0x92,-0xc(%rbp),%ecx
add    %ecx,%eax
imul   $0x172,-0x10(%rbp),%ecx
add    %ecx,%eax
imul   $0x1c2,-0x14(%rbp),%ecx
add    %ecx,%eax
imul   $0x2a0,-0x18(%rbp),%ecx
add    %ecx,%eax
imul   $0x2f2,-0x1c(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
mov    -0x24(%rbp),%eax
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rcx
imul   $0x1c,%rdx,%rdx
add    %rdx,%rcx
cmp    (%rcx),%eax
jge    12f8 <main+0x1e8>
mov    -0x24(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0xc(%rax)
mov    -0x14(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x10(%rax)
mov    -0x18(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x14(%rax)
mov    -0x1c(%rbp),%ecx
movslq -0x28(%rbp),%rdx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x18(%rax)
jmp    12fd <main+0x1ed>
jmp    1302 <main+0x1f2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b5 <main+0xa5>
jmp    1315 <main+0x205>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a4 <main+0x94>
jmp    1328 <main+0x218>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1193 <main+0x83>
jmp    133b <main+0x22b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1182 <main+0x72>
jmp    134e <main+0x23e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <main+0x61>
jmp    1361 <main+0x251>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <main+0x50>
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    1415 <main+0x305>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rcx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%edx
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jg     13f9 <main+0x2e9>
movslq -0x8(%rbp),%rcx
lea    -0x1d0(%rbp),%rax
imul   $0x1c,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13ba <main+0x2aa>
lea    0xc28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1384 <main+0x274>
mov    -0x4(%rbp),%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x308,%rsp
movl   $0x514,0x160(%rsp)
movl   $0x514,0x17c(%rsp)
movl   $0x514,0x198(%rsp)
movl   $0x514,0x1b4(%rsp)
movl   $0x514,0x1d0(%rsp)
movl   $0x514,0x1ec(%rsp)
movl   $0x514,0x208(%rsp)
movl   $0x514,0x224(%rsp)
movl   $0x514,0x240(%rsp)
movl   $0x514,0x25c(%rsp)
movl   $0x514,0x278(%rsp)
movl   $0x514,0x294(%rsp)
movl   $0x514,0x2b0(%rsp)
movl   $0x514,0x2cc(%rsp)
movl   $0x514,0x2e8(%rsp)
lea    0x324(%rsp),%r8
lea    0x320(%rsp),%rcx
lea    0x328(%rsp),%r9
lea    0x32c(%rsp),%r14
lea    0x330(%rsp),%r15
lea    0x334(%rsp),%rbp
lea    0x338(%rsp),%rbx
lea    0x5594(%rsp),%rax
xor    %edx,%edx
mov    $0x10,%r11d
mov    $0xffffffff,%esi
mov    $0x301,%edi
jmp    12cd <main+0x1ad>
nopl   (%rax)
mov    0x14(%rsp),%edx
add    $0x1,%edx
mov    0xb0(%rsp),%r8
add    $0x71c,%r8
mov    0x70(%rsp),%r11
add    $0x41,%r11
mov    0xa0(%rsp),%r9
add    $0x71c,%r9
mov    0x98(%rsp),%r14
add    $0x71c,%r14
mov    0x90(%rsp),%r15
add    $0x71c,%r15
mov    0x88(%rsp),%rbp
add    $0x71c,%rbp
mov    0x80(%rsp),%rbx
add    $0x71c,%rbx
mov    0xa8(%rsp),%rcx
add    $0x71c,%rcx
mov    0x24(%rsp),%esi
add    $0x1,%esi
mov    0x78(%rsp),%rax
add    $0x71c,%rax
mov    0x68(%rsp),%rdi
add    $0x41,%rdi
cmp    $0x11,%edx
je     1774 <main+0x654>
mov    %rdi,0x68(%rsp)
mov    %rax,0x78(%rsp)
mov    %edx,0x14(%rsp)
mov    %esi,0x24(%rsp)
mov    %rcx,0xa8(%rsp)
mov    %rbx,0x80(%rsp)
mov    %rbp,0x88(%rsp)
mov    %r15,0x90(%rsp)
mov    %r14,0x98(%rsp)
mov    %r9,0xa0(%rsp)
mov    %r11,0x70(%rsp)
mov    %r8,0xb0(%rsp)
movl   $0x0,0xc(%rsp)
jmp    13eb <main+0x2cb>
nopl   0x0(%rax)
mov    0xc(%rsp),%r10d
add    $0x1,%r10d
mov    0xb8(%rsp),%r8
add    $0xfdc,%r8
mov    0xc0(%rsp),%r11
add    $0x91,%r11
mov    0xc8(%rsp),%r9
add    $0xfdc,%r9
mov    0xd0(%rsp),%r14
add    $0xfdc,%r14
mov    0xd8(%rsp),%r15
add    $0xfdc,%r15
mov    0xe0(%rsp),%rbp
add    $0xfdc,%rbp
mov    0xe8(%rsp),%rbx
add    $0xfdc,%rbx
mov    0xf0(%rsp),%rcx
add    $0xfdc,%rcx
mov    0x28(%rsp),%esi
add    $0x1,%esi
mov    0x2c(%rsp),%edx
add    $0x1,%edx
mov    0xf8(%rsp),%rax
add    $0xfdc,%rax
mov    0x100(%rsp),%rdi
add    $0x91,%rdi
mov    %r10d,0xc(%rsp)
cmp    $0x9,%r10d
je     1230 <main+0x110>
movl   $0x0,0x10(%rsp)
mov    %rdi,0x100(%rsp)
mov    %rax,0xf8(%rsp)
mov    %edx,0x2c(%rsp)
mov    %esi,0x28(%rsp)
mov    %rcx,0xf0(%rsp)
mov    %rbx,0xe8(%rsp)
mov    %rbp,0xe0(%rsp)
mov    %r15,0xd8(%rsp)
mov    %r15,%r10
mov    %r14,0xd0(%rsp)
mov    %r9,0xc8(%rsp)
mov    %r9,%r12
mov    %r11,0xc0(%rsp)
mov    %r8,0xb8(%rsp)
mov    %r8,%r15
movabs $0x8888888888888889,%r8
88 88 88
jmp    152b <main+0x40b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp),%r9d
add    $0x1,%r9d
mov    0x108(%rsp),%r15
add    $0x285c,%r15
mov    0x110(%rsp),%r11
add    $0x171,%r11
mov    0x118(%rsp),%r12
add    $0x285c,%r12
mov    0x120(%rsp),%r14
add    $0x285c,%r14
mov    0x128(%rsp),%r10
add    $0x285c,%r10
mov    0x130(%rsp),%rbp
add    $0x285c,%rbp
mov    0x138(%rsp),%rbx
add    $0x285c,%rbx
mov    0x140(%rsp),%rcx
add    $0x285c,%rcx
mov    0x30(%rsp),%esi
add    $0x1,%esi
mov    0x34(%rsp),%edx
add    $0x1,%edx
mov    0x148(%rsp),%rax
add    $0x285c,%rax
mov    0x150(%rsp),%rdi
add    $0x171,%rdi
mov    %r9d,0x10(%rsp)
cmp    $0x4,%r9d
je     1330 <main+0x210>
mov    %rdi,0x150(%rsp)
mov    %rdi,0x18(%rsp)
mov    %rax,0x148(%rsp)
mov    %r11,%rdi
mov    %rax,%r11
mov    %edx,0x34(%rsp)
mov    %edx,%r9d
mov    %esi,0x30(%rsp)
mov    %esi,%r13d
mov    %rcx,0x140(%rsp)
mov    %r15,%rax
mov    %rcx,%r15
mov    0x18(%rsp),%rcx
mov    %rbx,0x138(%rsp)
mov    %rbx,0x60(%rsp)
mov    %rbp,0x130(%rsp)
mov    %rbp,0x58(%rsp)
mov    %r10,0x128(%rsp)
mov    %r10,0x50(%rsp)
mov    %r14,0x120(%rsp)
mov    %r14,0x48(%rsp)
mov    %r12,0x118(%rsp)
mov    %r12,0x40(%rsp)
mov    %rdi,0x110(%rsp)
mov    %rdi,%rsi
mov    %rax,0x108(%rsp)
mov    %rax,0x38(%rsp)
xor    %r12d,%r12d
jmp    1645 <main+0x525>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
addq   $0x311c,0x38(%rsp)
mov    0x158(%rsp),%rsi
add    $0x1c1,%rsi
addq   $0x311c,0x40(%rsp)
addq   $0x311c,0x48(%rsp)
addq   $0x311c,0x50(%rsp)
addq   $0x311c,0x58(%rsp)
addq   $0x311c,0x60(%rsp)
add    $0x311c,%r15
add    $0x1,%r13d
add    $0x1,%r9d
add    $0x311c,%r11
mov    0x18(%rsp),%rcx
add    $0x1c1,%rcx
cmp    $0x3,%r12d
je     1470 <main+0x350>
xor    %ebp,%ebp
mov    %rcx,0x18(%rsp)
mov    %rsi,0x158(%rsp)
xor    %r14d,%r14d
jmp    1685 <main+0x565>
nopl   0x0(%rax)
add    $0x1,%r14d
add    $0x4964,%rbp
add    $0x29f,%rsi
add    $0x29f,%rcx
cmp    $0xdc2c,%ebp
je     15d0 <main+0x4b0>
mov    %rsi,%rax
mul    %r8
mov    %rdx,%rdi
mov    %rcx,%rax
mul    %r8
lea    (%r9,%r14,1),%r10d
lea    (%r14,%r13,1),%ebx
cmp    $0xf,%ebx
ja     171a <main+0x5fa>
shr    $0x3,%rdi
imul   $0xfffffffffffffe5c,%rdi,%rdi
lea    (%r15,%rdi,1),%rbx
cmp    (%rbx,%rbp,1),%esi
jge    171a <main+0x5fa>
mov    %esi,(%rbx,%rbp,1)
mov    0x38(%rsp),%rax
lea    (%rax,%rdi,1),%rbx
mov    0x14(%rsp),%r8d
mov    %r8d,(%rbx,%rbp,1)
movabs $0x8888888888888889,%r8
88 88 88
mov    0x40(%rsp),%rax
lea    (%rax,%rdi,1),%rbx
mov    0xc(%rsp),%eax
mov    %eax,(%rbx,%rbp,1)
mov    0x48(%rsp),%rax
lea    (%rax,%rdi,1),%rbx
mov    0x10(%rsp),%eax
mov    %eax,(%rbx,%rbp,1)
mov    0x50(%rsp),%rax
lea    (%rax,%rdi,1),%rbx
mov    %r12d,(%rbx,%rbp,1)
mov    0x58(%rsp),%rax
lea    (%rax,%rdi,1),%rbx
mov    %r14d,(%rbx,%rbp,1)
add    0x60(%rsp),%rdi
movl   $0x0,(%rdi,%rbp,1)
cmp    $0xf,%r10d
ja     1660 <main+0x540>
shr    $0x3,%rdx
imul   $0xfffffffffffffe5c,%rdx,%rax
add    %r11,%rax
lea    0x2f1(%rsi),%edx
cmp    -0x18(%rax,%rbp,1),%edx
jge    1660 <main+0x540>
mov    %edx,-0x18(%rax,%rbp,1)
mov    0x14(%rsp),%edx
mov    %edx,-0x14(%rax,%rbp,1)
mov    0xc(%rsp),%edx
mov    %edx,-0x10(%rax,%rbp,1)
mov    0x10(%rsp),%edx
mov    %edx,-0xc(%rax,%rbp,1)
mov    %r12d,-0x8(%rax,%rbp,1)
mov    %r14d,-0x4(%rax,%rbp,1)
movl   $0x1,(%rax,%rbp,1)
jmp    1660 <main+0x540>
lea    0x893(%rip),%rdi
call   1030 <puts@plt>
lea    0x178(%rsp),%rbp
lea    0x871(%rip),%r14
lea    0x874(%rip),%r12
lea    0x899(%rip),%r15
xor    %ebx,%ebx
nop
mov    -0x18(%rbp),%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
add    $0x1c,%rbp
cmp    $0xf,%rbx
jne    17a0 <main+0x680>
xor    %eax,%eax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%2d | %4d\00"
@.str.2 = [4 x i8] c"%5d\00"
@str = [46 x i8] c"\0AMod Sum 66 146 370 450 672 754\0A |\00"
@str.4 = [6 x i8] c"\0A |\00"
define i32 @main() {
%1 = alloca [15 x [7 x i32]]
%2 = bitcast [15 x [7 x i32]]* %1 to i8*
%3 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 0, i64 0
store i32 1300, i32* %3
%4 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 1, i64 0
store i32 1300, i32* %4
%5 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 2, i64 0
store i32 1300, i32* %5
%6 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 3, i64 0
store i32 1300, i32* %6
%7 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 4, i64 0
store i32 1300, i32* %7
%8 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 5, i64 0
store i32 1300, i32* %8
%9 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 6, i64 0
store i32 1300, i32* %9
%10 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 7, i64 0
store i32 1300, i32* %10
%11 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 8, i64 0
store i32 1300, i32* %11
%12 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 9, i64 0
store i32 1300, i32* %12
%13 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 10, i64 0
store i32 1300, i32* %13
%14 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 11, i64 0
store i32 1300, i32* %14
%15 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 12, i64 0
store i32 1300, i32* %15
%16 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 13, i64 0
store i32 1300, i32* %16
%17 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 14, i64 0
store i32 1300, i32* %17
br label %18
18: ; preds = %0, %88
%19 = phi i32 [ %89, %88 ], [ 0, %0 ]
%20 = mul nuw nsw i32 %19, 66
%21 = add nuw nsw i32 %20, 16
br label %22
22: ; preds = %18, %85
%23 = phi i32 [ 0, %18 ], [ %86, %85 ]
%24 = add nuw nsw i32 %23, %19
%25 = mul nuw nsw i32 %23, 146
%26 = add nuw nsw i32 %21, %25
br label %27
27: ; preds = %22, %82
%28 = phi i32 [ 0, %22 ], [ %83, %82 ]
%29 = add nuw nsw i32 %24, %28
%30 = mul nuw nsw i32 %28, 370
%31 = add nuw nsw i32 %26, %30
br label %32
32: ; preds = %27, %79
%33 = phi i32 [ 0, %27 ], [ %80, %79 ]
%34 = add nuw nsw i32 %29, %33
%35 = mul nuw nsw i32 %33, 450
%36 = add nuw nsw i32 %31, %35
br label %37
37: ; preds = %32, %76
%38 = phi i32 [ 0, %32 ], [ %77, %76 ]
%39 = add nuw nsw i32 %34, %38
%40 = mul nuw nsw i32 %38, 672
%41 = add nuw nsw i32 %36, %40
%42 = add nsw i32 %39, -1
%43 = icmp ult i32 %42, 16
br i1 %43, label %44, label %58
44: ; preds = %37
%45 = sub nuw nsw i32 %41, %39
%46 = urem i32 %45, 15
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 0
%49 = load i32, i32* %48
%50 = icmp slt i32 %45, %49
br i1 %50, label %51, label %58
51: ; preds = %44
store i32 %45, i32* %48
%52 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 1
store i32 %19, i32* %52
%53 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 2
store i32 %23, i32* %53
%54 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 3
store i32 %28, i32* %54
%55 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 4
store i32 %33, i32* %55
%56 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 5
store i32 %38, i32* %56
%57 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %47, i64 6
store i32 0, i32* %57
br label %58
58: ; preds = %37, %51, %44
%59 = icmp ult i32 %39, 16
br i1 %59, label %60, label %76
60: ; preds = %58
%61 = xor i32 %39, -1
%62 = add nuw nsw i32 %41, 754
%63 = add i32 %62, %61
%64 = urem i32 %63, 15
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 0
%67 = load i32, i32* %66
%68 = icmp slt i32 %63, %67
br i1 %68, label %69, label %76
69: ; preds = %60
store i32 %63, i32* %66
%70 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 1
store i32 %19, i32* %70
%71 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 2
store i32 %23, i32* %71
%72 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 3
store i32 %28, i32* %72
%73 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 4
store i32 %33, i32* %73
%74 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 5
store i32 %38, i32* %74
%75 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %65, i64 6
store i32 1, i32* %75
br label %76
76: ; preds = %69, %60, %58
%77 = add nuw nsw i32 %38, 1
%78 = icmp eq i32 %77, 3
br i1 %78, label %79, label %37
79: ; preds = %76
%80 = add nuw nsw i32 %33, 1
%81 = icmp eq i32 %80, 3
br i1 %81, label %82, label %32
82: ; preds = %79
%83 = add nuw nsw i32 %28, 1
%84 = icmp eq i32 %83, 4
br i1 %84, label %85, label %27
85: ; preds = %82
%86 = add nuw nsw i32 %23, 1
%87 = icmp eq i32 %86, 9
br i1 %87, label %88, label %22
88: ; preds = %85
%89 = add nuw nsw i32 %19, 1
%90 = icmp eq i32 %89, 17
br i1 %90, label %91, label %18
91: ; preds = %88
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ 0, %91 ], [ %118, %93 ]
%95 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 0
%96 = load i32, i32* %95
%97 = trunc i64 %94 to i32
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %97, i32 %96)
%99 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 1
%100 = load i32, i32* %99
%101 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %100)
%102 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 2
%103 = load i32, i32* %102
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %103)
%105 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 3
%106 = load i32, i32* %105
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %106)
%108 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 4
%109 = load i32, i32* %108
%110 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %109)
%111 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 5
%112 = load i32, i32* %111
%113 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %112)
%114 = getelementptr inbounds [15 x [7 x i32]], [15 x [7 x i32]]* %1, i64 0, i64 %94, i64 6
%115 = load i32, i32* %114
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %115)
%117 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%118 = add nuw nsw i64 %94, 1
%119 = icmp eq i64 %118, 15
br i1 %119, label %120, label %93
120: ; preds = %93
ret i32 0
}