// File: patxitron[P]BattleyeRconToolLinux/a3s.cpp
// Function: patxi::a3s::a3s(boost::asio::io_context&, unsigned short, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::function<void (char const*, unsigned long)>, std::function<void (bool)>)
a3s::a3s(boost::asio::io_service& io_service, uint16_t port
        ,std::string const& addr, on_data_func on_data, on_login_func on_login)
		:loged_in_(false)
		,listening_(false)
		,sequence_(0)
		,on_data_(on_data)
		,on_login_(on_login)
		,socket_(io_service, udp::endpoint(udp::v4(), 0))
		,input_(io_service, ::dup(STDIN_FILENO))
		,console_data_(MAX_COMMAND_LENGTH)
{
	stringstream str_port;
	str_port << port;
	udp::resolver resolver(io_service);
	endpoint_ = *resolver.resolve({udp::v4(), addr, str_port.str()});
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %r9, -0x318(%rbp)
movq %r8, -0x330(%rbp)
movl %edx, %eax
movq %rsi, %rdx
movq -0x330(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq %rcx, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x320(%rbp)
movb $0x0, (%rdi)
movb $0x0, 0x1(%rdi)
movb $0x0, 0x2(%rdi)
addq $0x8, %rdi
movq %rdi, -0x328(%rbp)
callq 0xd470
movq -0x320(%rbp), %rdi
movq -0x318(%rbp), %rsi
addq $0x28, %rdi
movq %rdi, -0x310(%rbp)
callq 0xd520
jmp 0x8e93
movq -0x320(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x348(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x340(%rbp)
callq 0xd5d0
movl %eax, -0x5c(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x338(%rbp)
leaq -0x5c(%rbp), %rsi
xorl %edx, %edx
movl %edx, -0x34c(%rbp)
callq 0xd5f0
movl -0x34c(%rbp), %eax
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rsi
movq -0x338(%rbp), %rdx
movl %eax, %ecx
callq 0xd630
jmp 0x8ef8
movq -0x320(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x360(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x358(%rbp)
xorl %edi, %edi
movl %edi, -0x350(%rbp)
callq 0x8760
movq -0x360(%rbp), %rdi
movq -0x358(%rbp), %rsi
movl %eax, %ecx
movl -0x350(%rbp), %eax
movl %ecx, -0x60(%rbp)
movl %eax, %ecx
leaq -0x60(%rbp), %rdx
callq 0xd670
jmp 0x8f4a
movq -0x320(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0x370(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x8860
movq -0x370(%rbp), %rdi
movq -0x368(%rbp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0xd6b0
jmp 0x8f88
leaq -0x61(%rbp), %rdi
callq 0x84e0
movq -0x320(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0xd830
leaq -0x1f0(%rbp), %rdi
callq 0x8310
jmp 0x8fb2
leaq -0x1e0(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0x87f0
jmp 0x8fc4
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x238(%rbp), %rdi
callq 0xd850
jmp 0x8fda
callq 0xd5d0
movl %eax, -0x2e4(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x378(%rbp)
leaq -0x308(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x8440
jmp 0x9005
movq -0x378(%rbp), %rdx
leaq -0x2e0(%rbp), %rdi
leaq -0x2e4(%rbp), %rsi
leaq -0x308(%rbp), %rcx
movl $0x20, %r8d
callq 0xd960
jmp 0x902e
leaq -0x270(%rbp), %rdi
leaq -0x238(%rbp), %rsi
leaq -0x2e0(%rbp), %rdx
callq 0xd8a0
jmp 0x904a
leaq -0x270(%rbp), %rdi
callq 0xda60
movq %rax, -0x380(%rbp)
jmp 0x905f
movq -0x380(%rbp), %rsi
leaq -0x254(%rbp), %rdi
callq 0xda80
jmp 0x9074
movq -0x320(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
leaq -0x254(%rbp), %rsi
callq 0xdab0
leaq -0x270(%rbp), %rdi
callq 0xdae0
leaq -0x2e0(%rbp), %rdi
callq 0xdb00
leaq -0x308(%rbp), %rdi
callq 0x82a0
leaq -0x238(%rbp), %rdi
callq 0xdb40
leaq -0x1f0(%rbp), %rdi
callq 0x8350
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x91e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x91d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x91c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x84e0
jmp 0x91bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x91b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x91a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9199
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x918d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9181
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x270(%rbp), %rdi
callq 0xdae0
leaq -0x2e0(%rbp), %rdi
callq 0xdb00
leaq -0x308(%rbp), %rdi
callq 0x82a0
leaq -0x238(%rbp), %rdi
callq 0xdb40
leaq -0x1f0(%rbp), %rdi
callq 0x8350
movq -0x370(%rbp), %rdi
callq 0xdb70
movq -0x360(%rbp), %rdi
callq 0xdbc0
movq -0x348(%rbp), %rdi
callq 0xdbe0
movq -0x310(%rbp), %rdi
callq 0xdc00
movq -0x328(%rbp), %rdi
callq 0xdc20
movq -0x38(%rbp), %rdi
callq 0x8830
nopw %cs:(%rax,%rax)