#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int numeroIniziale = 0;
  unsigned int counter = 0;
  printf("%s",
         "Inserire il numero iniziale su cui calcolare la tabella (>0): ");
  scanf("%d", &numeroIniziale);
  if (numeroIniziale > 0) {
    printf("\nN\t%d*N\t%d*N\t%d*N\n\n", 10, 100, 1000);
    do {
      printf("%d\t%d\t%d\t%d\t\n", (numeroIniziale * (int)1),
             (numeroIniziale * (int)10), (numeroIniziale * (int)100),
             (numeroIniziale * (int)1000));
      numeroIniziale++;
      ++counter;
    } while (counter != 10);
  } else {
    puts("Attenzione non e' possibile stampare la tabella se il valore "
         "iniziale e' minore di 0");
  }
  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    0xeac(%rip),%rdi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11de <main+0xae>
lea    0xec2(%rip),%rdi
mov    $0xa,%esi
mov    $0x64,%edx
mov    $0x3e8,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x0,%esi
imul   $0xa,-0x8(%rbp),%edx
imul   $0x64,-0x8(%rbp),%ecx
imul   $0x3e8,-0x8(%rbp),%r8d
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1199 <main+0x69>
jmp    11ea <main+0xba>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xeb8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1311 <main+0x1e1>
lea    0xed0(%rip),%rdi
mov    $0xa,%esi
mov    $0x64,%edx
mov    $0x3e8,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
add    %eax,%eax
add    $0x2,%eax
lea    (%rax,%rax,4),%edx
imul   $0x64,%esi,%ecx
imul   $0x3e8,%esi,%r8d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    131d <main+0x1ed>
lea    0xd4f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [63 x i8] c"Inserire il numero iniziale su cui calcolare la tabella (>0): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [20 x i8] c"\0AN\09%d*N\09%d*N\09%d*N\0A\0A\00"
@.str.4 = [14 x i8] c"%d\09%d\09%d\09%d\09\0A\00"
@.str.5 = [85 x i8] c"Attenzione non e' possibile stampare la tabella se il valore iniziale e' minore di 0\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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %28
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 10, i32 100, i32 1000)
br label %10
10: ; preds = %24, %8
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 1
%13 = load i32, i32* %2
%14 = mul nsw i32 %13, 10
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 100
%17 = load i32, i32* %2
%18 = mul nsw i32 %17, 1000
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %12, i32 %14, i32 %16, i32 %18)
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
%22 = load i32, i32* %3
%23 = add i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %10
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 10
br i1 %26, label %10, label %27
27: ; preds = %24
br label %30
28: ; preds = %0
%29 = call i32 @puts(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %27
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [63 x i8] c"Inserire il numero iniziale su cui calcolare la tabella (>0): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [20 x i8] c"\0AN\09%d*N\09%d*N\09%d*N\0A\0A\00"
@.str.4 = [14 x i8] c"%d\09%d\09%d\09%d\09\0A\00"
@.str.5 = [85 x i8] c"Attenzione non e' possibile stampare la tabella se il valore iniziale e' minore di 0\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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %68
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 10, i32 100, i32 1000)
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 10
%11 = mul nsw i32 %9, 100
%12 = mul nsw i32 %9, 1000
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
%16 = mul nsw i32 %15, 10
%17 = mul nsw i32 %15, 100
%18 = mul nsw i32 %15, 1000
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
%22 = mul nsw i32 %21, 10
%23 = mul nsw i32 %21, 100
%24 = mul nsw i32 %21, 1000
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %21, i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
%28 = mul nsw i32 %27, 10
%29 = mul nsw i32 %27, 100
%30 = mul nsw i32 %27, 1000
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %28, i32 %29, i32 %30)
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
%34 = mul nsw i32 %33, 10
%35 = mul nsw i32 %33, 100
%36 = mul nsw i32 %33, 1000
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %33, i32 %34, i32 %35, i32 %36)
%38 = load i32, i32* %1
%39 = add nsw i32 %38, 1
store i32 %39, i32* %1
%40 = mul nsw i32 %39, 10
%41 = mul nsw i32 %39, 100
%42 = mul nsw i32 %39, 1000
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %39, i32 %40, i32 %41, i32 %42)
%44 = load i32, i32* %1
%45 = add nsw i32 %44, 1
store i32 %45, i32* %1
%46 = mul nsw i32 %45, 10
%47 = mul nsw i32 %45, 100
%48 = mul nsw i32 %45, 1000
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %45, i32 %46, i32 %47, i32 %48)
%50 = load i32, i32* %1
%51 = add nsw i32 %50, 1
store i32 %51, i32* %1
%52 = mul nsw i32 %51, 10
%53 = mul nsw i32 %51, 100
%54 = mul nsw i32 %51, 1000
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %51, i32 %52, i32 %53, i32 %54)
%56 = load i32, i32* %1
%57 = add nsw i32 %56, 1
store i32 %57, i32* %1
%58 = mul nsw i32 %57, 10
%59 = mul nsw i32 %57, 100
%60 = mul nsw i32 %57, 1000
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %57, i32 %58, i32 %59, i32 %60)
%62 = load i32, i32* %1
%63 = add nsw i32 %62, 1
store i32 %63, i32* %1
%64 = mul nsw i32 %63, 10
%65 = mul nsw i32 %63, 100
%66 = mul nsw i32 %63, 1000
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %63, i32 %64, i32 %65, i32 %66)
br label %70
68: ; preds = %0
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str.5, i64 0, i64 0))
br label %70
70: ; preds = %7, %68
ret i32 0
}