char *error_index(int e) {
  switch (e) {
  case (-1):
    return "Appeared general error";
    break;
  case (-2):
    return "Malloc failed. Not capable to allocate memory";
    break;
  case (-11):
    return "Some parameters of configuration are not correct";
    break;
  case (-4):
    return "Compression Algorithm not support";
    break;
  case (-5):
    return "General error on decompression";
    break;
  case (-8):
    return "Compressed file is not correct";
    break;
  case (-6):
    return "Error during search";
    break;
  case (-7):
    return "Impossible to make search/extract without marked chars";
    break;
  case (-12):
    return "Can't open or read the file";
    break;
  case (-13):
    return "Function not implemented";
    break;
  default:
    return "Appeared general error\n";
    break;
  }
}


x86 assembly (clang, -O0):
<error_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xd,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xc,%eax
ja     11d0 <error_index+0xd0>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xefd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf04(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf22(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf55(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf73(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf77(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xf9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xfaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11db <error_index+0xdb>
lea    0xfb3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_index>:
cmp    $0xfffffff3,%edi
jb     111a <error_index+0x1a>
add    $0xd,%edi
movslq %edi,%rax
lea    0x105e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0x1035(%rip),%rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Appeared general error\00"
@.str.1 = [46 x i8] c"Malloc failed. Not capable to allocate memory\00"
@.str.2 = [49 x i8] c"Some parameters of configuration are not correct\00"
@.str.3 = [34 x i8] c"Compression Algorithm not support\00"
@.str.4 = [31 x i8] c"General error on decompression\00"
@.str.5 = [31 x i8] c"Compressed file is not correct\00"
@.str.6 = [20 x i8] c"Error during search\00"
@.str.7 = [55 x i8] c"Impossible to make search/extract without marked chars\00"
@.str.8 = [28 x i8] c"Can't open or read the file\00"
@.str.9 = [25 x i8] c"Function not implemented\00"
@.str.10 = [24 x i8] c"Appeared general error\0A\00"
define i8* @error_index(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 -1, label %5
i32 -2, label %6
i32 -11, label %7
i32 -4, label %8
i32 -5, label %9
i32 -8, label %10
i32 -6, label %11
i32 -7, label %12
i32 -12, label %13
i32 -13, label %14
]
5: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
6: ; preds = %1
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %16
7: ; preds = %1
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %16
8: ; preds = %1
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %16
9: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %16
10: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %16
12: ; preds = %1
store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %16
13: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %16
14: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %16
15: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [23 x i8] c"Appeared general error\00"
@.str.1 = [46 x i8] c"Malloc failed. Not capable to allocate memory\00"
@.str.2 = [49 x i8] c"Some parameters of configuration are not correct\00"
@.str.3 = [34 x i8] c"Compression Algorithm not support\00"
@.str.4 = [31 x i8] c"General error on decompression\00"
@.str.5 = [31 x i8] c"Compressed file is not correct\00"
@.str.6 = [20 x i8] c"Error during search\00"
@.str.7 = [55 x i8] c"Impossible to make search/extract without marked chars\00"
@.str.8 = [28 x i8] c"Can't open or read the file\00"
@.str.9 = [25 x i8] c"Function not implemented\00"
@.str.10 = [24 x i8] c"Appeared general error\0A\00"
@reltable.error_index = [13 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.9 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.8 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([49 x i8]* @.str.2 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.10 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.10 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.5 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([55 x i8]* @.str.7 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.6 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.4 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.3 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.10 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([46 x i8]* @.str.1 to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str to i64), i64 ptrtoint ([13 x i32]* @reltable.error_index to i64)) to i32)]
define i8* @error_index(i32 %0) {
%2 = icmp ugt i32 %0, -14
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add i32 %0, 13
%5 = sext i32 %4 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([13 x i32]* @reltable.error_index to i8*), i64 %6)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), %1 ]
ret i8* %9
}