#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 *, int, ...);
void print_table(int n) {
  printf("\nTabla del %d del 0 al 10:\n", n);
  for (int i = 0; i <= 10; i++)
    printf("%3d * %2d = %d\n", n, i, n * i);
}


x86 assembly (clang, -O0):
<print_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1166 <print_table+0x56>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <print_table+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%rbx,1),%r15d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%rbx,2),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x0(,%rbx,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%rbx,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%r15,%r15,2),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1030 <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   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%rbx,8),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%r15,%r15,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"\0ATabla del %d del 0 al 10:\0A\00"
@.str.1 = [16 x i8] c"%3d * %2d = %d\0A\00"
define void @print_table(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 0, i32 0)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 1, i32 %0)
%5 = shl nsw i32 %0, 1
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 2, i32 %5)
%7 = mul nsw i32 %0, 3
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 3, i32 %7)
%9 = shl nsw i32 %0, 2
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 4, i32 %9)
%11 = mul nsw i32 %0, 5
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 5, i32 %11)
%13 = mul nsw i32 %0, 6
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 6, i32 %13)
%15 = mul nsw i32 %0, 7
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 7, i32 %15)
%17 = shl nsw i32 %0, 3
%18 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 8, i32 %17)
%19 = mul nsw i32 %0, 9
%20 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 9, i32 %19)
%21 = mul nsw i32 %0, 10
%22 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 10, i32 %21)
ret void
}