char *aux_StrError(int errnum) {
  static char *messages[] = {
      "(none)",
      "Forced exit",
      "Assertion failed",
      "Stack/heap collision (insufficient stack size)",
      "Array index out of bounds",
      "Invalid memory access",
      "Invalid instruction",
      "Stack underflow",
      "Heap underflow",
      "No (valid) native function callback",
      "Native function failed",
      "Divide by zero",
      "(sleep mode)",
      "Invalid state",
      "(reserved)",
      "(reserved)",
      "Out of memory",
      "Invalid/unsupported P-code file format",
      "File is for a newer version of the AMX",
      "File or function is not found",
      "Invalid index parameter (bad entry point)",
      "Debugger cannot run",
      "AMX not initialized (or doubly initialized)",
      "Unable to set user data field (table full)",
      "Cannot initialize the JIT",
      "Parameter error",
      "Domain error, expression result does not fit in range",
      "General error (unknown or unspecific error)",
      "Overlays are unsupported (JIT) or uninitialized",
  };
  if (errnum < 0 || errnum >= sizeof messages / sizeof messages[0])
    return "(unknown)";
  return messages[errnum];
}


x86 assembly (clang, -O0):
<aux_StrError>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     111f <aux_StrError+0x1f>
movslq -0xc(%rbp),%rax
cmp    $0x1d,%rax
jb     112f <aux_StrError+0x2f>
lea    0x11cb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <aux_StrError+0x42>
movslq -0xc(%rbp),%rcx
lea    0x2ef6(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux_StrError>:
cmp    $0x1c,%edi
jbe    110d <aux_StrError+0xd>
lea    0x1259(%rip),%rax
ret
mov    %edi,%eax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@aux_StrError.messages = internal global [29 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.27, i32 0, i32 0)]
@.str = [7 x i8] c"(none)\00"
@.str.1 = [12 x i8] c"Forced exit\00"
@.str.2 = [17 x i8] c"Assertion failed\00"
@.str.3 = [47 x i8] c"Stack/heap collision (insufficient stack size)\00"
@.str.4 = [26 x i8] c"Array index out of bounds\00"
@.str.5 = [22 x i8] c"Invalid memory access\00"
@.str.6 = [20 x i8] c"Invalid instruction\00"
@.str.7 = [16 x i8] c"Stack underflow\00"
@.str.8 = [15 x i8] c"Heap underflow\00"
@.str.9 = [36 x i8] c"No (valid) native function callback\00"
@.str.10 = [23 x i8] c"Native function failed\00"
@.str.11 = [15 x i8] c"Divide by zero\00"
@.str.12 = [13 x i8] c"(sleep mode)\00"
@.str.13 = [14 x i8] c"Invalid state\00"
@.str.14 = [11 x i8] c"(reserved)\00"
@.str.15 = [14 x i8] c"Out of memory\00"
@.str.16 = [39 x i8] c"Invalid/unsupported P-code file format\00"
@.str.17 = [39 x i8] c"File is for a newer version of the AMX\00"
@.str.18 = [30 x i8] c"File or function is not found\00"
@.str.19 = [42 x i8] c"Invalid index parameter (bad entry point)\00"
@.str.20 = [20 x i8] c"Debugger cannot run\00"
@.str.21 = [44 x i8] c"AMX not initialized (or doubly initialized)\00"
@.str.22 = [43 x i8] c"Unable to set user data field (table full)\00"
@.str.23 = [26 x i8] c"Cannot initialize the JIT\00"
@.str.24 = [16 x i8] c"Parameter error\00"
@.str.25 = [54 x i8] c"Domain error, expression result does not fit in range\00"
@.str.26 = [44 x i8] c"General error (unknown or unspecific error)\00"
@.str.27 = [48 x i8] c"Overlays are unsupported (JIT) or uninitialized\00"
@.str.28 = [10 x i8] c"(unknown)\00"
define i8* @aux_StrError(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = icmp uge i64 %8, 29
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [29 x i8*], [29 x i8*]* @aux_StrError.messages, i64 0, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@reltable.aux_StrError = internal unnamed_addr constant [29 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.2 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @.str.3 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.4 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.5 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.6 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.7 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.8 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @.str.9 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.10 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.11 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.12 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.13 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.14 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.14 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.15 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @.str.16 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @.str.17 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.18 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.19 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.20 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([44 x i8]* @.str.21 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @.str.22 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.23 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.24 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([54 x i8]* @.str.25 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([44 x i8]* @.str.26 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @.str.27 to i64), i64 ptrtoint ([29 x i32]* @reltable.aux_StrError to i64)) to i32)]
@.str = [7 x i8] c"(none)\00"
@.str.1 = [12 x i8] c"Forced exit\00"
@.str.2 = [17 x i8] c"Assertion failed\00"
@.str.3 = [47 x i8] c"Stack/heap collision (insufficient stack size)\00"
@.str.4 = [26 x i8] c"Array index out of bounds\00"
@.str.5 = [22 x i8] c"Invalid memory access\00"
@.str.6 = [20 x i8] c"Invalid instruction\00"
@.str.7 = [16 x i8] c"Stack underflow\00"
@.str.8 = [15 x i8] c"Heap underflow\00"
@.str.9 = [36 x i8] c"No (valid) native function callback\00"
@.str.10 = [23 x i8] c"Native function failed\00"
@.str.11 = [15 x i8] c"Divide by zero\00"
@.str.12 = [13 x i8] c"(sleep mode)\00"
@.str.13 = [14 x i8] c"Invalid state\00"
@.str.14 = [11 x i8] c"(reserved)\00"
@.str.15 = [14 x i8] c"Out of memory\00"
@.str.16 = [39 x i8] c"Invalid/unsupported P-code file format\00"
@.str.17 = [39 x i8] c"File is for a newer version of the AMX\00"
@.str.18 = [30 x i8] c"File or function is not found\00"
@.str.19 = [42 x i8] c"Invalid index parameter (bad entry point)\00"
@.str.20 = [20 x i8] c"Debugger cannot run\00"
@.str.21 = [44 x i8] c"AMX not initialized (or doubly initialized)\00"
@.str.22 = [43 x i8] c"Unable to set user data field (table full)\00"
@.str.23 = [26 x i8] c"Cannot initialize the JIT\00"
@.str.24 = [16 x i8] c"Parameter error\00"
@.str.25 = [54 x i8] c"Domain error, expression result does not fit in range\00"
@.str.26 = [44 x i8] c"General error (unknown or unspecific error)\00"
@.str.27 = [48 x i8] c"Overlays are unsupported (JIT) or uninitialized\00"
@.str.28 = [10 x i8] c"(unknown)\00"
define i8* @aux_StrError(i32 %0) {
%2 = icmp ugt i32 %0, 28
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([29 x i32]* @reltable.aux_StrError to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0), %1 ]
ret i8* %8
}