#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 */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void get_status_msg(int code, char msg[]) {
  bzero(msg, 8192);
  switch (code) {
  case 200:
    strcpy(msg, "OK");
    break;
  case 304:
    strcpy(msg, "Not Modified");
    break;
  case 400:
    strcpy(msg, "Bad Request");
    break;
  case 403:
    strcpy(msg, "Forbidden");
    break;
  case 404:
    strcpy(msg, "Not Found");
    break;
  case 408:
    strcpy(msg, "Request Timeout");
    break;
  case 501:
    strcpy(msg, "Not Implemented");
    break;
  case 505:
    strcpy(msg, "Version Not Support");
    break;
  case 522:
    strcpy(msg, "Connection Timed Out");
    break;
  default:
    strcpy(msg, "Unrecognized Statues");
    break;
  }
}


x86 assembly (clang, -O0):
<get_status_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2000,%esi
call   1040 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0xc8,%eax
je     11eb <get_status_msg+0xcb>
jmp    1153 <get_status_msg+0x33>
mov    -0x14(%rbp),%eax
sub    $0x130,%eax
je     1200 <get_status_msg+0xe0>
jmp    1166 <get_status_msg+0x46>
mov    -0x14(%rbp),%eax
sub    $0x190,%eax
je     1215 <get_status_msg+0xf5>
jmp    1179 <get_status_msg+0x59>
mov    -0x14(%rbp),%eax
sub    $0x193,%eax
je     122a <get_status_msg+0x10a>
jmp    118c <get_status_msg+0x6c>
mov    -0x14(%rbp),%eax
sub    $0x194,%eax
je     123f <get_status_msg+0x11f>
jmp    119f <get_status_msg+0x7f>
mov    -0x14(%rbp),%eax
sub    $0x198,%eax
je     1254 <get_status_msg+0x134>
jmp    11b2 <get_status_msg+0x92>
mov    -0x14(%rbp),%eax
sub    $0x1f5,%eax
je     1269 <get_status_msg+0x149>
jmp    11c5 <get_status_msg+0xa5>
mov    -0x14(%rbp),%eax
sub    $0x1f9,%eax
je     127e <get_status_msg+0x15e>
jmp    11d8 <get_status_msg+0xb8>
mov    -0x14(%rbp),%eax
sub    $0x20a,%eax
je     1293 <get_status_msg+0x173>
jmp    12a8 <get_status_msg+0x188>
mov    -0x10(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdf0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xddc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdcc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdc6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b8 <get_status_msg+0x198>
mov    -0x10(%rbp),%rdi
lea    0xdc6(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_status_msg>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rsi,%rdi
mov    $0x2000,%esi
call   1040 <bzero@plt>
cmp    $0x1f4,%ebx
jg     1162 <get_status_msg+0x42>
lea    -0x190(%rbx),%eax
cmp    $0x8,%eax
ja     1183 <get_status_msg+0x63>
lea    0xeb0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed4(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
cmp    $0x1f5,%ebx
je     11c0 <get_status_msg+0xa0>
cmp    $0x1f9,%ebx
je     11c9 <get_status_msg+0xa9>
cmp    $0x20a,%ebx
jne    11b7 <get_status_msg+0x97>
lea    0xf07(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
cmp    $0xc8,%ebx
je     11d2 <get_status_msg+0xb2>
cmp    $0x130,%ebx
jne    11b7 <get_status_msg+0x97>
lea    0xe8d(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xe9d(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xe9e(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xe9f(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xedf(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xe9d(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xea4(%rip),%rsi
jmp    11d9 <get_status_msg+0xb9>
lea    0xe4b(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [13 x i8] c"Not Modified\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 = [16 x i8] c"Request Timeout\00"
@.str.6 = [16 x i8] c"Not Implemented\00"
@.str.7 = [20 x i8] c"Version Not Support\00"
@.str.8 = [21 x i8] c"Connection Timed Out\00"
@.str.9 = [21 x i8] c"Unrecognized Statues\00"
define void @get_status_msg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @bzero(i8* %5, i32 8192)
%7 = load i32, i32* %3
switch i32 %7, label %35 [
i32 200, label %8
i32 304, label %11
i32 400, label %14
i32 403, label %17
i32 404, label %20
i32 408, label %23
i32 501, label %26
i32 505, label %29
i32 522, label %32
]
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %38
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %38
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %38
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %38
20: ; preds = %2
%21 = load i8*, i8** %4
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %38
23: ; preds = %2
%24 = load i8*, i8** %4
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %38
26: ; preds = %2
%27 = load i8*, i8** %4
%28 = call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %38
29: ; preds = %2
%30 = load i8*, i8** %4
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
br label %38
32: ; preds = %2
%33 = load i8*, i8** %4
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %38
35: ; preds = %2
%36 = load i8*, i8** %4
%37 = call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %38
38: ; preds = %35, %32, %29, %26, %23, %20, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [13 x i8] c"Not Modified\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 = [16 x i8] c"Request Timeout\00"
@.str.6 = [16 x i8] c"Not Implemented\00"
@.str.7 = [20 x i8] c"Version Not Support\00"
@.str.8 = [21 x i8] c"Connection Timed Out\00"
@.str.9 = [21 x i8] c"Unrecognized Statues\00"
define void @get_status_msg(i32 %0, i8* %1) {
%3 = tail call i32 @bzero(i8* %1, i32 8192)
switch i32 %0, label %12 [
i32 200, label %13
i32 304, label %4
i32 400, label %5
i32 403, label %6
i32 404, label %7
i32 408, label %8
i32 501, label %9
i32 505, label %10
i32 522, label %11
]
4: ; preds = %2
br label %13
5: ; preds = %2
br label %13
6: ; preds = %2
br label %13
7: ; preds = %2
br label %13
8: ; preds = %2
br label %13
9: ; preds = %2
br label %13
10: ; preds = %2
br label %13
11: ; preds = %2
br label %13
12: ; preds = %2
br label %13
13: ; preds = %2, %12, %11, %10, %9, %8, %7, %6, %5, %4
%14 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), %12 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), %11 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %2 ]
%15 = tail call i32 @strcpy(i8* %1, i8* %14)
ret void
}