unsigned char ConvertVIC_To_VM_Index(unsigned char VIC,
                                     unsigned char _3D_Struct) {
  unsigned char ConvertedVIC;
  const unsigned char VIC2Index[] = {
      0,  0,  1,  1,  2,  3,  4,  4,  5,  5,  7,  7,  8,  8,  10,
      10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 19, 19, 20, 20, 23,
      23, 24, 25, 26, 27, 28, 28, 29, 29, 30, 31, 32, 33, 33, 34,
      34, 35, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42};
  VIC &= 0x7F;
  if (VIC < 60) {
    ConvertedVIC = VIC2Index[VIC];
    if (_3D_Struct != 0x0F) {
      switch (VIC) {
      case 4:
        switch (_3D_Struct) {
        case 0x00:
          ConvertedVIC = 43;
          break;
        case 0x03:
          ConvertedVIC = 44;
          break;
        case 0x04:
          ConvertedVIC = 45;
          break;
        }
        break;
      case 5:
        switch (_3D_Struct) {
        case 0x00:
          ConvertedVIC = 46;
          break;
        case 0x08:
          ConvertedVIC = 47;
          break;
        }
        break;
      case 19:
        switch (_3D_Struct) {
        case 0x00:
          ConvertedVIC = 48;
          break;
        case 0x03:
          ConvertedVIC = 49;
          break;
        case 0x04:
          ConvertedVIC = 50;
          break;
        }
        break;
      case 20:
        switch (_3D_Struct) {
        case 0x00:
          ConvertedVIC = 51;
          break;
        case 0x08:
          ConvertedVIC = 52;
          break;
        }
        break;
      case 32:
        switch (_3D_Struct) {
        case 0x00:
          ConvertedVIC = 53;
          break;
        case 0x03:
          ConvertedVIC = 54;
          break;
        case 0x04:
          ConvertedVIC = 55;
          break;
        }
        break;
      }
    }
  } else
    ConvertedVIC = VIC;
  return ConvertedVIC;
}


