#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*/ printTableLine(int);
int /*<<< orphan*/ printf(char *);
void printTable(int lower, int upper) {
  int i = 0;
  printf("   Integer  |   Square   |    Cube    \n");
  printf("------------|------------|------------\n");
  for (i = lower; i <= upper; i++) {
    printTableLine(i);
  }
}


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)
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1175 <printTable+0x55>
mov    -0xc(%rbp),%edi
call   1030 <printTableLine@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <printTable+0x33>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
cmp    %ebx,%ebp
jg     115e <printTable+0x3e>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <printTableLine@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <printTable+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c" Integer | Square | Cube \0A\00"
@.str.1 = [40 x i8] c"------------|------------|------------\0A\00"
define void @printTable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %3
store i32 %8, i32* %5
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %5
%15 = call i32 @printTableLine(i32 %14)
br label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c" Integer | Square | Cube \00"
@str.2 = [39 x i8] c"------------|------------|------------\00"
define void @printTable(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
%5 = icmp sgt i32 %0, %1
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %0, %2 ]
%8 = tail call i32 @printTableLine(i32 %7)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}