char *subr_kind_str(long n) {
  switch (n) {
  case 4:
    return ("subr_0");
  case 5:
    return ("subr_1");
  case 6:
    return ("subr_2");
  case 21:
    return ("subr_2n");
  case 7:
    return ("subr_3");
  case 19:
    return ("subr_4");
  case 20:
    return ("subr_5");
  case 8:
    return ("lsubr");
  case 9:
    return ("fsubr");
  case 10:
    return ("msubr");
  default:
    return ("???");
  }
}


x86 assembly (clang, -O0):
<subr_kind_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
sub    $0x11,%rax
ja     11d2 <subr_kind_str+0xd2>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xf06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xefd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xef4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xeec(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xee3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <subr_kind_str+0xdd>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subr_kind_str>:
add    $0xfffffffffffffffc,%rdi
cmp    $0x11,%rdi
ja     1119 <subr_kind_str+0x19>
lea    0xf37(%rip),%rcx
movslq (%rcx,%rdi,4),%rax
add    %rcx,%rax
ret
lea    0xf24(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"subr_0\00"
@.str.1 = [7 x i8] c"subr_1\00"
@.str.2 = [7 x i8] c"subr_2\00"
@.str.3 = [8 x i8] c"subr_2n\00"
@.str.4 = [7 x i8] c"subr_3\00"
@.str.5 = [7 x i8] c"subr_4\00"
@.str.6 = [7 x i8] c"subr_5\00"
@.str.7 = [6 x i8] c"lsubr\00"
@.str.8 = [6 x i8] c"fsubr\00"
@.str.9 = [6 x i8] c"msubr\00"
@.str.10 = [4 x i8] c"???\00"
define i8* @subr_kind_str(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %15 [
i64 4, label %5
i64 5, label %6
i64 6, label %7
i64 21, label %8
i64 7, label %9
i64 19, label %10
i64 20, label %11
i64 8, label %12
i64 9, label %13
i64 10, label %14
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %16
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %16
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %16
9: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %16
10: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %16
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %16
13: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %16
14: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %16
15: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 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 = [7 x i8] c"subr_0\00"
@.str.1 = [7 x i8] c"subr_1\00"
@.str.2 = [7 x i8] c"subr_2\00"
@.str.3 = [8 x i8] c"subr_2n\00"
@.str.4 = [7 x i8] c"subr_3\00"
@.str.5 = [7 x i8] c"subr_4\00"
@.str.6 = [7 x i8] c"subr_5\00"
@.str.7 = [6 x i8] c"lsubr\00"
@.str.8 = [6 x i8] c"fsubr\00"
@.str.9 = [6 x i8] c"msubr\00"
@.str.10 = [4 x i8] c"???\00"
@reltable.subr_kind_str = [18 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.7 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.8 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.9 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.3 to i64), i64 ptrtoint ([18 x i32]* @reltable.subr_kind_str to i64)) to i32)]
define i8* @subr_kind_str(i64 %0) {
%2 = add i64 %0, -4
%3 = icmp ult i64 %2, 18
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = shl i64 %2, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([18 x i32]* @reltable.subr_kind_str to i8*), i64 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), %1 ]
ret i8* %8
}