char *obex_response_to_string(int rsp) {
  switch (rsp) {
  case 0x10:
    return "Continue";
  case 0x11:
    return "Switching protocols";
  case 0x20:
    return "OK, Success";
  case 0x21:
    return "Created";
  case 0x22:
    return "Accepted";
  case 0x24:
    return "No Content";
  case 0x40:
    return "Bad Request";
  case 0x41:
    return "Unautorized";
  case 0x42:
    return "Payment required";
  case 0x43:
    return "Forbidden";
  case 0x44:
    return "Not found";
  case 0x45:
    return "Method not allowed";
  case 0x49:
    return "Conflict";
  case 0x50:
    return "Internal server error";
  case 0x51:
    return "Not implemented!";
  case 0x60:
    return "Database full";
  case 0x61:
    return "Database locked";
  default:
    return "Unknown response";
  }
}


x86 assembly (clang, -O0):
<obex_response_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffff0,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x51,%eax
ja     1240 <obex_response_to_string+0x140>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1011(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0x100a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0x100e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0x100a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0x1002(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xffb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xff6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xff2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfee(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfef(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfdf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    124b <obex_response_to_string+0x14b>
lea    0xfe4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<obex_response_to_string>:
add    $0xfffffff0,%edi
cmp    $0x51,%edi
ja     1127 <obex_response_to_string+0x27>
lea    0x1039(%rip),%rax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x102b(%rip),%rax
ret
lea    0x10fd(%rip),%rax
ret
lea    0x102f(%rip),%rax
ret
lea    0x1033(%rip),%rax
ret
lea    0x1033(%rip),%rax
ret
lea    0x1034(%rip),%rax
ret
lea    0x1037(%rip),%rax
ret
lea    0x103b(%rip),%rax
ret
lea    0x103f(%rip),%rax
ret
lea    0x1048(%rip),%rax
ret
lea    0x104a(%rip),%rax
ret
lea    0x104c(%rip),%rax
ret
lea    0x1057(%rip),%rax
ret
lea    0x1058(%rip),%rax
ret
lea    0x1066(%rip),%rax
ret
lea    0x106f(%rip),%rax
ret
lea    0x1075(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Continue\00"
@.str.1 = [20 x i8] c"Switching protocols\00"
@.str.2 = [12 x i8] c"OK, Success\00"
@.str.3 = [8 x i8] c"Created\00"
@.str.4 = [9 x i8] c"Accepted\00"
@.str.5 = [11 x i8] c"No Content\00"
@.str.6 = [12 x i8] c"Bad Request\00"
@.str.7 = [12 x i8] c"Unautorized\00"
@.str.8 = [17 x i8] c"Payment required\00"
@.str.9 = [10 x i8] c"Forbidden\00"
@.str.10 = [10 x i8] c"Not found\00"
@.str.11 = [19 x i8] c"Method not allowed\00"
@.str.12 = [9 x i8] c"Conflict\00"
@.str.13 = [22 x i8] c"Internal server error\00"
@.str.14 = [17 x i8] c"Not implemented!\00"
@.str.15 = [14 x i8] c"Database full\00"
@.str.16 = [16 x i8] c"Database locked\00"
@.str.17 = [17 x i8] c"Unknown response\00"
define i8* @obex_response_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %22 [
i32 16, label %5
i32 17, label %6
i32 32, label %7
i32 33, label %8
i32 34, label %9
i32 36, label %10
i32 64, label %11
i32 65, label %12
i32 66, label %13
i32 67, label %14
i32 68, label %15
i32 69, label %16
i32 73, label %17
i32 80, label %18
i32 81, label %19
i32 96, label %20
i32 97, label %21
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %23
6: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %23
7: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %23
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %23
9: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %23
10: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 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 ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %23
16: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %23
17: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %23
18: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %23
19: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %23
20: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 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 ([17 x i8], [17 x i8]* @.str.17, 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 = [9 x i8] c"Continue\00"
@.str.1 = [20 x i8] c"Switching protocols\00"
@.str.2 = [12 x i8] c"OK, Success\00"
@.str.3 = [8 x i8] c"Created\00"
@.str.4 = [9 x i8] c"Accepted\00"
@.str.5 = [11 x i8] c"No Content\00"
@.str.6 = [12 x i8] c"Bad Request\00"
@.str.7 = [12 x i8] c"Unautorized\00"
@.str.8 = [17 x i8] c"Payment required\00"
@.str.9 = [10 x i8] c"Forbidden\00"
@.str.10 = [10 x i8] c"Not found\00"
@.str.11 = [19 x i8] c"Method not allowed\00"
@.str.12 = [9 x i8] c"Conflict\00"
@.str.13 = [22 x i8] c"Internal server error\00"
@.str.14 = [17 x i8] c"Not implemented!\00"
@.str.15 = [14 x i8] c"Database full\00"
@.str.16 = [16 x i8] c"Database locked\00"
@.str.17 = [17 x i8] c"Unknown response\00"
define i8* @obex_response_to_string(i32 %0) {
switch i32 %0, label %18 [
i32 16, label %19
i32 17, label %2
i32 32, label %3
i32 33, label %4
i32 34, label %5
i32 36, label %6
i32 64, label %7
i32 65, label %8
i32 66, label %9
i32 67, label %10
i32 68, label %11
i32 69, label %12
i32 73, label %13
i32 80, label %14
i32 81, label %15
i32 96, label %16
i32 97, 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 ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([12 x i8], [12 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 ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 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 ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %20
}