#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_phrase(int code) {
  switch (code) {
  case 200:
    return "OK"
           "\n";
  case 400:
    return "Bad Request"
           "\n";
  case 403:
    return "Forbidden"
           "\n";
  case 404:
    return "Not Found"
           "\n";
  case 405:
    return "Method Not Allowed"
           "\n";
  case 500:
    return "Internal Server Error"
           "\n";
  case 501:
    return "Not Implemetend"
           "\n";
  case 505:
    return "HTTP Version Not Supported"
           "\n";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<reason_phrase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xc8,%eax
je     11a2 <reason_phrase+0xa2>
jmp    111d <reason_phrase+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x190,%eax
je     11b2 <reason_phrase+0xb2>
jmp    1130 <reason_phrase+0x30>
mov    -0x10(%rbp),%eax
sub    $0x193,%eax
je     11c2 <reason_phrase+0xc2>
jmp    1143 <reason_phrase+0x43>
mov    -0x10(%rbp),%eax
sub    $0x194,%eax
je     11d2 <reason_phrase+0xd2>
jmp    1156 <reason_phrase+0x56>
mov    -0x10(%rbp),%eax
sub    $0x195,%eax
je     11e2 <reason_phrase+0xe2>
jmp    1169 <reason_phrase+0x69>
mov    -0x10(%rbp),%eax
sub    $0x1f4,%eax
je     11f2 <reason_phrase+0xf2>
jmp    117c <reason_phrase+0x7c>
mov    -0x10(%rbp),%eax
sub    $0x1f5,%eax
je     1202 <reason_phrase+0x102>
jmp    118f <reason_phrase+0x8f>
mov    -0x10(%rbp),%eax
sub    $0x1f9,%eax
je     1212 <reason_phrase+0x112>
jmp    1222 <reason_phrase+0x122>
lea    0xe57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe48(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe3e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe42(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe49(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
lea    0xe4a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <reason_phrase+0x12a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reason_phrase>:
cmp    $0x1f3,%edi
jg     112b <reason_phrase+0x2b>
lea    -0x190(%rdi),%eax
cmp    $0x5,%eax
ja     114b <reason_phrase+0x4b>
lea    0xee6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef2(%rip),%rax
ret
cmp    $0x1f4,%edi
je     1176 <reason_phrase+0x76>
cmp    $0x1f5,%edi
je     117e <reason_phrase+0x7e>
cmp    $0x1f9,%edi
jne    115b <reason_phrase+0x5b>
lea    0xf31(%rip),%rax
ret
cmp    $0xc8,%edi
jne    115b <reason_phrase+0x5b>
lea    0xebe(%rip),%rax
ret
xor    %eax,%eax
ret
lea    0xec4(%rip),%rax
ret
lea    0xec7(%rip),%rax
ret
lea    0xeca(%rip),%rax
ret
lea    0xed6(%rip),%rax
ret
lea    0xee5(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"OK\0A\00"
@.str.1 = [13 x i8] c"Bad Request\0A\00"
@.str.2 = [11 x i8] c"Forbidden\0A\00"
@.str.3 = [11 x i8] c"Not Found\0A\00"
@.str.4 = [20 x i8] c"Method Not Allowed\0A\00"
@.str.5 = [23 x i8] c"Internal Server Error\0A\00"
@.str.6 = [17 x i8] c"Not Implemetend\0A\00"
@.str.7 = [28 x i8] c"HTTP Version Not Supported\0A\00"
define i8* @reason_phrase(i32 %0) {
switch i32 %0, label %9 [
i32 200, label %10
i32 400, label %2
i32 403, label %3
i32 404, label %4
i32 405, label %5
i32 500, label %6
i32 501, label %7
i32 505, label %8
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i8* [ null, %9 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([11 x i8], [11 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 ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}