#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
const char *reason(unsigned short code) {
  switch (code) {
  case 200:
    return "OK";
  case 301:
    return "Moved Permanently";
  case 400:
    return "Bad Request";
  case 403:
    return "Forbidden";
  case 404:
    return "Not Found";
  case 405:
    return "Method Not Allowed";
  case 414:
    return "Request-URI Too Long";
  case 418:
    return "I'm a teapot";
  case 500:
    return "Internal Server Error";
  case 501:
    return "Not Implemented";
  case 505:
    return "HTTP Version Not Supported";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<reason>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xc8,%eax
je     11e0 <reason+0xe0>
jmp    1122 <reason+0x22>
mov    -0x10(%rbp),%eax
sub    $0x12d,%eax
je     11f0 <reason+0xf0>
jmp    1135 <reason+0x35>
mov    -0x10(%rbp),%eax
sub    $0x190,%eax
je     1200 <reason+0x100>
jmp    1148 <reason+0x48>
mov    -0x10(%rbp),%eax
sub    $0x193,%eax
je     1210 <reason+0x110>
jmp    115b <reason+0x5b>
mov    -0x10(%rbp),%eax
sub    $0x194,%eax
je     1220 <reason+0x120>
jmp    116e <reason+0x6e>
mov    -0x10(%rbp),%eax
sub    $0x195,%eax
je     1230 <reason+0x130>
jmp    1181 <reason+0x81>
mov    -0x10(%rbp),%eax
sub    $0x19e,%eax
je     1240 <reason+0x140>
jmp    1194 <reason+0x94>
mov    -0x10(%rbp),%eax
sub    $0x1a2,%eax
je     1250 <reason+0x150>
jmp    11a7 <reason+0xa7>
mov    -0x10(%rbp),%eax
sub    $0x1f4,%eax
je     1260 <reason+0x160>
jmp    11ba <reason+0xba>
mov    -0x10(%rbp),%eax
sub    $0x1f5,%eax
je     1270 <reason+0x170>
jmp    11cd <reason+0xcd>
mov    -0x10(%rbp),%eax
sub    $0x1f9,%eax
je     1280 <reason+0x180>
jmp    1290 <reason+0x190>
lea    0xe19(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe0c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe0e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe0a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe04(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xdfe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe01(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe03(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe09(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
lea    0xe09(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1298 <reason+0x198>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reason>:
movswl %di,%eax
cmp    $0x1f3,%eax
jg     1131 <reason+0x31>
lea    -0x190(%rdi),%eax
cmp    $0x12,%ax
ja     1151 <reason+0x51>
movzwl %ax,%eax
lea    0xee0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf31(%rip),%rax
ret
movzwl %di,%eax
cmp    $0x1f4,%eax
je     1195 <reason+0x95>
cmp    $0x1f5,%eax
je     119d <reason+0x9d>
cmp    $0x1f9,%eax
jne    1192 <reason+0x92>
lea    0xf8c(%rip),%rax
ret
movzwl %di,%eax
cmp    $0xc8,%eax
je     11a5 <reason+0xa5>
cmp    $0x12d,%eax
jne    1192 <reason+0x92>
lea    0xee6(%rip),%rax
ret
lea    0xefc(%rip),%rax
ret
lea    0xefe(%rip),%rax
ret
lea    0xf00(%rip),%rax
ret
lea    0xf0b(%rip),%rax
ret
lea    0xf18(%rip),%rax
ret
xor    %eax,%eax
ret
lea    0xf1a(%rip),%rax
ret
lea    0xf28(%rip),%rax
ret
lea    0xea0(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [18 x i8] c"Moved Permanently\00"
@.str.2 = [12 x i8] c"Bad Request\00"
@.str.3 = [10 x i8] c"Forbidden\00"
@.str.4 = [10 x i8] c"Not Found\00"
@.str.5 = [19 x i8] c"Method Not Allowed\00"
@.str.6 = [21 x i8] c"Request-URI Too Long\00"
@.str.7 = [13 x i8] c"I'm a teapot\00"
@.str.8 = [22 x i8] c"Internal Server Error\00"
@.str.9 = [16 x i8] c"Not Implemented\00"
@.str.10 = [27 x i8] c"HTTP Version Not Supported\00"
define i8* @reason(i16 zeroext %0) {
%2 = alloca i8*
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
switch i32 %5, label %17 [
i32 200, label %6
i32 301, label %7
i32 400, label %8
i32 403, label %9
i32 404, label %10
i32 405, label %11
i32 414, label %12
i32 418, label %13
i32 500, label %14
i32 501, label %15
i32 505, label %16
]
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
7: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %18
8: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %18
9: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %18
10: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %18
11: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %18
12: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %18
13: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %18
14: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %18
15: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %18
16: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %18
17: ; preds = %1
store i8* null, i8** %2
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [18 x i8] c"Moved Permanently\00"
@.str.2 = [12 x i8] c"Bad Request\00"
@.str.3 = [10 x i8] c"Forbidden\00"
@.str.4 = [10 x i8] c"Not Found\00"
@.str.5 = [19 x i8] c"Method Not Allowed\00"
@.str.6 = [21 x i8] c"Request-URI Too Long\00"
@.str.7 = [13 x i8] c"I'm a teapot\00"
@.str.8 = [22 x i8] c"Internal Server Error\00"
@.str.9 = [16 x i8] c"Not Implemented\00"
@.str.10 = [27 x i8] c"HTTP Version Not Supported\00"
define i8* @reason(i16 zeroext %0) {
switch i16 %0, label %12 [
i16 200, label %13
i16 301, label %2
i16 400, label %3
i16 403, label %4
i16 404, label %5
i16 405, label %6
i16 414, label %7
i16 418, label %8
i16 500, label %9
i16 501, label %10
i16 505, label %11
]
2: ; preds = %1
br label %13
3: ; preds = %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%14 = phi i8* [ null, %12 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([10 x i8], [10 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 ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([18 x i8], [18 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* %14
}