#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 *);
main() {
  int n = 0, i = 0;
  printf("Enter the number");
  scanf("%d", &n);
  printf("The multiplication table is");
  for (i = 0; i <= 12; i++) {
    printf(" \n %d * %d = %d ", n, i, n * i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jg     11a3 <main+0x83>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,1),%ecx
mov    %rbx,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,2),%ecx
mov    %rbx,%rdi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,4),%ecx
mov    %rbx,%rdi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,4),%ecx
mov    %rbx,%rdi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <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   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,8),%ecx
sub    %esi,%ecx
mov    %rbx,%rdi
mov    $0x7,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,8),%ecx
mov    %rbx,%rdi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,8),%ecx
mov    %rbx,%rdi
mov    $0x9,%edx
xor    %eax,%eax
call   1030 <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   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,4),%eax
lea    (%rsi,%rax,2),%ecx
mov    %rbx,%rdi
mov    $0xb,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0x0(,%rsi,4),%eax
lea    (%rax,%rax,2),%ecx
mov    %rbx,%rdi
mov    $0xc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Enter the number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"The multiplication table is\00"
@.str.3 = [17 x i8] c" \0A %d * %d = %d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 0, i32 0)
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 1, i32 %8)
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 2, i32 %11)
%13 = load i32, i32* %1
%14 = mul nsw i32 %13, 3
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 3, i32 %14)
%16 = load i32, i32* %1
%17 = shl nsw i32 %16, 2
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 4, i32 %17)
%19 = load i32, i32* %1
%20 = mul nsw i32 %19, 5
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 5, i32 %20)
%22 = load i32, i32* %1
%23 = mul nsw i32 %22, 6
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 6, i32 %23)
%25 = load i32, i32* %1
%26 = mul nsw i32 %25, 7
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %25, i32 7, i32 %26)
%28 = load i32, i32* %1
%29 = shl nsw i32 %28, 3
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %28, i32 8, i32 %29)
%31 = load i32, i32* %1
%32 = mul nsw i32 %31, 9
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 9, i32 %32)
%34 = load i32, i32* %1
%35 = mul nsw i32 %34, 10
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %34, i32 10, i32 %35)
%37 = load i32, i32* %1
%38 = mul nsw i32 %37, 11
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %37, i32 11, i32 %38)
%40 = load i32, i32* %1
%41 = mul nsw i32 %40, 12
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %40, i32 12, i32 %41)
ret i32 0
}