#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 */
char EOF;
int EXIT_SUCCESS;
scalar_t__ IsVowel(char);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char c = '\0';
  int count = 0;
  printf("Enter a sentence: ");
  while ((c = getchar()) != '\n' && c != EOF) {
    if (IsVowel(c)) {
      ++count;
    }
  }
  printf("Your sentence contains %d vowels.\n", count);
  getchar();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     1189 <main+0x59>
movsbl -0x5(%rbp),%eax
mov    0x2e6a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1199 <main+0x69>
jmp    11ba <main+0x8a>
movsbl -0x5(%rbp),%edi
call   1050 <IsVowel@plt>
cmp    $0x0,%rax
je     11b5 <main+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <main+0x28>
mov    -0xc(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     117f <main+0x4f>
mov    0x2e92(%rip),%r14
cmp    (%r14),%al
je     117f <main+0x4f>
xor    %ebx,%ebx
nopl   (%rax)
movsbl %al,%edi
call   1050 <IsVowel@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     117f <main+0x4f>
cmp    (%r14),%al
jne    1160 <main+0x30>
lea    0xe8d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Enter a sentence: \00"
@EOF = global i8 0
@.str.1 = [35 x i8] c"Your sentence contains %d vowels.\0A\00"
@EXIT_SUCCESS = global i32 0
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))
%2 = tail call signext i8 (...) @getchar()
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %19
7: ; preds = %0, %7
%8 = phi i8 [ %14, %7 ], [ %2, %0 ]
%9 = phi i32 [ %13, %7 ], [ 0, %0 ]
%10 = tail call i64 @IsVowel(i8 signext %8)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %9, %12
%14 = tail call signext i8 (...) @getchar()
%15 = icmp ne i8 %14, 10
%16 = load i8, i8* @EOF
%17 = icmp ne i8 %14, %16
%18 = select i1 %15, i1 %17, i1 false
br i1 %18, label %7, label %19
19: ; preds = %7, %0
%20 = phi i32 [ 0, %0 ], [ %13, %7 ]
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = tail call signext i8 (...) @getchar()
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}