#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 /*<<< orphan*/ system(char *);
int main() {
  int v[10];
  int p[10];
  int n;
  int i;
  int e;
  i = 0;
  while (i <= 9) {
    printf("\nInserisci numero:");
    scanf("%d", &v[i]);
    i++;
  }
  e = 0;
  i = 0;
  while (i < 10) {
    if (v[i] % 2 == 0) {
      p[e] = v[i];
      e++;
    }
    i++;
  }
  i = 0;
  printf("\nI numeri pari inseriti sono:\n\n");
  while (i < e) {
    printf("%d\n\n", p[i]);
    i++;
  }
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x9,-0x68(%rbp)
jg     1187 <main+0x57>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x68(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1146 <main+0x16>
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0xa,-0x68(%rbp)
jge    11df <main+0xaf>
movslq -0x68(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d1 <main+0xa1>
movslq -0x68(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x6c(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1195 <main+0x65>
movl   $0x0,-0x68(%rbp)
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    1224 <main+0xf4>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11f4 <main+0xc4>
lea    0xe10(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xeb1(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb1(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    (%rsp),%eax
test   $0x1,%al
jne    124c <main+0x10c>
mov    %eax,0x30(%rsp)
mov    $0x1,%ebp
mov    0x4(%rsp),%eax
test   $0x1,%al
jne    125d <main+0x11d>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x8(%rsp),%eax
test   $0x1,%al
jne    126e <main+0x12e>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0xc(%rsp),%eax
test   $0x1,%al
jne    127f <main+0x13f>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x10(%rsp),%eax
test   $0x1,%al
jne    1290 <main+0x150>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x14(%rsp),%eax
test   $0x1,%al
jne    12a1 <main+0x161>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x18(%rsp),%eax
test   $0x1,%al
jne    12b2 <main+0x172>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x1c(%rsp),%eax
test   $0x1,%al
jne    12c3 <main+0x183>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x20(%rsp),%eax
test   $0x1,%al
jne    12d4 <main+0x194>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x24(%rsp),%eax
test   $0x1,%al
jne    12f3 <main+0x1b3>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
lea    0xd35(%rip),%rdi
call   1030 <puts@plt>
jmp    1303 <main+0x1c3>
lea    0xd27(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
je     1327 <main+0x1e7>
mov    %ebp,%ebp
lea    0xd0a(%rip),%r14
xor    %ebx,%ebx
xchg   %ax,%ax
mov    0x30(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1310 <main+0x1d0>
lea    0xced(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AInserisci numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"\0AI numeri pari inseriti sono:\0A\0A\00"
@.str.3 = [5 x i8] c"%d\0A\0A\00"
@.str.4 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 9
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
store i32 0, i32* %6
store i32 0, i32* %5
br label %19
19: ; preds = %39, %18
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %42
22: ; preds = %19
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = srem i32 %26, 2
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %39
29: ; preds = %22
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %35
store i32 %33, i32* %36
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %39
39: ; preds = %29, %22
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %19
42: ; preds = %19
store i32 0, i32* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %48, %42
%45 = load i32, i32* %5
%46 = load i32, i32* %6
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %56
48: ; preds = %44
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %44
56: ; preds = %44
%57 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AInserisci numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [5 x i8] c"%d\0A\0A\00"
@.str.4 = [6 x i8] c"PAUSE\00"
@str = [31 x i8] c"\0AI numeri pari inseriti sono:\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %27)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %30)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %33)
%35 = load i32, i32* %6
%36 = and i32 %35, 1
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %0
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %35, i32* %39
br label %40
40: ; preds = %38, %0
%41 = phi i32 [ 1, %38 ], [ 0, %0 ]
%42 = load i32, i32* %9
%43 = and i32 %42, 1
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = zext i32 %41 to i64
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %46
store i32 %42, i32* %47
%48 = add nuw nsw i32 %41, 1
br label %49
49: ; preds = %45, %40
%50 = phi i32 [ %48, %45 ], [ %41, %40 ]
%51 = load i32, i32* %12
%52 = and i32 %51, 1
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %49
%55 = zext i32 %50 to i64
%56 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %55
store i32 %51, i32* %56
%57 = add nuw nsw i32 %50, 1
br label %58
58: ; preds = %54, %49
%59 = phi i32 [ %57, %54 ], [ %50, %49 ]
%60 = load i32, i32* %15
%61 = and i32 %60, 1
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %58
%64 = zext i32 %59 to i64
%65 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %64
store i32 %60, i32* %65
%66 = add nuw nsw i32 %59, 1
br label %67
67: ; preds = %63, %58
%68 = phi i32 [ %66, %63 ], [ %59, %58 ]
%69 = load i32, i32* %18
%70 = and i32 %69, 1
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %67
%73 = zext i32 %68 to i64
%74 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %73
store i32 %69, i32* %74
%75 = add nuw nsw i32 %68, 1
br label %76
76: ; preds = %72, %67
%77 = phi i32 [ %75, %72 ], [ %68, %67 ]
%78 = load i32, i32* %21
%79 = and i32 %78, 1
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %85
81: ; preds = %76
%82 = zext i32 %77 to i64
%83 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %82
store i32 %78, i32* %83
%84 = add nuw nsw i32 %77, 1
br label %85
85: ; preds = %81, %76
%86 = phi i32 [ %84, %81 ], [ %77, %76 ]
%87 = load i32, i32* %24
%88 = and i32 %87, 1
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = zext i32 %86 to i64
%92 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %91
store i32 %87, i32* %92
%93 = add nuw nsw i32 %86, 1
br label %94
94: ; preds = %90, %85
%95 = phi i32 [ %93, %90 ], [ %86, %85 ]
%96 = load i32, i32* %27
%97 = and i32 %96, 1
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %103
99: ; preds = %94
%100 = zext i32 %95 to i64
%101 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %100
store i32 %96, i32* %101
%102 = add nuw nsw i32 %95, 1
br label %103
103: ; preds = %99, %94
%104 = phi i32 [ %102, %99 ], [ %95, %94 ]
%105 = load i32, i32* %30
%106 = and i32 %105, 1
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %112
108: ; preds = %103
%109 = zext i32 %104 to i64
%110 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %109
store i32 %105, i32* %110
%111 = add nuw nsw i32 %104, 1
br label %112
112: ; preds = %108, %103
%113 = phi i32 [ %111, %108 ], [ %104, %103 ]
%114 = load i32, i32* %33
%115 = and i32 %114, 1
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %122
117: ; preds = %112
%118 = zext i32 %113 to i64
%119 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %118
store i32 %114, i32* %119
%120 = add nuw nsw i32 %113, 1
%121 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %125
122: ; preds = %112
%123 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%124 = icmp eq i32 %113, 0
br i1 %124, label %135, label %125
125: ; preds = %117, %122
%126 = phi i32 [ %120, %117 ], [ %113, %122 ]
%127 = zext i32 %126 to i64
br label %128
128: ; preds = %125, %128
%129 = phi i64 [ 0, %125 ], [ %133, %128 ]
%130 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %131)
%133 = add nuw nsw i64 %129, 1
%134 = icmp eq i64 %133, %127
br i1 %134, label %135, label %128
135: ; preds = %128, %122
%136 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}