#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 *, ...);
int main() {
  for (unsigned short x = 1; x < 16; ++x) {
    printf("%x |", x);
    for (unsigned short y = 1; y < 16; ++y) {
      if (x > y)
        printf("   ");
      else
        printf(" %2x", x * y);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x10,%eax
jge    11c8 <main+0xb8>
movzwl -0x6(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x1,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
cmp    $0x10,%eax
jge    11a9 <main+0x99>
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jle    117a <main+0x6a>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1193 <main+0x83>
movzwl -0x6(%rbp),%esi
movzwl -0x8(%rbp),%eax
imul   %eax,%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <main+0x88>
mov    -0x8(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x8(%rbp)
jmp    114a <main+0x3a>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x6(%rbp)
jmp    1125 <main+0x15>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r13d
lea    0xec8(%rip),%r14
lea    0xec6(%rip),%r15
lea    0xec3(%rip),%r12
jmp    1164 <main+0x44>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
cmp    $0x10,%r13d
je     11a8 <main+0x88>
mov    %r14,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%ebp
mov    $0x1,%ebx
jmp    1197 <main+0x77>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
add    %r13d,%ebp
cmp    $0x10,%ebx
je     1150 <main+0x30>
cmp    %ebx,%r13d
jbe    1180 <main+0x60>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118c <main+0x6c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%x |\00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [5 x i8] c" %2x\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 1, i16* %2
br label %4
4: ; preds = %37, %0
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %40
8: ; preds = %4
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
store i16 1, i16* %3
br label %12
12: ; preds = %32, %8
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = icmp slt i32 %14, 16
br i1 %15, label %16, label %35
16: ; preds = %12
%17 = load i16, i16* %2
%18 = zext i16 %17 to i32
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = icmp sgt i32 %18, %20
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %31
24: ; preds = %16
%25 = load i16, i16* %2
%26 = zext i16 %25 to i32
%27 = load i16, i16* %3
%28 = zext i16 %27 to i32
%29 = mul nsw i32 %26, %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %24, %22
br label %32
32: ; preds = %31
%33 = load i16, i16* %3
%34 = add i16 %33, 1
store i16 %34, i16* %3
br label %12
35: ; preds = %12
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i16, i16* %2
%39 = add i16 %38, 1
store i16 %39, i16* %2
br label %4
40: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%x |\00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [5 x i8] c" %2x\00"
define i32 @main() {
br label %2
1: ; preds = %5
ret i32 0
2: ; preds = %0, %5
%3 = phi i32 [ 1, %0 ], [ %7, %5 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %9
5: ; preds = %17
%6 = tail call i32 @putchar(i32 10)
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 16
br i1 %8, label %1, label %2
9: ; preds = %2, %17
%10 = phi i32 [ 1, %2 ], [ %18, %17 ]
%11 = icmp ugt i32 %3, %10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %17
14: ; preds = %9
%15 = mul nuw nsw i32 %10, %3
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %12, %14
%18 = add nuw nsw i32 %10, 1
%19 = icmp eq i32 %18, 16
br i1 %19, label %5, label %9
}