#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 n1;
  int n2;
  int k;
  int numeri[999];
  int num;
  int I;
  do {
    printf("\n inserisci n2 minore di 1000 e dispari: ");
    scanf("%d", &n2);
  } while ((n2 < 0) || (n2 > 1000) || (n2 % 2 == 0));
  do {
    printf("\n inserisci n1 maggiore di 0 e minore di n2: ");
    scanf("%d", &n1);
  } while ((n1 < 0) || (n1 > n2));
  do {
    printf("\n inserisci k maggiore di n1 e minore di n2: ");
    scanf("%d", &k);
  } while ((k < n1) || (k > n2));
  printf("\n inserisci num: ");
  scanf("%d", &num);
  for (I = 0; I < k; I++) {
    printf("\n inserisci un numero nel vettore: ");
    scanf("%d", &numeri[I]);
  }
  for (I = 0; I < k; I++) {
    numeri[I] = numeri[I] * num;
    printf("\n %d", numeri[I]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf77(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xfb9(%rbp)
jl     118e <main+0x6e>
mov    $0x1,%al
cmpl   $0x3e8,-0xc(%rbp)
mov    %al,-0xfb9(%rbp)
jg     118e <main+0x6e>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0xfb9(%rbp)
mov    -0xfb9(%rbp),%al
test   $0x1,%al
jne    1132 <main+0x12>
jmp    11a1 <main+0x81>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xfba(%rbp)
jl     11e0 <main+0xc0>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
mov    %al,-0xfba(%rbp)
mov    -0xfba(%rbp),%al
test   $0x1,%al
jne    11a1 <main+0x81>
jmp    11f3 <main+0xd3>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0xfbb(%rbp)
jl     1234 <main+0x114>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
mov    %al,-0xfbb(%rbp)
mov    -0xfbb(%rbp),%al
test   $0x1,%al
jne    11f3 <main+0xd3>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
lea    -0xfb4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12bf <main+0x19f>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xfb8(%rbp),%rax
lea    -0xfb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe18(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xfb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
jmp    126d <main+0x14d>
movl   $0x0,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    132b <main+0x20b>
movslq -0xfb8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%ecx
imul   -0xfb4(%rbp),%ecx
movslq -0xfb8(%rbp),%rax
mov    %ecx,-0xfb0(%rbp,%rax,4)
movslq -0xfb8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%esi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xfb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
jmp    12c9 <main+0x1a9>
mov    -0x4(%rbp),%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xfb8,%rsp
lea    0xecb(%rip),%r14
lea    0xf82(%rip),%r15
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%eax
and    $0x1,%eax
cmp    $0x3e8,%ecx
ja     1150 <main+0x30>
test   %eax,%eax
je     1150 <main+0x30>
lea    0xea9(%rip),%r14
lea    0xf36(%rip),%r15
lea    0x8(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
js     1190 <main+0x70>
cmp    0x4(%rsp),%eax
jg     1190 <main+0x70>
lea    0xe9e(%rip),%r14
lea    0xefd(%rip),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%eax
cmp    0x8(%rsp),%eax
jl     11d0 <main+0xb0>
cmp    0x4(%rsp),%eax
jg     11d0 <main+0xb0>
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    1294 <main+0x174>
lea    0x10(%rsp),%r12
lea    0xe73(%rip),%r14
lea    0xe92(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
add    $0x4,%r12
cmp    %rax,%rbx
jl     1230 <main+0x110>
test   %eax,%eax
jle    1294 <main+0x174>
lea    0xe5b(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%rsp),%esi
imul   0x10(%rsp,%rbx,4),%esi
mov    %esi,0x10(%rsp,%rbx,4)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
cmp    %rax,%rbx
jl     1270 <main+0x150>
xor    %eax,%eax
add    $0xfb8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0A inserisci n2 minore di 1000 e dispari: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [46 x i8] c"\0A inserisci n1 maggiore di 0 e minore di n2: \00"
@.str.3 = [46 x i8] c"\0A inserisci k maggiore di n1 e minore di n2: \00"
@.str.4 = [18 x i8] c"\0A inserisci num: \00"
@.str.5 = [36 x i8] c"\0A inserisci un numero nel vettore: \00"
@.str.6 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [999 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
br label %8
8: ; preds = %21, %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 1000
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = srem i32 %18, 2
%20 = icmp eq i32 %19, 0
br label %21
21: ; preds = %17, %14, %11
%22 = phi i1 [ true, %14 ], [ true, %11 ], [ %20, %17 ]
br i1 %22, label %8, label %23
23: ; preds = %21
br label %24
24: ; preds = %34, %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %27
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %27
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = icmp sgt i32 %31, %32
br label %34
34: ; preds = %30, %27
%35 = phi i1 [ true, %27 ], [ %33, %30 ]
br i1 %35, label %24, label %36
36: ; preds = %34
br label %37
37: ; preds = %48, %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %40
40: ; preds = %37
%41 = load i32, i32* %4
%42 = load i32, i32* %2
%43 = icmp slt i32 %41, %42
br i1 %43, label %48, label %44
44: ; preds = %40
%45 = load i32, i32* %4
%46 = load i32, i32* %3
%47 = icmp sgt i32 %45, %46
br label %48
48: ; preds = %44, %40
%49 = phi i1 [ true, %40 ], [ %47, %44 ]
br i1 %49, label %37, label %50
50: ; preds = %48
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%52 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
br label %53
53: ; preds = %63, %50
%54 = load i32, i32* %7
%55 = load i32, i32* %4
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %66
57: ; preds = %53
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%59 = load i32, i32* %7
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [999 x i32], [999 x i32]* %5, i64 0, i64 %60
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %61)
br label %63
63: ; preds = %57
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
br label %53
66: ; preds = %53
store i32 0, i32* %7
br label %67
67: ; preds = %86, %66
%68 = load i32, i32* %7
%69 = load i32, i32* %4
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %89
71: ; preds = %67
%72 = load i32, i32* %7
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [999 x i32], [999 x i32]* %5, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = load i32, i32* %6
%77 = mul nsw i32 %75, %76
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [999 x i32], [999 x i32]* %5, i64 0, i64 %79
store i32 %77, i32* %80
%81 = load i32, i32* %7
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [999 x i32], [999 x i32]* %5, i64 0, i64 %82
%84 = load i32, i32* %83
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %84)
br label %86
86: ; preds = %71
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
br label %67
89: ; preds = %67
%90 = load i32, i32* %1
ret i32 %90
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0A inserisci n2 minore di 1000 e dispari: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [46 x i8] c"\0A inserisci n1 maggiore di 0 e minore di n2: \00"
@.str.3 = [46 x i8] c"\0A inserisci k maggiore di n1 e minore di n2: \00"
@.str.4 = [18 x i8] c"\0A inserisci num: \00"
@.str.5 = [36 x i8] c"\0A inserisci un numero nel vettore: \00"
@.str.6 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [999 x i32]
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast [999 x i32]* %4 to i8*
%10 = bitcast i32* %5 to i8*
br label %11
11: ; preds = %11, %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = icmp ugt i32 %14, 1000
%16 = and i32 %14, 1
%17 = icmp eq i32 %16, 0
%18 = or i1 %15, %17
br i1 %18, label %11, label %19
19: ; preds = %11, %19
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%22 = load i32, i32* %1
%23 = icmp slt i32 %22, 0
%24 = load i32, i32* %2
%25 = icmp sgt i32 %22, %24
%26 = select i1 %23, i1 true, i1 %25
br i1 %26, label %19, label %27
27: ; preds = %19, %27
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%30 = load i32, i32* %3
%31 = load i32, i32* %1
%32 = icmp slt i32 %30, %31
%33 = load i32, i32* %2
%34 = icmp sgt i32 %30, %33
%35 = select i1 %32, i1 true, i1 %34
br i1 %35, label %27, label %36
36: ; preds = %27
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%39 = load i32, i32* %3
%40 = icmp sgt i32 %39, 0
br i1 %40, label %43, label %63
41: ; preds = %43
%42 = icmp sgt i32 %49, 0
br i1 %42, label %52, label %63
43: ; preds = %36, %43
%44 = phi i64 [ %48, %43 ], [ 0, %36 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%46 = getelementptr inbounds [999 x i32], [999 x i32]* %4, i64 0, i64 %44
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %46)
%48 = add nuw nsw i64 %44, 1
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = icmp slt i64 %48, %50
br i1 %51, label %43, label %41
52: ; preds = %41, %52
%53 = phi i64 [ %59, %52 ], [ 0, %41 ]
%54 = getelementptr inbounds [999 x i32], [999 x i32]* %4, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* %5
%57 = mul nsw i32 %56, %55
store i32 %57, i32* %54
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %57)
%59 = add nuw nsw i64 %53, 1
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = icmp slt i64 %59, %61
br i1 %62, label %52, label %63
63: ; preds = %52, %36, %41
ret i32 0
}