char *vowelstr(char *str) {
  switch (*str) {
  case 'a':
  case 'A':
  case 'e':
  case 'E':
  case 'i':
  case 'I':
  case 'o':
  case 'O':
  case 'u':
  case 'U':
    return "n";
  default:
    return "";
  }
}


x86 assembly (clang, -O0):
<vowelstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x41,%eax
je     11b9 <vowelstr+0xb9>
jmp    1120 <vowelstr+0x20>
mov    -0x14(%rbp),%eax
sub    $0x45,%eax
je     11b9 <vowelstr+0xb9>
jmp    1131 <vowelstr+0x31>
mov    -0x14(%rbp),%eax
sub    $0x49,%eax
je     11b9 <vowelstr+0xb9>
jmp    1142 <vowelstr+0x42>
mov    -0x14(%rbp),%eax
sub    $0x4f,%eax
je     11b9 <vowelstr+0xb9>
jmp    1153 <vowelstr+0x53>
mov    -0x14(%rbp),%eax
sub    $0x55,%eax
je     11b9 <vowelstr+0xb9>
jmp    1164 <vowelstr+0x64>
mov    -0x14(%rbp),%eax
sub    $0x61,%eax
je     11b9 <vowelstr+0xb9>
jmp    1175 <vowelstr+0x75>
mov    -0x14(%rbp),%eax
sub    $0x65,%eax
je     11b9 <vowelstr+0xb9>
jmp    1186 <vowelstr+0x86>
mov    -0x14(%rbp),%eax
sub    $0x69,%eax
je     11b9 <vowelstr+0xb9>
jmp    1197 <vowelstr+0x97>
mov    -0x14(%rbp),%eax
sub    $0x6f,%eax
je     11b9 <vowelstr+0xb9>
jmp    11a8 <vowelstr+0xa8>
mov    -0x14(%rbp),%eax
sub    $0x75,%eax
jne    11c9 <vowelstr+0xc9>
jmp    11b9 <vowelstr+0xb9>
lea    0xe40(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <vowelstr+0xd4>
lea    0xe31(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vowelstr>:
movsbl (%rdi),%eax
add    $0xffffffbf,%eax
cmp    $0x34,%eax
ja     1123 <vowelstr+0x23>
movabs $0x10411100104111,%rcx
bt     %rax,%rcx
jae    1123 <vowelstr+0x23>
lea    0xede(%rip),%rax
ret
lea    0xed7(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @vowelstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %8 [
i32 97, label %7
i32 65, label %7
i32 101, label %7
i32 69, label %7
i32 105, label %7
i32 73, label %7
i32 111, label %7
i32 79, label %7
i32 117, label %7
i32 85, label %7
]
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @vowelstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %4 [
i32 97, label %5
i32 65, label %5
i32 101, label %5
i32 69, label %5
i32 105, label %5
i32 73, label %5
i32 111, label %5
i32 79, label %5
i32 117, label %5
i32 85, label %5
]
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %4
%6 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}