const char *dcadec_strerror(int errnum) {
  static const char *const errors[] = {"Invalid argument",
                                       "Invalid bitstream format",
                                       "CRC check failed",
                                       "Bitstream navigation error",
                                       "Synchronization error",
                                       "Unsupported feature",
                                       "Memory allocation error",
                                       "PCM output overflow",
                                       "I/O error",
                                       "PCM output parameters changed"};
  static const char *const warnings[] = {"Failed to parse core auxiliary data",
                                         "Failed to parse core extension",
                                         "Failed to parse EXSS",
                                         "Failed to parse XLL",
                                         "XLL synchronization error",
                                         "XLL frequency band error",
                                         "XLL configuration error",
                                         "Clipping detected in XLL output",
                                         "XLL output not lossless"};
  if (errnum < 0) {
    unsigned int err = -errnum - 1;
    if (err < (sizeof(errors) / sizeof((errors)[0])))
      return errors[err];
    else
      return "Unspecified error";
  } else if (errnum > 0) {
    unsigned int warn = errnum - 1;
    if (warn < (sizeof(warnings) / sizeof((warnings)[0])))
      return warnings[warn];
    else
      return "Unspecified warning";
  } else {
    return "No error";
  }
}


x86 assembly (clang, -O0):
<dcadec_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1152 <dcadec_strerror+0x52>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    $0xa,%rax
jae    1142 <dcadec_strerror+0x42>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
lea    0x2c7b(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    11a6 <dcadec_strerror+0xa6>
lea    0x107a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a6 <dcadec_strerror+0xa6>
cmpl   $0x0,-0xc(%rbp)
jle    119b <dcadec_strerror+0x9b>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x9,%rax
jae    118b <dcadec_strerror+0x8b>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    0x2c82(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    11a6 <dcadec_strerror+0xa6>
lea    0x1043(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a6 <dcadec_strerror+0xa6>
lea    0x1047(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcadec_strerror>:
test   %edi,%edi
js     111f <dcadec_strerror+0x1f>
je     1135 <dcadec_strerror+0x35>
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     113d <dcadec_strerror+0x3d>
mov    %edi,%eax
lea    0x2ce9(%rip),%rcx
lea    (%rcx,%rax,8),%rax
mov    (%rax),%rax
ret
cmp    $0xfffffff6,%edi
jb     1145 <dcadec_strerror+0x45>
not    %edi
lea    0x2c83(%rip),%rax
lea    (%rax,%rdi,8),%rax
mov    (%rax),%rax
ret
lea    0x10ad(%rip),%rax
ret
lea    0x1091(%rip),%rax
ret
lea    0x1077(%rip),%rax
ret

LLVM IR (-O0):
@dcadec_strerror.errors = internal constant [10 x i8*] [i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 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 ([27 x i8], [27 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i32 0, i32 0)]
@.str = [17 x i8] c"Invalid argument\00"
@.str.1 = [25 x i8] c"Invalid bitstream format\00"
@.str.2 = [17 x i8] c"CRC check failed\00"
@.str.3 = [27 x i8] c"Bitstream navigation error\00"
@.str.4 = [22 x i8] c"Synchronization error\00"
@.str.5 = [20 x i8] c"Unsupported feature\00"
@.str.6 = [24 x i8] c"Memory allocation error\00"
@.str.7 = [20 x i8] c"PCM output overflow\00"
@.str.8 = [10 x i8] c"I/O error\00"
@.str.9 = [30 x i8] c"PCM output parameters changed\00"
@dcadec_strerror.warnings = internal constant [9 x i8*] [i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i32 0, i32 0)]
@.str.10 = [36 x i8] c"Failed to parse core auxiliary data\00"
@.str.11 = [31 x i8] c"Failed to parse core extension\00"
@.str.12 = [21 x i8] c"Failed to parse EXSS\00"
@.str.13 = [20 x i8] c"Failed to parse XLL\00"
@.str.14 = [26 x i8] c"XLL synchronization error\00"
@.str.15 = [25 x i8] c"XLL frequency band error\00"
@.str.16 = [24 x i8] c"XLL configuration error\00"
@.str.17 = [32 x i8] c"Clipping detected in XLL output\00"
@.str.18 = [24 x i8] c"XLL output not lossless\00"
@.str.19 = [18 x i8] c"Unspecified error\00"
@.str.20 = [20 x i8] c"Unspecified warning\00"
@.str.21 = [9 x i8] c"No error\00"
define i8* @dcadec_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = icmp ult i64 %13, 10
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [10 x i8*], [10 x i8*]* @dcadec_strerror.errors, i64 0, i64 %17
%19 = load i8*, i8** %18
store i8* %19, i8** %2
br label %37
20: ; preds = %8
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %37
21: ; preds = %1
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = zext i32 %27 to i64
%29 = icmp ult i64 %28, 9
br i1 %29, label %30, label %35
30: ; preds = %24
%31 = load i32, i32* %5
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds [9 x i8*], [9 x i8*]* @dcadec_strerror.warnings, i64 0, i64 %32
%34 = load i8*, i8** %33
store i8* %34, i8** %2
br label %37
35: ; preds = %24
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %37
36: ; preds = %21
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %37
37: ; preds = %36, %35, %30, %20, %15
%38 = load i8*, i8** %2
ret i8* %38
}

LLVM IR (-O2):
@dcadec_strerror.errors = internal unnamed_addr constant [10 x i8*] [i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 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 ([27 x i8], [27 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i32 0, i32 0)]
@.str = [17 x i8] c"Invalid argument\00"
@.str.1 = [25 x i8] c"Invalid bitstream format\00"
@.str.2 = [17 x i8] c"CRC check failed\00"
@.str.3 = [27 x i8] c"Bitstream navigation error\00"
@.str.4 = [22 x i8] c"Synchronization error\00"
@.str.5 = [20 x i8] c"Unsupported feature\00"
@.str.6 = [24 x i8] c"Memory allocation error\00"
@.str.7 = [20 x i8] c"PCM output overflow\00"
@.str.8 = [10 x i8] c"I/O error\00"
@.str.9 = [30 x i8] c"PCM output parameters changed\00"
@dcadec_strerror.warnings = internal unnamed_addr constant [9 x i8*] [i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i32 0, i32 0)]
@.str.10 = [36 x i8] c"Failed to parse core auxiliary data\00"
@.str.11 = [31 x i8] c"Failed to parse core extension\00"
@.str.12 = [21 x i8] c"Failed to parse EXSS\00"
@.str.13 = [20 x i8] c"Failed to parse XLL\00"
@.str.14 = [26 x i8] c"XLL synchronization error\00"
@.str.15 = [25 x i8] c"XLL frequency band error\00"
@.str.16 = [24 x i8] c"XLL configuration error\00"
@.str.17 = [32 x i8] c"Clipping detected in XLL output\00"
@.str.18 = [24 x i8] c"XLL output not lossless\00"
@.str.19 = [18 x i8] c"Unspecified error\00"
@.str.20 = [20 x i8] c"Unspecified warning\00"
@.str.21 = [9 x i8] c"No error\00"
define i8* @dcadec_strerror(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = icmp ugt i32 %0, -11
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = xor i32 %0, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [10 x i8*], [10 x i8*]* @dcadec_strerror.errors, i64 0, i64 %7
br label %17
9: ; preds = %1
%10 = icmp eq i32 %0, 0
br i1 %10, label %20, label %11
11: ; preds = %9
%12 = add nsw i32 %0, -1
%13 = icmp ult i32 %12, 9
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds [9 x i8*], [9 x i8*]* @dcadec_strerror.warnings, i64 0, i64 %15
br label %17
17: ; preds = %5, %14
%18 = phi i8** [ %16, %14 ], [ %8, %5 ]
%19 = load i8*, i8** %18
br label %20
20: ; preds = %17, %9, %11, %3
%21 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), %3 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), %11 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), %9 ], [ %19, %17 ]
ret i8* %21
}