#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 *, ...);
void main() {
  int i, j;
  for (i = 1; i <= 9; i++) {
    for (j = 1; j <= 9; j++) {
      printf("%d*%d=%-3d", j, i, i * j);
      if (i == j) {
        printf("\n");
        break;
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     119a <main+0x8a>
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     1187 <main+0x77>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1174 <main+0x64>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1187 <main+0x77>
jmp    1179 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
jmp    118c <main+0x7c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4,%r12d
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x6,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x9,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%r15d
mov    $0x10,%ebp
mov    $0x8,%r13d
mov    $0x24,%r14d
mov    $0x1c,%ebx
movl   $0x18,(%rsp)
movl   $0x14,0x4(%rsp)
mov    $0xc,%eax
nop
mov    %ebx,0xc(%rsp)
mov    %r14d,0x10(%rsp)
lea    0xdd0(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %eax,%ebx
mov    %r12d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    %r12d,%edx
mov    %r13d,0x14(%rsp)
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %r12d,%edx
mov    %ebx,0x8(%rsp)
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    0xc(%rsp),%ebx
mov    0x10(%rsp),%r14d
mov    $0x4,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x20,%r15d
je     1340 <main+0x220>
lea    0xd59(%rip),%rdi
mov    $0x5,%esi
mov    %r12d,%edx
mov    0x4(%rsp),%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x28,%r15d
je     1340 <main+0x220>
lea    0xd35(%rip),%rdi
mov    $0x6,%esi
mov    %r12d,%edx
mov    (%rsp),%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x30,%r15d
je     1340 <main+0x220>
lea    0xd16(%rip),%rdi
mov    $0x7,%esi
mov    %r12d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x38,%r15d
je     1340 <main+0x220>
lea    0xcf8(%rip),%rdi
mov    $0x8,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x40,%r15d
je     1340 <main+0x220>
lea    0xcd9(%rip),%rdi
mov    $0x9,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x48,%r15d
jne    134a <main+0x22a>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0x8,%r15d
add    $0x4,%ebp
mov    0x14(%rsp),%r13d
add    $0x2,%r13d
add    $0x9,%r14d
add    $0x7,%ebx
addl   $0x6,(%rsp)
addl   $0x5,0x4(%rsp)
mov    0x8(%rsp),%eax
add    $0x3,%eax
cmp    $0x50,%r15d
jne    1220 <main+0x100>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d*%d=%-3d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
br label %3
3: ; preds = %27, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 9
br i1 %5, label %6, label %30
6: ; preds = %3
store i32 1, i32* %2
br label %7
7: ; preds = %23, %6
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 9
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = mul nsw i32 %13, %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %15)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %26
22: ; preds = %10
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %7
26: ; preds = %20, %7
br label %27
27: ; preds = %26
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %3
30: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d*%d=%-3d\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 4)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 3, i32 3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 3, i32 6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 9)
%9 = tail call i32 @putchar(i32 10)
br label %10
10: ; preds = %42, %0
%11 = phi i32 [ 4, %0 ], [ %43, %42 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 %11, i32 %11)
%13 = shl nuw nsw i32 %11, 1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 %11, i32 %13)
%15 = mul nuw nsw i32 %11, 3
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 %11, i32 %15)
%17 = shl nuw nsw i32 %11, 2
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 %11, i32 %17)
%19 = icmp eq i32 %11, 4
br i1 %19, label %40, label %20
20: ; preds = %10
%21 = mul nuw nsw i32 %11, 5
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5, i32 %11, i32 %21)
%23 = icmp eq i32 %11, 5
br i1 %23, label %40, label %24
24: ; preds = %20
%25 = mul nuw nsw i32 %11, 6
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6, i32 %11, i32 %25)
%27 = icmp eq i32 %11, 6
br i1 %27, label %40, label %28
28: ; preds = %24
%29 = mul nuw nsw i32 %11, 7
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 7, i32 %11, i32 %29)
%31 = icmp eq i32 %11, 7
br i1 %31, label %40, label %32
32: ; preds = %28
%33 = shl nuw nsw i32 %11, 3
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 8, i32 %11, i32 %33)
%35 = icmp eq i32 %11, 8
br i1 %35, label %40, label %36
36: ; preds = %32
%37 = mul nuw nsw i32 %11, 9
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 9, i32 %11, i32 %37)
%39 = icmp eq i32 %11, 9
br i1 %39, label %40, label %42
40: ; preds = %36, %32, %28, %24, %20, %10
%41 = tail call i32 @putchar(i32 10)
br label %42
42: ; preds = %36, %40
%43 = add nuw nsw i32 %11, 1
%44 = icmp eq i32 %43, 10
br i1 %44, label %45, label %10
45: ; preds = %42
ret void
}