#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*/ die(char *);
int /*<<< orphan*/ printf(char *, ...);
void multiplicationTable(unsigned max) {
  unsigned row = 0;
  unsigned column = 0;
  if (max > 18)
    die("Outside display constraint of 80 char per line.\n");
  printf(" *");
  for (column; column <= max; ++column)
    printf("%4u", column);
  printf("\n");
  column = 0;
  for (row; row <= max; ++row) {
    printf("%2u", row);
    for (column; column <= max; ++column)
      printf("%4u", column * row);
    printf("\n");
    column = 0;
  }
}


x86 assembly (clang, -O0):
<multiplicationTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x12,-0x4(%rbp)
jbe    114f <multiplicationTable+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <die@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     1188 <multiplicationTable+0x68>
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <multiplicationTable+0x3d>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     120c <multiplicationTable+0xec>
mov    -0x8(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     11e9 <multiplicationTable+0xc9>
mov    -0xc(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ba <multiplicationTable+0x9a>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119d <multiplicationTable+0x7d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicationTable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r12d
cmp    $0x13,%edi
jb     114f <multiplicationTable+0x1f>
lea    0xeb6(%rip),%rdi
call   1050 <die@plt>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %r12d,%ebp
jbe    1170 <multiplicationTable+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea3(%rip),%r14
lea    0xe98(%rip),%r15
xor    %r13d,%r13d
nop
mov    %r14,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
add    %r13d,%ebx
cmp    %r12d,%ebp
jbe    11c0 <multiplicationTable+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
cmp    %r12d,%r13d
jbe    11a0 <multiplicationTable+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Outside display constraint of 80 char per line.\0A\00"
@.str.1 = [3 x i8] c" *\00"
@.str.2 = [4 x i8] c"%4u\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [4 x i8] c"%2u\00"
define void @multiplicationTable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = icmp ugt i32 %5, 18
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @die(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %4
br label %12
12: ; preds = %19, %9
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp ule i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = add i32 %20, 1
store i32 %21, i32* %4
br label %12
22: ; preds = %12
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
%24 = load i32, i32* %3
br label %25
25: ; preds = %47, %22
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = icmp ule i32 %26, %27
br i1 %28, label %29, label %50
29: ; preds = %25
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %4
br label %33
33: ; preds = %42, %29
%34 = load i32, i32* %4
%35 = load i32, i32* %2
%36 = icmp ule i32 %34, %35
br i1 %36, label %37, label %45
37: ; preds = %33
%38 = load i32, i32* %4
%39 = load i32, i32* %3
%40 = mul i32 %38, %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %37
%43 = load i32, i32* %4
%44 = add i32 %43, 1
store i32 %44, i32* %4
br label %33
45: ; preds = %33
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %47
47: ; preds = %45
%48 = load i32, i32* %3
%49 = add i32 %48, 1
store i32 %49, i32* %3
br label %25
50: ; preds = %25
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Outside display constraint of 80 char per line.\0A\00"
@.str.1 = [3 x i8] c" *\00"
@.str.2 = [4 x i8] c"%4u\00"
@.str.4 = [4 x i8] c"%2u\00"
define void @multiplicationTable(i32 %0) {
%2 = icmp ugt i32 %0, 18
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @die(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 0, %5 ], [ %10, %7 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = add i32 %8, 1
%11 = icmp ugt i32 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7
%13 = tail call i32 @putchar(i32 10)
br label %14
14: ; preds = %12, %23
%15 = phi i32 [ 0, %12 ], [ %25, %23 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %17
%18 = phi i32 [ 0, %14 ], [ %21, %17 ]
%19 = mul i32 %18, %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = add i32 %18, 1
%22 = icmp ugt i32 %21, %0
br i1 %22, label %23, label %17
23: ; preds = %17
%24 = tail call i32 @putchar(i32 10)
%25 = add i32 %15, 1
%26 = icmp ugt i32 %25, %0
br i1 %26, label %27, label %14
27: ; preds = %23
ret void
}