#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 */
scalar_t__ isalpha(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int toupper(char);
int main() {
  char ch;
  printf("Enter a letter: ");
  scanf("%c", &ch);
  if (isalpha(ch)) {
    switch (toupper(ch)) {
    case 'A':
    case 'E':
    case 'I':
    case 'O':
    case 'U':
      printf("You entered a vowel!\n");
    default:
      printf("You entered a consonant.\n");
    }
  } else
    printf("You didn't enter a letter.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     11fb <main+0xbb>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x41,%eax
je     11de <main+0x9e>
jmp    119a <main+0x5a>
mov    -0xc(%rbp),%eax
sub    $0x45,%eax
je     11de <main+0x9e>
jmp    11ab <main+0x6b>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     11de <main+0x9e>
jmp    11bc <main+0x7c>
mov    -0xc(%rbp),%eax
sub    $0x4f,%eax
je     11de <main+0x9e>
jmp    11cd <main+0x8d>
mov    -0xc(%rbp),%eax
sub    $0x55,%eax
jne    11ea <main+0xaa>
jmp    11de <main+0x9e>
lea    0xe2f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
call   1040 <printf@plt>
jmp    1207 <main+0xc7>
lea    0xe42(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%edi
call   1060 <isalpha@plt>
test   %rax,%rax
je     11b4 <main+0x64>
movsbl 0xf(%rsp),%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
ror    %eax
lea    0xead(%rip),%rbx
cmp    $0xa,%eax
ja     11bb <main+0x6b>
mov    $0x495,%ecx
bt     %eax,%ecx
jae    11bb <main+0x6b>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
jmp    11bb <main+0x6b>
lea    0xe59(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a letter: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [22 x i8] c"You entered a vowel!\0A\00"
@.str.3 = [26 x i8] c"You entered a consonant.\0A\00"
@.str.4 = [28 x i8] c"You didn't enter a letter.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 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 = call i64 @isalpha(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = load i8, i8* %2
%10 = call i32 @toupper(i8 signext %9)
switch i32 %10, label %13 [
i32 65, label %11
i32 69, label %11
i32 73, label %11
i32 79, label %11
i32 85, label %11
]
11: ; preds = %8, %8, %8, %8, %8
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %8, %11
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a letter: \00"
@.str.1 = [3 x i8] c"%c\00"
@str = [27 x i8] c"You didn't enter a letter.\00"
@str.5 = [21 x i8] c"You entered a vowel!\00"
@str.6 = [25 x i8] c"You entered a consonant.\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 = call i64 @isalpha(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %0
%8 = load i8, i8* %1
%9 = call i32 @toupper(i8 signext %8)
%10 = add i32 %9, -65
%11 = call i32 @llvm.fshl.i32(i32 %10, i32 %10, i32 31)
switch i32 %11, label %14 [
i32 0, label %12
i32 2, label %12
i32 4, label %12
i32 7, label %12
i32 10, label %12
]
12: ; preds = %7, %7, %7, %7, %7
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0))
br label %14
14: ; preds = %0, %12, %7
%15 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0), %12 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0), %0 ]
%16 = call i32 @puts(i8* dereferenceable(1) %15)
ret i32 0
}