#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, ...);
int main() {
  int i, mult, n;
  printf("tabuada de mltiplicação n=%d\n", n);
  printf("_________________ n=%d \n", n);
  for (i = 0; i <= 10; i = i + 1) {
    for (n = 0; n <= 10; n = n + 1) {
      mult = n * i;
      printf("%d x %d = %d \n\n", n, i, mult);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     11a5 <main+0x95>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     1192 <main+0x82>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x49>
jmp    1197 <main+0x87>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x38>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %r13d,%r13d
xor    %r12d,%r12d
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
xor    %ebx,%ebx
movl   $0x0,0xc(%rsp)
xor    %r15d,%r15d
movl   $0x0,0x4(%rsp)
xor    %r14d,%r14d
mov    %ebx,0x24(%rsp)
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r14d,%edx
mov    0xc(%rsp),%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r14d,%edx
mov    %r13d,0x20(%rsp)
mov    %r13d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r15d,0x18(%rsp)
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %r14d,%edx
mov    %r12d,0x1c(%rsp)
mov    %r12d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %r14d,%edx
mov    0x8(%rsp),%r12d
mov    %r12d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r14d,%edx
mov    0x10(%rsp),%r13d
mov    %r13d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    0x4(%rsp),%r15d
mov    %r15d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %r14d,%edx
mov    0x14(%rsp),%ebp
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x24(%rsp),%ebx
mov    $0xa,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%r14d
add    $0x8,%r15d
mov    %r15d,0x4(%rsp)
mov    0x18(%rsp),%r15d
add    $0x4,%r15d
addl   $0x2,0xc(%rsp)
add    $0xa,%ebx
add    $0x9,%ebp
mov    %ebp,0x14(%rsp)
add    $0x7,%r13d
mov    %r13d,0x10(%rsp)
add    $0x6,%r12d
mov    %r12d,0x8(%rsp)
mov    0x1c(%rsp),%r12d
add    $0x5,%r12d
mov    0x20(%rsp),%r13d
add    $0x3,%r13d
cmp    $0xb,%r14d
jne    1170 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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