const char *dfdom_errmsg(int code) {
  switch (code) {
  case 0:
    return "No error at all!\n";
  case 1:
    return "%s: expected %s; node will be ignored.\n";
  case 2:
    return "%s: invalid path specification; %s.\n";
  case 20:
    return "array item is out of range; it will be ignored.\n";
  case 21:
    return "%d: array item out of range; it will be ignored.\n";
  case 30:
    return "%s: invalid hash key; it will be ignored.\n";
  case 125:
    return "Error ignored; DOM integrity may be compromised.\n";
  case 126:
    return "an unknown error Dragonfly DOM error has occured\n";
  }
  return "unknown error";
}


x86 assembly (clang, -O0):
<dfdom_errmsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1191 <dfdom_errmsg+0x91>
jmp    111a <dfdom_errmsg+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11a1 <dfdom_errmsg+0xa1>
jmp    112b <dfdom_errmsg+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11b1 <dfdom_errmsg+0xb1>
jmp    113c <dfdom_errmsg+0x3c>
mov    -0x10(%rbp),%eax
sub    $0x14,%eax
je     11c1 <dfdom_errmsg+0xc1>
jmp    114d <dfdom_errmsg+0x4d>
mov    -0x10(%rbp),%eax
sub    $0x15,%eax
je     11d1 <dfdom_errmsg+0xd1>
jmp    115e <dfdom_errmsg+0x5e>
mov    -0x10(%rbp),%eax
sub    $0x1e,%eax
je     11e1 <dfdom_errmsg+0xe1>
jmp    116f <dfdom_errmsg+0x6f>
mov    -0x10(%rbp),%eax
sub    $0x7d,%eax
je     11f1 <dfdom_errmsg+0xf1>
jmp    1180 <dfdom_errmsg+0x80>
mov    -0x10(%rbp),%eax
sub    $0x7e,%eax
je     1201 <dfdom_errmsg+0x101>
jmp    1211 <dfdom_errmsg+0x111>
lea    0xe68(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xe6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xe82(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xf17(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121c <dfdom_errmsg+0x11c>
lea    0xf39(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfdom_errmsg>:
cmp    $0x1e,%edi
ja     1126 <dfdom_errmsg+0x26>
lea    0xf70(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf69(%rip),%rax
ret
cmp    $0x7d,%edi
je     1160 <dfdom_errmsg+0x60>
cmp    $0x7e,%edi
jne    1138 <dfdom_errmsg+0x38>
lea    0x1064(%rip),%rax
ret
lea    0x108e(%rip),%rax
ret
lea    0xf6f(%rip),%rax
ret
lea    0xf8c(%rip),%rax
ret
lea    0xfb5(%rip),%rax
ret
lea    0xfdf(%rip),%rax
ret
lea    0x1002(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"No error at all!\0A\00"
@.str.1 = [40 x i8] c"%s: expected %s; node will be ignored.\0A\00"
@.str.2 = [37 x i8] c"%s: invalid path specification; %s.\0A\00"
@.str.3 = [49 x i8] c"array item is out of range; it will be ignored.\0A\00"
@.str.4 = [50 x i8] c"%d: array item out of range; it will be ignored.\0A\00"
@.str.5 = [43 x i8] c"%s: invalid hash key; it will be ignored.\0A\00"
@.str.6 = [50 x i8] c"Error ignored; DOM integrity may be compromised.\0A\00"
@.str.7 = [50 x i8] c"an unknown error Dragonfly DOM error has occured\0A\00"
@.str.8 = [14 x i8] c"unknown error\00"
define i8* @dfdom_errmsg(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 20, label %8
i32 21, label %9
i32 30, label %10
i32 125, label %11
i32 126, label %12
]
5: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
6: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %14
7: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %14
8: ; preds = %1
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %14
9: ; preds = %1
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %14
10: ; preds = %1
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %14
11: ; preds = %1
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %14
12: ; preds = %1
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %14
13: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [18 x i8] c"No error at all!\0A\00"
@.str.1 = [40 x i8] c"%s: expected %s; node will be ignored.\0A\00"
@.str.2 = [37 x i8] c"%s: invalid path specification; %s.\0A\00"
@.str.3 = [49 x i8] c"array item is out of range; it will be ignored.\0A\00"
@.str.4 = [50 x i8] c"%d: array item out of range; it will be ignored.\0A\00"
@.str.5 = [43 x i8] c"%s: invalid hash key; it will be ignored.\0A\00"
@.str.6 = [50 x i8] c"Error ignored; DOM integrity may be compromised.\0A\00"
@.str.7 = [50 x i8] c"an unknown error Dragonfly DOM error has occured\0A\00"
@.str.8 = [14 x i8] c"unknown error\00"
define i8* @dfdom_errmsg(i32 %0) {
switch i32 %0, label %9 [
i32 0, label %10
i32 1, label %2
i32 2, label %3
i32 20, label %4
i32 21, label %5
i32 30, label %6
i32 125, label %7
i32 126, label %8
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}