// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdi, %rbx
movl 0x31c(%rsi), %ecx
leal -0x1(%rcx), %eax
cmpl $0x4, %eax
ja 0x7519
leaq 0x2b3f(%rip), %rcx      # 0xa014
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x6b03(%rip), %rax      # 0xdfe8
movq 0x6abc(%rip), %rdx      # 0xdfa8
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x64b0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x378(%rbx), %rdi
movq %r14, %rsi
callq 0x6330
jmp 0x7643
xorl %eax, %eax
cmpl $0x270f, %ecx           # imm = 0x270F
jne 0x7657
movq 0x6aba(%rip), %rax      # 0xdfe8
movq 0x6a1b(%rip), %rdx      # 0xdf50
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x64b0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x418(%rbx), %rdi
movq %r14, %rsi
callq 0x6330
jmp 0x7643
movq 0x6a7f(%rip), %rax      # 0xdfe8
movq 0x69f8(%rip), %rdx      # 0xdf68
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x64b0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x3f8(%rbx), %rdi
movq %r14, %rsi
callq 0x6330
jmp 0x7643
movq 0x6a44(%rip), %rax      # 0xdfe8
movq 0x6985(%rip), %rdx      # 0xdf30
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x64b0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x3b8(%rbx), %rdi
movq %r14, %rsi
callq 0x6330
jmp 0x7643
movq 0x6a0c(%rip), %rax      # 0xdfe8
movq 0x6965(%rip), %rdx      # 0xdf48
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x64b0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x3d8(%rbx), %rdi
movq %r14, %rsi
callq 0x6330
jmp 0x7643
movq 0x69d4(%rip), %rax      # 0xdfe8
movq 0x69dd(%rip), %rdx      # 0xdff8
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x64b0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x398(%rbx), %rdi
movq %r14, %rsi
callq 0x6330
cmpl $0x2, %eax
jne 0x7657
callq 0x6070
movq %rax, 0x898(%rbx)
pushq $0x2
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x785e
movq %rbx, %rdi
callq 0x61f0
movq %rax, %rbx
movq 0x68ae(%rip), %rdi      # 0xdf28
addq $0x10, %rdi
leaq 0x29bb(%rip), %rsi      # 0xa040
callq 0x6460
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6460
jmp 0x784a
movq %rax, %rbx
callq 0x66c0
jmp 0x785e
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x785e
movq %rbx, %rdi
callq 0x61f0
movq %rax, %rbx
movq 0x6857(%rip), %rdi      # 0xdf28
addq $0x10, %rdi
leaq 0x2964(%rip), %rsi      # 0xa040
callq 0x6460
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6460
jmp 0x784a
movq %rax, %rbx
callq 0x66c0
jmp 0x785e
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x785e
movq %rbx, %rdi
callq 0x61f0
movq %rax, %rbx
movq 0x6800(%rip), %rdi      # 0xdf28
addq $0x10, %rdi
leaq 0x290d(%rip), %rsi      # 0xa040
callq 0x6460
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6460
jmp 0x784a
movq %rax, %rbx
callq 0x66c0
jmp 0x785e
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x785e
movq %rbx, %rdi
callq 0x61f0
movq %rax, %rbx
movq 0x67a9(%rip), %rdi      # 0xdf28
addq $0x10, %rdi
leaq 0x28b6(%rip), %rsi      # 0xa040
callq 0x6460
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6460
jmp 0x784a
movq %rax, %rbx
callq 0x66c0
jmp 0x785e
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x785e
movq %rbx, %rdi
callq 0x61f0
movq %rax, %rbx
movq 0x6752(%rip), %rdi      # 0xdf28
addq $0x10, %rdi
leaq 0x285f(%rip), %rsi      # 0xa040
callq 0x6460
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6460
jmp 0x784a
movq %rax, %rbx
callq 0x66c0
jmp 0x785e
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x785e
movq %rbx, %rdi
callq 0x61f0
movq %rax, %rbx
movq 0x6705(%rip), %rdi      # 0xdf28
addq $0x10, %rdi
leaq 0x2812(%rip), %rsi      # 0xa040
callq 0x6460
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6460
callq 0x66c0
xorl %eax, %eax
jmp 0x7657
movq %rax, %rbx
callq 0x66c0
movq %rbx, %rdi
callq 0x6740
movq %rax, %rdi
callq 0x7939