const char *sqlite3ErrStr(int rc) {
  const char *z;
  switch (rc) {
  case 100:
  case 101:
  case 0:
    z = "not an error";
    break;
  case 1:
    z = "SQL logic error or missing database";
    break;
  case 2:
    z = "internal SQLite implementation flaw";
    break;
  case 3:
    z = "access permission denied";
    break;
  case 4:
    z = "callback requested query abort";
    break;
  case 5:
    z = "database is locked";
    break;
  case 6:
    z = "database table is locked";
    break;
  case 7:
    z = "out of memory";
    break;
  case 8:
    z = "attempt to write a readonly database";
    break;
  case 9:
    z = "interrupted";
    break;
  case 10:
    z = "disk I/O error";
    break;
  case 11:
    z = "database disk image is malformed";
    break;
  case 12:
    z = "table or record not found";
    break;
  case 13:
    z = "database is full";
    break;
  case 14:
    z = "unable to open database file";
    break;
  case 15:
    z = "database locking protocol failure";
    break;
  case 16:
    z = "table contains no data";
    break;
  case 17:
    z = "database schema has changed";
    break;
  case 18:
    z = "too much data for one table row";
    break;
  case 19:
    z = "constraint failed";
    break;
  case 20:
    z = "datatype mismatch";
    break;
  case 21:
    z = "library routine called out of sequence";
    break;
  case 22:
    z = "kernel lacks large file support";
    break;
  case 23:
    z = "authorization denied";
    break;
  case 24:
    z = "auxiliary database format error";
    break;
  case 25:
    z = "bind index out of range";
    break;
  case 26:
    z = "file is encrypted or is not a database";
    break;
  default:
    z = "unknown error";
    break;
  }
  return z;
}


