#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 strlen(char *);
int main() {
  char input[20];
  int i, s, len;
  printf("Please enter a string > ");
  scanf("%s", input);
  len = strlen(input);
  s = 0;
  for (i = 0; i < len; i++) {
    switch (input[i]) {
    case 'a':
      s++;
      break;
    case 'e':
      s++;
      break;
    case 'i':
      s++;
      break;
    case 'o':
      s++;
      break;
    case 'u':
      s++;
      break;
    case 'y':
      s++;
      break;
    default:
      break;
    }
  }
  printf("The number of syllables is %d.\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xf25(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    121e <main+0xee>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x18,%eax
ja     1206 <main+0xd6>
mov    -0x38(%rbp),%rax
lea    0xe57(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xdb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xdb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xdb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xdb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xdb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xdb>
jmp    120b <main+0xdb>
jmp    1210 <main+0xe0>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1177 <main+0x47>
mov    -0x28(%rbp),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xef6(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11a5 <main+0x75>
mov    %eax,%eax
xor    %ecx,%ecx
lea    0xe90(%rip),%rdx
xor    %ebx,%ebx
jmp    1189 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rcx
cmp    %rcx,%rax
je     11a5 <main+0x75>
movsbl (%rsp,%rcx,1),%esi
add    $0xffffff9f,%esi
ror    %esi
cmp    $0xc,%esi
ja     1180 <main+0x50>
movslq (%rdx,%rsi,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
add    $0x1,%ebx
jmp    1180 <main+0x50>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
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 [20 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %11
11: ; preds = %41, %0
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %44
15: ; preds = %11
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
switch i32 %20, label %39 [
i32 97, label %21
i32 101, label %24
i32 105, label %27
i32 111, label %30
i32 117, label %33
i32 121, label %36
]
21: ; preds = %15
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %40
24: ; preds = %15
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %40
27: ; preds = %15
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %40
30: ; preds = %15
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %40
33: ; preds = %15
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %40
36: ; preds = %15
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %40
39: ; preds = %15
br label %40
40: ; preds = %39, %36, %33, %30, %27, %24, %21
br label %41
41: ; preds = %40
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %11
44: ; preds = %11
%45 = load i32, i32* %4
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %45)
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 [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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %33
7: ; preds = %0
%8 = zext i32 %5 to i64
br label %9
9: ; preds = %7, %29
%10 = phi i64 [ 0, %7 ], [ %31, %29 ]
%11 = phi i32 [ 0, %7 ], [ %30, %29 ]
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %10
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, -97
%16 = call i32 @llvm.fshl.i32(i32 %15, i32 %15, i32 31)
switch i32 %16, label %29 [
i32 0, label %17
i32 2, label %19
i32 4, label %21
i32 7, label %23
i32 10, label %25
i32 12, label %27
]
17: ; preds = %9
%18 = add nsw i32 %11, 1
br label %29
19: ; preds = %9
%20 = add nsw i32 %11, 1
br label %29
21: ; preds = %9
%22 = add nsw i32 %11, 1
br label %29
23: ; preds = %9
%24 = add nsw i32 %11, 1
br label %29
25: ; preds = %9
%26 = add nsw i32 %11, 1
br label %29
27: ; preds = %9
%28 = add nsw i32 %11, 1
br label %29
29: ; preds = %17, %19, %21, %23, %25, %27, %9
%30 = phi i32 [ %11, %9 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ %22, %21 ], [ %20, %19 ], [ %18, %17 ]
%31 = add nuw nsw i64 %10, 1
%32 = icmp eq i64 %31, %8
br i1 %32, label %33, label %9
33: ; preds = %29, %0
%34 = phi i32 [ 0, %0 ], [ %30, %29 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %34)
ret i32 0
}