const char *error_get_message(int err) {
  switch (err) {
  case (0x1000):
    return "Memory allocation";
  case (0x1001):
    return "Saving config to file";
  case (0x1002):
    return "Unrecognised config key";
  case (0x1003):
    return "Config key creation";
  case (0x1004):
    return "Config key missing";
  case (0x1005):
    return "Not implemented";
  case (0x1006):
    return "Unexpected message content";
  case (0x1007):
    return "Browser IO";
  case (0x1008):
    return "GPGme";
  case (0x1009):
    return "Key not found in local keyring";
  case (0x1010):
    return "Ambigious key identifier";
  case (0x1011):
    return "Program environment";
  case (0x1012):
    return "Unexpected null pointer";
  default:
    return "Unknown error code";
  }
}


x86 assembly (clang, -O0):
<error_get_message>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffff000,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x12,%eax
ja     1202 <error_get_message+0x102>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf13(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf15(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf1b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf23(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf27(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf2a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf2a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf35(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf30(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf26(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf35(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf3e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf42(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    120d <error_get_message+0x10d>
lea    0xf4a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_get_message>:
add    $0xfffff000,%edi
cmp    $0x12,%edi
ja     111d <error_get_message+0x1d>
movslq %edi,%rax
lea    0x1007(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xfe3(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Memory allocation\00"
@.str.1 = [22 x i8] c"Saving config to file\00"
@.str.2 = [24 x i8] c"Unrecognised config key\00"
@.str.3 = [20 x i8] c"Config key creation\00"
@.str.4 = [19 x i8] c"Config key missing\00"
@.str.5 = [16 x i8] c"Not implemented\00"
@.str.6 = [27 x i8] c"Unexpected message content\00"
@.str.7 = [11 x i8] c"Browser IO\00"
@.str.8 = [6 x i8] c"GPGme\00"
@.str.9 = [31 x i8] c"Key not found in local keyring\00"
@.str.10 = [25 x i8] c"Ambigious key identifier\00"
@.str.11 = [20 x i8] c"Program environment\00"
@.str.12 = [24 x i8] c"Unexpected null pointer\00"
@.str.13 = [19 x i8] c"Unknown error code\00"
define i8* @error_get_message(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %18 [
i32 4096, label %5
i32 4097, label %6
i32 4098, label %7
i32 4099, label %8
i32 4100, label %9
i32 4101, label %10
i32 4102, label %11
i32 4103, label %12
i32 4104, label %13
i32 4105, label %14
i32 4112, label %15
i32 4113, label %16
i32 4114, label %17
]
5: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %2
br label %19
6: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %19
7: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %19
8: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %19
9: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %19
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %19
11: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %19
12: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %19
13: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %19
14: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %19
15: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %19
16: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %19
17: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %19
18: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %19
19: ; preds = %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [18 x i8] c"Memory allocation\00"
@.str.1 = [22 x i8] c"Saving config to file\00"
@.str.2 = [24 x i8] c"Unrecognised config key\00"
@.str.3 = [20 x i8] c"Config key creation\00"
@.str.4 = [19 x i8] c"Config key missing\00"
@.str.5 = [16 x i8] c"Not implemented\00"
@.str.6 = [27 x i8] c"Unexpected message content\00"
@.str.7 = [11 x i8] c"Browser IO\00"
@.str.8 = [6 x i8] c"GPGme\00"
@.str.9 = [31 x i8] c"Key not found in local keyring\00"
@.str.10 = [25 x i8] c"Ambigious key identifier\00"
@.str.11 = [20 x i8] c"Program environment\00"
@.str.12 = [24 x i8] c"Unexpected null pointer\00"
@.str.13 = [19 x i8] c"Unknown error code\00"
@reltable.error_get_message = [19 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.1 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.2 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.3 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.4 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.5 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.6 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.7 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.8 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.9 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.13 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.10 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.11 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.12 to i64), i64 ptrtoint ([19 x i32]* @reltable.error_get_message to i64)) to i32)]
define i8* @error_get_message(i32 %0) {
%2 = add i32 %0, -4096
%3 = icmp ult i32 %2, 19
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([19 x i32]* @reltable.error_get_message to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), %1 ]
ret i8* %9
}