#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() {
  int n, i;
  do {
    printf("Inserire un intero ");
    scanf("%d", &n);
  } while (n < 1);
  for (i = 1; i <= n; i++)
    if (n % i == 0)
      printf(" %d ", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jl     1128 <main+0x8>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1197 <main+0x77>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1184 <main+0x64>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1189 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <main+0x37>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%r14
lea    0xede(%rip),%rbp
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1140 <main+0x20>
lea    0xeb3(%rip),%rbx
xor    %ebp,%ebp
jmp    1174 <main+0x54>
nopl   0x0(%rax,%rax,1)
cmp    %ecx,%ebp
jge    1192 <main+0x72>
add    $0x1,%ebp
mov    %ecx,%eax
cltd
idiv   %ebp
test   %edx,%edx
jne    1170 <main+0x50>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
jmp    1170 <main+0x50>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Inserire un intero \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c" %d \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %6, %0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 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* %1)
br label %6
6: ; preds = %3
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 1
br i1 %8, label %3, label %9
9: ; preds = %6
store i32 1, i32* %2
br label %10
10: ; preds = %23, %9
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %14
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %10
26: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Inserire un intero \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c" %d \00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %16
%9 = phi i32 [ %17, %16 ], [ %6, %3 ]
%10 = phi i32 [ %18, %16 ], [ 1, %3 ]
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%15 = load i32, i32* %1
br label %16
16: ; preds = %8, %13
%17 = phi i32 [ %9, %8 ], [ %15, %13 ]
%18 = add nuw nsw i32 %10, 1
%19 = icmp slt i32 %10, %17
br i1 %19, label %8, label %20
20: ; preds = %16
ret void
}