#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 multiTable_v4() {
  int i, j, n;
  for (i = 1; i <= 9; i++) {
    for (n = 1; n <= 9 - i; n++) {
      printf("        ");
    }
    for (j = 1; j <= 9; j++) {
      printf("%d*%d=%2d\t", i, j, i * j);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<multiTable_v4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     11b5 <multiTable_v4+0xa5>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x9,%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jg     115f <multiTable_v4+0x4f>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <multiTable_v4+0x20>
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     1199 <multiTable_v4+0x89>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <multiTable_v4+0x56>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <multiTable_v4+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiTable_v4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x8,%r13d
lea    0xecc(%rip),%r14
lea    0xebc(%rip),%r15
jmp    1229 <multiTable_v4+0x109>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbx,1),%r12d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbx,2),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x0(,%rbx,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbx,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%r12,2),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x0(,%rbx,8),%ebp
mov    %ebp,%ecx
sub    %ebx,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbx,8),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
add    $0xffffffff,%r13d
cmp    $0xa,%ebx
je     1254 <multiTable_v4+0x134>
cmp    $0x2,%r13d
mov    $0x1,%ebp
cmovge %r13d,%ebp
cmp    $0x8,%ebx
ja     1150 <multiTable_v4+0x30>
nop
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1240 <multiTable_v4+0x120>
jmp    1150 <multiTable_v4+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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