const char *mbc_to_string(int mbc_type) {
  switch (mbc_type) {
  case 0:
    return "NONE";
  case 1:
    return "MBC1";
  case 2:
    return "MBC2";
  case 3:
    return "MBC3";
  case 5:
    return "MBC5";
  case 15:
    return "RUMBL";
  case 0xC1:
    return "HUC1";
  case 0xC3:
    return "HUC3";
  default:
    return "UNKN";
  }
}


x86 assembly (clang, -O0):
<mbc_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1195 <mbc_to_string+0x95>
jmp    111a <mbc_to_string+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11a5 <mbc_to_string+0xa5>
jmp    112b <mbc_to_string+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11b5 <mbc_to_string+0xb5>
jmp    113c <mbc_to_string+0x3c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11c5 <mbc_to_string+0xc5>
jmp    114d <mbc_to_string+0x4d>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     11d5 <mbc_to_string+0xd5>
jmp    115e <mbc_to_string+0x5e>
mov    -0x10(%rbp),%eax
sub    $0xf,%eax
je     11e5 <mbc_to_string+0xe5>
jmp    116f <mbc_to_string+0x6f>
mov    -0x10(%rbp),%eax
sub    $0xc1,%eax
je     11f5 <mbc_to_string+0xf5>
jmp    1182 <mbc_to_string+0x82>
mov    -0x10(%rbp),%eax
sub    $0xc3,%eax
je     1205 <mbc_to_string+0x105>
jmp    1215 <mbc_to_string+0x115>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe59(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe4e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe38(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe2d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe23(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe18(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1220 <mbc_to_string+0x120>
lea    0xe0d(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbc_to_string>:
cmp    $0xf,%edi
ja     1126 <mbc_to_string+0x26>
lea    0xf34(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf20(%rip),%rax
ret
cmp    $0xc1,%edi
je     1166 <mbc_to_string+0x66>
cmp    $0xc3,%edi
jne    113e <mbc_to_string+0x3e>
lea    0xf27(%rip),%rax
ret
lea    0xf24(%rip),%rax
ret
lea    0xefd(%rip),%rax
ret
lea    0xefa(%rip),%rax
ret
lea    0xef7(%rip),%rax
ret
lea    0xef4(%rip),%rax
ret
lea    0xef2(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"NONE\00"
@.str.1 = [5 x i8] c"MBC1\00"
@.str.2 = [5 x i8] c"MBC2\00"
@.str.3 = [5 x i8] c"MBC3\00"
@.str.4 = [5 x i8] c"MBC5\00"
@.str.5 = [6 x i8] c"RUMBL\00"
@.str.6 = [5 x i8] c"HUC1\00"
@.str.7 = [5 x i8] c"HUC3\00"
@.str.8 = [5 x i8] c"UNKN\00"
define i8* @mbc_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 5, label %9
i32 15, label %10
i32 193, label %11
i32 195, label %12
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %14
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %14
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %14
9: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %14
10: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %14
11: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %14
12: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %14
13: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"NONE\00"
@.str.1 = [5 x i8] c"MBC1\00"
@.str.2 = [5 x i8] c"MBC2\00"
@.str.3 = [5 x i8] c"MBC3\00"
@.str.4 = [5 x i8] c"MBC5\00"
@.str.5 = [6 x i8] c"RUMBL\00"
@.str.6 = [5 x i8] c"HUC1\00"
@.str.7 = [5 x i8] c"HUC3\00"
@.str.8 = [5 x i8] c"UNKN\00"
define i8* @mbc_to_string(i32 %0) {
switch i32 %0, label %9 [
i32 0, label %10
i32 1, label %2
i32 2, label %3
i32 3, label %4
i32 5, label %5
i32 15, label %6
i32 193, label %7
i32 195, label %8
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}