x86 assembly (clang, -O0):
<ConvertVIC_To_VM_Index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xf51(%rip),%rsi
mov    $0x3c,%edx
call   1030 <memcpy@plt>
movzbl -0x1(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x3c,%eax
jge    12fd <ConvertVIC_To_VM_Index+0x1ed>
movzbl -0x1(%rbp),%eax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xf,%eax
je     12f8 <ConvertVIC_To_VM_Index+0x1e8>
movzbl -0x1(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x1c,%eax
ja     12f3 <ConvertVIC_To_VM_Index+0x1e3>
mov    -0x48(%rbp),%rax
lea    0xe77(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzbl -0x2(%rbp),%eax
mov    %eax,-0x4c(%rbp)
test   %eax,%eax
je     11c8 <ConvertVIC_To_VM_Index+0xb8>
jmp    11a6 <ConvertVIC_To_VM_Index+0x96>
mov    -0x4c(%rbp),%eax
sub    $0x3,%eax
je     11d1 <ConvertVIC_To_VM_Index+0xc1>
jmp    11b7 <ConvertVIC_To_VM_Index+0xa7>
mov    -0x4c(%rbp),%eax
sub    $0x4,%eax
je     11da <ConvertVIC_To_VM_Index+0xca>
jmp    11de <ConvertVIC_To_VM_Index+0xce>
movb   $0x2b,-0x3(%rbp)
jmp    11de <ConvertVIC_To_VM_Index+0xce>
movb   $0x2c,-0x3(%rbp)
jmp    11de <ConvertVIC_To_VM_Index+0xce>
movb   $0x2d,-0x3(%rbp)
jmp    12f3 <ConvertVIC_To_VM_Index+0x1e3>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x50(%rbp)
test   %eax,%eax
je     1208 <ConvertVIC_To_VM_Index+0xf8>
jmp    11f7 <ConvertVIC_To_VM_Index+0xe7>
mov    -0x50(%rbp),%eax
sub    $0x8,%eax
je     1211 <ConvertVIC_To_VM_Index+0x101>
jmp    1215 <ConvertVIC_To_VM_Index+0x105>
movb   $0x2e,-0x3(%rbp)
jmp    1215 <ConvertVIC_To_VM_Index+0x105>
movb   $0x2f,-0x3(%rbp)
jmp    12f3 <ConvertVIC_To_VM_Index+0x1e3>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x54(%rbp)
test   %eax,%eax
je     1250 <ConvertVIC_To_VM_Index+0x140>
jmp    122e <ConvertVIC_To_VM_Index+0x11e>
mov    -0x54(%rbp),%eax
sub    $0x3,%eax
je     1259 <ConvertVIC_To_VM_Index+0x149>
jmp    123f <ConvertVIC_To_VM_Index+0x12f>
mov    -0x54(%rbp),%eax
sub    $0x4,%eax
je     1262 <ConvertVIC_To_VM_Index+0x152>
jmp    1266 <ConvertVIC_To_VM_Index+0x156>
movb   $0x30,-0x3(%rbp)
jmp    1266 <ConvertVIC_To_VM_Index+0x156>
movb   $0x31,-0x3(%rbp)
jmp    1266 <ConvertVIC_To_VM_Index+0x156>
movb   $0x32,-0x3(%rbp)
jmp    12f3 <ConvertVIC_To_VM_Index+0x1e3>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x58(%rbp)
test   %eax,%eax
je     1290 <ConvertVIC_To_VM_Index+0x180>
jmp    127f <ConvertVIC_To_VM_Index+0x16f>
mov    -0x58(%rbp),%eax
sub    $0x8,%eax
je     1299 <ConvertVIC_To_VM_Index+0x189>
jmp    129d <ConvertVIC_To_VM_Index+0x18d>
movb   $0x33,-0x3(%rbp)
jmp    129d <ConvertVIC_To_VM_Index+0x18d>
movb   $0x34,-0x3(%rbp)
jmp    12f3 <ConvertVIC_To_VM_Index+0x1e3>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x5c(%rbp)
test   %eax,%eax
je     12d8 <ConvertVIC_To_VM_Index+0x1c8>
jmp    12b6 <ConvertVIC_To_VM_Index+0x1a6>
mov    -0x5c(%rbp),%eax
sub    $0x3,%eax
je     12e1 <ConvertVIC_To_VM_Index+0x1d1>
jmp    12c7 <ConvertVIC_To_VM_Index+0x1b7>
mov    -0x5c(%rbp),%eax
sub    $0x4,%eax
je     12ea <ConvertVIC_To_VM_Index+0x1da>
jmp    12ee <ConvertVIC_To_VM_Index+0x1de>
movb   $0x35,-0x3(%rbp)
jmp    12ee <ConvertVIC_To_VM_Index+0x1de>
movb   $0x36,-0x3(%rbp)
jmp    12ee <ConvertVIC_To_VM_Index+0x1de>
movb   $0x37,-0x3(%rbp)
jmp    12f3 <ConvertVIC_To_VM_Index+0x1e3>
jmp    12f8 <ConvertVIC_To_VM_Index+0x1e8>
jmp    1303 <ConvertVIC_To_VM_Index+0x1f3>
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertVIC_To_VM_Index>:
and    $0x7f,%edi
mov    %edi,%eax
cmp    $0x3b,%dil
ja     111b <ConvertVIC_To_VM_Index+0x1b>
lea    0xf6e(%rip),%rax
mov    (%rdi,%rax,1),%al
cmp    $0xf,%sil
jne    111c <ConvertVIC_To_VM_Index+0x1c>
ret
add    $0xfffffffc,%edi
cmp    $0x1c,%edi
ja     111b <ConvertVIC_To_VM_Index+0x1b>
lea    0xed5(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
cmp    $0x4,%sil
je     1192 <ConvertVIC_To_VM_Index+0x92>
cmp    $0x3,%sil
je     1195 <ConvertVIC_To_VM_Index+0x95>
test   %sil,%sil
jne    111b <ConvertVIC_To_VM_Index+0x1b>
mov    $0x2b,%al
ret
cmp    $0x8,%sil
je     118c <ConvertVIC_To_VM_Index+0x8c>
test   %sil,%sil
jne    111b <ConvertVIC_To_VM_Index+0x1b>
mov    $0x2e,%al
ret
cmp    $0x4,%sil
je     1198 <ConvertVIC_To_VM_Index+0x98>
cmp    $0x3,%sil
je     119b <ConvertVIC_To_VM_Index+0x9b>
test   %sil,%sil
jne    111b <ConvertVIC_To_VM_Index+0x1b>
mov    $0x30,%al
ret
cmp    $0x8,%sil
je     118f <ConvertVIC_To_VM_Index+0x8f>
test   %sil,%sil
jne    111b <ConvertVIC_To_VM_Index+0x1b>
mov    $0x33,%al
ret
cmp    $0x4,%sil
je     119e <ConvertVIC_To_VM_Index+0x9e>
cmp    $0x3,%sil
je     11a1 <ConvertVIC_To_VM_Index+0xa1>
test   %sil,%sil
jne    111b <ConvertVIC_To_VM_Index+0x1b>
mov    $0x35,%al
ret
mov    $0x2f,%al
ret
mov    $0x34,%al
ret
mov    $0x2d,%al
ret
mov    $0x2c,%al
ret
mov    $0x32,%al
ret
mov    $0x31,%al
ret
mov    $0x37,%al
ret
mov    $0x36,%al
ret

LLVM IR (-O0):
@__const.ConvertVIC_To_VM_Index.VIC2Index = [60 x i8] c"\00\00\01\01\02\03\04\04\05\05\07\07\08\08\0A\0A\0B\0C\0C\0D\0E\0F\0F\10\10\13\13\14\14\17\17\18\19\1A\1B\1C\1C\1D\1D\1E\1F !!\22\22#$%%&&''(())**"
define zeroext i8 @ConvertVIC_To_VM_Index(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca [60 x i8]
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = bitcast [60 x i8]* %6 to i8*
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = and i32 %9, 127
%11 = trunc i32 %10 to i8
store i8 %11, i8* %3
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %13, 60
br i1 %14, label %15, label %61
15: ; preds = %2
%16 = load i8, i8* %3
%17 = zext i8 %16 to i64
%18 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %5
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %21, 15
br i1 %22, label %23, label %60
23: ; preds = %15
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
switch i32 %25, label %59 [
i32 4, label %26
i32 5, label %33
i32 19, label %39
i32 20, label %46
i32 32, label %52
]
26: ; preds = %23
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
switch i32 %28, label %32 [
i32 0, label %29
i32 3, label %30
i32 4, label %31
]
29: ; preds = %26
store i8 43, i8* %5
br label %32
30: ; preds = %26
store i8 44, i8* %5
br label %32
31: ; preds = %26
store i8 45, i8* %5
br label %32
32: ; preds = %26, %31, %30, %29
br label %59
33: ; preds = %23
%34 = load i8, i8* %4
%35 = zext i8 %34 to i32
switch i32 %35, label %38 [
i32 0, label %36
i32 8, label %37
]
36: ; preds = %33
store i8 46, i8* %5
br label %38
37: ; preds = %33
store i8 47, i8* %5
br label %38
38: ; preds = %33, %37, %36
br label %59
39: ; preds = %23
%40 = load i8, i8* %4
%41 = zext i8 %40 to i32
switch i32 %41, label %45 [
i32 0, label %42
i32 3, label %43
i32 4, label %44
]
42: ; preds = %39
store i8 48, i8* %5
br label %45
43: ; preds = %39
store i8 49, i8* %5
br label %45
44: ; preds = %39
store i8 50, i8* %5
br label %45
45: ; preds = %39, %44, %43, %42
br label %59
46: ; preds = %23
%47 = load i8, i8* %4
%48 = zext i8 %47 to i32
switch i32 %48, label %51 [
i32 0, label %49
i32 8, label %50
]
49: ; preds = %46
store i8 51, i8* %5
br label %51
50: ; preds = %46
store i8 52, i8* %5
br label %51
51: ; preds = %46, %50, %49
br label %59
52: ; preds = %23
%53 = load i8, i8* %4
%54 = zext i8 %53 to i32
switch i32 %54, label %58 [
i32 0, label %55
i32 3, label %56
i32 4, label %57
]
55: ; preds = %52
store i8 53, i8* %5
br label %58
56: ; preds = %52
store i8 54, i8* %5
br label %58
57: ; preds = %52
store i8 55, i8* %5
br label %58
58: ; preds = %52, %57, %56, %55
br label %59
59: ; preds = %23, %58, %51, %45, %38, %32
br label %60
60: ; preds = %59, %15
br label %63
61: ; preds = %2
%62 = load i8, i8* %3
store i8 %62, i8* %5
br label %63
63: ; preds = %61, %60
%64 = load i8, i8* %5
ret i8 %64
}

LLVM IR (-O2):
@__const.ConvertVIC_To_VM_Index.VIC2Index = [60 x i8] c"\00\00\01\01\02\03\04\04\05\05\07\07\08\08\0A\0A\0B\0C\0C\0D\0E\0F\0F\10\10\13\13\14\14\17\17\18\19\1A\1B\1C\1C\1D\1D\1E\1F !!\22\22#$%%&&''(())**"
define zeroext i8 @ConvertVIC_To_VM_Index(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %0, 127
%4 = zext i8 %3 to i32
%5 = icmp ult i8 %3, 60
br i1 %5, label %6, label %30
6: ; preds = %2
%7 = zext i8 %3 to i64
%8 = getelementptr inbounds [60 x i8], [60 x i8]* @__const.ConvertVIC_To_VM_Index.VIC2Index, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %1, 15
br i1 %10, label %30, label %11
11: ; preds = %6
switch i32 %4, label %30 [
i32 4, label %12
i32 5, label %16
i32 19, label %19
i32 20, label %23
i32 32, label %26
]
12: ; preds = %11
switch i8 %1, label %30 [
i8 0, label %13
i8 3, label %14
i8 4, label %15
]
13: ; preds = %12
br label %30
14: ; preds = %12
br label %30
15: ; preds = %12
br label %30
16: ; preds = %11
switch i8 %1, label %30 [
i8 0, label %17
i8 8, label %18
]
17: ; preds = %16
br label %30
18: ; preds = %16
br label %30
19: ; preds = %11
switch i8 %1, label %30 [
i8 0, label %20
i8 3, label %21
i8 4, label %22
]
20: ; preds = %19
br label %30
21: ; preds = %19
br label %30
22: ; preds = %19
br label %30
23: ; preds = %11
switch i8 %1, label %30 [
i8 0, label %24
i8 8, label %25
]
24: ; preds = %23
br label %30
25: ; preds = %23
br label %30
26: ; preds = %11
switch i8 %1, label %30 [
i8 0, label %27
i8 3, label %28
i8 4, label %29
]
27: ; preds = %26
br label %30
28: ; preds = %26
br label %30
29: ; preds = %26
br label %30
30: ; preds = %2, %6, %27, %28, %29, %26, %24, %25, %23, %20, %21, %22, %19, %17, %18, %16, %13, %14, %15, %12, %11
%31 = phi i8 [ %9, %11 ], [ %9, %26 ], [ 55, %29 ], [ 54, %28 ], [ 53, %27 ], [ %9, %23 ], [ 52, %25 ], [ 51, %24 ], [ %9, %19 ], [ 50, %22 ], [ 49, %21 ], [ 48, %20 ], [ %9, %16 ], [ 47, %18 ], [ 46, %17 ], [ %9, %12 ], [ 45, %15 ], [ 44, %14 ], [ 43, %13 ], [ %9, %6 ], [ %3, %2 ]
ret i8 %31
}