char *parnam(char c) {
  switch (c) {
  case 'e':
    return ("even");
  case 'o':
    return ("odd");
  case 'm':
    return ("mark");
  case 's':
    return ("space");
  case 0:
    return ("none");
  default:
    return ("invalid");
  }
}


x86 assembly (clang, -O0):
<parnam>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     11a2 <parnam+0xa2>
jmp    111e <parnam+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x65,%eax
je     1162 <parnam+0x62>
jmp    112f <parnam+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x6d,%eax
je     1182 <parnam+0x82>
jmp    1140 <parnam+0x40>
mov    -0x10(%rbp),%eax
sub    $0x6f,%eax
je     1172 <parnam+0x72>
jmp    1151 <parnam+0x51>
mov    -0x10(%rbp),%eax
sub    $0x73,%eax
je     1192 <parnam+0x92>
jmp    11b2 <parnam+0xb2>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <parnam+0xbd>
lea    0xe8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <parnam+0xbd>
lea    0xe80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <parnam+0xbd>
lea    0xe75(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <parnam+0xbd>
lea    0xe6b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <parnam+0xbd>
lea    0xe60(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parnam>:
lea    -0x65(%rdi),%ecx
cmp    $0xe,%ecx
ja     1127 <parnam+0x27>
lea    0xf2d(%rip),%rax
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf1f(%rip),%rax
ret
test   %edi,%edi
jne    1133 <parnam+0x33>
lea    0xf1e(%rip),%rax
ret
lea    0xf1b(%rip),%rax
ret
lea    0xeff(%rip),%rax
ret
lea    0xf00(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"even\00"
@.str.1 = [4 x i8] c"odd\00"
@.str.2 = [5 x i8] c"mark\00"
@.str.3 = [6 x i8] c"space\00"
@.str.4 = [5 x i8] c"none\00"
@.str.5 = [8 x i8] c"invalid\00"
define i8* @parnam(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 101, label %6
i32 111, label %7
i32 109, label %8
i32 115, label %9
i32 0, label %10
]
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"even\00"
@.str.1 = [4 x i8] c"odd\00"
@.str.2 = [5 x i8] c"mark\00"
@.str.3 = [6 x i8] c"space\00"
@.str.4 = [5 x i8] c"none\00"
@.str.5 = [8 x i8] c"invalid\00"
define i8* @parnam(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 101, label %8
i32 111, label %3
i32 109, label %4
i32 115, label %5
i32 0, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}