x86 assembly (clang, -O0):
<sqlite3ErrStr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x65,%rax
ja     12dc <sqlite3ErrStr+0x1dc>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1065(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1062(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1076(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x108a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1093(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10a2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10a5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10ae(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10ac(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10c1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10bd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10bc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10cd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10d7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10d8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10e5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10f7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x10fe(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x110a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x111a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x111c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x111e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1135(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1145(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x114a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x115a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1162(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12e7 <sqlite3ErrStr+0x1e7>
lea    0x1179(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3ErrStr>:
cmp    $0x65,%edi
ja     11f3 <sqlite3ErrStr+0xf3>
lea    0x1088(%rip),%rax
mov    %edi,%ecx
lea    0xee7(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
lea    0x107b(%rip),%rax
ret
lea    0x1097(%rip),%rax
ret
lea    0x10b3(%rip),%rax
ret
lea    0x10c4(%rip),%rax
ret
lea    0x10db(%rip),%rax
ret
lea    0x10e6(%rip),%rax
ret
lea    0x10f7(%rip),%rax
ret
lea    0x10fd(%rip),%rax
ret
lea    0x111a(%rip),%rax
ret
lea    0x111e(%rip),%rax
ret
lea    0x1125(%rip),%rax
ret
lea    0x113e(%rip),%rax
ret
lea    0x1150(%rip),%rax
ret
lea    0x1159(%rip),%rax
ret
lea    0x116e(%rip),%rax
ret
lea    0x1188(%rip),%rax
ret
lea    0x1197(%rip),%rax
ret
lea    0x11ab(%rip),%rax
ret
lea    0x11c3(%rip),%rax
ret
lea    0x11cd(%rip),%rax
ret
lea    0x11d7(%rip),%rax
ret
lea    0x11f6(%rip),%rax
ret
lea    0x120e(%rip),%rax
ret
lea    0x121b(%rip),%rax
ret
lea    0x1233(%rip),%rax
ret
lea    0x1243(%rip),%rax
ret
lea    0x1262(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"not an error\00"
@.str.1 = [36 x i8] c"SQL logic error or missing database\00"
@.str.2 = [36 x i8] c"internal SQLite implementation flaw\00"
@.str.3 = [25 x i8] c"access permission denied\00"
@.str.4 = [31 x i8] c"callback requested query abort\00"
@.str.5 = [19 x i8] c"database is locked\00"
@.str.6 = [25 x i8] c"database table is locked\00"
@.str.7 = [14 x i8] c"out of memory\00"
@.str.8 = [37 x i8] c"attempt to write a database\00"
@.str.9 = [12 x i8] c"interrupted\00"
@.str.10 = [15 x i8] c"disk I/O error\00"
@.str.11 = [33 x i8] c"database disk image is malformed\00"
@.str.12 = [26 x i8] c"table or record not found\00"
@.str.13 = [17 x i8] c"database is full\00"
@.str.14 = [29 x i8] c"unable to open database file\00"
@.str.15 = [34 x i8] c"database locking protocol failure\00"
@.str.16 = [23 x i8] c"table contains no data\00"
@.str.17 = [28 x i8] c"database schema has changed\00"
@.str.18 = [32 x i8] c"too much data for one table row\00"
@.str.19 = [18 x i8] c"constraint failed\00"
@.str.20 = [18 x i8] c"datatype mismatch\00"
@.str.21 = [39 x i8] c"library routine called out of sequence\00"
@.str.22 = [32 x i8] c"kernel lacks large file support\00"
@.str.23 = [21 x i8] c"authorization denied\00"
@.str.24 = [32 x i8] c"auxiliary database format error\00"
@.str.25 = [24 x i8] c"bind index out of range\00"
@.str.26 = [39 x i8] c"file is encrypted or is not a database\00"
@.str.27 = [14 x i8] c"unknown error\00"
define i8* @sqlite3ErrStr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %32 [
i32 100, label %5
i32 101, label %5
i32 0, 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 9, label %14
i32 10, label %15
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %19
i32 15, label %20
i32 16, label %21
i32 17, label %22
i32 18, label %23
i32 19, label %24
i32 20, label %25
i32 21, label %26
i32 22, label %27
i32 23, label %28
i32 24, label %29
i32 25, label %30
i32 26, label %31
]
5: ; preds = %1, %1, %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
br label %33
6: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %33
7: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %33
8: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %33
9: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %33
10: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %33
11: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %33
12: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %33
13: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %33
14: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %33
15: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %33
16: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %33
17: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %33
18: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %33
19: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %33
20: ; preds = %1
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %33
21: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %33
22: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i8** %3
br label %33
23: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i8** %3
br label %33
24: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i8** %3
br label %33
25: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i8** %3
br label %33
26: ; preds = %1
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.21, i64 0, i64 0), i8** %3
br label %33
27: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.22, i64 0, i64 0), i8** %3
br label %33
28: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i8** %3
br label %33
29: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.24, i64 0, i64 0), i8** %3
br label %33
30: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.25, i64 0, i64 0), i8** %3
br label %33
31: ; preds = %1
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.26, i64 0, i64 0), i8** %3
br label %33
32: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0), i8** %3
br label %33
33: ; preds = %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
@.str = [13 x i8] c"not an error\00"
@.str.1 = [36 x i8] c"SQL logic error or missing database\00"
@.str.2 = [36 x i8] c"internal SQLite implementation flaw\00"
@.str.3 = [25 x i8] c"access permission denied\00"
@.str.4 = [31 x i8] c"callback requested query abort\00"
@.str.5 = [19 x i8] c"database is locked\00"
@.str.6 = [25 x i8] c"database table is locked\00"
@.str.7 = [14 x i8] c"out of memory\00"
@.str.8 = [37 x i8] c"attempt to write a database\00"
@.str.9 = [12 x i8] c"interrupted\00"
@.str.10 = [15 x i8] c"disk I/O error\00"
@.str.11 = [33 x i8] c"database disk image is malformed\00"
@.str.12 = [26 x i8] c"table or record not found\00"
@.str.13 = [17 x i8] c"database is full\00"
@.str.14 = [29 x i8] c"unable to open database file\00"
@.str.15 = [34 x i8] c"database locking protocol failure\00"
@.str.16 = [23 x i8] c"table contains no data\00"
@.str.17 = [28 x i8] c"database schema has changed\00"
@.str.18 = [32 x i8] c"too much data for one table row\00"
@.str.19 = [18 x i8] c"constraint failed\00"
@.str.20 = [18 x i8] c"datatype mismatch\00"
@.str.21 = [39 x i8] c"library routine called out of sequence\00"
@.str.22 = [32 x i8] c"kernel lacks large file support\00"
@.str.23 = [21 x i8] c"authorization denied\00"
@.str.24 = [32 x i8] c"auxiliary database format error\00"
@.str.25 = [24 x i8] c"bind index out of range\00"
@.str.26 = [39 x i8] c"file is encrypted or is not a database\00"
@.str.27 = [14 x i8] c"unknown error\00"
define i8* @sqlite3ErrStr(i32 %0) {
switch i32 %0, label %28 [
i32 100, label %29
i32 101, label %29
i32 0, label %29
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 9, label %10
i32 10, label %11
i32 11, label %12
i32 12, label %13
i32 13, label %14
i32 14, label %15
i32 15, label %16
i32 16, label %17
i32 17, label %18
i32 18, label %19
i32 19, label %20
i32 20, label %21
i32 21, label %22
i32 22, label %23
i32 23, label %24
i32 24, label %25
i32 25, label %26
i32 26, label %27
]
2: ; preds = %1
br label %29
3: ; preds = %1
br label %29
4: ; preds = %1
br label %29
5: ; preds = %1
br label %29
6: ; preds = %1
br label %29
7: ; preds = %1
br label %29
8: ; preds = %1
br label %29
9: ; preds = %1
br label %29
10: ; preds = %1
br label %29
11: ; preds = %1
br label %29
12: ; preds = %1
br label %29
13: ; preds = %1
br label %29
14: ; preds = %1
br label %29
15: ; preds = %1
br label %29
16: ; preds = %1
br label %29
17: ; preds = %1
br label %29
18: ; preds = %1
br label %29
19: ; preds = %1
br label %29
20: ; preds = %1
br label %29
21: ; preds = %1
br label %29
22: ; preds = %1
br label %29
23: ; preds = %1
br label %29
24: ; preds = %1
br label %29
25: ; preds = %1
br label %29
26: ; preds = %1
br label %29
27: ; preds = %1
br label %29
28: ; preds = %1
br label %29
29: ; preds = %1, %1, %1, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%30 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0), %28 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.26, i64 0, i64 0), %27 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.25, i64 0, i64 0), %26 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.24, i64 0, i64 0), %25 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), %24 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.22, i64 0, i64 0), %23 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.21, i64 0, i64 0), %22 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), %21 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), %20 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([15 x i8], [15 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 ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %30
}