#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 i;
  int app;
  int pari[10];
  for (i = 0; i < 10; i++) {
    printf("Inserisci il valore del vettore:  ");
    scanf("%d", &v[i]);
  }
  app = 0;
  for (i = 0; i < 10; i++) {
    if (v[i] % 2 == 0) {
      pari[app] = v[i];
      app++;
    }
  }
  printf("Il vettore con numeri pari e':  ");
  for (i = 0; i < app; i++) {
    printf("%d  ", pari[i]);
  }
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1187 <main+0x57>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <main+0x16>
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11e4 <main+0xb4>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d1 <main+0xa1>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11d6 <main+0xa6>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1195 <main+0x65>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1229 <main+0xf9>
movslq -0x34(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11f9 <main+0xc9>
lea    0xe1c(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xec1(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%eax
test   $0x1,%al
jne    123c <main+0x10c>
mov    %eax,0x30(%rsp)
mov    $0x1,%ebp
mov    0x4(%rsp),%eax
test   $0x1,%al
jne    124d <main+0x11d>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x8(%rsp),%eax
test   $0x1,%al
jne    125e <main+0x12e>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0xc(%rsp),%eax
test   $0x1,%al
jne    126f <main+0x13f>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x10(%rsp),%eax
test   $0x1,%al
jne    1280 <main+0x150>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x14(%rsp),%eax
test   $0x1,%al
jne    1291 <main+0x161>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x18(%rsp),%eax
test   $0x1,%al
jne    12a2 <main+0x172>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x1c(%rsp),%eax
test   $0x1,%al
jne    12b3 <main+0x183>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x20(%rsp),%eax
test   $0x1,%al
jne    12c4 <main+0x194>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x24(%rsp),%eax
test   $0x1,%al
jne    12e5 <main+0x1b5>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
lea    0xd4a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12f7 <main+0x1c7>
lea    0xd3a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
je     1327 <main+0x1f7>
mov    %ebp,%ebp
lea    0xd47(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x30(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1310 <main+0x1e0>
lea    0xd1e(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Inserisci il valore del vettore: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Il vettore con numeri pari e': \00"
@.str.3 = [5 x i8] c"%d \00"
@.str.4 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
store i32 0, i32* %4
store i32 0, i32* %3
br label %19
19: ; preds = %40, %18
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %43
22: ; preds = %19
%23 = load i32, i32* %3
%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* %3
%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* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %35
store i32 %33, i32* %36
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %39
39: ; preds = %29, %22
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %19
43: ; preds = %19
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %45
45: ; preds = %55, %43
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %58
49: ; preds = %45
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %49
%56 = load i32, i32* %3
%57 = add nsw i32 %56, 1
store i32 %57, i32* %3
br label %45
58: ; preds = %45
%59 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [35 x i8] c"Inserisci il valore del vettore: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Il vettore con numeri pari e': \00"
@.str.3 = [5 x i8] c"%d \00"
@.str.4 = [6 x i8] c"PAUSE\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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 ([35 x i8], [35 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 = %0, %38
%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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %125
122: ; preds = %112
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, 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
}