#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 num = 0;
  printf("enter a sentence:\n");
  while ((ch = toupper(getchar())) != '.') {
    if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') {
      num++;
    }
  }
  printf("your sentence contains %d vowels.\n", num);
  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    $0x2e,%eax
je     11c0 <main+0x90>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
je     11b2 <main+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x45,%eax
je     11b2 <main+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x49,%eax
je     11b2 <main+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x4f,%eax
je     11b2 <main+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x55,%eax
jne    11bb <main+0x8b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <main+0x24>
mov    -0xc(%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   %rbp
push   %rbx
push   %rax
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
movabs $0x8208880000,%rbx
xor    %ebp,%ebp
jmp    1160 <main+0x20>
add    $0x1,%ebp
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
add    $0xd2,%al
cmp    $0x27,%al
ja     1160 <main+0x20>
movzbl %al,%eax
bt     %rax,%rbx
jb     115d <main+0x1d>
test   %rax,%rax
jne    1160 <main+0x20>
lea    0xe77(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"enter a sentence:\0A\00"
@.str.1 = [35 x i8] c"your sentence 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 ([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* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 46
br i1 %9, label %10, label %34
10: ; preds = %5
%11 = load i8, i8* %2
%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* %2
%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* %2
%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* %2
%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* %2
%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* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %33
33: ; preds = %30, %26
br label %5
34: ; preds = %5
%35 = load i32, i32* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"your sentence contains %d vowels.\0A\00"
@str = [18 x i8] c"enter a sentence:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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 46, 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 ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}