#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*/ flushall();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char vowel1;
  do {
    printf("Please Enter a vowel: \n");
    printf("Press 0 to exit\n");
    scanf("%c", &vowel1);
    flushall();
    switch (vowel1) {
    case 'a': {
      printf("You entered a vowel\n");
      break;
    }
    case 'e': {
      printf("You entered a vowel\n");
      break;
    }
    case 'i': {
      printf("You entered a vowel\n");
      break;
    }
    case 'o': {
      printf("You entered a vowel\n");
      break;
    }
    case 'u': {
      printf("You entered a vowel\n");
      break;
    }
    case 0: {
      printf("Wrong");
    }
    default: {
      printf("You did not enter a vowel\n");
    }
    }
  } while (vowel1 != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <flushall@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     122c <main+0xfc>
jmp    1182 <main+0x52>
mov    -0xc(%rbp),%eax
sub    $0x61,%eax
je     11d7 <main+0xa7>
jmp    1193 <main+0x63>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     11e8 <main+0xb8>
jmp    11a4 <main+0x74>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     11f9 <main+0xc9>
jmp    11b5 <main+0x85>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     120a <main+0xda>
jmp    11c6 <main+0x96>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
je     121b <main+0xeb>
jmp    1238 <main+0x108>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    1244 <main+0x114>
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
jmp    1244 <main+0x114>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    1244 <main+0x114>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
jmp    1244 <main+0x114>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
jmp    1244 <main+0x114>
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
jmp    1249 <main+0x119>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeb7(%rip),%r14
lea    0xec7(%rip),%r15
lea    0xea0(%rip),%r12
lea    0x7(%rsp),%rbx
lea    0xede(%rip),%rbp
mov    $0x104111,%r13d
jmp    1193 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
cmpb   $0x0,0x7(%rsp)
je     11dd <main+0x9d>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
movsbl 0x7(%rsp),%eax
lea    -0x61(%rax),%ecx
cmp    $0x14,%ecx
ja     11cb <main+0x8b>
bt     %ecx,%r13d
mov    %rbp,%rdi
jb     1187 <main+0x47>
test   %eax,%eax
jne    1180 <main+0x40>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Please Enter a vowel: \0A\00"
@.str.1 = [17 x i8] c"Press 0 to exit\0A\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [21 x i8] c"You entered a vowel\0A\00"
@.str.4 = [6 x i8] c"Wrong\00"
@.str.5 = [27 x i8] c"You did not enter a vowel\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %25, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%7 = call i32 (...) @flushall()
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
switch i32 %9, label %22 [
i32 97, label %10
i32 101, label %12
i32 105, label %14
i32 111, label %16
i32 117, label %18
i32 0, label %20
]
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %24
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %24
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %24
16: ; preds = %3
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %24
18: ; preds = %3
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %24
20: ; preds = %3
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %3, %20
%23 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %22, %18, %16, %14, %12, %10
br label %25
25: ; preds = %24
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 0
br i1 %28, label %3, label %29
29: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%c\00"
@.str.4 = [6 x i8] c"Wrong\00"
@str = [23 x i8] c"Please Enter a vowel: \00"
@str.6 = [16 x i8] c"Press 0 to exit\00"
@str.7 = [26 x i8] c"You did not enter a vowel\00"
@str.12 = [20 x i8] c"You entered a vowel\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %16, %0
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%6 = call i32 (...) @flushall()
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
switch i32 %8, label %15 [
i32 97, label %16
i32 101, label %9
i32 105, label %10
i32 111, label %11
i32 117, label %12
i32 0, label %13
]
9: ; preds = %2
br label %16
10: ; preds = %2
br label %16
11: ; preds = %2
br label %16
12: ; preds = %2
br label %16
13: ; preds = %2
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %2, %13
br label %16
16: ; preds = %2, %9, %10, %11, %12, %15
%17 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0), %9 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0), %10 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0), %11 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0), %12 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0), %15 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0), %2 ]
%18 = call i32 @puts(i8* dereferenceable(1) %17)
%19 = load i8, i8* %1
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %2
21: ; preds = %16
ret i32 0
}