void FCEU_DoSimpleCommand(int cmd) {
  switch (cmd) {
  case 0x18:
    FCEU_FDSInsert(-1);
    break;
  case 0x1A:
    FCEU_FDSSelect();
    break;
  case 0x19:
    FCEU_FDSEject();
    break;
  case 0x07:
    FCEU_VSUniCoin();
    break;
  case 0x08 ...(0x08 + 7):
    FCEU_VSUniToggleDIP(cmd - 0x08);
    break;
  case 0x02:
    PowerNES();
    break;
  case 0x01:
    ResetNES();
    break;
  }
}


x86 assembly (clang, -O0):
<FCEU_DoSimpleCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x19,%eax
ja     11fe <FCEU_DoSimpleCommand+0x8e>
mov    -0x10(%rbp),%rax
lea    0xe65(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xffffffff,%edi
mov    $0x0,%al
call   1040 <FCEU_FDSInsert@plt>
jmp    11fe <FCEU_DoSimpleCommand+0x8e>
mov    $0x0,%al
call   1090 <FCEU_FDSSelect@plt>
jmp    11fe <FCEU_DoSimpleCommand+0x8e>
mov    $0x0,%al
call   1070 <FCEU_FDSEject@plt>
jmp    11fe <FCEU_DoSimpleCommand+0x8e>
mov    $0x0,%al
call   1050 <FCEU_VSUniCoin@plt>
jmp    11fe <FCEU_DoSimpleCommand+0x8e>
mov    -0x4(%rbp),%edi
sub    $0x8,%edi
mov    $0x0,%al
call   1030 <FCEU_VSUniToggleDIP@plt>
jmp    11fe <FCEU_DoSimpleCommand+0x8e>
mov    $0x0,%al
call   1060 <PowerNES@plt>
jmp    11fe <FCEU_DoSimpleCommand+0x8e>
mov    $0x0,%al
call   1080 <ResetNES@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FCEU_DoSimpleCommand>:
lea    -0x1(%rdi),%eax
cmp    $0x19,%eax
ja     11a0 <FCEU_DoSimpleCommand+0x30>
lea    0xe81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0xfffffff8,%edi
xor    %eax,%eax
jmp    1030 <FCEU_VSUniToggleDIP@plt>
xor    %eax,%eax
jmp    1080 <ResetNES@plt>
xor    %eax,%eax
jmp    1060 <PowerNES@plt>
ret
xor    %eax,%eax
jmp    1050 <FCEU_VSUniCoin@plt>
mov    $0xffffffff,%edi
xor    %eax,%eax
jmp    1040 <FCEU_FDSInsert@plt>
xor    %eax,%eax
jmp    1070 <FCEU_FDSEject@plt>
xor    %eax,%eax
jmp    1090 <FCEU_FDSSelect@plt>

LLVM IR (-O0):
define void @FCEU_DoSimpleCommand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %20 [
i32 24, label %4
i32 26, label %6
i32 25, label %8
i32 7, label %10
i32 8, label %12
i32 9, label %12
i32 10, label %12
i32 11, label %12
i32 12, label %12
i32 13, label %12
i32 14, label %12
i32 15, label %12
i32 2, label %16
i32 1, label %18
]
4: ; preds = %1
%5 = call i32 (i32, ...) bitcast (i32 (...)* @FCEU_FDSInsert to i32 (i32, ...)*)(i32 -1)
br label %20
6: ; preds = %1
%7 = call i32 (...) @FCEU_FDSSelect()
br label %20
8: ; preds = %1
%9 = call i32 (...) @FCEU_FDSEject()
br label %20
10: ; preds = %1
%11 = call i32 (...) @FCEU_VSUniCoin()
br label %20
12: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 8
%15 = call i32 (i32, ...) bitcast (i32 (...)* @FCEU_VSUniToggleDIP to i32 (i32, ...)*)(i32 %14)
br label %20
16: ; preds = %1
%17 = call i32 (...) @PowerNES()
br label %20
18: ; preds = %1
%19 = call i32 (...) @ResetNES()
br label %20
20: ; preds = %1, %18, %16, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @FCEU_DoSimpleCommand(i32 %0) {
switch i32 %0, label %17 [
i32 24, label %2
i32 26, label %4
i32 25, label %6
i32 7, label %8
i32 8, label %10
i32 9, label %10
i32 10, label %10
i32 11, label %10
i32 12, label %10
i32 13, label %10
i32 14, label %10
i32 15, label %10
i32 2, label %13
i32 1, label %15
]
2: ; preds = %1
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @FCEU_FDSInsert to i32 (i32, ...)*)(i32 -1)
br label %17
4: ; preds = %1
%5 = tail call i32 (...) @FCEU_FDSSelect()
br label %17
6: ; preds = %1
%7 = tail call i32 (...) @FCEU_FDSEject()
br label %17
8: ; preds = %1
%9 = tail call i32 (...) @FCEU_VSUniCoin()
br label %17
10: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%11 = add nsw i32 %0, -8
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @FCEU_VSUniToggleDIP to i32 (i32, ...)*)(i32 %11)
br label %17
13: ; preds = %1
%14 = tail call i32 (...) @PowerNES()
br label %17
15: ; preds = %1
%16 = tail call i32 (...) @ResetNES()
br label %17
17: ; preds = %1, %15, %13, %10, %8, %6, %4, %2
ret void
}