// File: /workspace/github_cpp_makefile_star2_O1/lotuskip[P]yuxtapa/server/network.cpp
// Function: Network::receive_n_handle()
bool Network::receive_n_handle()
{
	sockaddr_storage them;
	socklen_t addr_len = sizeof(them);
	unsigned char mid;
	list<Player>::iterator pit;
	char handled = 0;
	short msglen;
	unsigned short ush;
	string s;
	while(handled++ < 20 && // handle at most 20 messages; then return control
		(msglen = recvfrom(s_me, recv_buffer.getw(), BUFFER_SIZE, 0,
			(sockaddr *)&them, &addr_len)) != -1)
	{
		mid = recv_buffer.read_ch();
		switch(mid)
		{
		case MID_HELLO:
		{
			// Check that interaction versions match:
			if(recv_buffer.read_sh() != INTR_VERSION)
			{
				send_buffer.clear();
				send_buffer.add((unsigned char)MID_HELLO_VERSION);
				do_send_to(&them, addr_len);
				break;
			}
			string pl_passw = "";
			ush = recv_buffer.read_sh();
			if(ush != 0xFFFF) // indicates a password has been sent, too
				recv_buffer.read_str(pl_passw);
			recv_buffer.read_str(s); // read nick
			if(num_syms(s) > MAX_NICK_LEN)
			{
				/* Client passed version control but has too long nick??
				 * That means it's a tampered client! Ignore the bastard. */
				break;
			}
			ush = player_hello(ush, pl_passw, s, them, false);
			// Note: player_hello can call something that uses send_buffer!
			send_buffer.clear();
			if(ush == ID_STEAL)
			{
				send_buffer.add((unsigned char)MID_HELLO_STEAL);
				do_send_to(&them, addr_len);
				break;
			}
			/*else*/ if(ush == IP_BANNED)
			{
				send_buffer.add((unsigned char)MID_HELLO_BANNED);
				do_send_to(&them, addr_len);
				break;
			}
			/*else*/ if(ush == SERVER_FULL)
			{
				send_buffer.add((unsigned char)MID_HELLO_FULL);
				do_send_to(&them, addr_len);
				break;
			}
			/*else*/ if(ush == JOIN_OK_ID_OK)
				send_buffer.add((unsigned char)MID_HELLO);
			else
			{
				send_buffer.add((unsigned char)MID_HELLO_NEWID);
				send_buffer.add(ush);
				send_buffer.add(pl_passw);
			}
			do_send_to(&them, addr_len);
			// Send greeting:
			s = Config::greeting_str();
			construct_msg(s, DEF_MSG_COL);
			do_send_to(&them, addr_len);
			list<Player>::iterator pit = (--cur_players.end());
			if(intermission) // send the miniview to the new player
			{
				do_send_to(&them, addr_len, Game::get_miniview());
				Game::construct_team_msgs(pit);
			}
			else
				Game::send_flag_upds(pit);
			time(&(pit->last_switched_cl));

			Game::send_state_change(pit);
			Game::send_team_upds(pit);
			to_chat(pit->nick + " connected.");
			break;
		}
		case MID_BOTHELLO:
		{
			send_buffer.clear();
			// Check that interaction versions match:
			if(recv_buffer.read_sh() != INTR_VERSION)
			{
				send_buffer.add((unsigned char)MID_HELLO_VERSION);
				do_send_to(&them, addr_len);
				to_log("Incompatible bot connection.");
				break;
			}
			ush = recv_buffer.read_sh();
			if((ush = bot_connect(ush, them)) <= HIGHEST_VALID_ID)
			{
				send_buffer.add((unsigned char)MID_HELLO_NEWID);
				send_buffer.add(ush);
				send_buffer.add((unsigned short)Config::int_settings[Config::IS_TURNMS]);
				do_send_to(&them, addr_len);
			}
			break;
		}
		case MID_QUIT:
			if((pit = who_is_this()) != cur_players.end())
				Game::remove_player(pit, " disconnected.");
			break;
		case MID_SAY_ALOUD:
			if(!intermission && (pit = who_is_this()) != cur_players.end()
				&& pit->is_alive() && voices.find(pit->own_pc->getpos()) == voices.end())
			{
				recv_buffer.read_str(s);
				// A proper client wouldn't send too long messages:
				if(num_syms(s) > MSG_WIN_X-3)
					cheat_attempt(pit);
				else
				{
					add_voice(pit->own_pc->getpos(), s);
					event_set.insert(pit->own_pc->getpos());
				}
			}
			break;
		case MID_SAY_CHAT:
			if((pit = who_is_this()) != cur_players.end())
			{
				recv_buffer.read_str(s);
				// Check if it is a !command
				if(!s.empty() && s[0] == '!'
					&& process_cmd(pit, s))
					break;
				// (process_cmd returns true if the command should not be
				// broadcast)

				// Else, we forward the message to all clients (and add the
				// speakers nick to the end). Note that we are using the
				// "receive buffer" for sending, in order to avoid copying.
				if(!pit->muted)
				{
					*(recv_buffer.getw()+1) = *(recv_buffer.getw()+2) = 0;
					recv_buffer.set_amount(msglen);
					recv_buffer.add(pit->nick);
					recv_buffer.add((unsigned char)pit->team);
					broadcast(0xFFFF, recv_buffer);
				}
			}
			break;
		case MID_VIEW_UPD:
			if((pit = who_is_this()) != cur_players.end())
			{
				ush = recv_buffer.read_sh();
				// 't' is an ack from a client "I've received the view
				// update for turn t'. But the message might be delayed;
				// must check if the player has acted since:
				if(ush > pit->last_heard_of)
					pit->last_heard_of = ush;
			}
			break;
		case MID_TAKE_ACTION:
			if(!intermission && (pit = who_is_this()) != cur_players.end()
				&& pit->action_queue.size() < MAX_AXN_QUEUE_SIZE)
			{
				// First check sequentiality. If this action is "timestamped" earlier than
				// the latest action we have actually received from this player, ignore it!
				ush = recv_buffer.read_sh(); // turn
				if(ush >= pit->last_acted_on_turn)
				{
					// This is the latest we've heard from this client:
					if(ush > pit->last_heard_of)
						pit->last_heard_of = ush;

					unsigned char an = recv_buffer.read_ch(); // action number for the turn
					if(ush > pit->last_acted_on_turn || an > pit->last_axn_number)
					{
						// we accept this action, so update the values:
						pit->last_acted_on_turn = ush;
						pit->last_axn_number = an;

						// Now, construct the action:
						if((mid = recv_buffer.read_ch()) == XN_SHOOT) // contains two more values
						{
							// If either coordinate is too large by abs-val (out of screen), kick
							char xcoord = static_cast<char>(recv_buffer.read_ch());
							char ycoord = static_cast<char>(recv_buffer.read_ch());
							if(abs(xcoord) > VIEWSIZE/2 || abs(ycoord) > VIEWSIZE/2
								|| (!xcoord && !ycoord)) // both zero is bad, too
							{
#ifdef DEBUG
								to_log("Read illegal shot coordinates ("
									+ lex_cast(xcoord) + ","
									+ lex_cast(ycoord) + ")!");
#endif
								cheat_attempt(pit);
								break;
							}
							Game::player_action(pit, Axn(mid, xcoord, ycoord));
						}
						else if(mid == XN_MOVE || mid == XN_ZAP || mid == XN_HEAL
							|| mid == XN_CIRCLE_ATTACK || mid == XN_MINE) // one more value
						{
							char dir = static_cast<char>(recv_buffer.read_ch());
							if(dir > MAX_D || dir < 0 || (dir == MAX_D && mid != XN_HEAL))
							{
#ifdef DEBUG
								to_log("Read illegal direction "
									+ lex_cast(dir) + " in "
									+ lex_cast(mid) + "-type xn!");
#endif
								cheat_attempt(pit);
								break;
							}
							Game::player_action(pit, Axn(mid, dir));
						}
						else
							Game::player_action(pit, Axn(mid));
					}
					// else delivery order got messed up
				}
				// else delivery order got messed up
			}
			break;
		case MID_SPAWN_AXN:
			if((pit = who_is_this()) != cur_players.end())
				Game::class_switch(pit, e_Class(recv_buffer.read_ch()));
			break;
		case MID_TEAM_SWITCH:
			if((pit = who_is_this()) != cur_players.end())
				Game::team_switch(pit);
			break;
		case MID_TEAM_INFO:
			if((pit = who_is_this()) != cur_players.end())
				Game::send_team_info(pit);
			break;
		default: break;
		}
	}
	return (handled == 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
leaq -0x30(%rbp), %rax
movl $0x80, (%rax)
leaq -0xd0(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movb $0x1, %al
xorl %ecx, %ecx
leaq 0x34c91(%rip), %r14     # 0x430c0
xorl %r12d, %r12d
movl %ecx, %r15d
movq %rax, -0x128(%rbp)
movl 0x33d06(%rip), %ebx     # 0x42148
leaq 0x334ef(%rip), %rdi     # 0x41938
callq 0x2b53a
movl $0x800, %edx            # imm = 0x800
movl %ebx, %edi
movq %rax, %rsi
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
leaq -0x30(%rbp), %r9
callq 0x42c0
movq %rax, %r13
cmpw $-0x1, %r13w
je 0xf318
leaq 0x334b9(%rip), %rdi     # 0x41938
callq 0x2b474
cmpb $0x9, %al
ja 0xee40
movzbl %al, %eax
leaq 0x1dd62(%rip), %rcx     # 0x2c1f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x33492(%rip), %rdi     # 0x41938
callq 0x2b45c
cmpw $0x3, %ax
jne 0xe94d
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1de28(%rip), %rdx     # 0x2c2f0
movq %rdx, %rsi
callq 0xdfec
leaq 0x33461(%rip), %rdi     # 0x41938
callq 0x2b45c
leaq -0x68(%rbp), %r15
movl %eax, %r13d
cmpw $-0x1, %ax
je 0xe4f9
leaq 0x33448(%rip), %rdi     # 0x41938
leaq -0x50(%rbp), %rsi
callq 0x2b486
leaq 0x33438(%rip), %rdi     # 0x41938
leaq -0xe0(%rbp), %rsi
callq 0x2b486
leaq -0xe0(%rbp), %rdi
callq 0x2b890
cmpw $0xa, %ax
jg 0xee27
movzwl %r13w, %edi
leaq -0x50(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
leaq -0x1a8(%rbp), %rcx
xorl %r8d, %r8d
callq 0x13287
movl %eax, %ebx
leaq 0x32bdf(%rip), %rdi     # 0x41128
callq 0x2b340
movzwl %bx, %ebx
leal -0xfffc(%rbx), %eax
cmpl $0x3, %eax
ja 0xeccf
leaq 0x1dcb9(%rip), %rcx     # 0x2c220
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x32bb1(%rip), %rdi     # 0x41128
movl $0x10, %esi
callq 0x2b354
jmp 0xeca3
leaq 0x333ab(%rip), %rbx     # 0x41938
movq %rbx, %rdi
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe790
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe598
jmp 0xe793
leaq 0x33379(%rip), %rdi     # 0x41938
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe856
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe5c7
jmp 0xe859
leaq 0x3334a(%rip), %rdi     # 0x41938
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe86f
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe5f6
jmp 0xe872
leaq 0x3331b(%rip), %rbx     # 0x41938
movq %rbx, %rdi
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe8ad
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe628
jmp 0xe8b0
leaq 0x31dc1(%rip), %rax     # 0x40410
cmpb $0x0, (%rax)
jne 0xee40
leaq 0x332d9(%rip), %rbx     # 0x41938
movq %rbx, %rdi
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe9fd
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe66a
jmp 0xea00
leaq 0x32a97(%rip), %rdi     # 0x41128
callq 0x2b340
leaq 0x3329b(%rip), %rdi     # 0x41938
callq 0x2b45c
cmpw $0x3, %ax
jne 0xe996
leaq 0x33285(%rip), %rdi     # 0x41938
callq 0x2b45c
movzwl %ax, %edi
leaq -0x1a8(%rbp), %rsi
callq 0x13aba
movl %eax, %ebx
cmpw $-0x5, %ax
ja 0xee40
leaq 0x32a4e(%rip), %rdi     # 0x41128
movl $0x14, %esi
callq 0x2b354
movzwl %bx, %esi
leaq 0x32a3a(%rip), %rdi     # 0x41128
callq 0x2b368
leaq 0x341a6(%rip), %rax     # 0x428a0
movzwl 0x14(%rax), %esi
leaq 0x32a23(%rip), %rdi     # 0x41128
callq 0x2b368
jmp 0xe96a
leaq 0x33222(%rip), %rdi     # 0x41938
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe8de
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe71e
jmp 0xe8e1
leaq 0x31ccb(%rip), %rax     # 0x40410
cmpb $0x0, (%rax)
je 0xe91b
xorl %eax, %eax
xorl %ebx, %ebx
leaq 0x331df(%rip), %r15     # 0x41938
jmp 0xebd9
leaq 0x331d3(%rip), %rbx     # 0x41938
movq %rbx, %rdi
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xe8f7
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe770
jmp 0xe8fa
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
movq %rbx, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x2b486
cmpq $0x0, -0xd8(%rbp)
je 0xe7d8
movq -0xe0(%rbp), %rax
cmpb $0x21, (%rax)
jne 0xe7d8
movq %r12, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x28070
testb %al, %al
jne 0xee40
cmpb $0x0, 0xba(%r12)
jne 0xee40
leaq 0x3314a(%rip), %rdi     # 0x41938
callq 0x2b53a
movb $0x0, 0x2(%rax)
leaq 0x3313a(%rip), %rdi     # 0x41938
callq 0x2b53a
movb $0x0, 0x1(%rax)
movswl %r13w, %esi
leaq 0x33126(%rip), %rdi     # 0x41938
callq 0x2b54e
leaq 0x98(%r12), %rsi
leaq 0x33112(%rip), %rdi     # 0x41938
callq 0x2b392
movzbl 0xbc(%r12), %esi
leaq 0x330fd(%rip), %rdi     # 0x41938
callq 0x2b354
movl $0xffff, %edi           # imm = 0xFFFF
leaq 0x330ec(%rip), %rsi     # 0x41938
callq 0xe383
jmp 0xee40
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
movq %r12, %rdi
callq 0x1d1f6
jmp 0xee40
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1da02(%rip), %rsi     # 0x2c293
leaq 0x1da09(%rip), %rdx     # 0x2c2a1
callq 0xdfec
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1bff2
jmp 0xee27
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
movq %rbx, %rdi
callq 0x2b45c
cmpw 0xb8(%r12), %ax
jbe 0xee40
movw %ax, 0xb8(%r12)
jmp 0xee40
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
movq %r12, %rdi
callq 0x1ca83
jmp 0xee40
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
movq %rbx, %rdi
callq 0x2b474
movzbl %al, %esi
movq %r12, %rdi
callq 0x1cc21
jmp 0xee40
leaq 0x33016(%rip), %r15     # 0x41938
movq %r15, %rdi
callq 0x2b45c
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xeb90
movq 0x90(%r12), %rcx
cmpw %ax, 0x10(%rcx)
jne 0xe92d
jmp 0xeb93
leaq 0x327d4(%rip), %rdi     # 0x41128
callq 0x2b340
leaq 0x327c8(%rip), %rdi     # 0x41128
movl $0x12, %esi
callq 0x2b354
movl -0x30(%rbp), %r9d
movl 0x337d4(%rip), %edi     # 0x42148
movswq 0x327b4(%rip), %rdx     # 0x41130
leaq 0x327af(%rip), %rsi     # 0x41132
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
callq 0x4050
jmp 0xee40
leaq 0x3278b(%rip), %rdi     # 0x41128
movl $0x12, %esi
callq 0x2b354
movl -0x30(%rbp), %r9d
movl 0x33797(%rip), %edi     # 0x42148
movswq 0x32777(%rip), %rdx     # 0x41130
leaq 0x32772(%rip), %rsi     # 0x41132
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
callq 0x4050
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1d892(%rip), %rsi     # 0x2c276
leaq 0x1d8a7(%rip), %rdx     # 0x2c292
callq 0xdfec
movq %rbx, %rdi
callq 0x15050
jmp 0xee27
movq %r14, %r12
cmpq %r14, %r12
je 0xee40
movq 0x130(%r12), %rax
movq %rax, %rcx
subq 0x110(%r12), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
imulq $0xaa, %rcx, %rax
movq 0x118(%r12), %rcx
subq 0x120(%r12), %rcx
movq 0x108(%r12), %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rcx
subq 0xf8(%r12), %rdx
imulq %rsi, %rdx
addq %rcx, %rdx
addq %rax, %rdx
cmpq $0x4, %rdx
ja 0xee40
movq %rbx, %rdi
callq 0x2b45c
movl %eax, %r13d
cmpw 0xe0(%r12), %ax
jb 0xee40
cmpw 0xb8(%r12), %r13w
jbe 0xea9f
movw %r13w, 0xb8(%r12)
leaq 0x32e92(%rip), %rdi     # 0x41938
callq 0x2b474
cmpw 0xe0(%r12), %r13w
ja 0xeac4
cmpb 0xe2(%r12), %al
jbe 0xee40
movw %r13w, 0xe0(%r12)
movb %al, 0xe2(%r12)
leaq 0x32e5c(%rip), %rdi     # 0x41938
callq 0x2b474
movl %eax, %r13d
movzbl %al, %esi
cmpb $0xc, %sil
leaq 0x32e46(%rip), %rbx     # 0x41938
ja 0xefd8
movl $0x1c90, %eax           # imm = 0x1C90
movl %esi, -0x54(%rbp)
btl %esi, %eax
jae 0xee57
movq %rbx, %rdi
callq 0x2b474
cmpb $0x8, %al
ja 0xeb27
setne %cl
cmpb $0xc, %r13b
sete %dl
orb %cl, %dl
jne 0xefc2
movsbl %al, %esi
leaq -0x120(%rbp), %rbx
movq %rbx, %rdi
callq 0x2be77
movl $0x17, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1d77a(%rip), %rcx     # 0x2c2c7
callq 0x4440
leaq -0xf0(%rbp), %rbx
leaq -0x90(%rbp), %r15
movq %rbx, -0x100(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xeecd
movq %rdx, -0x100(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xf0(%rbp)
jmp 0xeed3
movq %r14, %r12
cmpq %r14, %r12
je 0xebd5
leaq 0x10(%r12), %rdi
callq 0x125e6
testb %al, %al
leaq 0x373e5(%rip), %rdi     # 0x45f90
je 0xebd5
movq 0x148(%r12), %rax
movl 0x8(%rax), %eax
movl %eax, -0x7c(%rbp)
leaq -0x7c(%rbp), %rsi
movq %rdi, %rbx
callq 0xfb1c
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
sete %bl
movb $0x1, %al
jmp 0xebd9
xorl %eax, %eax
xorl %ebx, %ebx
testb %al, %al
je 0xebe6
leaq -0x7c(%rbp), %rdi
callq 0x2bbf6
testb %bl, %bl
je 0xee40
movq %r15, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x2b486
leaq -0xe0(%rbp), %rdi
callq 0x2b890
cmpw $0x37, %ax
jl 0xec1c
movq %r12, %rdi
callq 0xf745
jmp 0xee40
movq 0x148(%r12), %rax
movl 0x8(%rax), %eax
movl %eax, -0x50(%rbp)
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x20ba5
movq %rbx, %rdi
callq 0x2bbf6
movq 0x148(%r12), %rax
movl 0x8(%rax), %eax
movl %eax, -0x50(%rbp)
leaq 0x3737e(%rip), %rdi     # 0x45fd8
movq %rbx, %rsi
callq 0xfb84
movq %rbx, %rdi
callq 0x2bbf6
jmp 0xee40
leaq 0x324b2(%rip), %rdi     # 0x41128
movl $0x13, %esi
callq 0x2b354
jmp 0xeca3
leaq 0x3249f(%rip), %rdi     # 0x41128
xorl %esi, %esi
callq 0x2b354
jmp 0xecfe
leaq 0x3248f(%rip), %rdi     # 0x41128
movl $0x11, %esi
callq 0x2b354
movl -0x30(%rbp), %r9d
movl 0x3349b(%rip), %edi     # 0x42148
movswq 0x3247b(%rip), %rdx     # 0x41130
leaq 0x32476(%rip), %rsi     # 0x41132
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
callq 0x4050
jmp 0xee27
leaq 0x32452(%rip), %rdi     # 0x41128
movl $0x14, %esi
callq 0x2b354
leaq 0x32441(%rip), %rdi     # 0x41128
movl %ebx, %esi
callq 0x2b368
leaq 0x32433(%rip), %rdi     # 0x41128
leaq -0x50(%rbp), %rsi
callq 0x2b392
movl -0x30(%rbp), %r9d
movl 0x33440(%rip), %edi     # 0x42148
movswq 0x32420(%rip), %rdx     # 0x41130
leaq 0x3241b(%rip), %rsi     # 0x41132
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
callq 0x4050
callq 0x11b2e
leaq -0xe0(%rbp), %rdi
movq %rax, %rsi
callq 0x41f0
leaq -0xe0(%rbp), %rdi
movl $0xf, %esi
callq 0xf4ed
movl -0x30(%rbp), %r9d
movl 0x333f4(%rip), %edi     # 0x42148
movswq 0x323d4(%rip), %rdx     # 0x41130
leaq 0x323cf(%rip), %rsi     # 0x41132
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
callq 0x4050
movq 0x8(%r14), %r13
leaq 0x31694(%rip), %rax     # 0x40410
cmpb $0x1, (%rax)
jne 0xedb6
movl -0x30(%rbp), %ebx
callq 0x1c3bf
movl 0x333b9(%rip), %edi     # 0x42148
movq %rax, %rsi
addq $0xa, %rsi
movswq 0x8(%rax), %rdx
xorl %ecx, %ecx
leaq -0x1a8(%rbp), %r8
movl %ebx, %r9d
callq 0x4050
movq %r13, %rdi
callq 0x19ccb
jmp 0xedbe
movq %r13, %rdi
callq 0x1b30b
leaq 0xc8(%r13), %rdi
callq 0x43b0
movq %r13, %rdi
callq 0x1ca23
movq %r13, %rdi
callq 0x19f7b
movq %r15, -0x78(%rbp)
movq 0x98(%r13), %rsi
movq 0xa0(%r13), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0xfa82
movq %rbx, %rdi
leaq 0x1d465(%rip), %rsi     # 0x2c26a
callq 0x47c0
movq %rbx, %rdi
callq 0xf676
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0xee27
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xee40
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x128(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpb $0x15, %al
jne 0xe432
jmp 0xf315
movl -0x54(%rbp), %esi
cmpl $0x5, %esi
jne 0xefd8
movq %rbx, %rdi
callq 0x2b474
movl %eax, %r13d
movq %rbx, %rdi
callq 0x2b474
movsbl %r13b, %esi
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
movb %al, -0x29(%rbp)
movl %eax, %ecx
orb %sil, %cl
je 0xf14b
cmpl $0xb, %edx
ja 0xf14b
movb -0x29(%rbp), %cl
movl %ecx, %eax
sarb $0x7, %al
xorb %al, %cl
subb %al, %cl
cmpb $0xc, %cl
jae 0xf14b
movzbl -0x29(%rbp), %eax
shll $0x10, %eax
movzbl %r13b, %esi
shll $0x8, %esi
orl %eax, %esi
addl -0x54(%rbp), %esi
movq %r12, %rdi
callq 0x1c3cc
jmp 0xee40
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movl -0x54(%rbp), %r13d
movq 0x8(%rax), %rdx
movq %rdx, -0xf8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x100(%rbp), %rdi
leaq 0x1d3e0(%rip), %rsi     # 0x2c2df
callq 0x47c0
movq %r15, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq -0xc0(%rbp), %rdi
je 0xef34
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0xef3b
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %r13d, %esi
callq 0x2be77
movq -0xa0(%rbp), %rcx
movl $0xf, %esi
cmpq %r15, %rcx
je 0xef75
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %r8
movq -0xb8(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0xefad
movl $0xf, %esi
leaq -0xb0(%rbp), %rdi
cmpq %rdi, -0xc0(%rbp)
je 0xefa8
movq -0xb0(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xefe5
movq -0xc0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x4130
jmp 0xeff5
movzbl %al, %esi
shll $0x8, %esi
addl -0x54(%rbp), %esi
movq %r12, %rdi
callq 0x1c3cc
jmp 0xee40
movq %r12, %rdi
callq 0x1c3cc
jmp 0xee40
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4440
leaq -0x68(%rbp), %rsi
movq %rsi, -0x78(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xf016
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0xf01c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x78(%rbp), %rdi
leaq 0x1d2a1(%rip), %rsi     # 0x2c2e4
callq 0x47c0
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xf06c
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xf072
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x50(%rbp), %rdi
callq 0x15050
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf0ab
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xf0c4
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xf0e6
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0xf101
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf11c
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xf13e
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %r12, %rdi
callq 0xf745
jmp 0xee40
leaq -0x120(%rbp), %rbx
movq %rbx, %rdi
callq 0x2be77
leaq -0x100(%rbp), %r13
movq %r13, %rdi
leaq 0x1d137(%rip), %rsi     # 0x2c2a2
movq %rbx, %rdx
callq 0xf943
leaq -0x90(%rbp), %r15
movq %r13, %rdi
leaq 0x1d13e(%rip), %rsi     # 0x2c2c2
callq 0x47c0
movq %r15, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xf1b2
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0xf1b9
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movsbl -0x29(%rbp), %esi
leaq -0xc0(%rbp), %rbx
movq %rbx, %rdi
callq 0x2be77
leaq -0x78(%rbp), %r13
movq %r13, %rdi
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdx
callq 0xf891
movq %r13, %rdi
leaq 0x1d0be(%rip), %rsi     # 0x2c2c4
callq 0x47c0
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xf22f
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xf235
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x50(%rbp), %rdi
callq 0x15050
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf26e
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xf287
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xf2a9
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0xf2c4
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xf2e6
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43f0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xf308
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %r12, %rdi
callq 0xf745
jmp 0xee40
movb $0x14, %r15b
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xf33a
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x43f0
testb %r15b, %r15b
sete %al
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf373
jmp 0xf391
jmp 0xf3af
jmp 0xf3d6
jmp 0xf3fd
jmp 0xf424
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf394
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf394
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xf3b2
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf3b2
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xf3d9
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf3d9
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xf400
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf400
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xf427
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf427
movq %rax, %rbx
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xf4c3
movq -0x110(%rbp), %rsi
jmp 0xf4b6
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf44d
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0xf4a5
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf4a5
jmp 0xf4a2
jmp 0xf4c0
movq %rax, %rbx
leaq -0x7c(%rbp), %rdi
jmp 0xf47d
jmp 0xf476
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2bbf6
jmp 0xf4c3
jmp 0xf4c0
jmp 0xf4a2
jmp 0xf4c0
jmp 0xf4a2
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4a2
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
jmp 0xf4c0
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf4c3
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0xf4c3
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xf4e5
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %rbx, %rdi
callq 0x4750