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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jg     1204 <main+0xd4>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x61,%eax
je     11e8 <main+0xb8>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x65,%eax
je     11e8 <main+0xb8>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x6f,%eax
je     11e8 <main+0xb8>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x75,%eax
je     11e8 <main+0xb8>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x79,%eax
jne    11f1 <main+0xc1>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11f6 <main+0xc6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1172 <main+0x42>
mov    -0x28(%rbp),%esi
lea    0xe0a(%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    $0x15,%esi
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
js     11bc <main+0x8c>
xor    %ebp,%ebp
mov    $0xffffffffffffffff,%rbx
mov    %rsp,%r14
mov    $0x1104011,%r15d
jmp    11a3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
add    $0x1,%rbx
cmp    %rax,%rbx
jge    11bc <main+0x8c>
movzbl 0x1(%rsp,%rbx,1),%eax
add    $0x9f,%al
cmp    $0x18,%al
ja     1190 <main+0x60>
movzbl %al,%eax
bt     %rax,%r15
jae    1190 <main+0x60>
add    $0x1,%ebp
jmp    1190 <main+0x60>
lea    0xe55(%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 = [24 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 [22 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 21, i32 %7)
store i32 0, i32* %3
br label %9
9: ; preds = %53, %0
%10 = load i32, i32* %3
%11 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %56
14: ; preds = %9
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 97
br i1 %20, label %49, label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 101
br i1 %27, label %49, label %28
28: ; preds = %21
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 111
br i1 %34, label %49, label %35
35: ; preds = %28
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 117
br i1 %41, label %49, label %42
42: ; preds = %35
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 121
br i1 %48, label %49, label %52
49: ; preds = %42, %35, %28, %21, %14
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %52
52: ; preds = %49, %42
br label %53
53: ; preds = %52
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %9
56: ; preds = %9
%57 = load i32, i32* %4
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %57)
ret i32 0
}

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