const char *status_code_to_str(int status_code) {
  switch (status_code) {
  case 200:
    return "OK";
  case 201:
    return "Created";
  case 204:
    return "No Content";
  case 301:
    return "Moved Permanently";
  case 302:
    return "Found";
  case 304:
    return "Not Modified";
  case 400:
    return "Bad Request";
  case 403:
    return "Forbidden";
  case 404:
    return "Not Found";
  case 405:
    return "Method Not Allowed";
  case 409:
    return "Conflict";
  case 411:
    return "Length Required";
  case 413:
    return "Request Entity Too Large";
  case 415:
    return "Unsupported Media Type";
  case 423:
    return "Locked";
  case 500:
    return "Server Error";
  case 501:
    return "Not Implemented";
  default:
    return "Server Error";
  }
}


x86 assembly (clang, -O0):
<status_code_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xc8,%eax
je     124d <status_code_to_str+0x14d>
jmp    111d <status_code_to_str+0x1d>
mov    -0x10(%rbp),%eax
sub    $0xc9,%eax
je     125d <status_code_to_str+0x15d>
jmp    1130 <status_code_to_str+0x30>
mov    -0x10(%rbp),%eax
sub    $0xcc,%eax
je     126d <status_code_to_str+0x16d>
jmp    1143 <status_code_to_str+0x43>
mov    -0x10(%rbp),%eax
sub    $0x12d,%eax
je     127d <status_code_to_str+0x17d>
jmp    1156 <status_code_to_str+0x56>
mov    -0x10(%rbp),%eax
sub    $0x12e,%eax
je     128d <status_code_to_str+0x18d>
jmp    1169 <status_code_to_str+0x69>
mov    -0x10(%rbp),%eax
sub    $0x130,%eax
je     129d <status_code_to_str+0x19d>
jmp    117c <status_code_to_str+0x7c>
mov    -0x10(%rbp),%eax
sub    $0x190,%eax
je     12ad <status_code_to_str+0x1ad>
jmp    118f <status_code_to_str+0x8f>
mov    -0x10(%rbp),%eax
sub    $0x193,%eax
je     12bd <status_code_to_str+0x1bd>
jmp    11a2 <status_code_to_str+0xa2>
mov    -0x10(%rbp),%eax
sub    $0x194,%eax
je     12cd <status_code_to_str+0x1cd>
jmp    11b5 <status_code_to_str+0xb5>
mov    -0x10(%rbp),%eax
sub    $0x195,%eax
je     12dd <status_code_to_str+0x1dd>
jmp    11c8 <status_code_to_str+0xc8>
mov    -0x10(%rbp),%eax
sub    $0x199,%eax
je     12ed <status_code_to_str+0x1ed>
jmp    11db <status_code_to_str+0xdb>
mov    -0x10(%rbp),%eax
sub    $0x19b,%eax
je     12fd <status_code_to_str+0x1fd>
jmp    11ee <status_code_to_str+0xee>
mov    -0x10(%rbp),%eax
sub    $0x19d,%eax
je     130d <status_code_to_str+0x20d>
jmp    1201 <status_code_to_str+0x101>
mov    -0x10(%rbp),%eax
sub    $0x19f,%eax
je     131d <status_code_to_str+0x21d>
jmp    1214 <status_code_to_str+0x114>
mov    -0x10(%rbp),%eax
sub    $0x1a7,%eax
je     132d <status_code_to_str+0x22d>
jmp    1227 <status_code_to_str+0x127>
mov    -0x10(%rbp),%eax
sub    $0x1f4,%eax
je     133d <status_code_to_str+0x23d>
jmp    123a <status_code_to_str+0x13a>
mov    -0x10(%rbp),%eax
sub    $0x1f5,%eax
je     134d <status_code_to_str+0x24d>
jmp    135d <status_code_to_str+0x25d>
lea    0xdac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd92(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xdbb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd84(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd77(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd71(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd74(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd76(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd74(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd71(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1368 <status_code_to_str+0x268>
lea    0xd54(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_code_to_str>:
cmp    $0x12d,%edi
jle    112b <status_code_to_str+0x2b>
lea    -0x190(%rdi),%eax
cmp    $0x65,%eax
ja     1163 <status_code_to_str+0x63>
lea    0xee6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x10a3(%rip),%rax
ret
cmp    $0xcb,%edi
jg     114b <status_code_to_str+0x4b>
cmp    $0xc8,%edi
je     1183 <status_code_to_str+0x83>
cmp    $0xc9,%edi
jne    117b <status_code_to_str+0x7b>
lea    0x1051(%rip),%rax
ret
cmp    $0xcc,%edi
je     118b <status_code_to_str+0x8b>
cmp    $0x12d,%edi
jne    117b <status_code_to_str+0x7b>
lea    0x104c(%rip),%rax
ret
cmp    $0x12e,%edi
je     11db <status_code_to_str+0xdb>
cmp    $0x130,%edi
jne    117b <status_code_to_str+0x7b>
lea    0x1046(%rip),%rax
ret
lea    0x10ce(%rip),%rax
ret
lea    0x100e(%rip),%rax
ret
lea    0x1011(%rip),%rax
ret
lea    0x103f(%rip),%rax
ret
lea    0x1041(%rip),%rax
ret
lea    0x1043(%rip),%rax
ret
lea    0x104e(%rip),%rax
ret
lea    0x104f(%rip),%rax
ret
lea    0x1057(%rip),%rax
ret
lea    0x1068(%rip),%rax
ret
lea    0x1077(%rip),%rax
ret
lea    0x1083(%rip),%rax
ret
lea    0x1005(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [8 x i8] c"Created\00"
@.str.2 = [11 x i8] c"No Content\00"
@.str.3 = [18 x i8] c"Moved Permanently\00"
@.str.4 = [6 x i8] c"Found\00"
@.str.5 = [13 x i8] c"Not Modified\00"
@.str.6 = [12 x i8] c"Bad Request\00"
@.str.7 = [10 x i8] c"Forbidden\00"
@.str.8 = [10 x i8] c"Not Found\00"
@.str.9 = [19 x i8] c"Method Not Allowed\00"
@.str.10 = [9 x i8] c"Conflict\00"
@.str.11 = [16 x i8] c"Length Required\00"
@.str.12 = [25 x i8] c"Request Entity Too Large\00"
@.str.13 = [23 x i8] c"Unsupported Media Type\00"
@.str.14 = [7 x i8] c"Locked\00"
@.str.15 = [13 x i8] c"Server Error\00"
@.str.16 = [16 x i8] c"Not Implemented\00"
define i8* @status_code_to_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %22 [
i32 200, label %5
i32 201, label %6
i32 204, label %7
i32 301, label %8
i32 302, label %9
i32 304, label %10
i32 400, label %11
i32 403, label %12
i32 404, label %13
i32 405, label %14
i32 409, label %15
i32 411, label %16
i32 413, label %17
i32 415, label %18
i32 423, label %19
i32 500, label %20
i32 501, label %21
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %23
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %23
7: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %23
8: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %23
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %23
10: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %23
11: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %23
12: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %23
16: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %23
17: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %23
18: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %23
19: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %23
20: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %23
21: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %23
22: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %23
23: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [8 x i8] c"Created\00"
@.str.2 = [11 x i8] c"No Content\00"
@.str.3 = [18 x i8] c"Moved Permanently\00"
@.str.4 = [6 x i8] c"Found\00"
@.str.5 = [13 x i8] c"Not Modified\00"
@.str.6 = [12 x i8] c"Bad Request\00"
@.str.7 = [10 x i8] c"Forbidden\00"
@.str.8 = [10 x i8] c"Not Found\00"
@.str.9 = [19 x i8] c"Method Not Allowed\00"
@.str.10 = [9 x i8] c"Conflict\00"
@.str.11 = [16 x i8] c"Length Required\00"
@.str.12 = [25 x i8] c"Request Entity Too Large\00"
@.str.13 = [23 x i8] c"Unsupported Media Type\00"
@.str.14 = [7 x i8] c"Locked\00"
@.str.15 = [13 x i8] c"Server Error\00"
@.str.16 = [16 x i8] c"Not Implemented\00"
define i8* @status_code_to_str(i32 %0) {
switch i32 %0, label %18 [
i32 200, label %19
i32 201, label %2
i32 204, label %3
i32 301, label %4
i32 302, label %5
i32 304, label %6
i32 400, label %7
i32 403, label %8
i32 404, label %9
i32 405, label %10
i32 409, label %11
i32 411, label %12
i32 413, label %13
i32 415, label %14
i32 423, label %15
i32 500, label %16
i32 501, label %17
]
2: ; preds = %1
br label %19
3: ; preds = %1
br label %19
4: ; preds = %1
br label %19
5: ; preds = %1
br label %19
6: ; preds = %1
br label %19
7: ; preds = %1
br label %19
8: ; preds = %1
br label %19
9: ; preds = %1
br label %19
10: ; preds = %1
br label %19
11: ; preds = %1
br label %19
12: ; preds = %1
br label %19
13: ; preds = %1
br label %19
14: ; preds = %1
br label %19
15: ; preds = %1
br label %19
16: ; preds = %1
br label %19
17: ; preds = %1
br label %19
18: ; preds = %1
br label %19
19: ; preds = %1, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%20 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), %18 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 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* %20
}