#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char myString[21];
  int letter, counter = 0;
  printf("Please enter a string > ");
  scanf("%s", myString);
  for (letter = 0; myString[letter] != '\0'; letter++)
    if ((myString[letter] == 'a') || (myString[letter] == 'e') ||
        (myString[letter] == 'i') || (myString[letter] == 'o') ||
        (myString[letter] == 'u') || (myString[letter] == 'y')) {
      counter = counter + 1;
    }
  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,-0x28(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11f5 <main+0xd5>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x61,%eax
je     11d9 <main+0xb9>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x65,%eax
je     11d9 <main+0xb9>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x69,%eax
je     11d9 <main+0xb9>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x6f,%eax
je     11d9 <main+0xb9>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x75,%eax
je     11d9 <main+0xb9>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x79,%eax
jne    11e2 <main+0xc2>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e7 <main+0xc7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115b <main+0x3b>
mov    -0x28(%rbp),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xed3(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    $0x1104111,%eax
jmp    1164 <main+0x44>
test   %cl,%cl
je     117d <main+0x5d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
movzbl (%rbx),%ecx
lea    -0x61(%rcx),%edx
cmp    $0x18,%dl
ja     114f <main+0x2f>
movzbl %dl,%edx
bt     %rdx,%rax
jae    114f <main+0x2f>
add    $0x1,%ebp
jmp    1160 <main+0x40>
lea    0xe98(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <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"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [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* %4
%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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
store i32 0, i32* %3
br label %8
8: ; preds = %61, %0
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %64
15: ; preds = %8
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 97
br i1 %21, label %57, label %22
22: ; preds = %15
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 101
br i1 %28, label %57, label %29
29: ; preds = %22
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 105
br i1 %35, label %57, label %36
36: ; preds = %29
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 111
br i1 %42, label %57, label %43
43: ; preds = %36
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 117
br i1 %49, label %57, label %50
50: ; preds = %43
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 121
br i1 %56, label %57, label %60
57: ; preds = %50, %43, %36, %29, %22, %15
%58 = load i32, i32* %4
%59 = add nsw i32 %58, 1
store i32 %59, i32* %4
br label %60
60: ; preds = %57, %50
br label %61
61: ; preds = %60
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
store i32 %63, i32* %3
br label %8
64: ; preds = %8
%65 = load i32, i32* %4
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %65)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please enter a string > \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %5
5: ; preds = %12, %0
%6 = phi i64 [ %14, %12 ], [ 0, %0 ]
%7 = phi i32 [ %13, %12 ], [ 0, %0 ]
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %6
%9 = load i8, i8* %8
switch i8 %9, label %12 [
i8 0, label %15
i8 97, label %10
i8 101, label %10
i8 105, label %10
i8 111, label %10
i8 117, label %10
i8 121, label %10
]
10: ; preds = %5, %5, %5, %5, %5, %5
%11 = add nsw i32 %7, 1
br label %12
12: ; preds = %5, %10
%13 = phi i32 [ %11, %10 ], [ %7, %5 ]
%14 = add nuw i64 %6, 1
br label %5
15: ; preds = %5
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}