#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 numbers_table[10];
  numbers_table[0] = 0;
  numbers_table[1] = 0;
  numbers_table[2] = 0;
  numbers_table[3] = 0;
  numbers_table[4] = 0;
  numbers_table[5] = 0;
  numbers_table[6] = 0;
  numbers_table[7] = 0;
  numbers_table[8] = 0;
  numbers_table[9] = 0;
  printf("Enter 10 numbers: ");
  int index = 0;
  while (numbers_table[index] == 0) {
    scanf("%d\n", &numbers_table[index]);
    index++;
  }
  int number_even = 0;
  printf("Table content ");
  for (int i = 0; i < 10; i++) {
    printf("%d  ", numbers_table[i]);
    number_even += (numbers_table[i] % 2) == 0 ? 1 : 0;
  }
  printf("\n");
  printf("The table contain %d even numbers.\n", number_even);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
jne    11c2 <main+0xa2>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe64(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    118a <main+0x6a>
movl   $0x0,-0x38(%rbp)
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    122f <main+0x10f>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11de <main+0xbe>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rbx)
lea    0x4(%rbx),%rbx
je     1170 <main+0x40>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xe99(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%r14d
mov    0x4(%rsp),%esi
not    %r14d
and    $0x1,%r14d
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%ebp
mov    0x8(%rsp),%esi
not    %ebp
and    $0x1,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
movss  0x8(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
movss  0xc(%rsp),%xmm0
unpcklps 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
movss  0x10(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
movss  0x14(%rsp),%xmm0
unpcklps 0x30(%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
movss  0x18(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
movss  0x1c(%rsp),%xmm0
unpcklps 0x30(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
movss  0x20(%rsp),%xmm0
movaps %xmm0,0x50(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movd   0x24(%rsp),%xmm0
punpckldq 0x50(%rsp),%xmm0
punpcklqdq 0x30(%rsp),%xmm0
movdqa 0xd4b(%rip),%xmm1
movdqa 0x40(%rsp),%xmm2
pandn  %xmm1,%xmm2
pandn  %xmm1,%xmm0
paddd  %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%ebx
add    %ebp,%ebx
add    %r14d,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd48(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Enter 10 numbers: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [15 x i8] c"Table content \00"
@.str.3 = [5 x i8] c"%d \00"
@.str.5 = [36 x i8] c"The table contain %d even numbers.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%13 = bitcast [10 x i32]* %1 to i8*
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %0, %15
%16 = phi i64 [ 0, %0 ], [ %19, %15 ]
%17 = phi i32* [ %3, %0 ], [ %20, %15 ]
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %17)
%19 = add nuw i64 %16, 1
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %15, label %23
23: ; preds = %15
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %3
%28 = and i32 %27, 1
%29 = xor i32 %28, 1
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %4
%33 = and i32 %32, 1
%34 = xor i32 %33, 1
%35 = load i32, i32* %5
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %7
%44 = load i32, i32* %8
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %8
%47 = load i32, i32* %9
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %9
%50 = load i32, i32* %10
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %10
%53 = load i32, i32* %11
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %11
%56 = load i32, i32* %12
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %56)
%58 = load i32, i32* %12
%59 = insertelement <8 x i32> poison, i32 %58, i64 0
%60 = insertelement <8 x i32> %59, i32 %55, i64 1
%61 = insertelement <8 x i32> %60, i32 %52, i64 2
%62 = insertelement <8 x i32> %61, i32 %49, i64 3
%63 = insertelement <8 x i32> %62, i32 %46, i64 4
%64 = insertelement <8 x i32> %63, i32 %43, i64 5
%65 = insertelement <8 x i32> %64, i32 %40, i64 6
%66 = insertelement <8 x i32> %65, i32 %37, i64 7
%67 = and <8 x i32> %66, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%68 = xor <8 x i32> %67, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%69 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %68)
%70 = add nuw nsw i32 %69, %34
%71 = add nuw nsw i32 %70, %29
%72 = call i32 @putchar(i32 10)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %71)
ret i32 0
}