char *btesh2_tkfat_fstnameforfsty(int fsty) {
  char *s0;
  switch (fsty) {
  case 0x00:
    s0 = "(none)";
    break;
  case 0x06:
    s0 = "FAT16";
    break;
  case 0x0B:
    s0 = "FAT32";
    break;
  case 0x0C:
    s0 = "FAT32";
    break;
  default:
    s0 = "?";
    break;
  }
  return (s0);
}


x86 assembly (clang, -O0):
<btesh2_tkfat_fstnameforfsty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xc,%rax
ja     116c <btesh2_tkfat_fstnameforfsty+0x6c>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf01(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <btesh2_tkfat_fstnameforfsty+0x77>
lea    0xef8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <btesh2_tkfat_fstnameforfsty+0x77>
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <btesh2_tkfat_fstnameforfsty+0x77>
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <btesh2_tkfat_fstnameforfsty+0x77>
lea    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btesh2_tkfat_fstnameforfsty>:
cmp    $0xc,%edi
ja     1126 <btesh2_tkfat_fstnameforfsty+0x26>
lea    0xf28(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf1c(%rip),%rax
ret
lea    0xf1a(%rip),%rax
ret
lea    0xf06(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(none)\00"
@.str.1 = [6 x i8] c"FAT16\00"
@.str.2 = [6 x i8] c"FAT32\00"
@.str.3 = [2 x i8] c"?\00"
define i8* @btesh2_tkfat_fstnameforfsty(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 0, label %5
i32 6, label %6
i32 11, label %7
i32 12, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"(none)\00"
@.str.1 = [6 x i8] c"FAT16\00"
@.str.2 = [6 x i8] c"FAT32\00"
@.str.3 = [2 x i8] c"?\00"
define i8* @btesh2_tkfat_fstnameforfsty(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %6
i32 6, label %2
i32 11, label %3
i32 12, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}