#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 instring[20];
  int numVowels = 0;
  int i;
  printf("Please enter a string > ");
  fgets(instring, 20 - 1, stdin);
  for (i = 0; i < strlen(instring); i++) {
    if (instring[i] == 'a' || instring[i] == 'e' || instring[i] == 'i' ||
        instring[i] == 'o' || instring[i] == 'u' || instring[i] == 'y')
      numVowels += 0;
  }
  printf("The number of syllables is %d.\n", numVowels);
  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    $0x13,%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    1216 <main+0xe6>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x61,%eax
je     11fa <main+0xca>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x65,%eax
je     11fa <main+0xca>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x69,%eax
je     11fa <main+0xca>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x6f,%eax
je     11fa <main+0xca>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x75,%eax
je     11fa <main+0xca>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x79,%eax
jne    1203 <main+0xd3>
mov    -0x24(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x24(%rbp)
jmp    1208 <main+0xd8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1172 <main+0x42>
mov    -0x24(%rbp),%esi
lea    0xdf9(%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   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1050 <fgets@plt>
mov    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1170 <main+0x40>
lea    0xe93(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
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 [20 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 [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 19, i32 %7)
store i32 0, i32* %4
br label %9
9: ; preds = %60, %0
%10 = load i32, i32* %4
%11 = getelementptr inbounds [20 x i8], [20 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 %63
14: ; preds = %9
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [20 x i8], [20 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 %56, label %21
21: ; preds = %14
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [20 x i8], [20 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 %56, label %28
28: ; preds = %21
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 105
br i1 %34, label %56, label %35
35: ; preds = %28
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 111
br i1 %41, label %56, label %42
42: ; preds = %35
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 117
br i1 %48, label %56, label %49
49: ; preds = %42
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 121
br i1 %55, label %56, label %59
56: ; preds = %49, %42, %35, %28, %21, %14
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 0
store i32 %58, i32* %3
br label %59
59: ; preds = %56, %49
br label %60
60: ; preds = %59
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %9
63: ; preds = %9
%64 = load i32, i32* %3
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %64)
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 [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)
br label %6
6: ; preds = %6, %0
%7 = phi i32 [ 0, %0 ], [ %10, %6 ]
%8 = call i32 @strlen(i8* %2)
%9 = icmp slt i32 %7, %8
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %6, label %11
11: ; preds = %6
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}