#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 print_ttable(int outer, int inner) {
  int a, b;
  for (a = 1; a <= outer; a++) {
    for (b = 1; b <= inner; b++) {
      printf("%d\t", a * b);
    }
    printf("\n");
  }
  return;
}


x86 assembly (clang, -O0):
<print_ttable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1183 <print_ttable+0x73>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1167 <print_ttable+0x57>
mov    -0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <print_ttable+0x28>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <print_ttable+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ttable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1196 <print_ttable+0x76>
mov    %esi,%r15d
mov    %edi,%r14d
mov    $0x1,%r13d
lea    0xebe(%rip),%r12
jmp    1166 <print_ttable+0x46>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r13),%eax
cmp    %r14d,%r13d
mov    %eax,%r13d
je     1196 <print_ttable+0x76>
test   %r15d,%r15d
jle    1150 <print_ttable+0x30>
mov    %r13d,%ebx
mov    %r15d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %r13d,%ebx
add    $0xffffffff,%ebp
jne    1180 <print_ttable+0x60>
jmp    1150 <print_ttable+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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