#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char ch;
  int a_c, e_c, i_c, o_c, u_c;
  a_c = e_c = i_c = o_c = u_c = 0;
  printf("Enter a statement(# at end):\n");
  while ((ch = getchar()) != '#') {
    switch (ch) {
    case 'a':
    case 'A':
      a_c++;
      break;
    case 'e':
    case 'E':
      e_c++;
      break;
    case 'i':
    case 'I':
      i_c++;
      break;
    case 'o':
    case 'O':
      o_c++;
      break;
    case 'u':
    case 'U':
      u_c++;
      break;
    default:
      break;
    }
  }
  printf("number of vowels:");
  printf("   A   E   I   O   U\n");
  printf("                 %4d%4d%4d%4d%4d\n", a_c, e_c, i_c, o_c, u_c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xf7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x23,%eax
je     11f0 <main+0xd0>
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x34,%eax
ja     11e6 <main+0xc6>
mov    -0x28(%rbp),%rax
lea    0xe69(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11eb <main+0xcb>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11eb <main+0xcb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11eb <main+0xcb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11eb <main+0xcb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11eb <main+0xcb>
jmp    11eb <main+0xcb>
jmp    1160 <main+0x40>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xfc6(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    $0x0,%ebx
mov    $0x0,%r13d
mov    $0x0,%r12d
mov    $0x0,%r15d
cmp    $0x23,%al
jne    11b3 <main+0x83>
lea    0xf61(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfa4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf59(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe46(%rip),%rbp
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    11db <main+0xab>
add    $0x1,%r15d
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x23,%al
je     116c <main+0x3c>
movsbl %al,%eax
add    $0xffffffbf,%eax
cmp    $0x34,%eax
ja     11d0 <main+0xa0>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
add    $0x1,%r14d
jmp    11d0 <main+0xa0>
add    $0x1,%ebx
jmp    11d0 <main+0xa0>
add    $0x1,%r13d
jmp    11d0 <main+0xa0>
add    $0x1,%r12d
jmp    11d0 <main+0xa0>

LLVM IR (-O0):
@.str = [30 x i8] c"Enter a statement(# at end):\0A\00"
@.str.1 = [18 x i8] c"number of vowels:\00"
@.str.2 = [22 x i8] c" A E I O U\0A\00"
@.str.3 = [34 x i8] c" %4d%4d%4d%4d%4d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %32, %0
%10 = call signext i8 (...) @getchar()
store i8 %10, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 35
br i1 %12, label %13, label %33
13: ; preds = %9
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
switch i32 %15, label %31 [
i32 97, label %16
i32 65, label %16
i32 101, label %19
i32 69, label %19
i32 105, label %22
i32 73, label %22
i32 111, label %25
i32 79, label %25
i32 117, label %28
i32 85, label %28
]
16: ; preds = %13, %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %32
19: ; preds = %13, %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %32
22: ; preds = %13, %13
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %32
25: ; preds = %13, %13
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %32
28: ; preds = %13, %13
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %32
31: ; preds = %13
br label %32
32: ; preds = %31, %28, %25, %22, %19, %16
br label %9
33: ; preds = %9
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %36, i32 %37, i32 %38, i32 %39, i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"number of vowels:\00"
@.str.3 = [34 x i8] c" %4d%4d%4d%4d%4d\0A\00"
@str = [29 x i8] c"Enter a statement(# at end):\00"
@str.4 = [21 x i8] c" A E I O U\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 35
br i1 %3, label %30, label %4
4: ; preds = %0, %22
%5 = phi i8 [ %28, %22 ], [ %2, %0 ]
%6 = phi i32 [ %27, %22 ], [ 0, %0 ]
%7 = phi i32 [ %26, %22 ], [ 0, %0 ]
%8 = phi i32 [ %25, %22 ], [ 0, %0 ]
%9 = phi i32 [ %24, %22 ], [ 0, %0 ]
%10 = phi i32 [ %23, %22 ], [ 0, %0 ]
%11 = sext i8 %5 to i32
switch i32 %11, label %22 [
i32 97, label %12
i32 65, label %12
i32 101, label %14
i32 69, label %14
i32 105, label %16
i32 73, label %16
i32 111, label %18
i32 79, label %18
i32 117, label %20
i32 85, label %20
]
12: ; preds = %4, %4
%13 = add nsw i32 %10, 1
br label %22
14: ; preds = %4, %4
%15 = add nsw i32 %9, 1
br label %22
16: ; preds = %4, %4
%17 = add nsw i32 %8, 1
br label %22
18: ; preds = %4, %4
%19 = add nsw i32 %7, 1
br label %22
20: ; preds = %4, %4
%21 = add nsw i32 %6, 1
br label %22
22: ; preds = %4, %20, %18, %16, %14, %12
%23 = phi i32 [ %10, %4 ], [ %10, %20 ], [ %10, %18 ], [ %10, %16 ], [ %10, %14 ], [ %13, %12 ]
%24 = phi i32 [ %9, %4 ], [ %9, %20 ], [ %9, %18 ], [ %9, %16 ], [ %15, %14 ], [ %9, %12 ]
%25 = phi i32 [ %8, %4 ], [ %8, %20 ], [ %8, %18 ], [ %17, %16 ], [ %8, %14 ], [ %8, %12 ]
%26 = phi i32 [ %7, %4 ], [ %7, %20 ], [ %19, %18 ], [ %7, %16 ], [ %7, %14 ], [ %7, %12 ]
%27 = phi i32 [ %6, %4 ], [ %21, %20 ], [ %6, %18 ], [ %6, %16 ], [ %6, %14 ], [ %6, %12 ]
%28 = tail call signext i8 (...) @getchar()
%29 = icmp eq i8 %28, 35
br i1 %29, label %30, label %4
30: ; preds = %22, %0
%31 = phi i32 [ 0, %0 ], [ %23, %22 ]
%32 = phi i32 [ 0, %0 ], [ %24, %22 ]
%33 = phi i32 [ 0, %0 ], [ %25, %22 ]
%34 = phi i32 [ 0, %0 ], [ %26, %22 ]
%35 = phi i32 [ 0, %0 ], [ %27, %22 ]
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 %32, i32 %33, i32 %34, i32 %35)
ret i32 0
}