#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 toupper(char);
int main(void) {
  char ch;
  int a_cnt, e_cnt, i_cnt, o_cnt, u_cnt, other;
  a_cnt = e_cnt = i_cnt = o_cnt = u_cnt = other = 0;
  printf("Enter some text (# to quit):\n");
  while ((ch = getchar()) != '#') {
    switch (toupper(ch)) {
    case 'A':
      a_cnt++;
      break;
    case 'E':
      e_cnt++;
      break;
    case 'I':
      i_cnt++;
      break;
    case 'O':
      o_cnt++;
      break;
    case 'U':
      u_cnt++;
      break;
    default:
      other++;
    }
  }
  printf("Counts:    A    E    I    O    U    Other\n");
  printf("        %4d %4d %4d %4d %4d   %4d\n", a_cnt, e_cnt, i_cnt, o_cnt,
         u_cnt, other);
  (other > 10) ? printf("That's a lot of consonants yo\n")
               : printf("Get some consonants in your life bro\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x23,%eax
je     1210 <main+0xe0>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x14,%eax
ja     1202 <main+0xd2>
mov    -0x28(%rbp),%rax
lea    0xe4d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120b <main+0xdb>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    120b <main+0xdb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    120b <main+0xdb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120b <main+0xdb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    120b <main+0xdb>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1177 <main+0x47>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%eax
lea    0xe64(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xa,-0x20(%rbp)
jle    1260 <main+0x130>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    126e <main+0x13e>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <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
sub    $0x18,%rsp
lea    0xefa(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    $0x0,%ebx
mov    $0x0,%r13d
mov    $0x0,%r12d
mov    $0x0,%r15d
mov    $0x0,%ebp
cmp    $0x23,%al
jne    11e0 <main+0xa0>
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,(%rsp)
lea    0xe8d(%rip),%rdi
mov    0x14(%rsp),%esi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xb,%ebp
lea    0xefc(%rip),%rax
lea    0xed0(%rip),%rdi
cmovge %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe19(%rip),%r14
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebx,%ebx
movl   $0x0,0x14(%rsp)
jmp    121f <main+0xdf>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x23,%al
je     1189 <main+0x49>
movsbl %al,%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
ror    %eax
cmp    $0xa,%eax
ja     11fe <main+0xbe>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
addl   $0x1,0x14(%rsp)
jmp    1210 <main+0xd0>
add    $0x1,%ebx
jmp    1210 <main+0xd0>
add    $0x1,%r13d
jmp    1210 <main+0xd0>
add    $0x1,%r12d
jmp    1210 <main+0xd0>
add    $0x1,%r15d
jmp    1210 <main+0xd0>

LLVM IR (-O0):
@.str = [30 x i8] c"Enter some text (# to quit):\0A\00"
@.str.1 = [43 x i8] c"Counts: A E I O U Other\0A\00"
@.str.2 = [35 x i8] c" %4d %4d %4d %4d %4d %4d\0A\00"
@.str.3 = [31 x i8] c"That's a lot of consonants yo\0A\00"
@.str.4 = [38 x i8] c"Get some consonants in your life bro\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
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %8
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
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %35, %0
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 35
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i8, i8* %2
%16 = call i32 @toupper(i8 signext %15)
switch i32 %16, label %32 [
i32 65, label %17
i32 69, label %20
i32 73, label %23
i32 79, label %26
i32 85, label %29
]
17: ; preds = %14
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %35
20: ; preds = %14
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %35
23: ; preds = %14
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %35
26: ; preds = %14
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %35
29: ; preds = %14
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %35
32: ; preds = %14
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %35
35: ; preds = %32, %29, %26, %23, %20, %17
br label %10
36: ; preds = %10
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%38 = load i32, i32* %3
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %38, i32 %39, i32 %40, i32 %41, i32 %42, i32 %43)
%45 = load i32, i32* %8
%46 = icmp sgt i32 %45, 10
br i1 %46, label %47, label %49
47: ; preds = %36
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %51
49: ; preds = %36
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
%52 = phi i32 [ %48, %47 ], [ %50, %49 ]
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [35 x i8] c" %4d %4d %4d %4d %4d %4d\0A\00"
@str = [29 x i8] c"Enter some text (# to quit):\00"
@str.5 = [42 x i8] c"Counts: A E I O U Other\00"
@str.6 = [37 x i8] c"Get some consonants in your life bro\00"
@str.7 = [30 x i8] c"That's a lot of consonants yo\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 %36, label %4
4: ; preds = %0, %27
%5 = phi i8 [ %34, %27 ], [ %2, %0 ]
%6 = phi i32 [ %33, %27 ], [ 0, %0 ]
%7 = phi i32 [ %32, %27 ], [ 0, %0 ]
%8 = phi i32 [ %31, %27 ], [ 0, %0 ]
%9 = phi i32 [ %30, %27 ], [ 0, %0 ]
%10 = phi i32 [ %29, %27 ], [ 0, %0 ]
%11 = phi i32 [ %28, %27 ], [ 0, %0 ]
%12 = tail call i32 @toupper(i8 signext %5)
%13 = add i32 %12, -65
%14 = tail call i32 @llvm.fshl.i32(i32 %13, i32 %13, i32 31)
switch i32 %14, label %25 [
i32 0, label %15
i32 2, label %17
i32 4, label %19
i32 7, label %21
i32 10, label %23
]
15: ; preds = %4
%16 = add nsw i32 %11, 1
br label %27
17: ; preds = %4
%18 = add nsw i32 %10, 1
br label %27
19: ; preds = %4
%20 = add nsw i32 %9, 1
br label %27
21: ; preds = %4
%22 = add nsw i32 %8, 1
br label %27
23: ; preds = %4
%24 = add nsw i32 %7, 1
br label %27
25: ; preds = %4
%26 = add nsw i32 %6, 1
br label %27
27: ; preds = %25, %23, %21, %19, %17, %15
%28 = phi i32 [ %11, %25 ], [ %11, %23 ], [ %11, %21 ], [ %11, %19 ], [ %11, %17 ], [ %16, %15 ]
%29 = phi i32 [ %10, %25 ], [ %10, %23 ], [ %10, %21 ], [ %10, %19 ], [ %18, %17 ], [ %10, %15 ]
%30 = phi i32 [ %9, %25 ], [ %9, %23 ], [ %9, %21 ], [ %20, %19 ], [ %9, %17 ], [ %9, %15 ]
%31 = phi i32 [ %8, %25 ], [ %8, %23 ], [ %22, %21 ], [ %8, %19 ], [ %8, %17 ], [ %8, %15 ]
%32 = phi i32 [ %7, %25 ], [ %24, %23 ], [ %7, %21 ], [ %7, %19 ], [ %7, %17 ], [ %7, %15 ]
%33 = phi i32 [ %26, %25 ], [ %6, %23 ], [ %6, %21 ], [ %6, %19 ], [ %6, %17 ], [ %6, %15 ]
%34 = tail call signext i8 (...) @getchar()
%35 = icmp eq i8 %34, 35
br i1 %35, label %36, label %4
36: ; preds = %27, %0
%37 = phi i32 [ 0, %0 ], [ %28, %27 ]
%38 = phi i32 [ 0, %0 ], [ %29, %27 ]
%39 = phi i32 [ 0, %0 ], [ %30, %27 ]
%40 = phi i32 [ 0, %0 ], [ %31, %27 ]
%41 = phi i32 [ 0, %0 ], [ %32, %27 ]
%42 = phi i32 [ 0, %0 ], [ %33, %27 ]
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, i64 0, i64 0))
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %37, i32 %38, i32 %39, i32 %40, i32 %41, i32 %42)
%45 = icmp sgt i32 %42, 10
%46 = select i1 %45, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0)
%47 = tail call i32 @puts(i8* dereferenceable(1) %46)
ret i32 0
}