const char *sqlite3TestErrorName(int rc) {
  const char *zName = 0;
  switch (rc) {
  case 0:
    zName = "SQLITE_OK";
    break;
  case 1:
    zName = "SQLITE_ERROR";
    break;
  case 2:
    zName = "SQLITE_INTERNAL";
    break;
  case 3:
    zName = "SQLITE_PERM";
    break;
  case 4:
    zName = "SQLITE_ABORT";
    break;
  case 5:
    zName = "SQLITE_BUSY";
    break;
  case 6:
    zName = "SQLITE_LOCKED";
    break;
  case 7:
    zName = "SQLITE_NOMEM";
    break;
  case 8:
    zName = "SQLITE_READONLY";
    break;
  case 9:
    zName = "SQLITE_INTERRUPT";
    break;
  case 10:
    zName = "SQLITE_IOERR";
    break;
  case 11:
    zName = "SQLITE_CORRUPT";
    break;
  case 12:
    zName = "SQLITE_NOTFOUND";
    break;
  case 13:
    zName = "SQLITE_FULL";
    break;
  case 14:
    zName = "SQLITE_CANTOPEN";
    break;
  case 15:
    zName = "SQLITE_PROTOCOL";
    break;
  case 16:
    zName = "SQLITE_EMPTY";
    break;
  case 17:
    zName = "SQLITE_SCHEMA";
    break;
  case 18:
    zName = "SQLITE_TOOBIG";
    break;
  case 19:
    zName = "SQLITE_CONSTRAINT";
    break;
  case 20:
    zName = "SQLITE_MISMATCH";
    break;
  case 21:
    zName = "SQLITE_MISUSE";
    break;
  case 22:
    zName = "SQLITE_NOLFS";
    break;
  case 23:
    zName = "SQLITE_AUTH";
    break;
  case 24:
    zName = "SQLITE_FORMAT";
    break;
  case 25:
    zName = "SQLITE_RANGE";
    break;
  case 100:
    zName = "SQLITE_ROW";
    break;
  case 101:
    zName = "SQLITE_DONE";
    break;
  case 26:
    zName = "SQLITE_NOTADB";
    break;
  default:
    zName = "SQLITE_Unknown";
    break;
  }
  return zName;
}


