char *picmg_link_type(unsigned char b) {
  char *s;
  if (b >= 0xf0 && b <= 0xf3)
    s = "OEM GUID Definition";
  else
    switch (b) {
    case 0x01:
      s = "PICMG 3.0 Base Interface 10/100/1000";
      break;
    case 0x02:
      s = "PICMG 3.1 Ethernet Fabric Interface";
      break;
    case 0x03:
      s = "PICMG 3.2 Infiniband Fabric Interface";
      break;
    case 0x04:
      s = "PICMG 3.3 Star Fabric Interface";
      break;
    case 0x05:
      s = "PICMG 3.4 PCI Express Fabric Interface";
      break;
    default:
      s = "Reserved";
      break;
    }
  return (s);
}


x86 assembly (clang, -O0):
<picmg_link_type>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xf0,%eax
jl     1138 <picmg_link_type+0x38>
movzbl -0x1(%rbp),%eax
cmp    $0xf3,%eax
jg     1138 <picmg_link_type+0x38>
lea    0xee5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11c2 <picmg_link_type+0xc2>
movzbl -0x1(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11b2 <picmg_link_type+0xb2>
mov    -0x18(%rbp),%rax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11bd <picmg_link_type+0xbd>
lea    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11bd <picmg_link_type+0xbd>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11bd <picmg_link_type+0xbd>
lea    0xefe(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11bd <picmg_link_type+0xbd>
lea    0xf0e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11bd <picmg_link_type+0xbd>
lea    0xf25(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11c2 <picmg_link_type+0xc2>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<picmg_link_type>:
mov    %edi,%eax
and    $0xfc,%al
cmp    $0xf0,%al
jne    1110 <picmg_link_type+0x10>
lea    0xef1(%rip),%rax
ret
add    $0xff,%dil
cmp    $0x4,%dil
ja     112d <picmg_link_type+0x2d>
movsbq %dil,%rax
lea    0xfaf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf96(%rip),%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"OEM GUID Definition\00"
@.str.1 = [37 x i8] c"PICMG 3.0 Base Interface 10/100/1000\00"
@.str.2 = [36 x i8] c"PICMG 3.1 Ethernet Fabric Interface\00"
@.str.3 = [38 x i8] c"PICMG 3.2 Infiniband Fabric Interface\00"
@.str.4 = [32 x i8] c"PICMG 3.3 Star Fabric Interface\00"
@.str.5 = [39 x i8] c"PICMG 3.4 PCI Express Fabric Interface\00"
@.str.6 = [9 x i8] c"Reserved\00"
define i8* @picmg_link_type(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
%6 = icmp sge i32 %5, 240
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 243
br i1 %10, label %11, label %12
11: ; preds = %7
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %3
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
switch i32 %14, label %20 [
i32 1, label %15
i32 2, label %16
i32 3, label %17
i32 4, label %18
i32 5, label %19
]
15: ; preds = %12
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %21
16: ; preds = %12
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %21
17: ; preds = %12
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %21
18: ; preds = %12
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %21
19: ; preds = %12
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %21
20: ; preds = %12
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %21
21: ; preds = %20, %19, %18, %17, %16, %15
br label %22
22: ; preds = %21, %11
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [20 x i8] c"OEM GUID Definition\00"
@.str.1 = [37 x i8] c"PICMG 3.0 Base Interface 10/100/1000\00"
@.str.2 = [36 x i8] c"PICMG 3.1 Ethernet Fabric Interface\00"
@.str.3 = [38 x i8] c"PICMG 3.2 Infiniband Fabric Interface\00"
@.str.4 = [32 x i8] c"PICMG 3.3 Star Fabric Interface\00"
@.str.5 = [39 x i8] c"PICMG 3.4 PCI Express Fabric Interface\00"
@.str.6 = [9 x i8] c"Reserved\00"
@reltable.picmg_link_type = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.picmg_link_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.picmg_link_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([38 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.picmg_link_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.picmg_link_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @.str.5 to i64), i64 ptrtoint ([5 x i32]* @reltable.picmg_link_type to i64)) to i32)]
define i8* @picmg_link_type(i8 zeroext %0) {
%2 = and i8 %0, -4
%3 = icmp eq i8 %2, -16
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i8 %0, -1
%6 = icmp ult i8 %5, 5
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = sext i8 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.picmg_link_type to i8*), i64 %9)
br label %11
11: ; preds = %4, %7, %1
%12 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %1 ], [ %10, %7 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), %4 ]
ret i8* %12
}