#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 *);
int main() {
  int n;
  int I;
  int min;
  int num;
  printf("inserisci il numero dei valori che vuoi inserire? ");
  scanf("%d", &n);
  I = 1;
  printf("inserisci un numero ");
  scanf("%d", &min);
  while (I < n) {
    printf("inserisci un numero ");
    scanf("%d", &num);
    if (num < min) {
      min = num;
    }
    I++;
  }
  printf("il numero minimo e: %d", min);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11bc <main+0x9c>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ae <main+0x8e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <main+0x52>
mov    -0x10(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1d(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
cmpl   $0x2,0x10(%rsp)
jl     11c2 <main+0xa2>
mov    $0x1,%ebp
lea    0xeb9(%rip),%r14
lea    0xedb(%rip),%r15
lea    0x14(%rsp),%rbx
jmp    1199 <main+0x79>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    0x10(%rsp),%ebp
jge    11c6 <main+0xa6>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0xc(%rsp),%esi
cmp    %esi,%eax
jge    1190 <main+0x70>
mov    %eax,0xc(%rsp)
mov    %eax,%esi
jmp    1190 <main+0x70>
mov    0xc(%rsp),%esi
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"inserisci il numero dei valori che vuoi inserire? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"inserisci un numero \00"
@.str.3 = [23 x i8] c"il numero minimo e: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %10
10: ; preds = %22, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i32, i32* %5
store i32 %21, i32* %4
br label %22
22: ; preds = %20, %14
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %10
25: ; preds = %10
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [51 x i8] c"inserisci il numero dei valori che vuoi inserire? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"inserisci un numero \00"
@.str.3 = [23 x i8] c"il numero minimo e: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %0
%14 = load i32, i32* %2
br label %28
15: ; preds = %0, %23
%16 = phi i32 [ %25, %23 ], [ 1, %0 ]
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 %19, i32* %2
br label %23
23: ; preds = %22, %15
%24 = phi i32 [ %19, %22 ], [ %20, %15 ]
%25 = add nuw nsw i32 %16, 1
%26 = load i32, i32* %1
%27 = icmp slt i32 %25, %26
br i1 %27, label %15, label %28
28: ; preds = %23, %13
%29 = phi i32 [ %14, %13 ], [ %24, %23 ]
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %29)
ret i32 0
}