LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/network.cpp
// Function: Network::construct_msg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned char)
void Network::construct_msg(string &s, const unsigned char cpair)
{
	/* Note: all message are server-generated, and pretty much the only content
	 * unknown at compile time and beyond the admin's control are the player nicks,
	 * which have limited lenght. Hence, we can rest assured that the strings do
	 * not contain words of lenght > MSG_WIN_X (=57). */
	vector<string> blocks;
	size_t i;
	// break up at spaces:
	while(num_syms(s) > MSG_WIN_X)
	{
		if((i = s.rfind(' ', MSG_WIN_X)) == string::npos)
			i = MSG_WIN_X;
		blocks.push_back(s.substr(0, i));
		s.erase(0, i+1);
	}
	if(!s.empty())
		blocks.push_back(s);
	send_buffer.clear();
	send_buffer.add((unsigned char)MID_ADD_MSG);
	send_buffer.add(cpair);
	send_buffer.add((unsigned char)blocks.size());
	for(i = 0; i < blocks.size(); ++i)
		send_buffer.add(blocks[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, -0x2c(%rbp)
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r15
andq $0x0, 0x10(%r15)
movaps %xmm0, (%r15)
pushq $0x39
popq %r13
leaq -0x70(%rbp), %rbx
movq %r14, %rdi
callq 0x24af0
cmpw $0x3a, %ax
jl 0xc17d
movq %r14, %rdi
pushq $0x20
popq %rsi
movq %r13, %rdx
callq 0x47b0
movq %rax, %r12
cmpq $-0x1, %rax
cmoveq %r13, %r12
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x4410
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc834
movq %rbx, %rdi
callq 0x47e8
incq %r12
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x40d0
jmp 0xc121
cmpq $0x0, 0x8(%r14)
je 0xc190
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xc4cc
leaq 0x31f81(%rip), %rdi     # 0x3e118
callq 0x24712
leaq 0x31f75(%rip), %rdi     # 0x3e118
pushq $0xa
popq %rsi
callq 0x24724
movzbl -0x2c(%rbp), %esi
leaq 0x31f62(%rip), %rdi     # 0x3e118
callq 0x24724
movl -0x48(%rbp), %eax
subl -0x50(%rbp), %eax
shrl $0x5, %eax
movzbl %al, %esi
leaq 0x31f4a(%rip), %rdi     # 0x3e118
callq 0x24724
xorl %r14d, %r14d
leaq 0x31f3b(%rip), %rbx     # 0x3e118
xorl %r15d, %r15d
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r15
jae 0xc208
addq %r14, %rsi
movq %rbx, %rdi
callq 0x24762
incq %r15
addq $0x20, %r14
jmp 0xc1e0
leaq -0x50(%rbp), %rdi
callq 0xc508
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc234
jmp 0xc234
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x47e8
jmp 0xc237
jmp 0xc234
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0xc508
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/network.cpp
// Function: Network::to_chat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Network::to_chat(const string &s)
{
	send_buffer.clear();
	send_buffer.add((unsigned char)MID_SAY_CHAT);
	send_buffer.add((unsigned short)0);
	send_buffer.add(s);
	send_buffer.add(string("* "));
	send_buffer.add((unsigned char)T_NO_TEAM); // no team, server speaking
	broadcast();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %r14
leaq 0x31ebb(%rip), %rbx     # 0x3e118
movq %rbx, %rdi
callq 0x24712
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x24724
movq %rbx, %rdi
xorl %esi, %esi
callq 0x24738
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24762
leaq 0x1a0be(%rip), %rsi     # 0x2634a
leaq -0x38(%rbp), %r14
leaq -0x11(%rbp), %rdx
movq %r14, %rdi
callq 0xb292
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24762
leaq -0x38(%rbp), %rdi
callq 0x47e8
leaq 0x31e61(%rip), %rbx     # 0x3e118
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x24724
movl $0xffff, %edi           # imm = 0xFFFF
movq %rbx, %rsi
callq 0xb61b
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/network.cpp
// Function: (anonymous namespace)::who_is_this()
list<Player>::iterator who_is_this()
{
	unsigned short pid = recv_buffer.read_sh();
	for(list<Player>::iterator it = cur_players.begin(); it != cur_players.end(); ++it)
	{
		if(it->stats_i->ID == pid)
			return it;
		/* NOTE: in principle, a malignant client could register as one player and
		 * afterwards ID as another... A remedy would be to check the address, but
		 * atm it seems unnecessary. */
	}
	return cur_players.end();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x32631(%rip), %rdi     # 0x3e928
callq 0x24800
leaq 0x33dad(%rip), %rdx     # 0x400b0
movq %rdx, %rcx
movq (%rcx), %rcx
cmpq %rdx, %rcx
je 0xc31b
movq 0x90(%rcx), %rsi
cmpw %ax, 0x10(%rsi)
jne 0xc306
movq %rcx, %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/network.cpp
// Function: Network::clocksync(unsigned short, unsigned char)
void Network::clocksync(const unsigned short time, const unsigned char spawn)
{
	send_buffer.clear();
	send_buffer.add((unsigned char)MID_TIME_UPD);
	send_buffer.add(time);
	send_buffer.add(spawn);
	broadcast();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
leaq 0x31d4a(%rip), %r15     # 0x3e118
movq %r15, %rdi
callq 0x24712
pushq $0xe
popq %rsi
movq %r15, %rdi
callq 0x24724
movq %r15, %rdi
movl %r14d, %esi
callq 0x24738
movq %r15, %rdi
movl %ebx, %esi
callq 0x24724
movl $0xffff, %edi           # imm = 0xFFFF
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb61b
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/settings.cpp
// Function: (anonymous namespace)::validate_classlim()
bool validate_classlim()
{
	using namespace Config;
	if(int_settings[IS_CLASSLIMIT]
		&& int_settings[IS_CLASSLIMIT]*2*NO_CLASS < int_settings[IS_MAXPLAYERS])
	{
		int_settings[IS_CLASSLIMIT] = 0;
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x322a1(%rip), %eax     # 0x3f8a0
testl %eax, %eax
je 0xd619
imull $0x16, %eax, %eax
cmpl 0x32284(%rip), %eax     # 0x3f890
jae 0xd619
andl $0x0, 0x3228b(%rip)     # 0x3f8a0
movb $0x1, %al
jmp 0xd61b
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/settings.cpp
// Function: (anonymous namespace)::validate_minp()
bool validate_minp()
{
	using namespace Config;
	if(int_settings[IS_MINPLAYERS] > int_settings[IS_MAXPLAYERS]
		|| (int_settings[IS_MINPLAYERS] && !botexe.length()))
	{
		int_settings[IS_MINPLAYERS] = 0;
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x32295(%rip), %ecx     # 0x3f8bc
cmpl 0x32263(%rip), %ecx     # 0x3f890
ja 0xd63f
xorl %eax, %eax
testl %ecx, %ecx
je 0xd648
cmpq $0x0, 0x321ab(%rip)     # 0x3f7e8
jne 0xd648
andl $0x0, 0x32276(%rip)     # 0x3f8bc
movb $0x1, %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/settings.cpp
// Function: (anonymous namespace)::check_path_setting(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool)
bool check_path_setting(const string &name, string &val, const bool x)
{
	if(x)
	{
		if(access(val.c_str(), X_OK) == -1)
		{
			to_log("Config error: the \'" + name + "\' setting does not "
				"point to a valid executable file: \"" + val + "\".");
			val.clear();
			return true;
		}
		return false;
	}
	struct stat buf;
	if(stat(val.c_str(), &buf) || !(S_ISDIR(buf.st_mode)))
	{
		to_log("Config error: the \'" + name + "\' setting does not "
			"point to a valid directory: \"" + val + "\".");
		val.clear();
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
je 0xd6ff
movq (%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x46e0
cmpl $-0x1, %eax
jne 0xd724
leaq 0x19058(%rip), %rsi     # 0x266db
leaq -0x78(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xde6a
leaq 0x19056(%rip), %rdx     # 0x266ef
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0xb309
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq 0xe08e
leaq 0x1906a(%rip), %rdx     # 0x26726
leaq -0x128(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xb309
leaq -0x128(%rbp), %rdi
callq 0x10b68
leaq -0x128(%rbp), %rdi
callq 0x47e8
leaq -0x58(%rbp), %rdi
callq 0x47e8
leaq -0x38(%rbp), %rdi
callq 0x47e8
leaq -0x78(%rbp), %rdi
jmp 0xd7a6
movq (%rbx), %rdi
leaq -0x128(%rbp), %rsi
callq 0x43a0
testl %eax, %eax
jne 0xd72b
movl $0xf000, %eax           # imm = 0xF000
andl -0x110(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xd72b
xorl %eax, %eax
jmp 0xd7b8
leaq 0x18fa9(%rip), %rsi     # 0x266db
leaq -0x98(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xde6a
leaq 0x18fde(%rip), %rdx     # 0x26729
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0xb309
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movq %rbx, %rdx
callq 0xe08e
leaq 0x18fb8(%rip), %rdx     # 0x26726
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xb309
leaq -0x58(%rbp), %rdi
callq 0x10b68
leaq -0x58(%rbp), %rdi
callq 0x47e8
leaq -0x38(%rbp), %rdi
callq 0x47e8
leaq -0x78(%rbp), %rdi
callq 0x47e8
leaq -0x98(%rbp), %rdi
callq 0x47e8
andq $0x0, 0x8(%rbx)
movq (%rbx), %rax
movb $0x0, (%rax)
movb $0x1, %al
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x47e8
jmp 0xd7da
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x47e8
jmp 0xd7e8
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47e8
jmp 0xd7f6
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0xd830
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x47e8
jmp 0xd80d
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47e8
jmp 0xd81b
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x47e8
jmp 0xd829
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/settings.cpp
// Function: (anonymous namespace)::construct_value_list(std::vector<char, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*)
string construct_value_list(const vector<char> &l, string const* const s)
{
	string ret = "";
	for(vector<char>::const_iterator it = l.begin(); it != l.end(); ++it)
		ret += s[*it] + '/';
	ret.erase(ret.size()-1, 1);
	if(ret.size() > MAX_LIST_LEN)
	{
		ret.erase(ret.rfind('/', MAX_LIST_LEN-4));
		ret += "...";
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18651(%rip), %rsi     # 0x2634c
leaq -0x48(%rbp), %r12
movq %r12, %rdx
callq 0xb292
movq (%r15), %r13
cmpq 0x8(%r15), %r13
je 0xdd3f
movsbq (%r13), %rsi
shlq $0x5, %rsi
addq %r14, %rsi
movq %r12, %rdi
pushq $0x2f
popq %rdx
callq 0xe0b7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4790
movq %r12, %rdi
callq 0x47e8
incq %r13
jmp 0xdd0a
movq 0x8(%rbx), %rsi
decq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x40d0
cmpq $0x51, 0x8(%rbx)
jb 0xdd83
pushq $0x2f
popq %rsi
pushq $0x4c
popq %rdx
movq %rbx, %rdi
callq 0x47b0
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40d0
leaq 0x21e1e(%rip), %rsi     # 0x2fb99
movq %rbx, %rdi
callq 0x4770
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdd97
movq %rax, %r14
jmp 0xdda8
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x47e8
movq %r14, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/sighandle.cpp
// Function: reg_sig_handlers()
void reg_sig_handlers()
{
	struct sigaction sa;
	sa.sa_handler = handle_signal;
	sigemptyset(&sa.sa_mask);
	sa.sa_flags = 0;
	// List here all signals we're interested in:
	sigaction(SIGINT, &sa, 0);
	sigaction(SIGQUIT, &sa, 0);

	// Child processes would be bots. Let them be reaped:
	signal(SIGCHLD, SIG_IGN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
leaq 0x50(%rip), %rax        # 0xe57f
leaq -0x98(%rbp), %rbx
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
callq 0x44e0
andl $0x0, 0x80(%rbx)
pushq $0x2
popq %rdi
leaq -0xa0(%rbp), %rbx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44f0
pushq $0x3
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44f0
pushq $0x11
popq %rdi
pushq $0x1
popq %rsi
callq 0x4480
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: PlayerStats::PlayerStats()
PlayerStats::PlayerStats() : last_known_as(""), deaths(0), tks(0),
	healing_recvd(0), total_time(0), time_specced(0), arch_hits(0),
	arch_shots(0), cm_hits(0), cm_shots(0), ad_lvl(AL_GUEST)
{
	int i;
	for(i = 0; i < NO_CLASS; ++i)
		time_played[i] = 0;
	for(i = 0; i < MAX_WAY_TO_KILL; ++i)
		kills[i] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x10, %rdi
leaq 0x17d94(%rip), %rsi     # 0x2634c
leaq -0x9(%rbp), %rdx
callq 0xb292
andq $0x0, 0x30(%rbx)
andl $0x0, 0x130(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0x118(%rbx)
xorl %eax, %eax
cmpq $0xb, %rax
je 0xe602
andq $0x0, 0xb0(%rbx,%rax,8)
incq %rax
jmp 0xe5ee
xorl %eax, %eax
cmpq $0xb, %rax
je 0xe615
andq $0x0, 0x38(%rbx,%rax,8)
incq %rax
jmp 0xe604
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: Player::burn_torch()
bool Player::burn_torch()
{
	--torch_left;
	if(torch_left == 3*TORCH_DURATION/2 || torch_left == TORCH_DURATION/2
		|| torch_left == TORCH_DURATION || !torch_left)
		needs_state_upd = true;
	return !torch_left;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x160(%rdi), %ecx
leal -0x1(%rcx), %eax
movw %ax, 0x160(%rdi)
cmpl $0x1, %ecx
je 0xe762
cmpl $0xfb, %ecx
je 0xe762
cmpl $0x2ef, %ecx            # imm = 0x2EF
je 0xe762
cmpl $0x1f5, %ecx            # imm = 0x1F5
jne 0xe769
movb $0x1, 0x14d(%rdi)
testw %ax, %ax
sete %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: Player::torch_symbol(bool) const
unsigned char Player::torch_symbol(const bool lit) const
{
	if(cl_props.torch)
	{
		if(!torch_left)
			return ',';
		if(lit)
			return torch_sym[2*torch_left/TORCH_DURATION];
		return ' '; // torch not lit
	}
	return '-'; // no torch whatsoever
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x2d, %al
cmpb $0x1, 0x14b(%rdi)
jne 0xe7bc
movzwl 0x160(%rdi), %ecx
testw %cx, %cx
setne %dl
movl $0x20, %edi
movl $0x2c, %eax
cmovnel %edi, %eax
andb %sil, %dl
cmpb $0x1, %dl
jne 0xe7bc
movw $0xfa, %si
movl %ecx, %eax
cwtd
idivw %si
movswq %ax, %rax
leaq 0x182d9(%rip), %rcx     # 0x26a92
movb (%rax,%rcx), %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: store_known_players()
void store_known_players()
{
	// This function is called when the server shuts down. Now, it might be that
	// there were players connected at that time, and we need to stat their
	// playing times here!
	extern bool intermission;
	for(list<Player>::iterator pit = cur_players.begin();
		pit != cur_players.end(); ++pit)
	{
		if(pit->botpid != -1) // it's a bot
			known_players.erase(pit->stats_i);
		else
		{
			pit->stats_i->total_time += time(NULL) - pit->stats_i->last_seen;
			time(&(pit->stats_i->last_seen));
		
			if(pit->is_alive())
				pit->stats_i->time_played[pit->cl] += time(NULL) - pit->last_switched_cl;
			else if(pit->team == T_SPEC && !intermission)
				pit->stats_i->time_specced += time(NULL) - pit->last_switched_cl;
		}
	}

	// Now start actually storing the player statistics:
	write_player_stats();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x31438(%rip), %r14     # 0x400b0
leaq 0x2e781(%rip), %r15     # 0x3d400
leaq 0x31412(%rip), %rbx     # 0x40098
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0xed56
cmpl $-0x1, 0x174(%r12)
je 0xecb3
movq 0x90(%r12), %rsi
movq %rbx, %rdi
callq 0xfe68
jmp 0xec89
xorl %edi, %edi
callq 0x43c0
movq 0x90(%r12), %rcx
subq 0x138(%rcx), %rax
leaq 0x138(%rcx), %rdi
addq %rax, 0xb0(%rcx)
callq 0x43c0
movl 0xbc(%r12), %eax
cmpl $0x2, %eax
je 0xed20
cmpb $0x0, 0x153(%r12)
jle 0xed20
xorl %edi, %edi
callq 0x43c0
subq 0xc8(%r12), %rax
movq 0x90(%r12), %rcx
movl 0xc0(%r12), %edx
addq %rax, 0xc0(%rcx,%rdx,8)
jmp 0xec89
cmpl $0x2, %eax
jne 0xec89
cmpb $0x0, (%r15)
jne 0xec89
xorl %edi, %edi
callq 0x43c0
subq 0xc8(%r12), %rax
movq 0x90(%r12), %rcx
addq %rax, 0xb8(%rcx)
jmp 0xec89
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xed63
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: (anonymous namespace)::equal_ip(sockaddr_storage const*, sockaddr_storage const*)
bool equal_ip(const sockaddr_storage *first, const sockaddr_storage *second)
{
	if(first->ss_family == second->ss_family)
	{
		if(first->ss_family == AF_INET)
			return !memcmp(&(((const sockaddr_in*)first)->sin_addr),
				&(((const sockaddr_in*)second)->sin_addr), sizeof(in_addr));
		// else address family is AF_INET6
		return !memcmp(&(((const sockaddr_in6*)first)->sin6_addr),
				&(((const sockaddr_in6*)second)->sin6_addr), sizeof(in6_addr));
	}
	return false; // one is IPv4, other IPv6
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl (%rdi), %eax
cmpw (%rsi), %ax
jne 0xf1a9
cmpw $0x2, %ax
jne 0xf1ad
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
jmp 0xf1c4
xorl %eax, %eax
jmp 0xf1c7
movdqu 0x8(%rsi), %xmm0
movdqu 0x8(%rdi), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: (anonymous namespace)::add_and_register_player(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, sockaddr_storage&, bool)
unsigned short add_and_register_player(const string &nick, string &passw,
	sockaddr_storage &sas, const bool is_bot)
{
	list<PlayerStats>::iterator newpl = new_player();
	register_player(nick, sas, newpl, is_bot);
	passw.assign(newpl->password);
	return newpl->ID;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %ecx, %r15d
movq %rdx, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdi, %r12
leaq -0x190(%rbp), %r13
movq %r13, %rdi
callq 0xe5a4
movzwl 0x30edf(%rip), %ecx     # 0x400e0
leaq 0x30e90(%rip), %rbx     # 0x40098
xorl %r14d, %r14d
movw %cx, -0x190(%rbp)
movq 0x30e7f(%rip), %rdi     # 0x40098
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1007e
movl -0x190(%rbp), %ecx
incl %ecx
cmpq %rbx, %rax
je 0xf23b
cmpw $-0x5, %cx
cmovel %r14d, %ecx
jmp 0xf20b
movw %cx, 0x30e9e(%rip)      # 0x400e0
pushq $0x2
popq %rbx
pushq $0x5e
popq %r14
cmpq $0xa, %rbx
je 0xf268
callq 0x41e0
cqto
idivq %r14
addb $0x21, %dl
movb %dl, -0x190(%rbp,%rbx)
incq %rbx
jmp 0xf249
leaq -0x190(%rbp), %rdx
movb $0x0, 0xa(%rdx)
leaq 0x30e1e(%rip), %rdi     # 0x40098
movq %rdi, %rsi
callq 0x10046
movq %rax, %r13
leaq -0x180(%rbp), %rdi
callq 0x47e8
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4590
movzbl %r15b, %ecx
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r13, %rdx
callq 0xf305
leaq -0x58(%rbp), %rdi
callq 0x47e8
movq %r13, %rsi
addq $0x12, %rsi
movq -0x30(%rbp), %rdi
callq 0x4780
movzwl 0x10(%r13), %eax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0xf2f8
jmp 0xf2ee
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: bot_connect(unsigned short, sockaddr_storage&)
unsigned short bot_connect(const unsigned short pid, sockaddr_storage &sas)
{
	// Basically we delegate to player_hello, but some extra checks:
	// We don't want to "drop bots to make room for bots":
	if(cur_players.size() >= Config::int_settings[Config::IS_MAXPLAYERS])
		return SERVER_FULL;
	// else:
	string tmp1, tmp2 = Config::new_bot_name();
	unsigned short sh = player_hello(0xFFFF, tmp1, tmp2, sas, true);
	if(sh <= HIGHEST_VALID_ID) // player was added
		cur_players.back().botpid = pid;
	return sh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq 0x301ef(%rip), %rax     # 0x3f890
movl (%rax), %eax
movw $0xfffc, %r15w          # imm = 0xFFFC
cmpq %rax, 0x30a11(%rip)     # 0x400c0
jae 0xf71b
movq %rsi, %r14
movl %edi, %ebx
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
callq 0xde07
leaq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x4590
leaq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdx
pushq $0x1
popq %r8
movl $0xffff, %edi           # imm = 0xFFFF
movq %r14, %rcx
callq 0xefe3
movl %eax, %r15d
cmpw $-0x5, %ax
ja 0xf709
movzwl %bx, %eax
movq 0x309b5(%rip), %rcx     # 0x400b8
movl %eax, 0x174(%rcx)
leaq -0x38(%rbp), %rdi
callq 0x47e8
leaq -0x58(%rbp), %rdi
callq 0x47e8
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47e8
jmp 0xf73a
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: usage_update()
void usage_update()
{
	if(!cur_players.empty())
	{
		short n = cur_players.size();
		short nbots = num_bots();
		usage_per_30min.push_back(n - nbots);
		string msg = lex_cast(n - nbots) + " players";
		if(nbots)
			msg += " (+ " + lex_cast(nbots) + " bots)";
		timed_log(msg);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
leaq 0x3094c(%rip), %rax     # 0x400b0
cmpq %rax, 0x30945(%rip)     # 0x400b0
je 0xf842
movswl 0x30947(%rip), %r15d    # 0x400c0
callq 0xf89e
movl %eax, %r14d
movswl %ax, %ebx
subl %ebx, %r15d
leaq -0x60(%rbp), %rsi
movw %r15w, (%rsi)
leaq 0x308ea(%rip), %rdi     # 0x40080
callq 0x109cc
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
callq 0x24fde
leaq 0x171bc(%rip), %rdx     # 0x2696d
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0xb309
leaq -0x40(%rbp), %rdi
callq 0x47e8
testw %r14w, %r14w
je 0xf830
leaq -0x80(%rbp), %rdi
movl %ebx, %esi
callq 0x24fde
leaq 0x17198(%rip), %rsi     # 0x26976
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0xb332
leaq 0x17186(%rip), %rdx     # 0x2697b
leaq -0x40(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xb309
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4790
leaq -0x40(%rbp), %rdi
callq 0x47e8
leaq -0xa0(%rbp), %rdi
callq 0x47e8
leaq -0x80(%rbp), %rdi
callq 0x47e8
leaq -0x60(%rbp), %rdi
callq 0x10c94
leaq -0x60(%rbp), %rdi
callq 0x47e8
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x47e8
jmp 0xf863
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x47e8
jmp 0xf874
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x47e8
jmp 0xf884
jmp 0xf881
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
jmp 0xf891
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: num_bots()
short num_bots()
{
	short num = 0;
	list<Player>::iterator bit = cur_players.begin();
	while(next_bot(bit))
	{
		++bit;
		++num;
	}
	return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x30800(%rip), %rax     # 0x400b0
leaq -0x18(%rbp), %rbx
movq %rax, (%rbx)
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0xfd9d
testb %al, %al
je 0xf8d6
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
incl %r14d
jmp 0xf8ba
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/players.cpp
// Function: usage_report()
void usage_report()
{
	if(!usage_per_30min.empty())
	{
		// compute average:
		int sum = 0;
		for(vector<short>::const_iterator i = usage_per_30min.begin();
			i != usage_per_30min.end(); ++i)
			sum += *i;
		to_log("Average presence: " +
			lex_cast_fl(float(sum)/usage_per_30min.size()));
		usage_per_30min.clear();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movq 0x3078e(%rip), %rcx     # 0x40080
movq 0x3078f(%rip), %rax     # 0x40088
cmpq %rax, %rcx
je 0xf994
xorl %edx, %edx
movq %rcx, %rsi
cmpq %rax, %rsi
je 0xf917
movswl (%rsi), %edi
addl %edi, %edx
addq $0x2, %rsi
jmp 0xf907
cvtsi2ss %edx, %xmm0
subq %rcx, %rax
sarq %rax
js 0xf92a
cvtsi2ss %rax, %xmm1
jmp 0xf93f
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x2504e
leaq 0x1702c(%rip), %rsi     # 0x26982
leaq -0x28(%rbp), %rdi
movq %rbx, %rdx
callq 0xb332
leaq -0x28(%rbp), %rdi
callq 0x10b68
leaq -0x28(%rbp), %rdi
callq 0x47e8
leaq -0x48(%rbp), %rdi
callq 0x47e8
movq 0x306fc(%rip), %rax     # 0x40080
cmpq %rax, 0x306fd(%rip)     # 0x40088
je 0xf994
movq %rax, 0x306f4(%rip)     # 0x40088
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x47e8
jmp 0xf9ac
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/log.cpp
// Function: to_log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void to_log(const string &s)
{
	if(canlog)
	{
		string fname = Config::get_config_dir() + logfilename;
		ofstream logfile(fname.c_str(), ios_base::app);
		if(!logfile)
		{
			cerr << "Could not open log file (" << fname << ")!" << endl;
			canlog = false;
			return;
		}
		logfile << s << endl;
	}
#ifdef DEBUG
	cerr << "LOG: " << s << endl;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
cmpb $0x0, 0x2f9d8(%rip)     # 0x40558
jne 0x10c3d
callq 0xdc2d
leaq 0x2f9a6(%rip), %rdx     # 0x40538
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xfe1f
movq (%r14), %rsi
leaq -0x230(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x4440
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x210(%rbp,%rax), %r14d
testb $0x5, %r14b
je 0x10c0b
movq 0x2c41d(%rip), %rdi     # 0x3cff0
leaq 0x15ec7(%rip), %rsi     # 0x26aa1
callq 0x43e0
leaq -0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x4370
leaq 0x1572e(%rip), %rsi     # 0x26320
movq %rax, %rdi
callq 0x43e0
movq %rax, %rdi
callq 0x41c0
movb $0x1, 0x2f94f(%rip)     # 0x40558
jmp 0x10c22
leaq -0x230(%rbp), %rdi
movq %rbx, %rsi
callq 0x4370
movq %rax, %rdi
callq 0x41c0
leaq -0x230(%rbp), %rdi
callq 0x45f0
leaq -0x30(%rbp), %rdi
callq 0x47e8
testb $0x5, %r14b
jne 0x10c63
movq 0x2c3ac(%rip), %rdi     # 0x3cff0
leaq 0x15e70(%rip), %rsi     # 0x26abb
callq 0x43e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4370
movq %rax, %rdi
callq 0x41c0
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
jmp 0x10c83
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x45f0
leaq -0x30(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/log.cpp
// Function: timed_log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void timed_log(const string &s)
{
	time_t rawtime;
	struct tm *timeinfo;
	char buffer[7]; // eg. "12:13 " (and '\0')

	time(&rawtime);
 	timeinfo = localtime(&rawtime);
	strftime(buffer, 7, "%H:%M ", timeinfo);
	to_log(string(buffer) + s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x43c0
movq %r14, %rdi
callq 0x42a0
leaq 0x15e02(%rip), %rdx     # 0x26ac1
leaq -0x20(%rbp), %r14
pushq $0x7
popq %rsi
movq %r14, %rdi
movq %rax, %rcx
callq 0x4310
leaq -0x68(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0xb292
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xe08e
leaq -0x40(%rbp), %rdi
callq 0x10b68
leaq -0x40(%rbp), %rdi
callq 0x47e8
leaq -0x68(%rbp), %rdi
callq 0x47e8
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x47e8
jmp 0x10d2a
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/log.cpp
// Function: check_date_change(int)
bool check_date_change(const int d)
{
	// This check is only true on the first test, when the day is not yet
	// initialized:
	if(cur_mday == -1)
		cur_mday = d;
	else if(cur_mday != d)
	{
		time_t rawt;
		char b[30];
		time(&rawt);
		tm *timeinfo = localtime(&rawt);
		strftime(b, 30, "Day changed to %a %d %b", timeinfo);
		to_log(string(b));
		cur_mday = d;
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %edi, %ebx
movl 0x2c6c0(%rip), %eax     # 0x3d410
cmpl $-0x1, %eax
je 0x10db4
cmpl %ebx, %eax
je 0x10dba
leaq -0x28(%rbp), %r14
movq %r14, %rdi
callq 0x43c0
movq %r14, %rdi
callq 0x42a0
leaq 0x15d54(%rip), %rdx     # 0x26ac8
leaq -0x70(%rbp), %r14
pushq $0x1e
popq %rsi
movq %r14, %rdi
movq %rax, %rcx
callq 0x4310
leaq -0x48(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0xb292
movq %r15, %rdi
callq 0x10b68
leaq -0x48(%rbp), %rdi
callq 0x47e8
movl %ebx, 0x2c660(%rip)     # 0x3d410
movb $0x1, %al
jmp 0x10dbc
movl %ebx, 0x2c656(%rip)     # 0x3d410
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x47e8
movq %rbx, %rdi
callq 0x4710
nop
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::make_right_size(std::vector<std::vector<Tile, std::allocator<Tile>>, std::allocator<std::vector<Tile, std::allocator<Tile>>>>&) const
void Map::make_right_size(std::vector< std::vector<Tile> > &res) const
{
	// Resize the "inner vectors" (rows) that will remain
	for(short i = min(short(res.size()), mapsize)-1; i >= 0; --i)
		res[i].resize(mapsize, EMPTY_TILE);
	// Resize the outer vector (the collection of rows):
	res.resize(mapsize, vector<Tile>(mapsize, EMPTY_TILE));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rax
subq (%rsi), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movl (%rdi), %ecx
cmpw %ax, %cx
cmovll %ecx, %eax
movzwl %ax, %r12d
decq %r12
leaq 0x14fc2(%rip), %r15     # 0x26cbc
testw %r12w, %r12w
js 0x11d20
movl %r12d, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
imulq $0x18, %rax, %rdi
addq (%rbx), %rdi
movswq (%r14), %rsi
movq %r15, %rdx
callq 0x13a50
decq %r12
jmp 0x11cfa
movswq (%r14), %r14
leaq 0x14f91(%rip), %rdx     # 0x26cbc
leaq -0x40(%rbp), %r15
leaq -0x21(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x13ad2
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x13a8a
leaq -0x40(%rbp), %rdi
callq 0xffec
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xffec
movq %rbx, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::add_patch(Coords const&, Tile const&)
void Map::add_patch(const Coords &c, const Tile &t)
{
	char radius = random()%3 + 2; //2..4
	short x, y, cmp;
	for(y = max(0, c.y - radius); y <= min(mapsize-1, c.y + radius); ++y)
	{
		for(x = max(0, c.x - radius); x <= min(mapsize-1, c.x + radius); ++x)
		{
			if((cmp = (c.x-x)*(c.x-x)+(c.y-y)*(c.y-y)) <= radius*radius)
				data[y][x] = t;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x41e0
pushq $0x3
popq %rcx
cqto
idivq %rcx
addl $0x2, %edx
movswl 0x2(%r14), %r8d
movl %r8d, %eax
subl %edx, %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movl %edx, %esi
imull %edx, %esi
movzwl (%r15), %edi
cwtl
movswl %di, %r9d
decl %r9d
movswl %r8w, %r8d
addl %edx, %r8d
cmpl %r9d, %r8d
cmovgel %r9d, %r8d
cmpl %eax, %r8d
jl 0x11e95
movswl (%r14), %r9d
movl %r9d, %r8d
subl %edx, %r8d
testl %r8d, %r8d
cmovlel %ecx, %r8d
movslq %eax, %r10
imulq $0x18, %r10, %r10
movswl %r8w, %r8d
movswl %di, %r12d
decl %r12d
movswl %r9w, %r11d
leal (%rdx,%r11), %r13d
cmpl %r12d, %r13d
cmovll %r13d, %r12d
cmpl %r8d, %r12d
jl 0x11e89
subl %r8d, %r11d
imull %r11d, %r11d
movzwl 0x2(%r14), %r12d
subl %eax, %r12d
imull %r12d, %r12d
addl %r11d, %r12d
movswl %r12w, %r11d
cmpl %esi, %r11d
jg 0x11e84
movq 0x8(%r15), %rdi
movslq %r8d, %r9
movq (%rdi,%r10), %rdi
movl (%rbx), %r11d
movl %r11d, (%rdi,%r9,4)
movzwl (%r15), %edi
movzwl (%r14), %r9d
incl %r8d
jmp 0x11e2c
incl %eax
movzwl 0x2(%r14), %r8d
jmp 0x11df5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::apply_house(Coords const&)
void Map::apply_house(const Coords &c)
{
	short i, j;
	Tile* tp;
	for(i = 0; i < MAX_HS; ++i)
	{
		if(c.x+i >= mapsize-1 || c.y+i <= 0)
			break;
		for(j = 0; j < MAX_HS; ++j)
		{
			if(c.y+j >= mapsize-1 || c.y+j <= 0)
				break;
			tp = mod_tile(c.x + i, c.y + j);
			switch(house[j*MAX_HS+i])
			{
			case ':': case '.':
				*tp = T_FLOOR; break;
			case '#':
				*tp = T_WALL; break;
			case 'I':
				*tp = T_ILLUSION_WALL; break;
			case '+':
				*tp = T_DOOR;
				if(random()%2) // open instead of closed
				{
					tp->symbol = '\\';
					tp->flags |= TF_WALKTHRU|TF_SEETHRU;
				}
				break;
			case '|': case '-':
				*tp = T_WINDOW;
				tp->symbol = house[j*MAX_HS+i];
				break;
			// default: do nothing
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq 0x2e84b(%rip), %r15     # 0x40af0
xorl %esi, %esi
movq %rdi, -0x40(%rbp)
cmpw $0xe, %si
je 0x123b9
movzwl %si, %edx
movswl (%rbx), %eax
addl %edx, %eax
movswl (%rdi), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x123b9
movswl 0x2(%rbx), %eax
addl %edx, %eax
jle 0x123b9
movl %edx, -0x2c(%rbp)
movq %r15, -0x38(%rbp)
xorl %r13d, %r13d
movq %rsi, -0x48(%rbp)
cmpq $0xe, %r13
je 0x123a6
movswl 0x2(%rbx), %eax
addq %r13, %rax
testl %eax, %eax
jle 0x123a6
movswl (%rdi), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x123a6
movzwl (%rbx), %ecx
addw %si, %cx
movl %eax, %eax
movq 0x8(%rdi), %rdx
imulq $0x18, %rax, %rax
movswq %cx, %r12
movq (%rdx,%rax), %r14
movzbl (%r15), %eax
cmpl $0x23, %eax
je 0x1236c
cmpl $0x2b, %eax
je 0x12376
cmpl $0x2d, %eax
je 0x12353
cmpl $0x2e, %eax
je 0x12349
cmpl $0x7c, %eax
je 0x12353
cmpl $0x49, %eax
je 0x12362
cmpl $0x3a, %eax
jne 0x1239a
movl $0x1c2e0005, (%r14,%r12,4) # imm = 0x1C2E0005
jmp 0x1239a
movl $0x1a7c0004, (%r14,%r12,4) # imm = 0x1A7C0004
movb %al, 0x2(%r14,%r12,4)
jmp 0x1239a
movl $0x1a230001, (%r14,%r12,4) # imm = 0x1A230001
jmp 0x1239a
movl $0x1a230000, (%r14,%r12,4) # imm = 0x1A230000
jmp 0x1239a
movl $0x1b2b0000, (%r14,%r12,4) # imm = 0x1B2B0000
callq 0x41e0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdi
testb $0x1, %al
je 0x1239a
movb $0x5c, 0x2(%r14,%r12,4)
orb $0x5, (%r14,%r12,4)
incq %r13
addq $0xe, %r15
jmp 0x122e4
movl -0x2c(%rbp), %eax
incl %eax
movq -0x38(%rbp), %r15
incq %r15
movl %eax, %esi
jmp 0x122ab
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::fix_boundary()
void Map::fix_boundary()
{
	rowit rit = data.begin();
	vector<Tile>::iterator it;
	for(it = rit->begin(); it != rit->end(); ++it)
	{
		*it = T_WALL;
		it->flags |= TF_NODIG;
	}
	rit = data.begin()+mapsize-1;
	for(it = rit->begin(); it != rit->end(); ++it)
	{
		*it = T_WALL;
		it->flags |= TF_NODIG;
	}
	for(rit = data.begin(); rit != data.end(); ++rit)
	{
		(*rit)[0] = (*rit)[mapsize-1] = T_WALL;
		(*rit)[0].flags |= TF_NODIG;
		(*rit)[mapsize-1].flags |= TF_NODIG;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movq (%rax), %rcx
cmpq 0x8(%rax), %rcx
je 0x123e5
movl $0x1a231000, (%rcx)     # imm = 0x1A231000
addq $0x4, %rcx
jmp 0x123d3
movq 0x8(%rdi), %rcx
movswq (%rdi), %rax
imulq $0x18, %rax, %rdx
leaq (%rcx,%rdx), %rax
movq -0x18(%rcx,%rdx), %rcx
cmpq -0x10(%rax), %rcx
je 0x1240c
movl $0x1a231000, (%rcx)     # imm = 0x1A231000
addq $0x4, %rcx
jmp 0x123fa
movq 0x8(%rdi), %rax
movl $0x1a230000, %ecx       # imm = 0x1A230000
movw $0x1000, %dx            # imm = 0x1000
cmpq 0x10(%rdi), %rax
je 0x12446
movswq (%rdi), %rsi
movq (%rax), %r8
movl %ecx, -0x4(%r8,%rsi,4)
movq (%rax), %rsi
movl %ecx, (%rsi)
movq (%rax), %rsi
orw %dx, (%rsi)
movswq (%rdi), %r8
orw %dx, -0x4(%rsi,%r8,4)
addq $0x18, %rax
jmp 0x12419
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::upd_by_wall_flag(Coords const&)
void Map::upd_by_wall_flag(const Coords &c)
{
	Coords cn;
	e_Dir d = D_N;
	for(;;)
	{
		if(!point_out_of_map((cn = c.in(d)))
			&& data[cn.y][cn.x] == T_WALL)
		{
			data[c.y][c.x].flags |= TF_BYWALL;
			return;
		}
		if(++d == D_N) // went around!
		{
			data[c.y][c.x].flags &= ~(TF_BYWALL);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x38(%rbp), %r13
andl $0x0, (%r13)
leaq -0x34(%rbp), %r12
movl -0x38(%rbp), %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x24e0c
movl -0x34(%rbp), %eax
movl %eax, -0x30(%rbp)
testw %ax, %ax
js 0x124b1
movzwl (%r14), %edx
cmpw %ax, %dx
jle 0x124b1
movl %eax, %ecx
shrl $0x10, %ecx
testl %eax, %eax
sets %sil
cmpw %cx, %dx
setle %dl
orb %sil, %dl
je 0x124c8
movq %r12, %rdi
callq 0x24d9e
movq %r13, %rdi
callq 0x24d4c
cmpl $0x0, (%rax)
jne 0x12479
jmp 0x12515
movq 0x8(%r14), %rdx
imulq $0x18, %rcx, %rcx
andl $0x7fff, %eax           # imm = 0x7FFF
movq (%rdx,%rcx), %rcx
movb 0x2(%rcx,%rax,4), %r15b
movb 0x3(%rcx,%rax,4), %al
movb %al, -0x29(%rbp)
movq %r12, %rdi
callq 0x24d9e
cmpb $0x23, %r15b
jne 0x124b9
cmpb $0x1a, -0x29(%rbp)
jne 0x124b9
movswq 0x2(%rbx), %rax
movq 0x8(%r14), %rcx
imulq $0x18, %rax, %rax
movswq (%rbx), %rdx
movq (%rcx,%rax), %rax
orw $0x8, (%rax,%rdx,4)
jmp 0x1252f
movswq 0x2(%rbx), %rax
movq 0x8(%r14), %rcx
imulq $0x18, %rax, %rax
movswq (%rbx), %rdx
movq (%rcx,%rax), %rax
andw $-0x9, (%rax,%rdx,4)
leaq -0x30(%rbp), %rdi
callq 0x24d9e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12549
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x24d9e
movq %rbx, %rdi
callq 0x4710
nop
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::get_center_of_sector(e_Dir) const
Coords Map::get_center_of_sector(const e_Dir d) const
{
	Coords c(mapsize/2, mapsize/2);
	if(d == MAX_D)
		return c;
	Coords shift(0,0);
	shift = shift.in(d);
	shift.x *= mapsize/3;
	shift.y *= mapsize/3;
	c.x += shift.x;
	c.y += shift.y;
	return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movzwl (%rsi), %eax
cwtd
movw $0x2, %cx
idivw %cx
movswl %ax, %edx
movl %edx, %esi
callq 0x24d90
cmpl $0x8, %r15d
je 0x12627
leaq -0x1c(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x20(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
movl %r15d, %edx
callq 0x24e0c
leaq -0x20(%rbp), %rdi
movl (%rdi), %eax
leaq -0x1c(%rbp), %r15
movl %eax, (%r15)
callq 0x24d9e
movzwl (%r14), %eax
cwtd
movw $0x3, %cx
idivw %cx
movzwl (%r15), %ecx
imulw %ax, %cx
movw %cx, (%r15)
imulw 0x2(%r15), %ax
addw %cx, (%rbx)
movw %ax, 0x2(%r15)
addw %ax, 0x2(%rbx)
movq %r15, %rdi
callq 0x24d9e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x1c(%rbp), %rdi
callq 0x24d9e
jmp 0x12646
movq %rax, %r14
movq %rbx, %rdi
callq 0x24d9e
movq %r14, %rdi
callq 0x4710
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::subsample_tile(Tile const&) const
Tile Map::subsample_tile(const Tile &t) const
{
	// 't' is assumed to be a tile of a type of which there exists
	// only a few in a sampling area. We "change it into" something
	// more representative.
	if(t == T_TREE)
		return T_GROUND;
	if(t == T_SWAMP)
		return T_WATER;
	if(t == T_ROUGH)
		return T_FLOOR;
	if(t.symbol == '\\' || t.symbol == '+') // doors
		return T_FLOOR;
	if(t.symbol == '#') // includes illusory walls
		return T_WALL;
	return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x2(%rsi), %ecx
movl %ecx, %r8d
xorb $0x54, %r8b
movb 0x3(%rsi), %dl
movl %edx, %edi
xorb $0x17, %dil
movl $0x182e0005, %eax       # imm = 0x182E0005
orb %dil, %r8b
je 0x1269c
movl %ecx, %r8d
xorb $0x22, %r8b
movl $0x1d7e0405, %eax       # imm = 0x1D7E0405
orb %dil, %r8b
je 0x1269c
movl %ecx, %edi
xorb $0x3b, %dil
xorb $0x1a, %dl
movl $0x1c2e0005, %eax       # imm = 0x1C2E0005
orb %dil, %dl
jne 0x1269e
popq %rbp
retq
cmpl $0x5c, %ecx
je 0x1269c
cmpl $0x2b, %ecx
je 0x1269c
cmpl $0x23, %ecx
jne 0x126b4
movl $0x1a230000, %eax       # imm = 0x1A230000
jmp 0x1269c
movl (%rsi), %eax
jmp 0x1269c
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: Map::coords_in_sector(Coords const&) const
e_Dir Map::coords_in_sector(const Coords &c) const
{
	if(c.x < mapsize/3)
	{
		if(c.y < mapsize/3)
			return D_NW;
		if(c.y < 2*mapsize/3)
			return D_W;
		return D_SW;
	}
	if(c.x < 2*mapsize/3)
	{
		if(c.y < mapsize/3)
			return D_N;
		if(c.y < 2*mapsize/3)
			return MAX_D;
		return D_S;
	}
	if(c.y < mapsize/3)
		return D_NE;
	if(c.y < 2*mapsize/3)
		return D_E;
	return D_SE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movswl (%rsi), %r8d
movswl (%rdi), %edi
movl %edi, %eax
cwtd
movw $0x3, %cx
idivw %cx
movl %eax, %ecx
cmpw %r8w, %ax
jle 0x128da
movswl 0x2(%rsi), %esi
cmpw %si, %cx
jle 0x1290a
movl $0x7, %eax
jmp 0x1293a
addl %edi, %edi
movl $0x3, %r9d
movl %edi, %eax
cltd
idivl %r9d
movl %eax, %edx
movswl 0x2(%rsi), %esi
cmpl %r8d, %eax
jle 0x12924
xorl %eax, %eax
cmpw %si, %cx
jg 0x1293a
xorl %eax, %eax
cmpl %esi, %edx
setg %al
leal 0x4(,%rax,4), %eax
jmp 0x1293a
addl %edi, %edi
movl $0x3, %ecx
movl %edi, %eax
cltd
idivl %ecx
movl %eax, %ecx
xorl %eax, %eax
cmpl %esi, %ecx
setg %al
addl $0x5, %eax
jmp 0x1293a
cmpw %si, %cx
jle 0x12930
movl $0x1, %eax
jmp 0x1293a
xorl %eax, %eax
cmpl %esi, %edx
setg %al
xorl $0x3, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: (anonymous namespace)::fill_hc_circular(std::vector<Coords, std::allocator<Coords>>&, char, short)
void fill_hc_circular(vector<Coords> &hc, const char num, const short size)
{
	// putting just one point onto a circle is silly:
	if(num == 1)
	{
		hc[0].x = size/3 + random()%(size/3);
		hc[0].y = size/3 + random()%(size/3);
		return;
	}
	// The angle between the points, 2Pi/num:
	float theta = 6.28318f/num;
	// We want the points to be at a *walking* distance of MAX_HS+1:
	short rad = (MAX_HS+1)/max(abs(1.0f-cos(theta)), abs(sin(theta)))+1;
	/* NOTE: the maximum number of houses being limited by map size should
	 * ensure that rad cannot be too large. If rad is too large the houses
	 * will be put outside of the map... */
	if(rad >= size/2 - MAX_HS)
	{
#ifdef DEBUG
		cerr << "Debug warning: circular house placement has too big radius!" << endl;
#endif
		rad = size/2 - MAX_HS - 1;
	}
	for(char i = 0; i < num; ++i)
	{
		hc[i].x = size/2 + rad*cos(theta*i);
		hc[i].y = size/2 + rad*sin(theta*i);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
cmpb $0x1, %r14b
jne 0x130b4
movl %r15d, %eax
cwtd
movw $0x3, %cx
idivw %cx
movl %eax, %r14d
movswq %ax, %r15
callq 0x41e0
cqto
idivq %r15
addl %r14d, %edx
movq (%rbx), %rax
movw %dx, (%rax)
callq 0x41e0
cqto
idivq %r15
addl %r14d, %edx
movq (%rbx), %rax
movw %dx, 0x2(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movsbl %r14b, %eax
cvtsi2ss %eax, %xmm1
movss 0x13a50(%rip), %xmm0    # 0x26b14
divss %xmm1, %xmm0
movss %xmm0, -0x1c(%rbp)
callq 0x4290
movss 0x13a3e(%rip), %xmm1    # 0x26b18
subss %xmm0, %xmm1
andps 0x13a5b(%rip), %xmm1    # 0x26b40
movaps %xmm1, -0x40(%rbp)
movss -0x1c(%rbp), %xmm0
callq 0x4330
andps 0x13a46(%rip), %xmm0    # 0x26b40
maxss -0x40(%rbp), %xmm0
movss 0x13a15(%rip), %xmm1    # 0x26b1c
divss %xmm0, %xmm1
addss 0x13a05(%rip), %xmm1    # 0x26b18
cvttss2si %xmm1, %ecx
movw $0x2, %si
movl %r15d, %eax
cwtd
idivw %si
movl %eax, %r15d
leal -0xe(%r15), %eax
cmpw %cx, %ax
jg 0x1314e
movq 0x29eba(%rip), %rdi     # 0x3cff0
leaq 0x15c0e(%rip), %rsi     # 0x28d4b
callq 0x43e0
movq %rax, %rdi
callq 0x41c0
leal -0xf(%r15), %ecx
movswl %r15w, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x40(%rbp)
movswl %cx, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x20(%rbp)
movzbl %r14b, %eax
xorl %r15d, %r15d
testb %r14b, %r14b
cmovlel %r15d, %eax
movzbl %al, %r14d
cmpq %r15, %r14
je 0x130a9
movsbl %r15b, %eax
cvtsi2ss %eax, %xmm0
mulss -0x1c(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
callq 0x4290
mulss -0x20(%rbp), %xmm0
addss -0x40(%rbp), %xmm0
cvttss2si %xmm0, %eax
movq (%rbx), %rcx
movw %ax, (%rcx,%r15,4)
movss -0x24(%rbp), %xmm0
callq 0x4330
mulss -0x20(%rbp), %xmm0
addss -0x40(%rbp), %xmm0
cvttss2si %xmm0, %eax
movq (%rbx), %rcx
movw %ax, 0x2(%rcx,%r15,4)
incq %r15
jmp 0x13179
// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: (anonymous namespace)::fill_hc_old(std::vector<Coords, std::allocator<Coords>>&, char, short)
void fill_hc_old(vector<Coords> &hc, const char num, const short size)
{
	hc[0].x = size/3 + random()%(size/3);
	hc[0].y = size/3 + random()%(size/3);
	for(char i = 1; i < num; ++i)
	{
		hc[i].x = hc[i-1].x + MAX_HS + 1 + random()%MAX_HS;
		hc[i].y = hc[i-1].y + random()%7 - 3;
		if(hc[i].x >= size - MAX_HS - 1) // wen't too far
		{
			hc[i].x = 2 + random()%10;
			hc[i].y += MAX_HS + 1 + random()%MAX_HS;
			if(hc[i].y >= size - MAX_HS - 1)
				hc[i].y = 2 + random()%10;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl %ebx, %eax
cwtd
movw $0x3, %cx
idivw %cx
movl %eax, %r12d
movswq %ax, %r13
callq 0x41e0
cqto
idivq %r13
addl %r12d, %edx
movq (%r14), %rax
movw %dx, (%rax)
callq 0x41e0
cqto
idivq %r13
addl %r12d, %edx
movq (%r14), %rax
movw %dx, 0x2(%rax)
addl $-0xf, %ebx
movslq %r15d, %r15
pushq $0x1
popq %r12
cmpq %r15, %r12
jge 0x132e4
movzwl -0x4(%rax,%r12,4), %r13d
callq 0x41e0
cqto
pushq $0xe
popq %rcx
idivq %rcx
leal (%rdx,%r13), %eax
addl $0xf, %eax
movq (%r14), %rcx
movw %ax, (%rcx,%r12,4)
movzwl -0x2(%rcx,%r12,4), %r13d
callq 0x41e0
cqto
pushq $0x7
popq %rcx
idivq %rcx
addw %r13w, %dx
addl $-0x3, %edx
movq (%r14), %rax
movw %dx, 0x2(%rax,%r12,4)
movswl (%rax,%r12,4), %ecx
cmpl %ecx, %ebx
jg 0x132dc
callq 0x41e0
cqto
pushq $0xa
popq %rcx
idivq %rcx
addl $0x2, %edx
movq (%r14), %rax
movw %dx, (%rax,%r12,4)
callq 0x41e0
cqto
pushq $0xe
popq %rcx
idivq %rcx
movq (%r14), %rax
addw 0x2(%rax,%r12,4), %dx
addl $0xf, %edx
movw %dx, 0x2(%rax,%r12,4)
movswl %dx, %ecx
cmpl %ecx, %ebx
jg 0x132dc
callq 0x41e0
cqto
pushq $0xa
popq %rcx
idivq %rcx
addl $0x2, %edx
movq (%r14), %rax
movw %dx, 0x2(%rax,%r12,4)
incq %r12
jmp 0x1322e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq