#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 = 1, x = 1, a, resultado;
  printf(" Introduza a quantidade de tabuadas que quer! ");
  scanf("%d", &a);
  do {
    printf("\nTabuada do %d\n", x);
    while (i <= 10) {
      resultado = i * x;
      printf(" %dx%d=%d\n", i, a, resultado);
      i++;
    }
    i = 1;
    x++;
  } while (x <= a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xa,-0x8(%rbp)
jg     11a5 <main+0x85>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x4c>
movl   $0x1,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    115b <main+0x3b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%ebx
movl   $0x8,0x20(%rsp)
movl   $0x4,0xc(%rsp)
mov    $0x2,%ebp
movl   $0xa,0x1c(%rsp)
movl   $0x9,0x18(%rsp)
movl   $0x7,0x14(%rsp)
movl   $0x6,0x10(%rsp)
mov    $0x5,%r14d
mov    $0x3,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe8b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
mov    %rbx,0x30(%rsp)
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
lea    0xe82(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x2,%esi
mov    %ebp,0x28(%rsp)
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x3,%esi
mov    %r12d,0x2c(%rsp)
mov    %r12d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x4,%esi
mov    0xc(%rsp),%ebp
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x5,%esi
mov    %r14d,0x24(%rsp)
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x6,%esi
mov    0x10(%rsp),%r14d
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x7,%esi
mov    0x14(%rsp),%r13d
mov    %r13d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x8,%esi
mov    0x20(%rsp),%ebx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x9,%esi
mov    0x18(%rsp),%r12d
mov    %r12d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0xa,%esi
mov    0x1c(%rsp),%r15d
mov    %r15d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x30(%rsp),%rcx
lea    0x1(%rcx),%eax
add    $0x8,%ebx
mov    %ebx,0x20(%rsp)
add    $0x4,%ebp
mov    %ebp,0xc(%rsp)
mov    0x28(%rsp),%ebp
add    $0x2,%ebp
add    $0xa,%r15d
mov    %r15d,0x1c(%rsp)
add    $0x9,%r12d
mov    %r12d,0x18(%rsp)
add    $0x7,%r13d
mov    %r13d,0x14(%rsp)
add    $0x6,%r14d
mov    %r14d,0x10(%rsp)
mov    0x24(%rsp),%r14d
add    $0x5,%r14d
mov    0x2c(%rsp),%r12d
add    $0x3,%r12d
cmp    0x8(%rsp),%ecx
mov    %eax,%ebx
jl     11a0 <main+0x80>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c" Introduza a quantidade de tabuadas que quer! \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0ATabuada do %d\0A\00"
@.str.3 = [11 x i8] c" %dx%d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %8
8: ; preds = %27, %0
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %14, %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 10
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = mul nsw i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %11
24: ; preds = %11
store i32 1, i32* %2
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = icmp sle i32 %28, %29
br i1 %30, label %8, label %31
31: ; preds = %27
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [47 x i8] c" Introduza a quantidade de tabuadas que quer! \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0ATabuada do %d\0A\00"
@.str.3 = [11 x i8] c" %dx%d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 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)
br label %5
5: ; preds = %5, %0
%6 = phi i32 [ 1, %0 ], [ %37, %5 ]
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %8, i32 %6)
%10 = shl nuw nsw i32 %6, 1
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %11, i32 %10)
%13 = mul nuw nsw i32 %6, 3
%14 = load i32, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %14, i32 %13)
%16 = shl nuw nsw i32 %6, 2
%17 = load i32, i32* %1
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 %17, i32 %16)
%19 = mul nuw nsw i32 %6, 5
%20 = load i32, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 5, i32 %20, i32 %19)
%22 = mul nuw nsw i32 %6, 6
%23 = load i32, i32* %1
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 %23, i32 %22)
%25 = mul nuw nsw i32 %6, 7
%26 = load i32, i32* %1
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 7, i32 %26, i32 %25)
%28 = shl nuw nsw i32 %6, 3
%29 = load i32, i32* %1
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 8, i32 %29, i32 %28)
%31 = mul nuw nsw i32 %6, 9
%32 = load i32, i32* %1
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 9, i32 %32, i32 %31)
%34 = mul nuw nsw i32 %6, 10
%35 = load i32, i32* %1
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 10, i32 %35, i32 %34)
%37 = add nuw nsw i32 %6, 1
%38 = load i32, i32* %1
%39 = icmp slt i32 %6, %38
br i1 %39, label %5, label %40
40: ; preds = %5
ret i32 0
}