const char *editorconfig_get_error_msg(int err_num) {
  if (err_num > 0)
    return "Failed to parse file.";
  switch (err_num) {
  case 0:
    return "No error occurred.";
  case (-2):
    return "Input file must be a full path name.";
  case (-3):
    return "Memory error.";
  case (-4):
    return "Required version is greater than the current version.";
  default:
    break;
  }
  return "Unknown error.";
}


x86 assembly (clang, -O0):
<editorconfig_get_error_msg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1121 <editorconfig_get_error_msg+0x21>
lea    0xefc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <editorconfig_get_error_msg+0x9a>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     118a <editorconfig_get_error_msg+0x8a>
mov    -0x18(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <editorconfig_get_error_msg+0x9a>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <editorconfig_get_error_msg+0x9a>
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <editorconfig_get_error_msg+0x9a>
lea    0xeef(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <editorconfig_get_error_msg+0x9a>
jmp    118f <editorconfig_get_error_msg+0x8f>
lea    0xf10(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<editorconfig_get_error_msg>:
test   %edi,%edi
jle    110c <editorconfig_get_error_msg+0xc>
lea    0xef5(%rip),%rax
ret
add    $0x4,%edi
cmp    $0x4,%edi
ja     1126 <editorconfig_get_error_msg+0x26>
movslq %edi,%rax
lea    0xf86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf65(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Failed to parse file.\00"
@.str.1 = [19 x i8] c"No error occurred.\00"
@.str.2 = [37 x i8] c"Input file must be a full path name.\00"
@.str.3 = [14 x i8] c"Memory error.\00"
@.str.4 = [54 x i8] c"Required version is greater than the current version.\00"
@.str.5 = [15 x i8] c"Unknown error.\00"
define i8* @editorconfig_get_error_msg(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
switch i32 %8, label %13 [
i32 0, label %9
i32 -2, label %10
i32 -3, label %11
i32 -4, label %12
]
9: ; preds = %7
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %7
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
12: ; preds = %7
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
13: ; preds = %7
br label %14
14: ; preds = %13
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %14, %12, %11, %10, %9, %6
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"Failed to parse file.\00"
@.str.1 = [19 x i8] c"No error occurred.\00"
@.str.2 = [37 x i8] c"Input file must be a full path name.\00"
@.str.3 = [14 x i8] c"Memory error.\00"
@.str.4 = [54 x i8] c"Required version is greater than the current version.\00"
@.str.5 = [15 x i8] c"Unknown error.\00"
@reltable.editorconfig_get_error_msg = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([54 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.editorconfig_get_error_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.editorconfig_get_error_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.editorconfig_get_error_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.5 to i64), i64 ptrtoint ([5 x i32]* @reltable.editorconfig_get_error_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.editorconfig_get_error_msg to i64)) to i32)]
define i8* @editorconfig_get_error_msg(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add i32 %0, 4
%5 = icmp ult i32 %4, 5
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.editorconfig_get_error_msg to i8*), i64 %8)
br label %10
10: ; preds = %3, %6, %1
%11 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %1 ], [ %9, %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), %3 ]
ret i8* %11
}