const char *vohttpd_code_message(int code) {
  switch (code) {
  case 200:
    return "OK";
  case 403:
    return "Forbidden";
  case 404:
    return "Not Found";
  case 405:
    return "Access Denied";
  case 413:
    return "Request too large";
  case 501:
    return "Not Implemented";
  default:
    return "Unknown";
  }
}


x86 assembly (clang, -O0):
<vohttpd_code_message>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xc8,%eax
je     117c <vohttpd_code_message+0x7c>
jmp    111d <vohttpd_code_message+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x193,%eax
je     118c <vohttpd_code_message+0x8c>
jmp    1130 <vohttpd_code_message+0x30>
mov    -0x10(%rbp),%eax
sub    $0x194,%eax
je     119c <vohttpd_code_message+0x9c>
jmp    1143 <vohttpd_code_message+0x43>
mov    -0x10(%rbp),%eax
sub    $0x195,%eax
je     11ac <vohttpd_code_message+0xac>
jmp    1156 <vohttpd_code_message+0x56>
mov    -0x10(%rbp),%eax
sub    $0x19d,%eax
je     11bc <vohttpd_code_message+0xbc>
jmp    1169 <vohttpd_code_message+0x69>
mov    -0x10(%rbp),%eax
sub    $0x1f5,%eax
je     11cc <vohttpd_code_message+0xcc>
jmp    11dc <vohttpd_code_message+0xdc>
lea    0xe7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <vohttpd_code_message+0xe7>
lea    0xe70(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <vohttpd_code_message+0xe7>
lea    0xe6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <vohttpd_code_message+0xe7>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <vohttpd_code_message+0xe7>
lea    0xe62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <vohttpd_code_message+0xe7>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <vohttpd_code_message+0xe7>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vohttpd_code_message>:
lea    -0x193(%rdi),%eax
cmp    $0xa,%eax
ja     1123 <vohttpd_code_message+0x23>
lea    0xeee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf0d(%rip),%rax
ret
cmp    $0xc8,%edi
je     115b <vohttpd_code_message+0x5b>
cmp    $0x1f5,%edi
jne    113b <vohttpd_code_message+0x3b>
lea    0xf29(%rip),%rax
ret
lea    0xf31(%rip),%rax
ret
lea    0xeef(%rip),%rax
ret
lea    0xef1(%rip),%rax
ret
lea    0xef7(%rip),%rax
ret
lea    0xeca(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [10 x i8] c"Forbidden\00"
@.str.2 = [10 x i8] c"Not Found\00"
@.str.3 = [14 x i8] c"Access Denied\00"
@.str.4 = [18 x i8] c"Request too large\00"
@.str.5 = [16 x i8] c"Not Implemented\00"
@.str.6 = [8 x i8] c"Unknown\00"
define i8* @vohttpd_code_message(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 200, label %5
i32 403, label %6
i32 404, label %7
i32 405, label %8
i32 413, label %9
i32 501, label %10
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
8: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %12
9: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [10 x i8] c"Forbidden\00"
@.str.2 = [10 x i8] c"Not Found\00"
@.str.3 = [14 x i8] c"Access Denied\00"
@.str.4 = [18 x i8] c"Request too large\00"
@.str.5 = [16 x i8] c"Not Implemented\00"
@.str.6 = [8 x i8] c"Unknown\00"
define i8* @vohttpd_code_message(i32 %0) {
switch i32 %0, label %7 [
i32 200, label %8
i32 403, label %2
i32 404, label %3
i32 405, label %4
i32 413, label %5
i32 501, label %6
]
2: ; preds = %1
br label %8
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, %2
%9 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}