#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 */
char getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char ch;
  printf("Introduzca una vocal: ");
  ch = getchar();
  switch (ch) {
  case 'a':
    printf("Se ha pulsado una a");
    break;
  case 'e':
    printf("Se ha pulsado una e");
    break;
  case 'i':
    printf("Se ha pulsado una i");
    break;
  case 'o':
    printf("Se ha pulsado una o");
    break;
  case 'u':
    printf("Se ha pulsado una u");
    break;
  default:
    printf("Error");
    break;
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf1e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     11c4 <main+0xa4>
mov    -0x10(%rbp),%rax
lea    0xe9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xf01(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%eax
add    $0xffffff9f,%eax
ror    %eax
cmp    $0xa,%eax
ja     1163 <main+0x33>
cltq
lea    0xf2a(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    116a <main+0x3a>
lea    0xf11(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Introduzca una vocal: \00"
@.str.1 = [20 x i8] c"Se ha pulsado una a\00"
@.str.2 = [20 x i8] c"Se ha pulsado una e\00"
@.str.3 = [20 x i8] c"Se ha pulsado una i\00"
@.str.4 = [20 x i8] c"Se ha pulsado una o\00"
@.str.5 = [20 x i8] c"Se ha pulsado una u\00"
@.str.6 = [6 x i8] c"Error\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
switch i32 %6, label %17 [
i32 97, label %7
i32 101, label %9
i32 105, label %11
i32 111, label %13
i32 117, label %15
]
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %19
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %19
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %19
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %19
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %11, %9, %7
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Introduzca una vocal: \00"
@.str.1 = [20 x i8] c"Se ha pulsado una a\00"
@.str.2 = [20 x i8] c"Se ha pulsado una e\00"
@.str.3 = [20 x i8] c"Se ha pulsado una i\00"
@.str.4 = [20 x i8] c"Se ha pulsado una o\00"
@.str.5 = [20 x i8] c"Se ha pulsado una u\00"
@.str.6 = [6 x i8] c"Error\00"
@reltable.main = [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.2 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.3 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.4 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.5 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -97
%5 = tail call i32 @llvm.fshl.i32(i32 %4, i32 %4, i32 31)
%6 = icmp ult i32 %5, 11
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.main to i8*), i64 %9)
br label %11
11: ; preds = %0, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %0 ]
%13 = tail call i32 @printf(i8* dereferenceable(1) %12)
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}