#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
char toupper(int /*<<< orphan*/);
int main(void) {
  char ch;
  int vowel_count = 0;
  printf("Enter a word: ");
  while ((ch = toupper(getchar())) != '\n') {
    switch (ch) {
    case 'A':
    case 'E':
    case 'I':
    case 'O':
    case 'U':
      vowel_count += 1;
      break;
    default:
      break;
    }
  }
  printf("Your sentance contains %d vowels.\n", vowel_count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     11e2 <main+0xb2>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x41,%eax
je     11ca <main+0x9a>
jmp    1186 <main+0x56>
mov    -0x10(%rbp),%eax
sub    $0x45,%eax
je     11ca <main+0x9a>
jmp    1197 <main+0x67>
mov    -0x10(%rbp),%eax
sub    $0x49,%eax
je     11ca <main+0x9a>
jmp    11a8 <main+0x78>
mov    -0x10(%rbp),%eax
sub    $0x4f,%eax
je     11ca <main+0x9a>
jmp    11b9 <main+0x89>
mov    -0x10(%rbp),%eax
sub    $0x55,%eax
jne    11d8 <main+0xa8>
jmp    11ca <main+0x9a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11dd <main+0xad>
jmp    11dd <main+0xad>
jmp    1154 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
cmp    $0xa,%al
jne    116e <main+0x3e>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x495,%ebp
xor    %ebx,%ebx
jmp    1192 <main+0x62>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
cmp    $0xa,%al
je     1155 <main+0x25>
movsbl %al,%eax
add    $0xffffffbf,%eax
ror    %eax
cmp    $0xa,%eax
ja     1180 <main+0x50>
bt     %eax,%ebp
jae    1180 <main+0x50>
add    $0x1,%ebx
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a word: \00"
@.str.1 = [35 x i8] c"Your sentance contains %d vowels.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %17, %0
%6 = call i32 (...) @getchar()
%7 = call signext i8 @toupper(i32 %6)
store i8 %7, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
switch i32 %12, label %16 [
i32 65, label %13
i32 69, label %13
i32 73, label %13
i32 79, label %13
i32 85, label %13
]
13: ; preds = %10, %10, %10, %10, %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %13
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter a word: \00"
@.str.1 = [35 x i8] c"Your sentance contains %d vowels.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call signext i8 @toupper(i32 %2)
%4 = icmp eq i8 %3, 10
br i1 %4, label %18, label %5
5: ; preds = %0, %13
%6 = phi i8 [ %16, %13 ], [ %3, %0 ]
%7 = phi i32 [ %14, %13 ], [ 0, %0 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %8, -65
%10 = tail call i32 @llvm.fshl.i32(i32 %9, i32 %9, i32 31)
switch i32 %10, label %13 [
i32 0, label %11
i32 2, label %11
i32 4, label %11
i32 7, label %11
i32 10, label %11
]
11: ; preds = %5, %5, %5, %5, %5
%12 = add nsw i32 %7, 1
br label %13
13: ; preds = %5, %11
%14 = phi i32 [ %7, %5 ], [ %12, %11 ]
%15 = tail call i32 (...) @getchar()
%16 = tail call signext i8 @toupper(i32 %15)
%17 = icmp eq i8 %16, 10
br i1 %17, label %18, label %5
18: ; preds = %13, %0
%19 = phi i32 [ 0, %0 ], [ %14, %13 ]
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}