const char *hiba_err(int err) {
  if (err == 0)
    return "ok";
  switch (err) {
  case -7:
    return "internal error";
  case -1:
    return "unexpected hiba magic header";
  case -2:
    return "incompatible hiba version";
  case -3:
    return "invalid input parameter";
  case -4:
    return "unexpected extra data in hiba extension";
  case -5:
    return "no such key in hiba extension";
  case -6:
    return "unknown hiba extension";
  case -20:
    return "missing mandatory domain";
  case -21:
    return "grant validity must be an integer";
  case -24:
    return "used of reserved key for identity extension";
  case -25:
    return "grant options syntax error";
  case -23:
    return "the key for identity extension must be unique";
  case -40:
    return "schema mismatch";
  case -41:
    return "version mismatch";
  case -42:
    return "expired grant";
  case -43:
    return "revoked grant";
  case -44:
    return "missing grl file";
  case -45:
    return "hostname mismatch";
  case -46:
    return "role mismatch";
  case -48:
    return "no grants matching";
  case -47:
    return "no grants attached";
  default:
    return "unknown error";
  }
}


x86 assembly (clang, -O0):
<hiba_err>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <hiba_err+0x21>
lea    0xfa8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x2f,%eax
ja     129a <hiba_err+0x19a>
mov    -0x18(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf72(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xf71(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xf7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xf88(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xf90(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xfa8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xfb6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xfbd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xfc6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xfd8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xff4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0xfff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x101e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12a5 <hiba_err+0x1a5>
lea    0x1021(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiba_err>:
add    $0x30,%edi
cmp    $0x30,%edi
ja     111a <hiba_err+0x1a>
movslq %edi,%rax
lea    0x10fe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0x10e1(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
@.str.1 = [15 x i8] c"internal error\00"
@.str.2 = [29 x i8] c"unexpected hiba magic header\00"
@.str.3 = [26 x i8] c"incompatible hiba version\00"
@.str.4 = [24 x i8] c"invalid input parameter\00"
@.str.5 = [40 x i8] c"unexpected extra data in hiba extension\00"
@.str.6 = [30 x i8] c"no such key in hiba extension\00"
@.str.7 = [23 x i8] c"unknown hiba extension\00"
@.str.8 = [25 x i8] c"missing mandatory domain\00"
@.str.9 = [34 x i8] c"grant validity must be an integer\00"
@.str.10 = [44 x i8] c"used of reserved key for identity extension\00"
@.str.11 = [27 x i8] c"grant options syntax error\00"
@.str.12 = [46 x i8] c"the key for identity extension must be unique\00"
@.str.13 = [16 x i8] c"schema mismatch\00"
@.str.14 = [17 x i8] c"version mismatch\00"
@.str.15 = [14 x i8] c"expired grant\00"
@.str.16 = [14 x i8] c"revoked grant\00"
@.str.17 = [17 x i8] c"missing grl file\00"
@.str.18 = [18 x i8] c"hostname mismatch\00"
@.str.19 = [14 x i8] c"role mismatch\00"
@.str.20 = [19 x i8] c"no grants matching\00"
@.str.21 = [19 x i8] c"no grants attached\00"
@.str.22 = [14 x i8] c"unknown error\00"
define i8* @hiba_err(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %31
7: ; preds = %1
%8 = load i32, i32* %3
switch i32 %8, label %30 [
i32 -7, label %9
i32 -1, label %10
i32 -2, label %11
i32 -3, label %12
i32 -4, label %13
i32 -5, label %14
i32 -6, label %15
i32 -20, label %16
i32 -21, label %17
i32 -24, label %18
i32 -25, label %19
i32 -23, label %20
i32 -40, label %21
i32 -41, label %22
i32 -42, label %23
i32 -43, label %24
i32 -44, label %25
i32 -45, label %26
i32 -46, label %27
i32 -48, label %28
i32 -47, label %29
]
9: ; preds = %7
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %31
10: ; preds = %7
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %31
11: ; preds = %7
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %31
12: ; preds = %7
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %31
13: ; preds = %7
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %31
14: ; preds = %7
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %31
15: ; preds = %7
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %31
16: ; preds = %7
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %31
17: ; preds = %7
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %31
18: ; preds = %7
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %31
19: ; preds = %7
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %31
20: ; preds = %7
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %31
21: ; preds = %7
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %31
22: ; preds = %7
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %31
23: ; preds = %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %31
24: ; preds = %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %31
25: ; preds = %7
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %31
26: ; preds = %7
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %31
27: ; preds = %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %31
28: ; preds = %7
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %31
29: ; preds = %7
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %31
30: ; preds = %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %31
31: ; preds = %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %6
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
@.str.1 = [15 x i8] c"internal error\00"
@.str.2 = [29 x i8] c"unexpected hiba magic header\00"
@.str.3 = [26 x i8] c"incompatible hiba version\00"
@.str.4 = [24 x i8] c"invalid input parameter\00"
@.str.5 = [40 x i8] c"unexpected extra data in hiba extension\00"
@.str.6 = [30 x i8] c"no such key in hiba extension\00"
@.str.7 = [23 x i8] c"unknown hiba extension\00"
@.str.8 = [25 x i8] c"missing mandatory domain\00"
@.str.9 = [34 x i8] c"grant validity must be an integer\00"
@.str.10 = [44 x i8] c"used of reserved key for identity extension\00"
@.str.11 = [27 x i8] c"grant options syntax error\00"
@.str.12 = [46 x i8] c"the key for identity extension must be unique\00"
@.str.13 = [16 x i8] c"schema mismatch\00"
@.str.14 = [17 x i8] c"version mismatch\00"
@.str.15 = [14 x i8] c"expired grant\00"
@.str.16 = [14 x i8] c"revoked grant\00"
@.str.17 = [17 x i8] c"missing grl file\00"
@.str.18 = [18 x i8] c"hostname mismatch\00"
@.str.19 = [14 x i8] c"role mismatch\00"
@.str.20 = [19 x i8] c"no grants matching\00"
@.str.21 = [19 x i8] c"no grants attached\00"
@.str.22 = [14 x i8] c"unknown error\00"
@reltable.hiba_err = [49 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.20 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.21 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.19 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.18 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.17 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.16 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.15 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.14 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.13 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.11 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([44 x i8]* @.str.10 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([46 x i8]* @.str.12 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.9 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.8 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.22 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.1 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.7 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.6 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @.str.5 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.4 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.3 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.2 to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([49 x i32]* @reltable.hiba_err to i64)) to i32)]
define i8* @hiba_err(i32 %0) {
%2 = add i32 %0, 48
%3 = icmp ult i32 %2, 49
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 ([49 x i32]* @reltable.hiba_err to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), %1 ]
ret i8* %9
}