a_or_an(item) char *item;
{
  int i, v = 0;
  static char vowels[] = "AEIOU";
  for (i = 0; i < 5; ++i)
    if (*item == *(vowels + i))
      v = 1;
  if (v)
    print("an ");
  else
    print("a ");
}


x86 assembly (clang, -O0):
<a_or_an>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    116c <a_or_an+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movslq -0x14(%rbp),%rdx
lea    0x2ee2(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1159 <a_or_an+0x49>
movl   $0x1,-0x18(%rbp)
jmp    115e <a_or_an+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <a_or_an+0x1a>
cmpl   $0x0,-0x18(%rbp)
je     1189 <a_or_an+0x79>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    1197 <a_or_an+0x87>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or_an>:
mov    (%rdi),%al
add    $0xbf,%al
ror    %al
cmp    $0xa,%al
ja     1133 <a_or_an+0x23>
movsbq %al,%rax
lea    0xee3(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
xor    %eax,%eax
jmp    1030 <print@plt>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"an \00"
@.str.1 = [3 x i8] c"a \00"
@reltable.a_or_an = [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([11 x i32]* @reltable.a_or_an to i64)) to i32)]
define i32 @a_or_an(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -65
%4 = tail call i8 @llvm.fshl.i8(i8 %3, i8 %3, i8 7)
%5 = icmp ult i8 %4, 11
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i8 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.a_or_an to i8*), i64 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %1 ]
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* %11)
ret i32 undef
}