// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/client/network.cpp
// Function: Network::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Network::connect(string &errors)
{
	// determine ip and port
	string sip = Config::get_server_ip(); // this is just what was read from the config; could be garbage!
	string port = "", ip = "";
	size_t i;
	if((i = sip.rfind(':')) != string::npos && i > 1 && i != sip.size()-1)
	{
		port = sip.substr(i+1);
		ip = sip.substr(0, i);
		if(ip[0] == '[') // this would indicate IPv6
		{
			ip.erase(0,1);
			if(ip.empty())
			{
				errors = "Not a valid address: " + sip;
				return false;
			}
			ip.erase(ip.size()-1,1); // erase assumed ']'
		}
	}
	else
	{
		errors = "Not a valid address: " + sip;
		return false;
	}

	// create the socket
	struct addrinfo hints;
	int rv;
	bzero(&hints, sizeof(hints));
	hints.ai_family = AF_UNSPEC;
	hints.ai_socktype = SOCK_DGRAM;
	// get server info:
	if((rv = getaddrinfo(ip.c_str(), port.c_str(), &hints, &servinfo)))
	{
		errors = string("Error in getaddrinfo: ") + gai_strerror(rv);
		return false;
	}
	// initialize the_serv and make the socket based on its protocol info:
	for(the_serv = servinfo; the_serv; the_serv = the_serv->ai_next)
	{
		if((s_me = socket(the_serv->ai_family, the_serv->ai_socktype, the_serv->ai_protocol)) != -1)
			break;
	}
	if(!the_serv)
	{
		errors = "Failed to create socket!";
		freeaddrinfo(servinfo);
		return false;
	}
	// set socket to nonblock mode:
	fcntl(s_me, F_SETFL, O_NONBLOCK);

	last_sent_axn.update(); // must init this at some point

	add_msg("[Connecting to " + sip + "...]", 15);
	// construct a hello message:
	send_buffer.add((unsigned char)MID_HELLO);
	send_buffer.add(INTR_VERSION);
	add_id_info_for_server(sip);
	send_buffer.add(Config::get_nick());
	
	// send hello message (repeatedly) and wait for a reply
	int k;
	for(char j = 0; j < CONNECTION_ATTEMPTS; ++j)
	{
		if(do_send())
		{
			errors = "Problem sending connection request.";
			close(s_me);
			freeaddrinfo(servinfo);
			return false;
		}
		// Wait for the reply (the timeout on the getch() call will delay):
		for(k = 0; k < REPLY_WAIT_MS/GETCH_TIMEOUT; ++k)
		{
			if(do_receive() != -1)
			{
				// got *some* message
				unsigned char mid = recv_buffer.read_ch();
				switch(mid)
				{
				case MID_HELLO:
					Base::print_str("(identified)", 7, 0, 5, STAT_WIN, false);
					return true;
				case MID_HELLO_FULL:
				case MID_HELLO_BANNED:
				case MID_HELLO_VERSION:
				case MID_HELLO_STEAL:
					errors = hello_errors[mid - MID_HELLO_FULL];
					close(s_me);
					freeaddrinfo(servinfo);
					return false;
				case MID_HELLO_NEWID:
				{
					cur_id = recv_buffer.read_sh();
					string passw;
					recv_buffer.read_str(passw);
					store_id_for_server(cur_id, sip, passw);
					Base::print_str("(new id)", 7, 0, 5, STAT_WIN, false);
					return true;
				}
				default: break; // ignore other messages
				}
			} // received something
			if(getch() == KEYCODE_INT)
			{
				errors = "Aborted by user.";
				return false;
			}
		} // listen for connections loop
	} // send connection requests loop
	errors = "Did not get a reply from the server.";
	close(s_me);
	freeaddrinfo(servinfo);
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp            # imm = 0x548
movq %rdi, %rbx
callq 0xdfe4
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x731a
leaq -0x120(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x5071(%rip), %rdx      # 0x10479
leaq -0x130(%rbp), %rdi
movq %rdx, %rsi
callq 0x891a
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x504f(%rip), %rdx      # 0x10479
leaq -0xf0(%rbp), %rdi
movq %rdx, %rsi
callq 0x891a
leaq -0x90(%rbp), %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
callq 0x4710
movq %rax, %r14
addq $-0x2, %rax
cmpq $-0x4, %rax
ja 0xb471
movq -0x88(%rbp), %rax
decq %rax
cmpq %rax, %r14
jne 0xb525
leaq 0x52d0(%rip), %rsi      # 0x10748
leaq -0x538(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0xcbd6
leaq -0x538(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4480
movq (%r14), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xb4bb
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
xorl %r14d, %r14d
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0xb4d9
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x130(%rbp), %rdi
cmpq %r13, %rdi
je 0xb4f4
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xb510
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x4390
movl %r14d, %eax
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1(%r14), %rdx
leaq -0x538(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq $-0x1, %rcx
callq 0x43b0
leaq -0x130(%rbp), %rdi
leaq -0x538(%rbp), %r15
movq %r15, %rsi
callq 0x4480
movq (%r15), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xb577
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x538(%rbp), %rdi
leaq -0x90(%rbp), %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x43b0
leaq -0xf0(%rbp), %rdi
leaq -0x538(%rbp), %r14
movq %r14, %rsi
callq 0x4480
movq (%r14), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xb5c3
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0xf0(%rbp), %rdi
cmpb $0x5b, (%rdi)
jne 0xb60d
leaq -0xf0(%rbp), %rdi
movl $0x1, %edx
xorl %esi, %esi
callq 0x40d0
movq -0xe8(%rbp), %rsi
testq %rsi, %rsi
je 0xb75b
decq %rsi
leaq -0xf0(%rbp), %rdi
movl $0x1, %edx
callq 0x40d0
movq -0xf0(%rbp), %rdi
xorps %xmm0, %xmm0
leaq -0x570(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movl $0x2, 0x8(%rdx)
movq -0x130(%rbp), %rsi
leaq 0xdbf9(%rip), %rcx      # 0x19230
callq 0x4490
movl %eax, %r14d
testl %eax, %eax
je 0xb6af
leaq -0x320(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x5109(%rip), %rsi      # 0x1075e
leaq 0x5118(%rip), %rdx      # 0x10774
leaq -0x330(%rbp), %rdi
callq 0x891a
movl %r14d, %edi
callq 0x4510
leaq -0x330(%rbp), %rdi
movq %rax, %rsi
callq 0x46e0
leaq -0x528(%rbp), %r13
movq %r13, -0x538(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb6f0
movq %rdx, -0x538(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x528(%rbp)
jmp 0xb6f8
movq 0xdb7a(%rip), %rax      # 0x19230
movq %rax, 0xdb7b(%rip)      # 0x19238
testq %rax, %rax
je 0xb7fb
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x40e0
movl %eax, 0xdb66(%rip)      # 0x19240
movq 0xdb57(%rip), %rcx      # 0x19238
cmpl $-0x1, %eax
jne 0xb77a
movq 0x28(%rcx), %rax
jmp 0xb6b6
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x538(%rbp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4480
movq (%r14), %rdi
cmpq %r13, %rdi
je 0xb738
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x330(%rbp), %rdi
cmpq %r15, %rdi
leaq -0x120(%rbp), %r13
je 0xb4bb
movq -0x320(%rbp), %rsi
jmp 0xb4b3
leaq 0x4fe6(%rip), %rsi      # 0x10748
leaq -0x538(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0xcbd6
jmp 0xb492
testq %rcx, %rcx
je 0xb7fb
movl %eax, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x4210
leaq 0xdaaf(%rip), %rdi      # 0x19248
callq 0xf1b4
leaq 0x4fe9(%rip), %rsi      # 0x1078e
leaq -0x330(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0xcbd6
leaq 0x4fdf(%rip), %rsi      # 0x1079e
leaq -0x330(%rbp), %rdi
callq 0x46e0
leaq -0x528(%rbp), %rsi
movq %rsi, -0x538(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb827
movq %rdx, -0x538(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x528(%rbp)
jmp 0xb82d
movq 0x8(%rbx), %rdx
leaq 0x4f6f(%rip), %rcx      # 0x10775
movl $0x18, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x45a0
movq 0xda13(%rip), %rdi      # 0x19230
callq 0x44d0
jmp 0xb4bb
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x538(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0xf, %esi
callq 0x9bb7
movq -0x538(%rbp), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xb877
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x320(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb896
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
leaq 0xd0db(%rip), %rdi      # 0x18978
xorl %esi, %esi
callq 0xf22c
leaq 0xd0cd(%rip), %rdi      # 0x18978
movl $0x3, %esi
callq 0xf240
movw $0xffff, 0xd99a(%rip)   # imm = 0xFFFF
callq 0xe047
leaq 0xd8be(%rip), %rdx      # 0x19188
leaq -0x330(%rbp), %rdi
movq %rax, %rsi
callq 0xcc68
movq -0x330(%rbp), %rsi
leaq -0x538(%rbp), %rdi
movl $0x8, %edx
callq 0x4690
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xb913
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x320(%rbp), %rax
movq %rax, -0x330(%rbp)
xorl %eax, %eax
movq %rax, -0x328(%rbp)
movb %al, -0x320(%rbp)
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq -0x538(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x518(%rbp,%rax)
jne 0xb9d2
leaq -0x538(%rbp), %r14
leaq -0x70(%rbp), %r15
movq %r14, %rdi
leaq -0x330(%rbp), %rsi
callq 0x44a0
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x4550
movq %r14, %rdi
movq %r15, %rsi
callq 0x44a0
movq -0x328(%rbp), %rdx
cmpq -0x88(%rbp), %rdx
jne 0xb9b0
testq %rdx, %rdx
je 0xb9c7
movq -0x90(%rbp), %rsi
movq -0x330(%rbp), %rdi
callq 0x43a0
testl %eax, %eax
je 0xb9c7
movq -0x538(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x518(%rbp,%rax)
je 0xb95e
jmp 0xb9d2
movzwl -0x50(%rbp), %eax
movw %ax, 0xd886(%rip)       # 0x19258
movzwl 0xd87f(%rip), %esi      # 0x19258
leaq 0xcf98(%rip), %rdi      # 0x18978
callq 0xf240
cmpw $-0x1, 0xd86b(%rip)     # 0x19258
je 0xb9ff
leaq 0xcf82(%rip), %rdi      # 0x18978
leaq -0x70(%rbp), %rsi
callq 0xf26a
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xba18
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xba3a
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x538(%rbp), %rdi
callq 0x40f0
callq 0xdff1
leaq 0xcf26(%rip), %rdi      # 0x18978
movq %rax, %rsi
callq 0xf26a
movl $0x0, -0x2c(%rbp)
leaq 0xcf1a(%rip), %rsi      # 0x18982
movl 0xd7d2(%rip), %edi      # 0x19240
movswq 0xcf0a(%rip), %rdx      # 0x18980
movq 0xd7bb(%rip), %rax      # 0x19238
movq 0x18(%rax), %r8
movl 0x10(%rax), %r9d
movq %rsi, %r14
xorl %ecx, %ecx
callq 0x4060
cmpq $-0x1, %rax
je 0xbca1
movl $0x32, %r15d
callq 0xc402
cmpw $-0x1, %ax
je 0xbad2
leaq 0xc6b7(%rip), %rdi      # 0x18168
callq 0xf344
movzbl %al, %eax
leal -0x10(%rax), %ecx
cmpl $0x4, %ecx
jb 0xbb29
testl %eax, %eax
je 0xbb79
cmpl $0x14, %eax
je 0xbb9f
movq 0xb4e7(%rip), %rax      # 0x16fc0
movq (%rax), %rdi
callq 0x44b0
cmpl $0x3, %eax
je 0xbb56
decl %r15d
jne 0xba9f
movl -0x2c(%rbp), %eax
incb %al
movl %eax, -0x2c(%rbp)
cmpb $0x3, %al
movq %r14, %rsi
jne 0xba68
movq 0x8(%rbx), %rdx
leaq 0x4ce5(%rip), %rcx      # 0x107ee
movl $0x24, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x45a0
movl 0xd721(%rip), %edi      # 0x19240
callq 0x4700
jmp 0xb816
shll $0x5, %eax
leaq 0xd67d(%rip), %rcx      # 0x191b0
leaq (%rax,%rcx), %rsi
addq $-0x200, %rsi           # imm = 0xFE00
movq %rbx, %rdi
callq 0x4200
movl 0xd6f4(%rip), %edi      # 0x19240
callq 0x4700
jmp 0xb816
movq 0x8(%rbx), %rdx
xorl %r14d, %r14d
leaq 0x4c79(%rip), %rcx      # 0x107dd
movl $0x10, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x45a0
jmp 0xb4be
movb $0x1, %r14b
leaq 0x4c44(%rip), %rdi      # 0x107c7
movl $0x7, %esi
xorl %edx, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x686d
jmp 0xb4be
leaq 0xc5c2(%rip), %rdi      # 0x18168
callq 0xf32c
movw %ax, 0xd6a6(%rip)       # 0x19258
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xc599(%rip), %rdi      # 0x18168
leaq -0x110(%rbp), %rsi
callq 0xf356
movzwl 0xd676(%rip), %ebx      # 0x19258
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x731a
leaq -0x50(%rbp), %rdi
movq 0x8(%rdi), %rsi
movl $0x1, %ecx
xorl %edx, %edx
movl $0x20, %r8d
callq 0x46d0
leaq -0xb0(%rbp), %rdi
movl %ebx, %esi
callq 0xfcfb
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0xa8(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0xbc4d
movq -0x40(%rbp), %rdi
movq -0xb0(%rbp), %rsi
cmpq %rdi, %rax
jbe 0xbc76
leaq -0xa0(%rbp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0xbc71
movq -0xa0(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xbcc0
leaq -0x50(%rbp), %rdi
callq 0x4120
leaq -0x320(%rbp), %rsi
movq %rsi, -0x330(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jne 0xbcee
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
jmp 0xbcff
leaq 0x4afb(%rip), %rsi      # 0x107a3
movq %rbx, %rdi
callq 0x44f0
movl 0xd58a(%rip), %edi      # 0x19240
callq 0x4700
jmp 0xb816
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4400
leaq -0x320(%rbp), %rcx
movq %rcx, -0x330(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xc101
movq %rdx, -0x330(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x320(%rbp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x328(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x330(%rbp), %rdi
movq 0x8(%rdi), %rsi
movl $0x1, %ecx
xorl %edx, %edx
movl $0x20, %r8d
callq 0x46d0
leaq -0x528(%rbp), %rsi
movq %rsi, -0x538(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xbd6b
movq %rdx, -0x538(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x528(%rbp)
jmp 0xbd71
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x538(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
callq 0x4120
leaq -0x60(%rbp), %rsi
movq %rsi, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xbdc6
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0xbdcc
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x538(%rbp), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xbe05
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xbe27
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbe46
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0xbe5b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4390
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movq $0x0, -0xc0(%rbp)
callq 0xe047
leaq 0xd30c(%rip), %rdx      # 0x19188
leaq -0x330(%rbp), %rdi
movq %rax, %rsi
callq 0xcc68
movq -0x330(%rbp), %rsi
leaq -0x538(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x4690
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xbec8
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x50(%rbp), %r14
leaq -0x40(%rbp), %rax
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movb $0x1, %r15b
movq -0x538(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4360
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x46b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xbf5a
testb $0x1, %r15b
je 0xbf49
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4650
testq %rax, %rax
jne 0xbf49
movq %r14, %rdi
leaq -0x70(%rbp), %rsi
callq 0x4200
xorl %r15d, %r15d
leaq -0xd0(%rbp), %rdi
movq %r14, %rsi
callq 0x9584
jmp 0xbee3
leaq -0x538(%rbp), %rdi
callq 0x40a0
testb $0x1, %r15b
je 0xbf7c
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x9584
callq 0xe047
leaq 0xd200(%rip), %rdx      # 0x19188
leaq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0xcc68
movq -0xb0(%rbp), %rsi
leaq -0x330(%rbp), %rdi
movl $0x10, %edx
callq 0x43e0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xbfd1
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x330(%rbp), %rbx
leaq -0xd0(%rbp), %r14
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
je 0xc039
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x4410
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4360
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4250
movq -0xd0(%rbp), %rsi
movq %r14, %rdi
callq 0x97a0
jmp 0xbfdf
movq 0xaf78(%rip), %rax      # 0x16fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x328(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x330(%rbp,%rcx)
callq 0x42f0
leaq -0x238(%rbp), %rdi
callq 0x4140
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc088
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x538(%rbp), %rdi
callq 0x40f0
leaq -0xd0(%rbp), %rdi
callq 0x72ac
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc0b9
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4390
leaq 0x4714(%rip), %rdi      # 0x107d4
movl $0x7, %esi
xorl %edx, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x686d
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xc0f9
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x4390
movb $0x1, %r14b
jmp 0xb4be
movups (%rcx), %xmm0
leaq -0x320(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0xbcff
jmp 0xc394
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2d4
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc2d4
movq %rax, %rbx
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xc2f9
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc2f9
movq %rax, %rbx
movq -0x538(%rbp), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xc19e
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc19e
movq %rax, %rbx
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xc1c5
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc1c5
movq %rax, %rbx
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc1eb
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc1eb
jmp 0xc1e8
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0xc31e
movq -0x40(%rbp), %rsi
jmp 0xc316
jmp 0xc2b6
jmp 0xc2b6
movq %rax, %rbx
jmp 0xc2f9
jmp 0xc394
movq %rax, %rbx
jmp 0xc31e
movq %rax, %rbx
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
jmp 0xc268
movq %rax, %rbx
movq -0x538(%rbp), %rdi
leaq -0x528(%rbp), %rax
cmpq %rax, %rdi
je 0xc25d
movq -0x528(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc25d
movq %rax, %rbx
leaq -0x320(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xc2a5
jmp 0xc397
jmp 0xc394
jmp 0xc394
jmp 0xc394
jmp 0xc346
jmp 0xc394
jmp 0xc2c5
jmp 0xc394
movq %rax, %rbx
movq -0x330(%rbp), %rdi
cmpq %r15, %rdi
je 0xc397
movq -0x320(%rbp), %rsi
jmp 0xc338
jmp 0xc394
movq %rax, %rbx
jmp 0xc2d4
jmp 0xc394
jmp 0xc394
movq %rax, %rbx
leaq -0x330(%rbp), %rdi
callq 0x4540
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc2ed
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x538(%rbp), %rdi
callq 0x40f0
leaq -0xd0(%rbp), %rdi
callq 0x72ac
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc31e
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xc397
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc397
jmp 0xc394
jmp 0xc394
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc362
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4390
movq -0x330(%rbp), %rdi
leaq -0x320(%rbp), %rax
cmpq %rax, %rdi
je 0xc384
movq -0x320(%rbp), %rsi
incq %rsi
callq 0x4390
leaq -0x538(%rbp), %rdi
callq 0x40f0
jmp 0xc397
jmp 0xc394
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0xc3b7
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc3b7
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xc3de
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x4390
jmp 0xc3de
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xc3fa
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x4390
movq %rbx, %rdi
callq 0x4660