#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*/ system(char *);
void paresA(int v1[30], int v7[30]) {
  int i, contf;
  printf("Numeros Pares del Vector A\n");
  contf = 0;
  for (i = 0; i < 30; i++) {
    if (v1[i] % 2 == 0) {
      v7[contf] = v1[i];
      contf++;
    }
  }
  for (i = 0; i < contf; i++) {
    printf("%d\n", v7[i]);
  }
  system("pause");
}


x86 assembly (clang, -O0):
<paresA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    11a4 <paresA+0x84>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1191 <paresA+0x71>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1196 <paresA+0x76>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <paresA+0x2c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11de <paresA+0xbe>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <paresA+0x8b>
lea    0xe3b(%rip),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paresA>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    $0x1,%ecx
jmp    116a <paresA+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x2,%rcx
cmp    $0x1f,%rcx
je     118f <paresA+0x5f>
mov    -0x4(%rbx,%rcx,4),%edx
test   $0x1,%dl
jne    117c <paresA+0x4c>
cltq
mov    %edx,(%r14,%rax,4)
add    $0x1,%eax
mov    (%rbx,%rcx,4),%edx
test   $0x1,%dl
jne    1160 <paresA+0x30>
cltq
mov    %edx,(%r14,%rax,4)
add    $0x1,%eax
jmp    1160 <paresA+0x30>
test   %eax,%eax
jle    11b7 <paresA+0x87>
mov    %eax,%r12d
lea    0xe63(%rip),%r15
xor    %ebx,%ebx
nop
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11a0 <paresA+0x70>
lea    0xe46(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <system@plt>

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"pause\00"
@str = [27 x i8] c"Numeros Pares del Vector A\00"
define void @paresA(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %8
4: ; preds = %30
%5 = icmp sgt i32 %31, 0
br i1 %5, label %6, label %41
6: ; preds = %4
%7 = zext i32 %31 to i64
br label %34
8: ; preds = %30, %2
%9 = phi i64 [ 0, %2 ], [ %32, %30 ]
%10 = phi i32 [ 0, %2 ], [ %31, %30 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = sext i32 %10 to i64
%17 = getelementptr inbounds i32, i32* %1, i64 %16
store i32 %12, i32* %17
%18 = add nsw i32 %10, 1
br label %19
19: ; preds = %8, %15
%20 = phi i32 [ %18, %15 ], [ %10, %8 ]
%21 = or i64 %9, 1
%22 = getelementptr inbounds i32, i32* %0, i64 %21
%23 = load i32, i32* %22
%24 = and i32 %23, 1
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %19
%27 = sext i32 %20 to i64
%28 = getelementptr inbounds i32, i32* %1, i64 %27
store i32 %23, i32* %28
%29 = add nsw i32 %20, 1
br label %30
30: ; preds = %26, %19
%31 = phi i32 [ %29, %26 ], [ %20, %19 ]
%32 = add nuw nsw i64 %9, 2
%33 = icmp eq i64 %32, 30
br i1 %33, label %4, label %8
34: ; preds = %6, %34
%35 = phi i64 [ 0, %6 ], [ %39, %34 ]
%36 = getelementptr inbounds i32, i32* %1, i64 %35
%37 = load i32, i32* %36
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i64 %35, 1
%40 = icmp eq i64 %39, %7
br i1 %40, label %41, label %34
41: ; preds = %34, %4
%42 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}