#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 *, char *);
main() {
  char letter;
  printf("type a letter \n");
  scanf("%c", &letter);
  switch (letter) {
  case 'a':
    if (letter == 'a' || letter == 'A') {
      printf("letter is a vowel \n");
    }
    break;
  case 'e':
    if (letter == 'e' || letter == 'E') {
      printf("letter is a vowel \n");
    }
    break;
  case 'i':
    if (letter == 'i' || letter == 'I') {
      printf("letter is a vowel \n");
    }
    break;
  case 'o':
    if (letter == 'o' || letter == 'O') {
      printf("letter is a vowel \n");
    }
    break;
  case 'u':
    if (letter == 'u' || letter == 'U') {
      printf("letter is a vowel \n");
    }
    break;
  default: {
    printf("letter is a consonant \n");
  }
  }
}


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>
lea    0xf22(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     124c <main+0x12c>
mov    -0x10(%rbp),%rax
lea    0xe94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
je     118f <main+0x6f>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    119b <main+0x7b>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1258 <main+0x138>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
je     11ba <main+0x9a>
movsbl -0x5(%rbp),%eax
cmp    $0x45,%eax
jne    11c6 <main+0xa6>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1258 <main+0x138>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
je     11e5 <main+0xc5>
movsbl -0x5(%rbp),%eax
cmp    $0x49,%eax
jne    11f1 <main+0xd1>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    1258 <main+0x138>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
je     1210 <main+0xf0>
movsbl -0x5(%rbp),%eax
cmp    $0x4f,%eax
jne    121c <main+0xfc>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
jmp    1258 <main+0x138>
movsbl -0x5(%rbp),%eax
cmp    $0x75,%eax
je     123b <main+0x11b>
movsbl -0x5(%rbp),%eax
cmp    $0x55,%eax
jne    1247 <main+0x127>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    1258 <main+0x138>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%eax
lea    -0x61(%rax),%ecx
ror    %ecx
lea    0xf02(%rip),%rdi
cmp    $0xa,%ecx
ja     1191 <main+0x71>
lea    0xea5(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
and    $0xdf,%al
cmp    $0x41,%al
je     118a <main+0x6a>
jmp    1196 <main+0x76>
and    $0xdf,%al
cmp    $0x45,%al
je     118a <main+0x6a>
jmp    1196 <main+0x76>
and    $0xdf,%al
cmp    $0x49,%al
je     118a <main+0x6a>
jmp    1196 <main+0x76>
and    $0xdf,%al
cmp    $0x4f,%al
je     118a <main+0x6a>
jmp    1196 <main+0x76>
and    $0xdf,%al
cmp    $0x55,%al
jne    1196 <main+0x76>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"type a letter \0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [20 x i8] c"letter is a vowel \0A\00"
@.str.3 = [24 x i8] c"letter is a consonant \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
switch i32 %6, label %62 [
i32 97, label %7
i32 101, label %18
i32 105, label %29
i32 111, label %40
i32 117, label %51
]
7: ; preds = %0
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 97
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 65
br i1 %14, label %15, label %17
15: ; preds = %11, %7
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
br label %64
18: ; preds = %0
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 101
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 69
br i1 %25, label %26, label %28
26: ; preds = %22, %18
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
br label %64
29: ; preds = %0
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 105
br i1 %32, label %37, label %33
33: ; preds = %29
%34 = load i8, i8* %2
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 73
br i1 %36, label %37, label %39
37: ; preds = %33, %29
%38 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %33
br label %64
40: ; preds = %0
%41 = load i8, i8* %2
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 111
br i1 %43, label %48, label %44
44: ; preds = %40
%45 = load i8, i8* %2
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 79
br i1 %47, label %48, label %50
48: ; preds = %44, %40
%49 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %48, %44
br label %64
51: ; preds = %0
%52 = load i8, i8* %2
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 117
br i1 %54, label %59, label %55
55: ; preds = %51
%56 = load i8, i8* %2
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 85
br i1 %58, label %59, label %61
59: ; preds = %55, %51
%60 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %61
61: ; preds = %59, %55
br label %64
62: ; preds = %0
%63 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %62, %61, %50, %39, %28, %17
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@str = [15 x i8] c"type a letter \00"
@str.8 = [19 x i8] c"letter is a vowel \00"
@str.9 = [23 x i8] c"letter is a consonant \00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, -97
%7 = call i32 @llvm.fshl.i32(i32 %6, i32 %6, i32 31)
switch i32 %7, label %23 [
i32 0, label %8
i32 2, label %11
i32 4, label %14
i32 7, label %17
i32 10, label %20
]
8: ; preds = %0
%9 = and i8 %4, -33
%10 = icmp eq i8 %9, 65
br i1 %10, label %23, label %26
11: ; preds = %0
%12 = and i8 %4, -33
%13 = icmp eq i8 %12, 69
br i1 %13, label %23, label %26
14: ; preds = %0
%15 = and i8 %4, -33
%16 = icmp eq i8 %15, 73
br i1 %16, label %23, label %26
17: ; preds = %0
%18 = and i8 %4, -33
%19 = icmp eq i8 %18, 79
br i1 %19, label %23, label %26
20: ; preds = %0
%21 = and i8 %4, -33
%22 = icmp eq i8 %21, 85
br i1 %22, label %23, label %26
23: ; preds = %0, %20, %17, %14, %11, %8
%24 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0), %8 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0), %11 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0), %17 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0), %20 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.9, i64 0, i64 0), %0 ]
%25 = call i32 @puts(i8* dereferenceable(1) %24)
br label %26
26: ; preds = %23, %20, %17, %14, %11, %8
ret i32 0
}