#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 ExecuteCommand1(unsigned int, unsigned int, unsigned int);
int ExecuteCommand3(unsigned int, unsigned int, unsigned int);
int ExecuteCommand4(unsigned int, unsigned int, unsigned int);
int ExecuteCommand5(unsigned int, unsigned int, unsigned int);
int ExecuteCommand6(unsigned int, unsigned int, unsigned int);
int ExecuteCommand8();
int ExecuteCommand9();
int ExecuteCommands02(unsigned int, unsigned int, unsigned int);
int CommandCentral(unsigned int tag, unsigned int index, unsigned int operation,
                   unsigned int HexAddress) {
  switch (operation) {
  case 2:
  case 0:
    return ExecuteCommands02(index, tag, HexAddress);
    break;
  case 1:
    return ExecuteCommand1(index, tag, HexAddress);
    break;
  case 3:
    return ExecuteCommand3(index, tag, HexAddress);
    break;
  case 4:
    return ExecuteCommand4(index, tag, HexAddress);
    break;
  case 5:
    return ExecuteCommand5(index, tag, HexAddress);
    break;
  case 6:
    return ExecuteCommand6(index, tag, HexAddress);
    break;
  case 8:
    return ExecuteCommand8();
    break;
  case 9:
    return ExecuteCommand9();
    break;
  default:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<CommandCentral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x9,%rax
ja     125b <CommandCentral+0xdb>
mov    -0x20(%rbp),%rax
lea    0xe50(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <ExecuteCommands02@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1070 <ExecuteCommand1@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1080 <ExecuteCommand3@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <ExecuteCommand4@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1090 <ExecuteCommand5@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1060 <ExecuteCommand6@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    $0x0,%al
call   1050 <ExecuteCommand8@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
mov    $0x0,%al
call   10a0 <ExecuteCommand9@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <CommandCentral+0xe2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommandCentral>:
cmp    $0x9,%edx
ja     11db <CommandCentral+0x5b>
mov    %edi,%eax
mov    %edx,%edx
lea    0xe70(%rip),%rdi
movslq (%rdi,%rdx,4),%rdx
add    %rdi,%rdx
jmp    *%rdx
mov    %esi,%edi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1040 <ExecuteCommands02@plt>
mov    %esi,%edi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1070 <ExecuteCommand1@plt>
mov    %esi,%edi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1080 <ExecuteCommand3@plt>
mov    %esi,%edi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1030 <ExecuteCommand4@plt>
mov    %esi,%edi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1090 <ExecuteCommand5@plt>
mov    %esi,%edi
mov    %eax,%esi
mov    %ecx,%edx
jmp    1060 <ExecuteCommand6@plt>
xor    %eax,%eax
ret
xor    %eax,%eax
jmp    1050 <ExecuteCommand8@plt>
xor    %eax,%eax
jmp    10a0 <ExecuteCommand9@plt>

LLVM IR (-O0):
define i32 @CommandCentral(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
switch i32 %10, label %45 [
i32 2, label %11
i32 0, label %11
i32 1, label %16
i32 3, label %21
i32 4, label %26
i32 5, label %31
i32 6, label %36
i32 8, label %41
i32 9, label %43
]
11: ; preds = %4, %4
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = load i32, i32* %9
%15 = call i32 @ExecuteCommands02(i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %5
br label %46
16: ; preds = %4
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %9
%20 = call i32 @ExecuteCommand1(i32 %17, i32 %18, i32 %19)
store i32 %20, i32* %5
br label %46
21: ; preds = %4
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %9
%25 = call i32 @ExecuteCommand3(i32 %22, i32 %23, i32 %24)
store i32 %25, i32* %5
br label %46
26: ; preds = %4
%27 = load i32, i32* %7
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = call i32 @ExecuteCommand4(i32 %27, i32 %28, i32 %29)
store i32 %30, i32* %5
br label %46
31: ; preds = %4
%32 = load i32, i32* %7
%33 = load i32, i32* %6
%34 = load i32, i32* %9
%35 = call i32 @ExecuteCommand5(i32 %32, i32 %33, i32 %34)
store i32 %35, i32* %5
br label %46
36: ; preds = %4
%37 = load i32, i32* %7
%38 = load i32, i32* %6
%39 = load i32, i32* %9
%40 = call i32 @ExecuteCommand6(i32 %37, i32 %38, i32 %39)
store i32 %40, i32* %5
br label %46
41: ; preds = %4
%42 = call i32 (...) @ExecuteCommand8()
store i32 %42, i32* %5
br label %46
43: ; preds = %4
%44 = call i32 (...) @ExecuteCommand9()
store i32 %44, i32* %5
br label %46
45: ; preds = %4
store i32 0, i32* %5
br label %46
46: ; preds = %45, %43, %41, %36, %31, %26, %21, %16, %11
%47 = load i32, i32* %5
ret i32 %47
}

LLVM IR (-O2):
define i32 @CommandCentral(i32 %0, i32 %1, i32 %2, i32 %3) {
switch i32 %2, label %21 [
i32 2, label %5
i32 0, label %5
i32 1, label %7
i32 3, label %9
i32 4, label %11
i32 5, label %13
i32 6, label %15
i32 8, label %17
i32 9, label %19
]
5: ; preds = %4, %4
%6 = tail call i32 @ExecuteCommands02(i32 %1, i32 %0, i32 %3)
br label %21
7: ; preds = %4
%8 = tail call i32 @ExecuteCommand1(i32 %1, i32 %0, i32 %3)
br label %21
9: ; preds = %4
%10 = tail call i32 @ExecuteCommand3(i32 %1, i32 %0, i32 %3)
br label %21
11: ; preds = %4
%12 = tail call i32 @ExecuteCommand4(i32 %1, i32 %0, i32 %3)
br label %21
13: ; preds = %4
%14 = tail call i32 @ExecuteCommand5(i32 %1, i32 %0, i32 %3)
br label %21
15: ; preds = %4
%16 = tail call i32 @ExecuteCommand6(i32 %1, i32 %0, i32 %3)
br label %21
17: ; preds = %4
%18 = tail call i32 (...) @ExecuteCommand8()
br label %21
19: ; preds = %4
%20 = tail call i32 (...) @ExecuteCommand9()
br label %21
21: ; preds = %4, %19, %17, %15, %13, %11, %9, %7, %5
%22 = phi i32 [ %20, %19 ], [ %18, %17 ], [ %16, %15 ], [ %14, %13 ], [ %12, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ 0, %4 ]
ret i32 %22
}