char *getStatusCodeName(int code) {
  switch (code) {
  case 200:
    return "OK";
  case 400:
    return "Bad Request";
  case 404:
    return "Not Found";
  case 405:
    return "Method Not Allowed";
  case 500:
    return "Internal Server Error";
  case 501:
    return "Not Implemented";
  case 505:
    return "HTTP Version Not Supported";
  default:
    return "";
  }
}


x86 assembly (clang, -O0):
<getStatusCodeName>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xc8,%eax
je     118f <getStatusCodeName+0x8f>
jmp    111d <getStatusCodeName+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x190,%eax
je     119f <getStatusCodeName+0x9f>
jmp    1130 <getStatusCodeName+0x30>
mov    -0x10(%rbp),%eax
sub    $0x194,%eax
je     11af <getStatusCodeName+0xaf>
jmp    1143 <getStatusCodeName+0x43>
mov    -0x10(%rbp),%eax
sub    $0x195,%eax
je     11bf <getStatusCodeName+0xbf>
jmp    1156 <getStatusCodeName+0x56>
mov    -0x10(%rbp),%eax
sub    $0x1f4,%eax
je     11cf <getStatusCodeName+0xcf>
jmp    1169 <getStatusCodeName+0x69>
mov    -0x10(%rbp),%eax
sub    $0x1f5,%eax
je     11df <getStatusCodeName+0xdf>
jmp    117c <getStatusCodeName+0x7c>
mov    -0x10(%rbp),%eax
sub    $0x1f9,%eax
je     11ef <getStatusCodeName+0xef>
jmp    11ff <getStatusCodeName+0xff>
lea    0xe6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xe5d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xe59(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xe53(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xe5c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xe5c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120a <getStatusCodeName+0x10a>
lea    0xdfc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStatusCodeName>:
cmp    $0x194,%edi
jle    1128 <getStatusCodeName+0x28>
cmp    $0x1f4,%edi
jg     1148 <getStatusCodeName+0x48>
cmp    $0x195,%edi
je     1160 <getStatusCodeName+0x60>
cmp    $0x1f4,%edi
jne    1178 <getStatusCodeName+0x78>
lea    0xf05(%rip),%rax
ret
cmp    $0xc8,%edi
je     1168 <getStatusCodeName+0x68>
cmp    $0x190,%edi
je     1180 <getStatusCodeName+0x80>
cmp    $0x194,%edi
jne    1178 <getStatusCodeName+0x78>
lea    0xec8(%rip),%rax
ret
cmp    $0x1f5,%edi
je     1170 <getStatusCodeName+0x70>
cmp    $0x1f9,%edi
jne    1178 <getStatusCodeName+0x78>
lea    0xef3(%rip),%rax
ret
lea    0xeb2(%rip),%rax
ret
lea    0xe91(%rip),%rax
ret
lea    0xecb(%rip),%rax
ret
lea    0xe83(%rip),%rax
ret
lea    0xe7c(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [12 x i8] c"Bad Request\00"
@.str.2 = [10 x i8] c"Not Found\00"
@.str.3 = [19 x i8] c"Method Not Allowed\00"
@.str.4 = [22 x i8] c"Internal Server Error\00"
@.str.5 = [16 x i8] c"Not Implemented\00"
@.str.6 = [27 x i8] c"HTTP Version Not Supported\00"
@.str.7 = [1 x i8] zeroinitializer
define i8* @getStatusCodeName(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 200, label %5
i32 400, label %6
i32 404, label %7
i32 405, label %8
i32 500, label %9
i32 501, label %10
i32 505, label %11
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %13
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %13
8: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %13
9: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %13
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %13
11: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %13
12: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [12 x i8] c"Bad Request\00"
@.str.2 = [10 x i8] c"Not Found\00"
@.str.3 = [19 x i8] c"Method Not Allowed\00"
@.str.4 = [22 x i8] c"Internal Server Error\00"
@.str.5 = [16 x i8] c"Not Implemented\00"
@.str.6 = [27 x i8] c"HTTP Version Not Supported\00"
@.str.7 = [1 x i8] zeroinitializer
define i8* @getStatusCodeName(i32 %0) {
switch i32 %0, label %8 [
i32 200, label %9
i32 400, label %2
i32 404, label %3
i32 405, label %4
i32 500, label %5
i32 501, label %6
i32 505, label %7
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3, %2
%10 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([27 x i8], [27 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 ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([19 x i8], [19 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 ([12 x i8], [12 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* %10
}