#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 *);
void main() {
  printf("Este programa foi feito por Jessica Cristina Cacau Patricio.\n\n");
  int num, cont = 1, cont2;
  printf("Digite um numero inteiro:\n");
  scanf("%d", &num);
  while (cont <= num) {
    cont2 = 1;
    while (cont2 <= 10) {
      printf("%d * %d = %d\n", cont, cont2, cont * cont2);
      cont2++;
    }
    cont++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11af <main+0x8f>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     11a1 <main+0x81>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <main+0x3b>
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    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x18(%rsp)
jle    130d <main+0x1dd>
mov    $0x1,%r13d
movl   $0x8,0x14(%rsp)
movl   $0x4,0x10(%rsp)
mov    $0x2,%ebx
movl   $0xa,0xc(%rsp)
movl   $0x9,0x8(%rsp)
movl   $0x7,0x4(%rsp)
mov    $0x6,%ebp
mov    $0x5,%r14d
mov    $0x3,%r12d
cs nopw 0x0(%rax,%rax,1)
lea    0xe3c(%rip),%r15
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x1,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x2,%edx
mov    %ebx,0x20(%rsp)
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x3,%edx
mov    %r12d,0x24(%rsp)
mov    %r12d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x4,%edx
mov    0x10(%rsp),%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x5,%edx
mov    %r14d,0x1c(%rsp)
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x6,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x7,%edx
mov    0x4(%rsp),%r14d
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x8,%edx
mov    0x14(%rsp),%ebx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0x9,%edx
mov    0x8(%rsp),%r12d
mov    %r12d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    $0xa,%edx
mov    0xc(%rsp),%r15d
mov    %r15d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%r13),%eax
add    $0x8,%ebx
mov    %ebx,0x14(%rsp)
addl   $0x4,0x10(%rsp)
mov    0x20(%rsp),%ebx
add    $0x2,%ebx
add    $0xa,%r15d
mov    %r15d,0xc(%rsp)
add    $0x9,%r12d
mov    %r12d,0x8(%rsp)
add    $0x7,%r14d
mov    %r14d,0x4(%rsp)
add    $0x6,%ebp
mov    0x1c(%rsp),%r14d
add    $0x5,%r14d
mov    0x24(%rsp),%r12d
add    $0x3,%r12d
cmp    0x18(%rsp),%r13d
mov    %eax,%r13d
jl     11c0 <main+0x90>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [63 x i8] c"Este programa foi feito por Jessica Cristina Cacau Patricio.\0A\0A\00"
@.str.1 = [27 x i8] c"Digite um numero inteiro:\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [14 x i8] c"%d * %d = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
br label %7
7: ; preds = %24, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %27
11: ; preds = %7
store i32 1, i32* %3
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 10
br i1 %14, label %15, label %24
15: ; preds = %12
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = mul nsw i32 %18, %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 %17, i32 %20)
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %12
24: ; preds = %12
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %7
27: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [14 x i8] c"%d * %d = %d\0A\00"
@str = [62 x i8] c"Este programa foi feito por Jessica Cristina Cacau Patricio.\0A\00"
@str.4 = [26 x i8] c"Digite um numero inteiro:\00"
define void @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %32, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %29, %8 ], [ 1, %0 ]
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 1, i32 %9)
%11 = shl nuw nsw i32 %9, 1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 2, i32 %11)
%13 = mul nuw nsw i32 %9, 3
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 3, i32 %13)
%15 = shl nuw nsw i32 %9, 2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 4, i32 %15)
%17 = mul nuw nsw i32 %9, 5
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 5, i32 %17)
%19 = mul nuw nsw i32 %9, 6
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 6, i32 %19)
%21 = mul nuw nsw i32 %9, 7
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 7, i32 %21)
%23 = shl nuw nsw i32 %9, 3
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 8, i32 %23)
%25 = mul nuw nsw i32 %9, 9
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 9, i32 %25)
%27 = mul nuw nsw i32 %9, 10
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 10, i32 %27)
%29 = add nuw nsw i32 %9, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %9, %30
br i1 %31, label %8, label %32
32: ; preds = %8, %0
ret void
}