#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) {
  int count = 0;
  char ch;
  printf("Enter a sentence: ");
  while ((ch = toupper(getchar())) != '\n') {
    if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
      count++;
  }
  printf("Your message contains %d vowels.\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%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,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     11c0 <main+0x90>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
je     11b2 <main+0x82>
movsbl -0x9(%rbp),%eax
cmp    $0x45,%eax
je     11b2 <main+0x82>
movsbl -0x9(%rbp),%eax
cmp    $0x49,%eax
je     11b2 <main+0x82>
movsbl -0x9(%rbp),%eax
cmp    $0x4f,%eax
je     11b2 <main+0x82>
movsbl -0x9(%rbp),%eax
cmp    $0x55,%eax
jne    11bb <main+0x8b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x104111,%r14d
xor    %ebx,%ebx
jmp    1154 <main+0x24>
nopl   0x0(%rax)
cmp    $0xa,%al
je     1178 <main+0x48>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
lea    -0x41(%rax),%ecx
cmp    $0x14,%cl
ja     1150 <main+0x20>
movzbl %cl,%ecx
bt     %rcx,%r14
jae    1150 <main+0x20>
add    $0x1,%ebx
jmp    1154 <main+0x24>
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Enter a sentence: \00"
@.str.1 = [34 x i8] c"Your message contains %d vowels.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %7, %0
%3 = phi i32 [ %8, %7 ], [ 0, %0 ]
br label %4
4: ; preds = %2, %4
%5 = tail call i32 (...) @getchar()
%6 = tail call signext i8 @toupper(i32 %5)
switch i8 %6, label %4 [
i8 10, label %9
i8 85, label %7
i8 79, label %7
i8 73, label %7
i8 69, label %7
i8 65, label %7
]
7: ; preds = %4, %4, %4, %4, %4
%8 = add nuw nsw i32 %3, 1
br label %2
9: ; preds = %4
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}