#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 printTable(int userStart, int userEnd) {
  int i = 0, j = 0;
  for (i = userStart; i <= userEnd; i++) {
    for (j = 1; j < 10; j++) {
      printf("%d * %d = %d \n", i, j, i * j);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1194 <printTable+0x84>
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1178 <printTable+0x68>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <printTable+0x35>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <printTable+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,0x8(%rsp)
cmp    %esi,%edi
jg     12ab <printTable+0x18b>
mov    %edi,%r15d
addl   $0x1,0x8(%rsp)
lea    0x0(,%r15,8),%eax
lea    0x0(,%r15,4),%ecx
mov    %ecx,0x10(%rsp)
lea    (%r15,%r15,1),%ecx
lea    (%r15,%r15,8),%edx
mov    %edx,0x14(%rsp)
mov    %eax,0x18(%rsp)
sub    %edi,%eax
mov    %eax,0xc(%rsp)
mov    %rcx,%rbp
lea    (%rcx,%rcx,2),%r14d
lea    (%r15,%r15,4),%r13d
lea    (%r15,%r15,2),%ebx
nopl   0x0(%rax,%rax,1)
lea    0xe79(%rip),%r12
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x2,%edx
mov    %rbp,0x20(%rsp)
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x3,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x4,%edx
mov    0x10(%rsp),%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x5,%edx
mov    %r13d,0x1c(%rsp)
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x6,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x7,%edx
mov    0xc(%rsp),%r13d
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x8,%edx
mov    0x18(%rsp),%ebp
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x9,%edx
mov    %ebx,%r12d
mov    0x14(%rsp),%ebx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
add    $0x8,%ebp
mov    %ebp,0x18(%rsp)
addl   $0x4,0x10(%rsp)
mov    0x20(%rsp),%rbp
add    $0x2,%ebp
add    $0x9,%ebx
mov    %ebx,0x14(%rsp)
mov    %r12d,%ebx
add    $0x7,%r13d
mov    %r13d,0xc(%rsp)
add    $0x6,%r14d
mov    0x1c(%rsp),%r13d
add    $0x5,%r13d
add    $0x3,%ebx
cmp    %r15d,0x8(%rsp)
jne    1180 <printTable+0x60>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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