#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 */
typedef int /*<<< orphan*/ numeroStr;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char numeroStr[3];
  int contador, numero;
  printf("Introduzca un numero: ");
  fgets(numeroStr, sizeof(numeroStr), stdin);
  for (contador = 1; contador <= numero; contador++) {
    if (contador % 2 == 0) {
      printf("%i es un numero par!", contador);
    } else {
      printf("%i es un numero impar!", contador);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x13(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <fgets@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11bc <main+0x9c>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1198 <main+0x78>
mov    -0x18(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
mov    -0x18(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <main+0x8e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <main+0x42>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
lea    0xd(%rsp),%rdi
mov    $0x3,%esi
call   1040 <fgets@plt>
mov    $0x1,%ebx
lea    0xebc(%rip),%r14
lea    0xeca(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   $0x1,%bl
mov    %r15,%rdi
cmove  %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1170 <main+0x50>

LLVM IR (-O0):
@.str = [23 x i8] c"Introduzca un numero: \00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"%i es un numero par!\00"
@.str.2 = [23 x i8] c"%i es un numero impar!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 3, i32 %11)
store i32 1, i32* %7
br label %13
13: ; preds = %28, %2
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = load i32, i32* %7
%19 = srem i32 %18, 2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %27
24: ; preds = %17
%25 = load i32, i32* %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %13
31: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Introduzca un numero: \00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"%i es un numero par!\00"
@.str.2 = [23 x i8] c"%i es un numero impar!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 3, i32 %6)
br label %8
8: ; preds = %8, %2
%9 = phi i32 [ 1, %2 ], [ %14, %8 ]
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12, i32 %9)
%14 = add nuw nsw i32 %9, 1
br label %8
}