const char *trotRCToString(signed int rc) {
  static const char *_rcStrings[] = {"Success",
                                     "Precondition Error",
                                     "Memory Allocation Error",
                                     "Standard Library Error",
                                     "Failure Point Error",
                                     "Bad Index Error",
                                     "Wrong Kind Error",
                                     "List Overflow Error",
                                     "Invalid Op Error",
                                     "Bad Type Error",
                                     "Divide By Zero Error",
                                     "Decode Error",
                                     "Mem Limit Error"};
  static const char *_rcUnknown = "Unknown Error";
  if (rc >= 0 && rc <= 4) {
    return _rcStrings[rc];
  } else if (rc >= 2001 && rc <= 2008) {
    return _rcStrings[4 + rc - 2001 + 1];
  }
  return _rcUnknown;
}


x86 assembly (clang, -O0):
<trotRCToString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1133 <trotRCToString+0x33>
cmpl   $0x4,-0xc(%rbp)
jg     1133 <trotRCToString+0x33>
movslq -0xc(%rbp),%rcx
lea    0x2f0a(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <trotRCToString+0x82>
cmpl   $0x7d1,-0xc(%rbp)
jl     1172 <trotRCToString+0x72>
cmpl   $0x7d8,-0xc(%rbp)
jg     1172 <trotRCToString+0x72>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
sub    $0x7d1,%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2ecb(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <trotRCToString+0x82>
jmp    1177 <trotRCToString+0x77>
mov    0x2f1a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trotRCToString>:
cmp    $0x5,%edi
jb     1116 <trotRCToString+0x16>
lea    -0x7d1(%rdi),%eax
cmp    $0x7,%eax
ja     1127 <trotRCToString+0x27>
add    $0xfffff834,%edi
mov    %edi,%eax
lea    0xee1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xfeb(%rip),%rax
ret

LLVM IR (-O0):
@trotRCToString._rcStrings = internal global [13 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i32 0, i32 0)]
@.str = [8 x i8] c"Success\00"
@.str.1 = [19 x i8] c"Precondition Error\00"
@.str.2 = [24 x i8] c"Memory Allocation Error\00"
@.str.3 = [23 x i8] c"Standard Library Error\00"
@.str.4 = [20 x i8] c"Failure Point Error\00"
@.str.5 = [16 x i8] c"Bad Index Error\00"
@.str.6 = [17 x i8] c"Wrong Kind Error\00"
@.str.7 = [20 x i8] c"List Overflow Error\00"
@.str.8 = [17 x i8] c"Invalid Op Error\00"
@.str.9 = [15 x i8] c"Bad Type Error\00"
@.str.10 = [21 x i8] c"Divide By Zero Error\00"
@.str.11 = [13 x i8] c"Decode Error\00"
@.str.12 = [16 x i8] c"Mem Limit Error\00"
@trotRCToString._rcUnknown = internal global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i32 0, i32 0)
@.str.13 = [14 x i8] c"Unknown Error\00"
define i8* @trotRCToString(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 4
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [13 x i8*], [13 x i8*]* @trotRCToString._rcStrings, i64 0, i64 %11
%13 = load i8*, i8** %12
store i8* %13, i8** %2
br label %31
14: ; preds = %6, %1
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 2001
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 2008
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i32, i32* %3
%22 = add nsw i32 4, %21
%23 = sub nsw i32 %22, 2001
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [13 x i8*], [13 x i8*]* @trotRCToString._rcStrings, i64 0, i64 %25
%27 = load i8*, i8** %26
store i8* %27, i8** %2
br label %31
28: ; preds = %17, %14
br label %29
29: ; preds = %28
%30 = load i8*, i8** @trotRCToString._rcUnknown
store i8* %30, i8** %2
br label %31
31: ; preds = %29, %20, %9
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
@reltable.trotRCToString = internal unnamed_addr constant [13 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.1 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.2 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.3 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.4 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.5 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.6 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.7 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.8 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.9 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.10 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.11 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.12 to i64), i64 ptrtoint ([13 x i32]* @reltable.trotRCToString to i64)) to i32)]
@.str = [8 x i8] c"Success\00"
@.str.1 = [19 x i8] c"Precondition Error\00"
@.str.2 = [24 x i8] c"Memory Allocation Error\00"
@.str.3 = [23 x i8] c"Standard Library Error\00"
@.str.4 = [20 x i8] c"Failure Point Error\00"
@.str.5 = [16 x i8] c"Bad Index Error\00"
@.str.6 = [17 x i8] c"Wrong Kind Error\00"
@.str.7 = [20 x i8] c"List Overflow Error\00"
@.str.8 = [17 x i8] c"Invalid Op Error\00"
@.str.9 = [15 x i8] c"Bad Type Error\00"
@.str.10 = [21 x i8] c"Divide By Zero Error\00"
@.str.11 = [13 x i8] c"Decode Error\00"
@.str.12 = [16 x i8] c"Mem Limit Error\00"
@.str.13 = [14 x i8] c"Unknown Error\00"
define i8* @trotRCToString(i32 %0) {
%2 = icmp ult i32 %0, 5
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = add i32 %0, -2001
%5 = icmp ult i32 %4, 8
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = add nsw i32 %0, -1996
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ %0, %1 ]
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([13 x i32]* @reltable.trotRCToString to i8*), i64 %11)
br label %13
13: ; preds = %8, %3
%14 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), %3 ], [ %12, %8 ]
ret i8* %14
}