const char *errNoToErrStr(int errNo) {
  switch (errNo) {
  case 200:
    return "OK";
  case 400:
    return "Bad Request";
  case 401:
    return "Unauthorized";
  case 404:
    return "Not Found";
  case 500:
    return "Internal Server Error";
  case 501:
    return "Not Implemented";
  case 505:
    return "HTTP Version Not Supported";
  default:
    return "For No Reason";
  }
}


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

x86 assembly (clang, -O2):
<errNoToErrStr>:
cmp    $0x193,%edi
jle    1128 <errNoToErrStr+0x28>
cmp    $0x1f4,%edi
jg     1148 <errNoToErrStr+0x48>
cmp    $0x194,%edi
je     1160 <errNoToErrStr+0x60>
cmp    $0x1f4,%edi
jne    1178 <errNoToErrStr+0x78>
lea    0xeff(%rip),%rax
ret
cmp    $0xc8,%edi
je     1168 <errNoToErrStr+0x68>
cmp    $0x190,%edi
je     1180 <errNoToErrStr+0x80>
cmp    $0x191,%edi
jne    1178 <errNoToErrStr+0x78>
lea    0xec8(%rip),%rax
ret
cmp    $0x1f5,%edi
je     1170 <errNoToErrStr+0x70>
cmp    $0x1f9,%edi
jne    1178 <errNoToErrStr+0x78>
lea    0xeed(%rip),%rax
ret
lea    0xeb5(%rip),%rax
ret
lea    0xe91(%rip),%rax
ret
lea    0xec5(%rip),%rax
ret
lea    0xee8(%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 = [13 x i8] c"Unauthorized\00"
@.str.3 = [10 x i8] c"Not Found\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 = [14 x i8] c"For No Reason\00"
define i8* @errNoToErrStr(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 401, label %7
i32 404, 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 ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %13
8: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 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 ([14 x i8], [14 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 = [13 x i8] c"Unauthorized\00"
@.str.3 = [10 x i8] c"Not Found\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 = [14 x i8] c"For No Reason\00"
define i8* @errNoToErrStr(i32 %0) {
switch i32 %0, label %8 [
i32 200, label %9
i32 400, label %2
i32 401, label %3
i32 404, 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 ([14 x i8], [14 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 ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([13 x i8], [13 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
}