x86 assembly (clang, -O0):
<sqlite3TestErrorName>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x65,%rax
ja     1304 <sqlite3TestErrorName+0x204>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x105d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1057(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1054(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1054(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1050(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x104d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1049(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1047(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1044(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1044(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1045(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1042(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1041(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1041(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x103d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x103d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x103d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x103a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1038(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1036(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1038(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1038(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1036(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1033(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x102f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x102d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x102a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1025(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x1021(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    130f <sqlite3TestErrorName+0x20f>
lea    0x101f(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3TestErrorName>:
cmp    $0x65,%edi
ja     11f2 <sqlite3TestErrorName+0xf2>
lea    0x1088(%rip),%rax
mov    %edi,%ecx
lea    0xee7(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0x1079(%rip),%rax
ret
lea    0x107e(%rip),%rax
ret
lea    0x1086(%rip),%rax
ret
lea    0x108a(%rip),%rax
ret
lea    0x108f(%rip),%rax
ret
lea    0x1093(%rip),%rax
ret
lea    0x1099(%rip),%rax
ret
lea    0x109e(%rip),%rax
ret
lea    0x10a6(%rip),%rax
ret
lea    0x10af(%rip),%rax
ret
lea    0x10b4(%rip),%rax
ret
lea    0x10bb(%rip),%rax
ret
lea    0x10c3(%rip),%rax
ret
lea    0x10c7(%rip),%rax
ret
lea    0x10cf(%rip),%rax
ret
lea    0x10d7(%rip),%rax
ret
lea    0x10dc(%rip),%rax
ret
lea    0x10e2(%rip),%rax
ret
lea    0x10e8(%rip),%rax
ret
lea    0x10f2(%rip),%rax
ret
lea    0x10fa(%rip),%rax
ret
lea    0x1100(%rip),%rax
ret
lea    0x1105(%rip),%rax
ret
lea    0x1109(%rip),%rax
ret
lea    0x110f(%rip),%rax
ret
lea    0x112b(%rip),%rax
ret
lea    0x1131(%rip),%rax
ret
lea    0x1104(%rip),%rax
ret
lea    0x1107(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"SQLITE_OK\00"
@.str.1 = [13 x i8] c"SQLITE_ERROR\00"
@.str.2 = [16 x i8] c"SQLITE_INTERNAL\00"
@.str.3 = [12 x i8] c"SQLITE_PERM\00"
@.str.4 = [13 x i8] c"SQLITE_ABORT\00"
@.str.5 = [12 x i8] c"SQLITE_BUSY\00"
@.str.6 = [14 x i8] c"SQLITE_LOCKED\00"
@.str.7 = [13 x i8] c"SQLITE_NOMEM\00"
@.str.8 = [16 x i8] c"SQLITE_READONLY\00"
@.str.9 = [17 x i8] c"SQLITE_INTERRUPT\00"
@.str.10 = [13 x i8] c"SQLITE_IOERR\00"
@.str.11 = [15 x i8] c"SQLITE_CORRUPT\00"
@.str.12 = [16 x i8] c"SQLITE_NOTFOUND\00"
@.str.13 = [12 x i8] c"SQLITE_FULL\00"
@.str.14 = [16 x i8] c"SQLITE_CANTOPEN\00"
@.str.15 = [16 x i8] c"SQLITE_PROTOCOL\00"
@.str.16 = [13 x i8] c"SQLITE_EMPTY\00"
@.str.17 = [14 x i8] c"SQLITE_SCHEMA\00"
@.str.18 = [14 x i8] c"SQLITE_TOOBIG\00"
@.str.19 = [18 x i8] c"SQLITE_CONSTRAINT\00"
@.str.20 = [16 x i8] c"SQLITE_MISMATCH\00"
@.str.21 = [14 x i8] c"SQLITE_MISUSE\00"
@.str.22 = [13 x i8] c"SQLITE_NOLFS\00"
@.str.23 = [12 x i8] c"SQLITE_AUTH\00"
@.str.24 = [14 x i8] c"SQLITE_FORMAT\00"
@.str.25 = [13 x i8] c"SQLITE_RANGE\00"
@.str.26 = [11 x i8] c"SQLITE_ROW\00"
@.str.27 = [12 x i8] c"SQLITE_DONE\00"
@.str.28 = [14 x i8] c"SQLITE_NOTADB\00"
@.str.29 = [15 x i8] c"SQLITE_Unknown\00"
define i8* @sqlite3TestErrorName(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %34 [
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 100, label %31
i32 101, label %32
i32 26, label %33
]
5: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
br label %35
6: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %35
7: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %35
8: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %35
9: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %35
10: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %35
11: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %35
12: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %35
13: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %35
14: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %35
15: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %35
16: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %35
17: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %35
18: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %35
19: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %35
20: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %35
21: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %35
22: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8** %3
br label %35
23: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i8** %3
br label %35
24: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i8** %3
br label %35
25: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.20, i64 0, i64 0), i8** %3
br label %35
26: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.21, i64 0, i64 0), i8** %3
br label %35
27: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i8** %3
br label %35
28: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0), i8** %3
br label %35
29: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), i8** %3
br label %35
30: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8** %3
br label %35
31: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0), i8** %3
br label %35
32: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i8** %3
br label %35
33: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i8** %3
br label %35
34: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.29, i64 0, i64 0), i8** %3
br label %35
35: ; preds = %34, %33, %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
%36 = load i8*, i8** %3
ret i8* %36
}

LLVM IR (-O2):
@.str = [10 x i8] c"SQLITE_OK\00"
@.str.1 = [13 x i8] c"SQLITE_ERROR\00"
@.str.2 = [16 x i8] c"SQLITE_INTERNAL\00"
@.str.3 = [12 x i8] c"SQLITE_PERM\00"
@.str.4 = [13 x i8] c"SQLITE_ABORT\00"
@.str.5 = [12 x i8] c"SQLITE_BUSY\00"
@.str.6 = [14 x i8] c"SQLITE_LOCKED\00"
@.str.7 = [13 x i8] c"SQLITE_NOMEM\00"
@.str.8 = [16 x i8] c"SQLITE_READONLY\00"
@.str.9 = [17 x i8] c"SQLITE_INTERRUPT\00"
@.str.10 = [13 x i8] c"SQLITE_IOERR\00"
@.str.11 = [15 x i8] c"SQLITE_CORRUPT\00"
@.str.12 = [16 x i8] c"SQLITE_NOTFOUND\00"
@.str.13 = [12 x i8] c"SQLITE_FULL\00"
@.str.14 = [16 x i8] c"SQLITE_CANTOPEN\00"
@.str.15 = [16 x i8] c"SQLITE_PROTOCOL\00"
@.str.16 = [13 x i8] c"SQLITE_EMPTY\00"
@.str.17 = [14 x i8] c"SQLITE_SCHEMA\00"
@.str.18 = [14 x i8] c"SQLITE_TOOBIG\00"
@.str.19 = [18 x i8] c"SQLITE_CONSTRAINT\00"
@.str.20 = [16 x i8] c"SQLITE_MISMATCH\00"
@.str.21 = [14 x i8] c"SQLITE_MISUSE\00"
@.str.22 = [13 x i8] c"SQLITE_NOLFS\00"
@.str.23 = [12 x i8] c"SQLITE_AUTH\00"
@.str.24 = [14 x i8] c"SQLITE_FORMAT\00"
@.str.25 = [13 x i8] c"SQLITE_RANGE\00"
@.str.26 = [11 x i8] c"SQLITE_ROW\00"
@.str.27 = [12 x i8] c"SQLITE_DONE\00"
@.str.28 = [14 x i8] c"SQLITE_NOTADB\00"
@.str.29 = [15 x i8] c"SQLITE_Unknown\00"
define i8* @sqlite3TestErrorName(i32 %0) {
switch i32 %0, label %30 [
i32 0, label %31
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 100, label %27
i32 101, label %28
i32 26, label %29
]
2: ; preds = %1
br label %31
3: ; preds = %1
br label %31
4: ; preds = %1
br label %31
5: ; preds = %1
br label %31
6: ; preds = %1
br label %31
7: ; preds = %1
br label %31
8: ; preds = %1
br label %31
9: ; preds = %1
br label %31
10: ; preds = %1
br label %31
11: ; preds = %1
br label %31
12: ; preds = %1
br label %31
13: ; preds = %1
br label %31
14: ; preds = %1
br label %31
15: ; preds = %1
br label %31
16: ; preds = %1
br label %31
17: ; preds = %1
br label %31
18: ; preds = %1
br label %31
19: ; preds = %1
br label %31
20: ; preds = %1
br label %31
21: ; preds = %1
br label %31
22: ; preds = %1
br label %31
23: ; preds = %1
br label %31
24: ; preds = %1
br label %31
25: ; preds = %1
br label %31
26: ; preds = %1
br label %31
27: ; preds = %1
br label %31
28: ; preds = %1
br label %31
29: ; preds = %1
br label %31
30: ; preds = %1
br label %31
31: ; preds = %1, %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, %4, %3, %2
%32 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.29, i64 0, i64 0), %30 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), %29 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), %28 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0), %27 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), %26 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), %25 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0), %24 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), %23 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.21, i64 0, i64 0), %22 ], [ getelementptr inbounds ([16 x i8], [16 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 ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([12 x i8], [12 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 ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([13 x i8], [13 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 ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %32
}