#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 a;
  printf("\tPrograma que indica si un número es par.\n\n");
  printf("Introduce el número: ");
  scanf("%d", &a);
  switch (a) {
  case 1:
  case 3:
  case 5:
  case 7:
  case 9:
    printf("Es impar.\n");
    break;
  case 0:
  case 2:
  case 4:
  case 6:
  case 8:
  case 10:
    printf("Es par.\n");
    break;
  default:
    printf("El número es menor a 1, mayor a 10, o no es un número.\n");
    break;
  }
  printf("Fin del Programa.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1225 <main+0x105>
jmp    116a <main+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1214 <main+0xf4>
jmp    117b <main+0x5b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1225 <main+0x105>
jmp    118c <main+0x6c>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1214 <main+0xf4>
jmp    119d <main+0x7d>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1225 <main+0x105>
jmp    11ae <main+0x8e>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     1214 <main+0xf4>
jmp    11bf <main+0x9f>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     1225 <main+0x105>
jmp    11d0 <main+0xb0>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     1214 <main+0xf4>
jmp    11e1 <main+0xc1>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     1225 <main+0x105>
jmp    11f2 <main+0xd2>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     1214 <main+0xf4>
jmp    1203 <main+0xe3>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     1225 <main+0x105>
jmp    1236 <main+0x116>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    1242 <main+0x122>
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
jmp    1242 <main+0x122>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
cmp    $0xa,%rax
ja     1175 <main+0x45>
lea    0xf38(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    117c <main+0x4c>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"\09Programa que indica si un n\C3\BAmero es par.\0A\0A\00"
@.str.1 = [23 x i8] c"Introduce el n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [11 x i8] c"Es impar.\0A\00"
@.str.4 = [9 x i8] c"Es par.\0A\00"
@.str.5 = [58 x i8] c"El n\C3\BAmero es menor a 1, mayor a 10, o no es un n\C3\BAmero.\0A\00"
@.str.6 = [19 x i8] c"Fin del Programa.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* 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* %2)
%6 = load i32, i32* %2
switch i32 %6, label %11 [
i32 1, label %7
i32 3, label %7
i32 5, label %7
i32 7, label %7
i32 9, label %7
i32 0, label %9
i32 2, label %9
i32 4, label %9
i32 6, label %9
i32 8, label %9
i32 10, label %9
]
7: ; preds = %0, %0, %0, %0, %0
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %13
9: ; preds = %0, %0, %0, %0, %0, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Introduce el n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [44 x i8] c"\09Programa que indica si un n\C3\BAmero es par.\0A\00"
@str.7 = [8 x i8] c"Es par.\00"
@str.8 = [18 x i8] c"Fin del Programa.\00"
@str.9 = [10 x i8] c"Es impar.\00"
@str.10 = [57 x i8] c"El n\C3\BAmero es menor a 1, mayor a 10, o no es un n\C3\BAmero.\00"
@reltable.main = [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @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 ult i32 %6, 11
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.main to i8*), i64 %10)
br label %12
12: ; preds = %0, %8
%13 = phi i8* [ %11, %8 ], [ getelementptr inbounds ([57 x i8], [57 x i8]* @str.10, i64 0, i64 0), %0 ]
%14 = call i32 @puts(i8* dereferenceable(1) %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}