#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*/ main();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int pares() {
  int maximo, numero, rresto;
  printf("Este programa imprime los numeros pares por debajo del número "
         "introducido.\n");
  printf("Introduzca el numero: ");
  scanf("%d", &maximo);
  if (maximo <= 0) {
    printf("El numero debe ser positivo\n");
  } else {
    for (numero = 1; numero <= maximo; numero++) {
      rresto = numero % 2;
      if (rresto == 0)
        printf("%d es un numero par\n", numero);
    }
  }
  printf("Adios\n");
  system("pause");
  system("cls");
  main();
}


x86 assembly (clang, -O0):
<pares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     1191 <pares+0x51>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e5 <pares+0xa5>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e0 <pares+0xa0>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11cd <pares+0x8d>
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d2 <pares+0x92>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1198 <pares+0x58>
jmp    11e5 <pares+0xa5>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
call   1030 <system@plt>
lea    0xea0(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <main@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pares>:
push   %rbp
push   %rbx
push   %rax
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11bf <pares+0x6f>
lea    0xe8d(%rip),%rbx
xor    %ebp,%ebp
jmp    11a4 <pares+0x54>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %eax,%ebp
jge    11cb <pares+0x7b>
add    $0x1,%ebp
test   $0x1,%bpl
jne    11a0 <pares+0x50>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
jmp    11a0 <pares+0x50>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe51(%rip),%rdi
call   1040 <system@plt>
lea    0xe4b(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1060 <main@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Este programa imprime los numeros pares por debajo del n\C3\BAmero introducido.\0A\00"
@.str.1 = [23 x i8] c"Introduzca el numero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [29 x i8] c"El numero debe ser positivo\0A\00"
@.str.4 = [21 x i8] c"%d es un numero par\0A\00"
@.str.5 = [7 x i8] c"Adios\0A\00"
@.str.6 = [6 x i8] c"pause\00"
@.str.7 = [4 x i8] c"cls\00"
define i32 @pares() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %30
12: ; preds = %0
store i32 1, i32* %3
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i32, i32* %3
%19 = srem i32 %18, 2
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %17
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %13
29: ; preds = %13
br label %30
30: ; preds = %29, %10
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%32 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (...) @main()
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Introduzca el numero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.4 = [21 x i8] c"%d es un numero par\0A\00"
@.str.6 = [6 x i8] c"pause\00"
@.str.7 = [4 x i8] c"cls\00"
@str = [76 x i8] c"Este programa imprime los numeros pares por debajo del n\C3\BAmero introducido.\00"
@str.8 = [6 x i8] c"Adios\00"
@str.9 = [28 x i8] c"El numero debe ser positivo\00"
define i32 @pares() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.9, i64 0, i64 0))
br label %22
10: ; preds = %0, %18
%11 = phi i32 [ %19, %18 ], [ %6, %0 ]
%12 = phi i32 [ %20, %18 ], [ 1, %0 ]
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%17 = load i32, i32* %1
br label %18
18: ; preds = %10, %15
%19 = phi i32 [ %11, %10 ], [ %17, %15 ]
%20 = add nuw nsw i32 %12, 1
%21 = icmp slt i32 %12, %19
br i1 %21, label %10, label %22
22: ; preds = %18, %8
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%25 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%26 = call i32 (...) @main()
ret i32 undef
}