#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 strlen(char *);
int is_vowel(char ch) {
  char vowels[] = "aeiouyAEIOUY";
  for (int i = 0; i < strlen(vowels); ++i)
    if (ch == vowels[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_vowel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed4(%rip),%al
mov    %al,-0x6(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    1192 <is_vowel+0x82>
movsbl -0x5(%rbp),%eax
movslq -0x18(%rbp),%rcx
movsbl -0x12(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    117f <is_vowel+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1199 <is_vowel+0x89>
jmp    1184 <is_vowel+0x74>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1142 <is_vowel+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vowel>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
movabs $0x59554f49454179,%rax
mov    %rax,0x5(%rsp)
movabs $0x454179756f696561,%rax
79 41 45
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1169 <is_vowel+0x59>
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   0x0(%rax,%rax,1)
cmp    %bpl,(%rsp,%rbx,1)
je     116d <is_vowel+0x5d>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1150 <is_vowel+0x40>
xor    %eax,%eax
jmp    1172 <is_vowel+0x62>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.is_vowel.vowels = [13 x i8] c"aeiouyAEIOUY\00"
define i32 @is_vowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [13 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [13 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %23, %1
%8 = load i32, i32* %5
%9 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %26
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %14, %19
br i1 %20, label %21, label %22
21: ; preds = %12
store i32 1, i32* %2
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
store i32 0, i32* %2
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@__const.is_vowel.vowels = [13 x i8] c"aeiouyAEIOUY\00"
define i32 @is_vowel(i8 signext %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %10, label %16
6: ; preds = %10
%7 = call i32 @strlen(i8* %3)
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %15, %8
br i1 %9, label %10, label %16
10: ; preds = %1, %6
%11 = phi i64 [ %15, %6 ], [ 0, %1 ]
%12 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %0
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %6
16: ; preds = %6, %10, %1
%17 = phi i32 [ 0, %1 ], [ 1, %10 ], [ 0, %6 ]
ret i32 %17
}