char *OKN_STATUS_DESC(int code) {
  switch (code) {
  case 1:
    return "success";
  case -1:
    return "internal error";
  case -2:
    return "no available memory";
  case -3:
    return "object null";
  case -4:
    return "object does not exist";
  case -5:
    return "index out of bounds";
  case -6:
    return "resource limit reached";
  case -7:
    return "reference error";
  case -8:
    return "invalid type";
  case -10:
    return "parse error";
  case -20:
    return "object state denied";
  case -50:
    return "could not open";
  case -51:
    return "could not close";
  case -52:
    return "I/O error";
  case -100:
    return "third party error";
  default:
    return "invalid error code";
  }
}


x86 assembly (clang, -O0):
<OKN_STATUS_DESC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x64,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x65,%eax
ja     1220 <OKN_STATUS_DESC+0x120>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1061(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1059(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1058(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x105c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1058(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x105e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1062(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1069(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1069(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1066(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1062(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1066(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1065(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1065(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x105f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122b <OKN_STATUS_DESC+0x12b>
lea    0x1061(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OKN_STATUS_DESC>:
add    $0x64,%edi
cmp    $0x65,%edi
ja     1127 <OKN_STATUS_DESC+0x27>
lea    0x1089(%rip),%rax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x1150(%rip),%rax
ret
lea    0x115a(%rip),%rax
ret
lea    0x1136(%rip),%rax
ret
lea    0x111e(%rip),%rax
ret
lea    0x1107(%rip),%rax
ret
lea    0x10eb(%rip),%rax
ret
lea    0x10d7(%rip),%rax
ret
lea    0x10c2(%rip),%rax
ret
lea    0x1093(%rip),%rax
ret
lea    0x1077(%rip),%rax
ret
lea    0x1059(%rip),%rax
ret
lea    0x1045(%rip),%rax
ret
lea    0x1029(%rip),%rax
ret
lea    0x1012(%rip),%rax
ret
lea    0x107a(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"success\00"
@.str.1 = [15 x i8] c"internal error\00"
@.str.2 = [20 x i8] c"no available memory\00"
@.str.3 = [12 x i8] c"object null\00"
@.str.4 = [22 x i8] c"object does not exist\00"
@.str.5 = [20 x i8] c"index out of bounds\00"
@.str.6 = [23 x i8] c"resource limit reached\00"
@.str.7 = [16 x i8] c"reference error\00"
@.str.8 = [13 x i8] c"invalid type\00"
@.str.9 = [12 x i8] c"parse error\00"
@.str.10 = [20 x i8] c"object state denied\00"
@.str.11 = [15 x i8] c"could not open\00"
@.str.12 = [16 x i8] c"could not close\00"
@.str.13 = [10 x i8] c"I/O error\00"
@.str.14 = [18 x i8] c"third party error\00"
@.str.15 = [19 x i8] c"invalid error code\00"
define i8* @OKN_STATUS_DESC(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %20 [
i32 1, label %5
i32 -1, label %6
i32 -2, label %7
i32 -3, label %8
i32 -4, label %9
i32 -5, label %10
i32 -6, label %11
i32 -7, label %12
i32 -8, label %13
i32 -10, label %14
i32 -20, label %15
i32 -50, label %16
i32 -51, label %17
i32 -52, label %18
i32 -100, label %19
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %21
6: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %21
7: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %21
8: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %21
9: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %21
10: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %21
11: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %21
12: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %21
13: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %21
14: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %21
15: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %21
16: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %21
17: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %21
18: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %21
19: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %21
20: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %21
21: ; preds = %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@.str = [8 x i8] c"success\00"
@.str.1 = [15 x i8] c"internal error\00"
@.str.2 = [20 x i8] c"no available memory\00"
@.str.3 = [12 x i8] c"object null\00"
@.str.4 = [22 x i8] c"object does not exist\00"
@.str.5 = [20 x i8] c"index out of bounds\00"
@.str.6 = [23 x i8] c"resource limit reached\00"
@.str.7 = [16 x i8] c"reference error\00"
@.str.8 = [13 x i8] c"invalid type\00"
@.str.9 = [12 x i8] c"parse error\00"
@.str.10 = [20 x i8] c"object state denied\00"
@.str.11 = [15 x i8] c"could not open\00"
@.str.12 = [16 x i8] c"could not close\00"
@.str.13 = [10 x i8] c"I/O error\00"
@.str.14 = [18 x i8] c"third party error\00"
@.str.15 = [19 x i8] c"invalid error code\00"
define i8* @OKN_STATUS_DESC(i32 %0) {
switch i32 %0, label %16 [
i32 1, label %17
i32 -1, label %2
i32 -2, label %3
i32 -3, label %4
i32 -4, label %5
i32 -5, label %6
i32 -6, label %7
i32 -7, label %8
i32 -8, label %9
i32 -10, label %10
i32 -20, label %11
i32 -50, label %12
i32 -51, label %13
i32 -52, label %14
i32 -100, label %15
]
2: ; preds = %1
br label %17
3: ; preds = %1
br label %17
4: ; preds = %1
br label %17
5: ; preds = %1
br label %17
6: ; preds = %1
br label %17
7: ; preds = %1
br label %17
8: ; preds = %1
br label %17
9: ; preds = %1
br label %17
10: ; preds = %1
br label %17
11: ; preds = %1
br label %17
12: ; preds = %1
br label %17
13: ; preds = %1
br label %17
14: ; preds = %1
br label %17
15: ; preds = %1
br label %17
16: ; preds = %1
br label %17
17: ; preds = %1, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%18 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %18
}