#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, j, k;
  printf("\nDigite um numero para gerar a tabuada:\n");
  scanf("%d", &i);
  printf("\n");
  for (j = 1; j < 11; j++) {
    k = i * j;
    printf("%d x %d = %d\n", i, j, k);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0xb,-0xc(%rbp)
jge    119b <main+0x7b>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ecx
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,1),%ecx
mov    %rbx,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,2),%ecx
mov    %rbx,%rdi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,4),%ecx
mov    %rbx,%rdi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,4),%ecx
mov    %rbx,%rdi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,2),%ecx
mov    %rbx,%rdi
mov    $0x6,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,8),%ecx
sub    %esi,%ecx
mov    %rbx,%rdi
mov    $0x7,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,8),%ecx
mov    %rbx,%rdi
mov    $0x8,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,8),%ecx
mov    %rbx,%rdi
mov    $0x9,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%ecx
mov    %rbx,%rdi
mov    $0xa,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0ADigite um numero para gerar a tabuada:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [14 x i8] c"%d x %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %8
8: ; preds = %19, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 11
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %8
22: ; preds = %8
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [14 x i8] c"%d x %d = %d\0A\00"
@str = [40 x i8] c"\0ADigite um numero para gerar a tabuada:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @putchar(i32 10)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 1, i32 %6)
%8 = load i32, i32* %1
%9 = shl nsw i32 %8, 1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 2, i32 %9)
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, 3
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 3, i32 %12)
%14 = load i32, i32* %1
%15 = shl nsw i32 %14, 2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 4, i32 %15)
%17 = load i32, i32* %1
%18 = mul nsw i32 %17, 5
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %17, i32 5, i32 %18)
%20 = load i32, i32* %1
%21 = mul nsw i32 %20, 6
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 6, i32 %21)
%23 = load i32, i32* %1
%24 = mul nsw i32 %23, 7
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 7, i32 %24)
%26 = load i32, i32* %1
%27 = shl nsw i32 %26, 3
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 8, i32 %27)
%29 = load i32, i32* %1
%30 = mul nsw i32 %29, 9
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 9, i32 %30)
%32 = load i32, i32* %1
%33 = mul nsw i32 %32, 10
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %32, i32 10, i32 %33)
%35 = call i32 @putchar(i32 10)
ret i32 0
}