#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 I;
  int numeri[10];
  int x;
  int pari[10];
  for (I = 0; I <= 9; I++) {
    printf("\n Inserire elemento nell'array ");
    scanf("%d", &numeri[I]);
  }
  x = 0;
  for (I = 0; I < 10; I++) {
    if (numeri[I] % 2 == 0) {
      pari[x] = numeri[I];
      x++;
    }
  }
  for (I = 0; I < x; I++) {
    printf("\n %d", pari[I]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     1177 <main+0x57>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebe(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11d4 <main+0xb4>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c1 <main+0xa1>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1185 <main+0x65>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    120b <main+0xeb>
movslq -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11db <main+0xbb>
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    0xed1(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%eax
test   $0x1,%al
jne    122c <main+0x10c>
mov    %eax,0x30(%rsp)
mov    $0x1,%ebp
mov    0x4(%rsp),%eax
test   $0x1,%al
jne    123d <main+0x11d>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x8(%rsp),%eax
test   $0x1,%al
jne    124e <main+0x12e>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0xc(%rsp),%eax
test   $0x1,%al
jne    125f <main+0x13f>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x10(%rsp),%eax
test   $0x1,%al
jne    1270 <main+0x150>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x14(%rsp),%eax
test   $0x1,%al
jne    1281 <main+0x161>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x18(%rsp),%eax
test   $0x1,%al
jne    1292 <main+0x172>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x1c(%rsp),%eax
test   $0x1,%al
jne    12a3 <main+0x183>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x20(%rsp),%eax
test   $0x1,%al
jne    12b4 <main+0x194>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
mov    0x24(%rsp),%eax
test   $0x1,%al
jne    12c7 <main+0x1a7>
mov    %ebp,%ecx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x1,%ebp
jmp    12cb <main+0x1ab>
test   %ebp,%ebp
je     12f7 <main+0x1d7>
mov    %ebp,%ebp
lea    0xd4c(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x30(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    12e0 <main+0x1c0>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0A Inserire elemento nell'array \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca [10 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %3, 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* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
store i32 0, i32* %4
store i32 0, i32* %2
br label %19
19: ; preds = %40, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %43
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %3, 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* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %3, 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* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %19
43: ; preds = %19
store i32 0, i32* %2
br label %44
44: ; preds = %54, %43
%45 = load i32, i32* %2
%46 = load i32, i32* %4
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %57
48: ; preds = %44
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %48
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %44
57: ; preds = %44
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0A Inserire elemento nell'array \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A %d\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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 ([32 x i8], [32 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 %41, label %43
38: ; preds = %120, %124
%39 = phi i32 [ %123, %120 ], [ %116, %124 ]
%40 = zext i32 %39 to i64
br label %126
41: ; preds = %0
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %35, i32* %42
br label %43
43: ; preds = %0, %41
%44 = phi i32 [ 1, %41 ], [ 0, %0 ]
%45 = load i32, i32* %9
%46 = and i32 %45, 1
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %43
%49 = zext i32 %44 to i64
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %49
store i32 %45, i32* %50
%51 = add nuw nsw i32 %44, 1
br label %52
52: ; preds = %48, %43
%53 = phi i32 [ %51, %48 ], [ %44, %43 ]
%54 = load i32, i32* %12
%55 = and i32 %54, 1
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %52
%58 = zext i32 %53 to i64
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %58
store i32 %54, i32* %59
%60 = add nuw nsw i32 %53, 1
br label %61
61: ; preds = %57, %52
%62 = phi i32 [ %60, %57 ], [ %53, %52 ]
%63 = load i32, i32* %15
%64 = and i32 %63, 1
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %61
%67 = zext i32 %62 to i64
%68 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %67
store i32 %63, i32* %68
%69 = add nuw nsw i32 %62, 1
br label %70
70: ; preds = %66, %61
%71 = phi i32 [ %69, %66 ], [ %62, %61 ]
%72 = load i32, i32* %18
%73 = and i32 %72, 1
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %70
%76 = zext i32 %71 to i64
%77 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %76
store i32 %72, i32* %77
%78 = add nuw nsw i32 %71, 1
br label %79
79: ; preds = %75, %70
%80 = phi i32 [ %78, %75 ], [ %71, %70 ]
%81 = load i32, i32* %21
%82 = and i32 %81, 1
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %88
84: ; preds = %79
%85 = zext i32 %80 to i64
%86 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %85
store i32 %81, i32* %86
%87 = add nuw nsw i32 %80, 1
br label %88
88: ; preds = %84, %79
%89 = phi i32 [ %87, %84 ], [ %80, %79 ]
%90 = load i32, i32* %24
%91 = and i32 %90, 1
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %97
93: ; preds = %88
%94 = zext i32 %89 to i64
%95 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %94
store i32 %90, i32* %95
%96 = add nuw nsw i32 %89, 1
br label %97
97: ; preds = %93, %88
%98 = phi i32 [ %96, %93 ], [ %89, %88 ]
%99 = load i32, i32* %27
%100 = and i32 %99, 1
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %106
102: ; preds = %97
%103 = zext i32 %98 to i64
%104 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %103
store i32 %99, i32* %104
%105 = add nuw nsw i32 %98, 1
br label %106
106: ; preds = %102, %97
%107 = phi i32 [ %105, %102 ], [ %98, %97 ]
%108 = load i32, i32* %30
%109 = and i32 %108, 1
%110 = icmp eq i32 %109, 0
br i1 %110, label %111, label %115
111: ; preds = %106
%112 = zext i32 %107 to i64
%113 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %112
store i32 %108, i32* %113
%114 = add nuw nsw i32 %107, 1
br label %115
115: ; preds = %111, %106
%116 = phi i32 [ %114, %111 ], [ %107, %106 ]
%117 = load i32, i32* %33
%118 = and i32 %117, 1
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %115
%121 = zext i32 %116 to i64
%122 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %121
store i32 %117, i32* %122
%123 = add nuw nsw i32 %116, 1
br label %38
124: ; preds = %115
%125 = icmp eq i32 %116, 0
br i1 %125, label %133, label %38
126: ; preds = %38, %126
%127 = phi i64 [ 0, %38 ], [ %131, %126 ]
%128 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %127
%129 = load i32, i32* %128
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %129)
%131 = add nuw nsw i64 %127, 1
%132 = icmp eq i64 %131, %40
br i1 %132, label %133, label %126
133: ; preds = %126, %124
ret i32 0
}