#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*/ isalpha(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char toupper(char);
int main() {
  char ch;
  printf("Compound if Example 3\n\n");
  printf("Enter a character: ");
  scanf("%c", &ch);
  if (!isalpha(ch))
    printf("You did not enter a letter.\n\n");
  else {
    ch = toupper(ch);
    if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
      printf("The letter is a vowel.\n\n");
    else
      printf("The letter is a consonant.\n\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    0xeb6(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    119a <main+0x5a>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
jmp    1209 <main+0xc9>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
je     11e7 <main+0xa7>
movsbl -0x5(%rbp),%eax
cmp    $0x45,%eax
je     11e7 <main+0xa7>
movsbl -0x5(%rbp),%eax
cmp    $0x49,%eax
je     11e7 <main+0xa7>
movsbl -0x5(%rbp),%eax
cmp    $0x4f,%eax
je     11e7 <main+0xa7>
movsbl -0x5(%rbp),%eax
cmp    $0x55,%eax
jne    11f8 <main+0xb8>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
jmp    1204 <main+0xc4>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
jmp    1209 <main+0xc9>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1070 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1060 <isalpha@plt>
test   %eax,%eax
je     11b2 <main+0x62>
movsbl 0x7(%rsp),%edi
call   1030 <toupper@plt>
mov    %al,0x7(%rsp)
add    $0xbf,%al
ror    %al
cmp    $0xa,%al
ja     11bb <main+0x6b>
movsbq %al,%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    11c2 <main+0x72>
lea    0xe75(%rip),%rdi
jmp    11c2 <main+0x72>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Compound if Example 3\0A\0A\00"
@.str.1 = [20 x i8] c"Enter a character: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [30 x i8] c"You did not enter a letter.\0A\0A\00"
@.str.4 = [25 x i8] c"The letter is a vowel.\0A\0A\00"
@.str.5 = [29 x i8] c"The letter is a consonant.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = call i32 @isalpha(i8 signext %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %38
11: ; preds = %0
%12 = load i8, i8* %2
%13 = call signext i8 @toupper(i8 signext %12)
store i8 %13, i8* %2
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 65
br i1 %16, label %33, label %17
17: ; preds = %11
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 69
br i1 %20, label %33, label %21
21: ; preds = %17
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 73
br i1 %24, label %33, label %25
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 79
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 85
br i1 %32, label %33, label %35
33: ; preds = %29, %25, %21, %17, %11
%34 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %37
35: ; preds = %29
%36 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
br label %38
38: ; preds = %37, %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"Enter a character: \00"
@.str.2 = [3 x i8] c"%c\00"
@str = [23 x i8] c"Compound if Example 3\0A\00"
@str.6 = [29 x i8] c"You did not enter a letter.\0A\00"
@str.7 = [28 x i8] c"The letter is a consonant.\0A\00"
@str.8 = [24 x i8] c"The letter is a vowel.\0A\00"
@reltable.main = [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = call i32 @isalpha(i8 signext %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %0
%9 = load i8, i8* %1
%10 = call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %1
%11 = add i8 %10, -65
%12 = call i8 @llvm.fshl.i8(i8 %11, i8 %11, i8 7)
%13 = icmp ult i8 %12, 11
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = sext i8 %12 to i64
%16 = shl i64 %15, 2
%17 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.main to i8*), i64 %16)
br label %18
18: ; preds = %8, %14, %0
%19 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0), %0 ], [ %17, %14 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0), %8 ]
%20 = call i32 @puts(i8* dereferenceable(1) %19)
ret i32 0
}