// File: /workspace/github_cpp_makefile_star2_O1/Neuromancer2701[P]OpenTool/src/OpenTool.cpp
// Function: OpenTool::OpenTool(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, MID_Revision)
OpenTool::OpenTool(int spindleNumber, string _ip, int _port, int _timeout, int _retries, MID_Revision _rev)
{
	ip_address = _ip;
	port = _port;
	timeout = static_cast<double>(_timeout);
	retries = _retries;
	openToolHeader.SpindleID = spindleNumber;
	openToolHeader.Revision = version = _rev;
	SetStationID();
	SetAckStatus();
	if(ip_address.length() > 0)
	{
		lastSentTime = std::chrono::system_clock::now(); //Client timeout functionality
		timer_count = -1;
	}
	else
	{
		keep_alive_timer.init(timeout, 0, false); //Server KeepAlive
		keep_alive_timer.start();
		timer_count = keep_alive_timer.GetCount();
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, -0x30(%rbp)
movl %r8d, -0x34(%rbp)
movl %ecx, %r15d
movq %rdx, %r12
movl %esi, -0x2c(%rbp)
movq %rdi, %r14
movq 0x83de(%rip), %rax      # 0xef18
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x10(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x20(%rdi), %rax
movq %rax, -0x58(%rbp)
movq %rax, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movb $0x0, 0x20(%rdi)
leaq 0x48(%rdi), %r13
movq %r13, %rdi
callq 0x62b0
leaq 0x378(%r14), %rdi
leaq 0x438(%r14), %rbx
movl $0xc0, %edx
movq %rdi, -0x48(%rbp)
xorl %esi, %esi
callq 0x6250
movq %rbx, -0x60(%rbp)
movq %rbx, %rdi
movq %r13, -0x50(%rbp)
callq 0x6340
leaq 0x478(%r14), %rdi
movq %rdi, %rbx
callq 0x6040
movq $0x0, 0x898(%r14)
leaq 0x8a8(%r14), %r13
movq %r13, %rdi
callq 0x6160
movq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x6240
movl 0x10(%rbp), %eax
movl %r15d, 0x30(%r14)
movl -0x34(%rbp), %esi
cvtsi2sd %esi, %xmm0
movsd %xmm0, 0x38(%r14)
movl -0x30(%rbp), %ecx
movl %ecx, 0x40(%r14)
movl -0x2c(%rbp), %ecx
movl %ecx, 0x374(%r14)
movl %eax, 0x34(%r14)
movl %eax, 0x368(%r14)
movl $0x0, 0x370(%r14)
movb $0x0, 0x36c(%r14)
cmpq $0x0, 0x18(%r14)
je 0x6c2d
callq 0x6080
movq %rax, 0x898(%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6c48
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x60c0
movq %r13, %rdi
callq 0x6270
movl 0xa38(%r14), %eax
movl %eax, 0x8a0(%r14)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x6c80
movq %rax, %r15
jmp 0x6c88
movq %rax, %r15
jmp 0x6c91
movq %rax, %r15
jmp 0x6d45
movq %rax, %r15
movq %r13, %rdi
callq 0x6660
movq %rbx, %rdi
callq 0x6070
movq -0x60(%rbp), %rdi
callq 0x60e0
movq 0x428(%r14), %rax
testq %rax, %rax
je 0x6cae
leaq 0x418(%r14), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x408(%r14), %rax
testq %rax, %rax
je 0x6ccb
leaq 0x3f8(%r14), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x3e8(%r14), %rax
testq %rax, %rax
je 0x6ce8
leaq 0x3d8(%r14), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x3c8(%r14), %rax
testq %rax, %rax
je 0x6d05
leaq 0x3b8(%r14), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x3a8(%r14), %rax
testq %rax, %rax
je 0x6d22
leaq 0x398(%r14), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x388(%r14), %rax
testq %rax, %rax
je 0x6d3c
movq -0x48(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x50(%rbp), %rdi
callq 0x63c0
movq -0x40(%rbp), %rax
movq (%rax), %rdi
cmpq -0x58(%rbp), %rdi
je 0x6d57
callq 0x63e0
movq %r15, %rdi
callq 0x6680
jmp 0x6d69
jmp 0x6d69
jmp 0x6d69
jmp 0x6d69
jmp 0x6d69
movq %rax, %rdi
callq 0x7b16
nop