#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 *);
void dispOperador(unsigned op) {
  switch (op) {
  case 1:
    printf("Movimiento ARRIBA:\n");
    break;
  case 2:
    printf("Movimiento ABAJO:\n");
    break;
  case 3:
    printf("Movimiento IZQUIERDA:\n");
    break;
  case 4:
    printf("Movimiento DERECHA:\n");
    break;
  default:
    printf("Movimiento no Válido");
    break;
  }
}


x86 assembly (clang, -O0):
<dispOperador>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1188 <dispOperador+0x78>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <dispOperador+0x84>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <dispOperador+0x84>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <dispOperador+0x84>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <dispOperador+0x84>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispOperador>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     1144 <dispOperador+0x24>
lea    0xed1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf23(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec5(%rip),%rdi
jmp    1040 <printf@plt>
lea    0xef9(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xed7(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xeb7(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Movimiento ARRIBA:\0A\00"
@.str.1 = [19 x i8] c"Movimiento ABAJO:\0A\00"
@.str.2 = [23 x i8] c"Movimiento IZQUIERDA:\0A\00"
@.str.3 = [21 x i8] c"Movimiento DERECHA:\0A\00"
@.str.4 = [22 x i8] c"Movimiento no V\C3\A1lido\00"
define void @dispOperador(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %14
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %14
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %14
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %14
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str.4 = [22 x i8] c"Movimiento no V\C3\A1lido\00"
@str = [20 x i8] c"Movimiento DERECHA:\00"
@str.5 = [22 x i8] c"Movimiento IZQUIERDA:\00"
@str.6 = [18 x i8] c"Movimiento ABAJO:\00"
@str.7 = [19 x i8] c"Movimiento ARRIBA:\00"
define void @dispOperador(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
br label %12
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
br label %12
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4, %2
ret void
}