#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Add();
int /*<<< orphan*/ Branch();
int /*<<< orphan*/ BranchNeg();
int /*<<< orphan*/ BranchZero();
int /*<<< orphan*/ Divide();
int /*<<< orphan*/ Load();
int /*<<< orphan*/ Multiply();
int OpCodGetValue();
int /*<<< orphan*/ Read();
int /*<<< orphan*/ Store();
int /*<<< orphan*/ Subtract();
int /*<<< orphan*/ Write();
void ExecuteAInstruction(void) {
  switch (OpCodGetValue()) {
  case 10:
    Read();
    break;
  case 11:
    Write();
    break;
  case 20:
    Load();
    break;
  case 21:
    Store();
    break;
  case 30:
    Add();
    break;
  case 31:
    Subtract();
    break;
  case 32:
    Divide();
    break;
  case 33:
    Multiply();
    break;
  case 40:
    Branch();
    break;
  case 41:
    BranchNeg();
    break;
  case 42:
    BranchZero();
    break;
  case 43:
    break;
  }
}


x86 assembly (clang, -O0):
<ExecuteAInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   10d0 <OpCodGetValue@plt>
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
sub    $0x21,%eax
ja     127e <ExecuteAInstruction+0xbe>
mov    -0x8(%rbp),%rax
lea    0xe14(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <Read@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   1070 <Write@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   1040 <Load@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   1050 <Store@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   10e0 <Add@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   1080 <Subtract@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   10b0 <Divide@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   1090 <Multiply@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   10c0 <Branch@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   1030 <BranchNeg@plt>
jmp    127e <ExecuteAInstruction+0xbe>
mov    $0x0,%al
call   10a0 <BranchZero@plt>
jmp    127e <ExecuteAInstruction+0xbe>
jmp    127e <ExecuteAInstruction+0xbe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExecuteAInstruction>:
push   %rax
xor    %eax,%eax
call   10d0 <OpCodGetValue@plt>
add    $0xfffffff6,%eax
cmp    $0x20,%eax
ja     11f0 <ExecuteAInstruction+0x30>
lea    0xe29(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rcx
jmp    1060 <Read@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <Write@plt>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <Load@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <Store@plt>
xor    %eax,%eax
pop    %rcx
jmp    10e0 <Add@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <Subtract@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <Divide@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <Multiply@plt>
xor    %eax,%eax
pop    %rcx
jmp    10c0 <Branch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <BranchNeg@plt>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <BranchZero@plt>

LLVM IR (-O0):
define void @ExecuteAInstruction() {
%1 = call i32 (...) @OpCodGetValue()
switch i32 %1, label %25 [
i32 10, label %2
i32 11, label %4
i32 20, label %6
i32 21, label %8
i32 30, label %10
i32 31, label %12
i32 32, label %14
i32 33, label %16
i32 40, label %18
i32 41, label %20
i32 42, label %22
i32 43, label %24
]
2: ; preds = %0
%3 = call i32 (...) @Read()
br label %25
4: ; preds = %0
%5 = call i32 (...) @Write()
br label %25
6: ; preds = %0
%7 = call i32 (...) @Load()
br label %25
8: ; preds = %0
%9 = call i32 (...) @Store()
br label %25
10: ; preds = %0
%11 = call i32 (...) @Add()
br label %25
12: ; preds = %0
%13 = call i32 (...) @Subtract()
br label %25
14: ; preds = %0
%15 = call i32 (...) @Divide()
br label %25
16: ; preds = %0
%17 = call i32 (...) @Multiply()
br label %25
18: ; preds = %0
%19 = call i32 (...) @Branch()
br label %25
20: ; preds = %0
%21 = call i32 (...) @BranchNeg()
br label %25
22: ; preds = %0
%23 = call i32 (...) @BranchZero()
br label %25
24: ; preds = %0
br label %25
25: ; preds = %0, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}

LLVM IR (-O2):
define void @ExecuteAInstruction() {
%1 = tail call i32 (...) @OpCodGetValue()
switch i32 %1, label %24 [
i32 10, label %2
i32 11, label %4
i32 20, label %6
i32 21, label %8
i32 30, label %10
i32 31, label %12
i32 32, label %14
i32 33, label %16
i32 40, label %18
i32 41, label %20
i32 42, label %22
]
2: ; preds = %0
%3 = tail call i32 (...) @Read()
br label %24
4: ; preds = %0
%5 = tail call i32 (...) @Write()
br label %24
6: ; preds = %0
%7 = tail call i32 (...) @Load()
br label %24
8: ; preds = %0
%9 = tail call i32 (...) @Store()
br label %24
10: ; preds = %0
%11 = tail call i32 (...) @Add()
br label %24
12: ; preds = %0
%13 = tail call i32 (...) @Subtract()
br label %24
14: ; preds = %0
%15 = tail call i32 (...) @Divide()
br label %24
16: ; preds = %0
%17 = tail call i32 (...) @Multiply()
br label %24
18: ; preds = %0
%19 = tail call i32 (...) @Branch()
br label %24
20: ; preds = %0
%21 = tail call i32 (...) @BranchNeg()
br label %24
22: ; preds = %0
%23 = tail call i32 (...) @BranchZero()
br label %24
24: ; preds = %0, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}