#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(void) {
  char input[21];
  int counter = 0, i;
  printf("Please enter a string > ");
  fgets(input, 20, stdin);
  for (i = 0; i < strlen(input); i++)
    switch (input[i]) {
    case 'a':
    case 'A':
    case 'e':
    case 'E':
    case 'i':
    case 'I':
    case 'o':
    case 'O':
    case 'u':
    case 'U':
    case 'y':
    case 'Y':
      counter += 1;
      break;
    default:
      break;
    }
  printf("The number of syllables is %d.\n", counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    1289 <main+0x159>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
mov    %eax,-0x30(%rbp)
sub    $0x41,%eax
je     1263 <main+0x133>
jmp    11a8 <main+0x78>
mov    -0x30(%rbp),%eax
sub    $0x45,%eax
je     1263 <main+0x133>
jmp    11b9 <main+0x89>
mov    -0x30(%rbp),%eax
sub    $0x49,%eax
je     1263 <main+0x133>
jmp    11ca <main+0x9a>
mov    -0x30(%rbp),%eax
sub    $0x4f,%eax
je     1263 <main+0x133>
jmp    11db <main+0xab>
mov    -0x30(%rbp),%eax
sub    $0x55,%eax
je     1263 <main+0x133>
jmp    11ec <main+0xbc>
mov    -0x30(%rbp),%eax
sub    $0x59,%eax
je     1263 <main+0x133>
jmp    11fd <main+0xcd>
mov    -0x30(%rbp),%eax
sub    $0x61,%eax
je     1263 <main+0x133>
jmp    120e <main+0xde>
mov    -0x30(%rbp),%eax
sub    $0x65,%eax
je     1263 <main+0x133>
jmp    121f <main+0xef>
mov    -0x30(%rbp),%eax
sub    $0x69,%eax
je     1263 <main+0x133>
jmp    1230 <main+0x100>
mov    -0x30(%rbp),%eax
sub    $0x6f,%eax
je     1263 <main+0x133>
jmp    1241 <main+0x111>
mov    -0x30(%rbp),%eax
sub    $0x75,%eax
je     1263 <main+0x133>
jmp    1252 <main+0x122>
mov    -0x30(%rbp),%eax
sub    $0x79,%eax
jne    1271 <main+0x141>
jmp    1263 <main+0x133>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1276 <main+0x146>
jmp    1276 <main+0x146>
jmp    127b <main+0x14b>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1172 <main+0x42>
mov    -0x24(%rbp),%esi
lea    0xd86(%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   %rbx
sub    $0x18,%rsp
lea    0xebf(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x14,%esi
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11aa <main+0x7a>
xor    %ebx,%ebx
mov    %rsp,%r14
mov    $0x14951495,%r15d
xor    %ebp,%ebp
nopl   0x0(%rax)
movsbl (%rsp,%rbx,1),%eax
add    $0xffffffbf,%eax
ror    %eax
cmp    $0x1c,%eax
ja     1197 <main+0x67>
bt     %eax,%r15d
jae    1197 <main+0x67>
add    $0x1,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1180 <main+0x50>
lea    0xe68(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please enter a string > \00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"The number of syllables is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 20, i32 %7)
store i32 0, i32* %4
br label %9
9: ; preds = %25, %0
%10 = load i32, i32* %4
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %28
14: ; preds = %9
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
switch i32 %19, label %23 [
i32 97, label %20
i32 65, label %20
i32 101, label %20
i32 69, label %20
i32 105, label %20
i32 73, label %20
i32 111, label %20
i32 79, label %20
i32 117, label %20
i32 85, label %20
i32 121, label %20
i32 89, label %20
]
20: ; preds = %14, %14, %14, %14, %14, %14, %14, %14, %14, %14, %14, %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %24
23: ; preds = %14
br label %24
24: ; preds = %23, %20
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %9
28: ; preds = %9
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please enter a string > \00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"The number of syllables is %d.\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 20, i32 %4)
%6 = call i32 @strlen(i8* %2)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %0, %18
%9 = phi i64 [ %20, %18 ], [ 0, %0 ]
%10 = phi i32 [ %19, %18 ], [ 0, %0 ]
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %9
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, -65
%15 = call i32 @llvm.fshl.i32(i32 %14, i32 %14, i32 31)
switch i32 %15, label %18 [
i32 16, label %16
i32 0, label %16
i32 18, label %16
i32 2, label %16
i32 20, label %16
i32 4, label %16
i32 23, label %16
i32 7, label %16
i32 26, label %16
i32 10, label %16
i32 28, label %16
i32 12, label %16
]
16: ; preds = %8, %8, %8, %8, %8, %8, %8, %8, %8, %8, %8, %8
%17 = add nsw i32 %10, 1
br label %18
18: ; preds = %16, %8
%19 = phi i32 [ %10, %8 ], [ %17, %16 ]
%20 = add nuw nsw i64 %9, 1
%21 = call i32 @strlen(i8* %2)
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %20, %22
br i1 %23, label %8, label %24
24: ; preds = %18, %0
%25 = phi i32 [ 0, %0 ], [ %19, %18 ]
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret i32 0
}