const char *method_str(unsigned method) {
  switch (method) {
  case 0:
    return "uncompressed";
  case 1:
    return "shrink";
  case 2:
  case 3:
  case 4:
  case 5:
    return "reduce";
  case 6:
    return "implode";
  case 8:
    return "deflate";
  case 9:
    return "deflate64";
  case 10:
    return "IBM TERSE (old)";
  case 12:
    return "bzip2";
  case 14:
    return "lzma";
  case 18:
    return "IBM TERSE (new)";
  case 19:
    return "IBM LZ77 z";
  case 97:
    return "WavPack";
  case 98:
    return "PPMd";
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<method_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x62,%rax
ja     11fc <method_str+0xfc>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1059(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1056(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x104d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1044(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x103c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1034(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x102e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x102e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1024(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1019(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1019(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1014(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x100c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <method_str+0x107>
lea    0x1001(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<method_str>:
cmp    $0x62,%edi
ja     117e <method_str+0x7e>
lea    0x1080(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0x107b(%rip),%rax
ret
lea    0x106c(%rip),%rax
ret
lea    0x1072(%rip),%rax
ret
lea    0x1072(%rip),%rax
ret
lea    0x1072(%rip),%rax
ret
lea    0x1074(%rip),%rax
ret
lea    0x107c(%rip),%rax
ret
lea    0x107a(%rip),%rax
ret
lea    0x1077(%rip),%rax
ret
lea    0x107f(%rip),%rax
ret
lea    0x1082(%rip),%rax
ret
lea    0x1082(%rip),%rax
ret
lea    0x107f(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"uncompressed\00"
@.str.1 = [7 x i8] c"shrink\00"
@.str.2 = [7 x i8] c"reduce\00"
@.str.3 = [8 x i8] c"implode\00"
@.str.4 = [8 x i8] c"deflate\00"
@.str.5 = [10 x i8] c"deflate64\00"
@.str.6 = [16 x i8] c"IBM TERSE (old)\00"
@.str.7 = [6 x i8] c"bzip2\00"
@.str.8 = [5 x i8] c"lzma\00"
@.str.9 = [16 x i8] c"IBM TERSE (new)\00"
@.str.10 = [11 x i8] c"IBM LZ77 z\00"
@.str.11 = [8 x i8] c"WavPack\00"
@.str.12 = [5 x i8] c"PPMd\00"
@.str.13 = [8 x i8] c"unknown\00"
define i8* @method_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %18 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %7
i32 4, label %7
i32 5, label %7
i32 6, label %8
i32 8, label %9
i32 9, label %10
i32 10, label %11
i32 12, label %12
i32 14, label %13
i32 18, label %14
i32 19, label %15
i32 97, label %16
i32 98, label %17
]
5: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
br label %19
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %19
7: ; preds = %1, %1, %1, %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %19
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %19
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %19
10: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %19
11: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %19
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %19
13: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %19
14: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %19
15: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %19
16: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %19
17: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %19
18: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %19
19: ; preds = %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"uncompressed\00"
@.str.1 = [7 x i8] c"shrink\00"
@.str.2 = [7 x i8] c"reduce\00"
@.str.3 = [8 x i8] c"implode\00"
@.str.4 = [8 x i8] c"deflate\00"
@.str.5 = [10 x i8] c"deflate64\00"
@.str.6 = [16 x i8] c"IBM TERSE (old)\00"
@.str.7 = [6 x i8] c"bzip2\00"
@.str.8 = [5 x i8] c"lzma\00"
@.str.9 = [16 x i8] c"IBM TERSE (new)\00"
@.str.10 = [11 x i8] c"IBM LZ77 z\00"
@.str.11 = [8 x i8] c"WavPack\00"
@.str.12 = [5 x i8] c"PPMd\00"
@.str.13 = [8 x i8] c"unknown\00"
define i8* @method_str(i32 %0) {
switch i32 %0, label %14 [
i32 0, label %15
i32 1, label %2
i32 2, label %3
i32 3, label %3
i32 4, label %3
i32 5, label %3
i32 6, label %4
i32 8, label %5
i32 9, label %6
i32 10, label %7
i32 12, label %8
i32 14, label %9
i32 18, label %10
i32 19, label %11
i32 97, label %12
i32 98, label %13
]
2: ; preds = %1
br label %15
3: ; preds = %1, %1, %1, %1
br label %15
4: ; preds = %1
br label %15
5: ; preds = %1
br label %15
6: ; preds = %1
br label %15
7: ; preds = %1
br label %15
8: ; preds = %1
br label %15
9: ; preds = %1
br label %15
10: ; preds = %1
br label %15
11: ; preds = %1
br label %15
12: ; preds = %1
br label %15
13: ; preds = %1
br label %15
14: ; preds = %1
br label %15
15: ; preds = %1, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%16 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %16
}