// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x31c(%rsi), %eax
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x76dc
leaq 0x3990(%rip), %rax      # 0xb014
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x7954(%rip), %rax      # 0xefe8
movq 0x790d(%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, -0x20(%rbp)
cmpq $0x0, 0x388(%rbx)
je 0x78a0
leaq 0x378(%rbx), %rdi
leaq -0x20(%rbp), %rsi
callq *0x390(%rbx)
jmp 0x7869
xorl %r14d, %r14d
cmpl $0x270f, %eax           # imm = 0x270F
jne 0x786c
movq 0x78f7(%rip), %rax      # 0xefe8
movq 0x7858(%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, -0x20(%rbp)
cmpq $0x0, 0x428(%rbx)
je 0x788c
leaq 0x418(%rbx), %rdi
leaq -0x20(%rbp), %rsi
callq *0x430(%rbx)
jmp 0x7869
movq 0x78a8(%rip), %rax      # 0xefe8
movq 0x7821(%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, -0x20(%rbp)
cmpq $0x0, 0x408(%rbx)
je 0x7891
leaq 0x3f8(%rbx), %rdi
leaq -0x20(%rbp), %rsi
callq *0x410(%rbx)
jmp 0x7869
movq 0x7859(%rip), %rax      # 0xefe8
movq 0x7792(%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, -0x20(%rbp)
cmpq $0x0, 0x3c8(%rbx)
je 0x7896
leaq 0x3b8(%rbx), %rdi
leaq -0x20(%rbp), %rsi
callq *0x3d0(%rbx)
jmp 0x7869
movq 0x780a(%rip), %rax      # 0xefe8
movq 0x7763(%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, -0x20(%rbp)
cmpq $0x0, 0x3e8(%rbx)
je 0x789b
leaq 0x3d8(%rbx), %rdi
leaq -0x20(%rbp), %rsi
callq *0x3f0(%rbx)
jmp 0x7869
movq 0x77be(%rip), %rax      # 0xefe8
movq 0x77c7(%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, -0x20(%rbp)
cmpq $0x0, 0x3a8(%rbx)
je 0x78a5
leaq 0x398(%rbx), %rdi
leaq -0x20(%rbp), %rsi
callq *0x3b0(%rbx)
movl %eax, %r14d
cmpl $0x2, %r14d
jne 0x787e
callq 0x6080
movq %rax, 0x898(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x61a0
callq 0x61a0
callq 0x61a0
callq 0x61a0
callq 0x61a0
callq 0x61a0
movq %rax, %r14
cmpl $0x1, %edx
jne 0x7acb
movq %r14, %rdi
callq 0x61d0
movq %rax, %r15
movq 0x7658(%rip), %r14      # 0xef20
addq $0x10, %r14
leaq 0x376d(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %r14, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ab6
movq %rax, %r14
callq 0x6610
jmp 0x7acb
movq %rax, %r14
cmpl $0x1, %edx
jne 0x7acb
movq %r14, %rdi
callq 0x61d0
movq %rax, %r15
movq 0x75fc(%rip), %r14      # 0xef20
addq $0x10, %r14
leaq 0x3711(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %r14, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ab6
movq %rax, %r14
callq 0x6610
jmp 0x7acb
movq %rax, %r14
cmpl $0x1, %edx
jne 0x7acb
movq %r14, %rdi
callq 0x61d0
movq %rax, %r15
movq 0x75a0(%rip), %r14      # 0xef20
addq $0x10, %r14
leaq 0x36b5(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %r14, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ab6
movq %rax, %r14
callq 0x6610
jmp 0x7acb
movq %rax, %r14
cmpl $0x1, %edx
jne 0x7acb
movq %r14, %rdi
callq 0x61d0
movq %rax, %r15
movq 0x7544(%rip), %r14      # 0xef20
addq $0x10, %r14
leaq 0x3659(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %r14, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ab6
movq %rax, %r14
callq 0x6610
jmp 0x7acb
movq %rax, %r14
cmpl $0x1, %edx
jne 0x7acb
movq %r14, %rdi
callq 0x61d0
movq %rax, %r15
movq 0x74e8(%rip), %r14      # 0xef20
addq $0x10, %r14
leaq 0x35fd(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %r14, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6400
jmp 0x7ab6
movq %rax, %r14
callq 0x6610
jmp 0x7acb
movq %rax, %r14
cmpl $0x1, %edx
jne 0x7acb
movq %r14, %rdi
callq 0x61d0
movq %rax, %r15
movq 0x7496(%rip), %r14      # 0xef20
addq $0x10, %r14
leaq 0x35ab(%rip), %rsi      # 0xb040
movl $0xb, %edx
movq %r14, %rdi
callq 0x6460
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x6400
callq 0x6610
xorl %r14d, %r14d
jmp 0x786c
movq %rax, %r14
callq 0x6610
movq %r14, %rdi
callq 0x6680
movq %rax, %rdi
callq 0x7b16
nop