#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;
  int i4, j4;
  printf("\n        ");
  for (j = 1; j < 10; j++) {
    printf("%1d       ", j);
  }
  printf("\n\n");
  for (i = 1; i <= 10; i++) {
    i4 = i * i * i * i;
    printf("%2d| %5d %2d", i, i4, i4 % 15);
    for (j = 2; j < i; j++) {
      j4 = j * j * j * j;
      printf(" %4d %2d", i4 - j4 + 1, (i4 - j4 + 1) % 15);
    }
    printf("\n  |\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    115d <main+0x4d>
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     122c <main+0x11c>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x18(%rbp),%edx
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1210 <main+0x100>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
sub    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11bc <main+0xac>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <main+0x62>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rbx
mov    $0x1,%r12d
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
lea    0xe42(%rip),%r13
lea    0xe46(%rip),%r15
xor    %ebx,%ebx
jmp    1209 <main+0xe9>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
add    $0x1,%r12d
add    $0xffffffff,%ebx
cmp    $0xb,%r12d
je     12ae <main+0x18e>
mov    %r12d,%ebp
imul   %r12d,%ebp
imul   %ebp,%ebp
movzwl %bp,%eax
imul   $0x8889,%eax,%eax
shr    $0x13,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
mov    %ebp,%ecx
sub    %eax,%ecx
movzwl %cx,%ecx
lea    0xde2(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3,%r12d
jb     11f0 <main+0xd0>
mov    $0x2,%r14d
nopl   0x0(%rax,%rax,1)
mov    %r14d,%eax
imul   %r14d,%eax
imul   %eax,%eax
mov    %ebp,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
add    $0x1,%eax
movslq %eax,%rsi
imul   $0xffffffff88888889,%rsi,%rax
shr    $0x20,%rax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
mov    %esi,%edx
sub    %eax,%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%r14,1),%eax
add    $0x1,%eax
mov    %r14d,%ecx
add    $0x1,%ecx
mov    %ecx,%r14d
cmp    $0x1,%eax
jne    1250 <main+0x130>
jmp    11f0 <main+0xd0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0A \00"
@.str.1 = [11 x i8] c"%1d \00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [13 x i8] c"%2d| %5d %2d\00"
@.str.4 = [9 x i8] c" %4d %2d\00"
@.str.5 = [6 x i8] c"\0A |\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %7
7: ; preds = %13, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %18
18: ; preds = %61, %16
%19 = load i32, i32* %2
%20 = icmp sle i32 %19, 10
br i1 %20, label %21, label %64
21: ; preds = %18
%22 = load i32, i32* %2
%23 = load i32, i32* %2
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %2
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %2
%28 = mul nsw i32 %26, %27
store i32 %28, i32* %4
%29 = load i32, i32* %2
%30 = load i32, i32* %4
%31 = load i32, i32* %4
%32 = srem i32 %31, 15
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30, i32 %32)
store i32 2, i32* %3
br label %34
34: ; preds = %56, %21
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %59
38: ; preds = %34
%39 = load i32, i32* %3
%40 = load i32, i32* %3
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %3
%43 = mul nsw i32 %41, %42
%44 = load i32, i32* %3
%45 = mul nsw i32 %43, %44
store i32 %45, i32* %5
%46 = load i32, i32* %4
%47 = load i32, i32* %5
%48 = sub nsw i32 %46, %47
%49 = add nsw i32 %48, 1
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = sub nsw i32 %50, %51
%53 = add nsw i32 %52, 1
%54 = srem i32 %53, 15
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %49, i32 %54)
br label %56
56: ; preds = %38
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
store i32 %58, i32* %3
br label %34
59: ; preds = %34
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %61
61: ; preds = %59
%62 = load i32, i32* %2
%63 = add nsw i32 %62, 1
store i32 %63, i32* %2
br label %18
64: ; preds = %18
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0A \00"
@.str.1 = [11 x i8] c"%1d \00"
@.str.3 = [13 x i8] c"%2d| %5d %2d\00"
@.str.4 = [9 x i8] c" %4d %2d\00"
@str = [2 x i8] c"\0A\00"
@str.6 = [5 x i8] c"\0A |\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %0, %31
%13 = phi i32 [ 1, %0 ], [ %33, %31 ]
%14 = mul i32 %13, %13
%15 = mul i32 %14, %14
%16 = trunc i32 %15 to i16
%17 = urem i16 %16, 15
%18 = zext i16 %17 to i32
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 %15, i32 %18)
%20 = icmp ugt i32 %13, 2
br i1 %20, label %21, label %31
21: ; preds = %12, %21
%22 = phi i32 [ %29, %21 ], [ 2, %12 ]
%23 = mul i32 %22, %22
%24 = mul i32 %23, %23
%25 = sub nsw i32 %15, %24
%26 = add nsw i32 %25, 1
%27 = srem i32 %26, 15
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %26, i32 %27)
%29 = add nuw nsw i32 %22, 1
%30 = icmp eq i32 %29, %13
br i1 %30, label %31, label %21
31: ; preds = %21, %12
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
%33 = add nuw nsw i32 %13, 1
%34 = icmp eq i32 %33, 11
br i1 %34, label %35, label %12
35: ; preds = %31
ret i32 0
}