#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() {
  int size = 20;
  int vowels = 0;
  char n[size];
  printf("Please enter a string > ");
  fgets(n, size - 1, stdin);
  int i;
  for (i = 0; i < strlen(n); i++) {
    if (n[i] == 'a' || n[i] == 'e' || n[i] == 'i' || n[i] == 'o' ||
        n[i] == 'u' || n[i] == 'y')
      vowels++;
  }
  printf("The number of syllables is %d.\n", vowels);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    0x2e56(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    1256 <main+0x126>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
je     123a <main+0x10a>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x65,%eax
je     123a <main+0x10a>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x69,%eax
je     123a <main+0x10a>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
je     123a <main+0x10a>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x75,%eax
je     123a <main+0x10a>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x79,%eax
jne    1243 <main+0x113>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1248 <main+0x118>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a0 <main+0x70>
mov    -0xc(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%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    $0x13,%esi
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11ad <main+0x7d>
xor    %ebx,%ebx
mov    %rsp,%r14
mov    $0x1495,%r15d
xor    %ebp,%ebp
jmp    1193 <main+0x63>
xchg   %ax,%ax
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11ad <main+0x7d>
movzbl (%rsp,%rbx,1),%eax
add    $0x9f,%al
ror    %al
cmp    $0xc,%al
ja     1180 <main+0x50>
movzbl %al,%eax
bt     %rax,%r15
jae    1180 <main+0x50>
add    $0x1,%ebp
jmp    1180 <main+0x50>
lea    0xe65(%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 i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i8, i64 %8
store i64 %8, i64* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %10, i32 %13, i32 %14)
store i32 0, i32* %6
br label %16
16: ; preds = %66, %0
%17 = load i32, i32* %6
%18 = call i32 @strlen(i8* %10)
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %69
20: ; preds = %16
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %10, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 97
br i1 %26, label %62, label %27
27: ; preds = %20
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %10, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 101
br i1 %33, label %62, label %34
34: ; preds = %27
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %10, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 105
br i1 %40, label %62, label %41
41: ; preds = %34
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %10, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 111
br i1 %47, label %62, label %48
48: ; preds = %41
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %10, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 117
br i1 %54, label %62, label %55
55: ; preds = %48
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %10, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 121
br i1 %61, label %62, label %65
62: ; preds = %55, %48, %41, %34, %27, %20
%63 = load i32, i32* %3
%64 = add nsw i32 %63, 1
store i32 %64, i32* %3
br label %65
65: ; preds = %62, %55
br label %66
66: ; preds = %65
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
br label %16
69: ; preds = %16
%70 = load i32, i32* %3
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %70)
store i32 0, i32* %1
%72 = load i8*, i8** %4
%73 = load i32, i32* %1
ret i32 %73
}

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 [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 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 19, i32 %4)
%6 = call i32 @strlen(i8* %2)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %0, %17
%9 = phi i64 [ %19, %17 ], [ 0, %0 ]
%10 = phi i32 [ %18, %17 ], [ 0, %0 ]
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %9
%12 = load i8, i8* %11
%13 = add i8 %12, -97
%14 = call i8 @llvm.fshl.i8(i8 %13, i8 %13, i8 7)
switch i8 %14, label %17 [
i8 0, label %15
i8 2, label %15
i8 4, label %15
i8 7, label %15
i8 10, label %15
i8 12, label %15
]
15: ; preds = %8, %8, %8, %8, %8, %8
%16 = add nsw i32 %10, 1
br label %17
17: ; preds = %8, %15
%18 = phi i32 [ %16, %15 ], [ %10, %8 ]
%19 = add nuw nsw i64 %9, 1
%20 = call i32 @strlen(i8* %2)
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %19, %21
br i1 %22, label %8, label %23
23: ; preds = %17, %0
%24 = phi i32 [ 0, %0 ], [ %18, %17 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %24)
ret i32 0
}