// File: /workspace/github_cpp_makefile_star2_O3/Neuromancer2701[P]OpenTool/src/OpenTool.cpp
// Function: OpenTool::MIDInputAction(Header*)
Error OpenTool::MIDInputAction(Header* message)
{
	 Error result = Error::UNKNOWN;

	 switch(message->Number)
	 {
		 case MID_Number::CommunicationStart:
			  try{
				  Mid_0001* mid0001 = dynamic_cast<Mid_0001*>(message);
				  mid0001->Unpack();
				  result = MID0001Received(mid0001);
			  }
			  catch(exception& my_ex)
			  {
				  Log << "Exception: " << my_ex.what();
			  }
			  break;
		 case MID_Number::CommunicationStartAcknowledge:
			  try{
				  Mid_0002* mid0002 = dynamic_cast<Mid_0002*>(message);
				  mid0002->Unpack();
				  result = MID0002Received(mid0002);
			  }
			  catch(exception& my_ex)
			  {
				  Log << "Exception: " << my_ex.what();
			  }
			  break;
		 case MID_Number::CommunicationStop:
			  try{
				  Mid_0003* mid0003 = dynamic_cast<Mid_0003*>(message);
				  mid0003->Unpack();
				  result = MID0003Received(mid0003);
			  }
			  catch(exception& my_ex)
			  {
				  Log << "Exception: " << my_ex.what();
			  }
			  break;
		 case MID_Number::CommandError:
			  try{
				  Mid_0004* mid0004 = dynamic_cast<Mid_0004*>(message);
				  mid0004->Unpack();
				  result = MID0004Received(mid0004);
			  }
			  catch(exception& my_ex)
			  {
				  Log << "Exception: " << my_ex.what();
			  }
			  break;
		 case MID_Number::CommandAccepted:
			  try{
				  Mid_0005* mid0005 = dynamic_cast<Mid_0005*>(message);
				  mid0005->Unpack();
				  result = MID0005Received(mid0005);
			  }
			  catch(exception& my_ex)
			  {
				  Log << "Exception: " << my_ex.what();
			  }
			  break;
		 case MID_Number::KeepAliveMessage:
			  try{
				  Mid_9999* mid9999 = dynamic_cast<Mid_9999*>(message);
				  mid9999->Unpack();
				  result = MID9999Received(mid9999);
			  }
			  catch(exception& my_ex)
			  {
				  Log << "Exception: " << my_ex.what();
			  }
			  break;

		 default:
			  break;
	 }

	 if(result == Error::NONE)
		 lastSentTime = std::chrono::system_clock::now();

	 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x31c(%rsi), %ecx
leal -0x1(%rcx), %eax
cmpl $0x4, %eax
ja 0x76f1
leaq 0x397b(%rip), %rcx      # 0xb014
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x793f(%rip), %rax      # 0xefe8
movq 0x78f8(%rip), %rdx      # 0xefa8
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x6450
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, -0x18(%rbp)
cmpq $0x0, 0x388(%rbx)
je 0x78b1
leaq 0x378(%rbx), %rdi
leaq -0x18(%rbp), %rsi
callq *0x390(%rbx)
jmp 0x787e
xorl %eax, %eax
cmpl $0x270f, %ecx           # imm = 0x270F
jne 0x7894
movq 0x78e2(%rip), %rax      # 0xefe8
movq 0x7843(%rip), %rdx      # 0xef50
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x6450
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, -0x18(%rbp)
cmpq $0x0, 0x428(%rbx)
je 0x789d
leaq 0x418(%rbx), %rdi
leaq -0x18(%rbp), %rsi
callq *0x430(%rbx)
jmp 0x787e
movq 0x7893(%rip), %rax      # 0xefe8
movq 0x780c(%rip), %rdx      # 0xef68
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x6450
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, -0x18(%rbp)
cmpq $0x0, 0x408(%rbx)
je 0x78a2
leaq 0x3f8(%rbx), %rdi
leaq -0x18(%rbp), %rsi
callq *0x410(%rbx)
jmp 0x787e
movq 0x7844(%rip), %rax      # 0xefe8
movq 0x777d(%rip), %rdx      # 0xef28
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x6450
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, -0x18(%rbp)
cmpq $0x0, 0x3c8(%rbx)
je 0x78a7
leaq 0x3b8(%rbx), %rdi
leaq -0x18(%rbp), %rsi
callq *0x3d0(%rbx)
jmp 0x787e
movq 0x77f5(%rip), %rax      # 0xefe8
movq 0x774e(%rip), %rdx      # 0xef48
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x6450
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, -0x18(%rbp)
cmpq $0x0, 0x3e8(%rbx)
je 0x78ac
leaq 0x3d8(%rbx), %rdi
leaq -0x18(%rbp), %rsi
callq *0x3f0(%rbx)
jmp 0x787e
movq 0x77a9(%rip), %rax      # 0xefe8
movq 0x77b2(%rip), %rdx      # 0xeff8
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x6450
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, -0x18(%rbp)
cmpq $0x0, 0x3a8(%rbx)
je 0x78b6
leaq 0x398(%rbx), %rdi
leaq -0x18(%rbp), %rsi
callq *0x3b0(%rbx)
cmpl $0x2, %eax
jne 0x7894
callq 0x6080
movq %rax, 0x898(%rbx)
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x61a0
callq 0x61a0
callq 0x61a0
callq 0x61a0
callq 0x61a0
callq 0x61a0
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7adb
movq %rbx, %rdi
callq 0x61d0
movq %rax, %r14
movq 0x7647(%rip), %rbx      # 0xef20
addq $0x10, %rbx
leaq 0x375c(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %rbx, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ac7
movq %rax, %rbx
callq 0x6610
jmp 0x7adb
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7adb
movq %rbx, %rdi
callq 0x61d0
movq %rax, %r14
movq 0x75eb(%rip), %rbx      # 0xef20
addq $0x10, %rbx
leaq 0x3700(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %rbx, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ac7
movq %rax, %rbx
callq 0x6610
jmp 0x7adb
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7adb
movq %rbx, %rdi
callq 0x61d0
movq %rax, %r14
movq 0x758f(%rip), %rbx      # 0xef20
addq $0x10, %rbx
leaq 0x36a4(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %rbx, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ac7
movq %rax, %rbx
callq 0x6610
jmp 0x7adb
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7adb
movq %rbx, %rdi
callq 0x61d0
movq %rax, %r14
movq 0x7533(%rip), %rbx      # 0xef20
addq $0x10, %rbx
leaq 0x3648(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %rbx, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ac7
movq %rax, %rbx
callq 0x6610
jmp 0x7adb
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7adb
movq %rbx, %rdi
callq 0x61d0
movq %rax, %r14
movq 0x74d7(%rip), %rbx      # 0xef20
addq $0x10, %rbx
leaq 0x35ec(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %rbx, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ac7
movq %rax, %rbx
callq 0x6610
jmp 0x7adb
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7adb
movq %rbx, %rdi
callq 0x61d0
movq %rax, %r14
movq 0x7485(%rip), %rbx      # 0xef20
addq $0x10, %rbx
leaq 0x359a(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %rbx, %rdi
callq 0x6460
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6400
callq 0x6610
xorl %eax, %eax
jmp 0x7894
movq %rax, %rbx
callq 0x6610
movq %rbx, %rdi
callq 0x6680
movq %rax, %rdi
callq 0x7b26
nop