#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 *, char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(void) {
  unsigned int perfetto(unsigned int numeroFattoriale);
  unsigned int maxNumDaControllare;
  unsigned int numeroDaControllare;
  do {
    printf("%s", "inserisci i numeri, partendo da 0 da controllare: ");
    scanf("%u", &maxNumDaControllare);
    if (maxNumDaControllare++ >= 1) {
      perfetto(numeroDaControllare);
    }
  } while (numeroDaControllare <= maxNumDaControllare);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
jb     117e <main+0x4e>
mov    -0xc(%rbp),%edi
call   1040 <perfetto@plt>
jmp    1183 <main+0x53>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%r14
lea    0xebd(%rip),%r15
lea    0xee9(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
je     1160 <main+0x30>
call   1040 <perfetto@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [51 x i8] c"inserisci i numeri, partendo da 0 da controllare: \00"
@.str.2 = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 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* %2)
%7 = load i32, i32* %2
%8 = add i32 %7, 1
store i32 %8, i32* %2
%9 = icmp uge i32 %7, 1
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = call i32 @perfetto(i32 %11)
br label %13
13: ; preds = %10, %4
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = icmp ule i32 %15, %16
br i1 %17, label %4, label %18
18: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [51 x i8] c"inserisci i numeri, partendo da 0 da controllare: \00"
@.str.2 = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %9, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 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* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, 1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %10
9: ; preds = %3, %10
br label %3
10: ; preds = %3
%11 = call i32 @perfetto(i32 undef)
br label %9
}