char *FruTypeString(unsigned char frutype) {
  char *pstr;
  switch (frutype) {
  case 0x07:
    pstr = "Baseboard";
    break;
  case 0x0c:
    pstr = "Baseboard";
    break;
  case 0x0a:
    pstr = "PowerSply";
    break;
  case 0x15:
    pstr = "PowerCage";
    break;
  case 0x20:
    pstr = "DIMM     ";
    break;
  case 0x0f:
    pstr = "HotSwapCt";
    break;
  case 0x2e:
    pstr = "ME       ";
    break;
  default:
    pstr = "Component";
    break;
  }
  return (pstr);
}


x86 assembly (clang, -O0):
<FruTypeString>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x27,%eax
ja     11a4 <FruTypeString+0xa4>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf65(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf55(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf4f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf49(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf43(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf3d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf37(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11af <FruTypeString+0xaf>
lea    0xf31(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FruTypeString>:
add    $0xf9,%dil
cmp    $0x27,%dil
ja     1126 <FruTypeString+0x26>
lea    0xf8f(%rip),%rax
movzbl %dil,%ecx
lea    0xee4(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
lea    0xfaf(%rip),%rax
ret
lea    0xf75(%rip),%rax
ret
lea    0xf8b(%rip),%rax
ret
lea    0xf79(%rip),%rax
ret
lea    0xf85(%rip),%rax
ret
lea    0xf5f(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Baseboard\00"
@.str.1 = [10 x i8] c"PowerSply\00"
@.str.2 = [10 x i8] c"PowerCage\00"
@.str.3 = [10 x i8] c"DIMM \00"
@.str.4 = [10 x i8] c"HotSwapCt\00"
@.str.5 = [10 x i8] c"ME \00"
@.str.6 = [10 x i8] c"Component\00"
define i8* @FruTypeString(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
switch i32 %5, label %13 [
i32 7, label %6
i32 12, label %7
i32 10, label %8
i32 21, label %9
i32 32, label %10
i32 15, label %11
i32 46, label %12
]
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
br label %14
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
br label %14
8: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %14
9: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %14
10: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %14
11: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %14
12: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %14
13: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [10 x i8] c"Baseboard\00"
@.str.1 = [10 x i8] c"PowerSply\00"
@.str.2 = [10 x i8] c"PowerCage\00"
@.str.3 = [10 x i8] c"DIMM \00"
@.str.4 = [10 x i8] c"HotSwapCt\00"
@.str.5 = [10 x i8] c"ME \00"
@.str.6 = [10 x i8] c"Component\00"
define i8* @FruTypeString(i8 zeroext %0) {
switch i8 %0, label %7 [
i8 7, label %8
i8 12, label %8
i8 10, label %2
i8 21, label %3
i8 32, label %4
i8 15, label %5
i8 46, label %6
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %1, %7, %6, %5, %4, %3, %2
%9 = phi i8* [ getelementptr inbounds ([10 x i8], [10 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 ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}