LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b798
leaq -0x38(%rbp), %r13
movl $0x0, (%r13)
leaq -0x34(%rbp), %r12
movl -0x38(%rbp), %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2b818
movl -0x34(%rbp), %eax
movl %eax, -0x30(%rbp)
testw %ax, %ax
js 0x16e6a
movzwl (%r14), %edx
cmpw %ax, %dx
jle 0x16e6a
movl %eax, %ecx
shrl $0x10, %ecx
testl %eax, %eax
sets %sil
cmpw %cx, %dx
setle %dl
orb %sil, %dl
je 0x16e81
movq %r12, %rdi
callq 0x2b7a6
movq %r13, %rdi
callq 0x2b74c
cmpl $0x0, (%rax)
jne 0x16e32
jmp 0x16ece
movq 0x8(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
andl $0x7fff, %eax           # imm = 0x7FFF
movq (%rdx,%rcx,8), %rcx
movb 0x2(%rcx,%rax,4), %r15b
movb 0x3(%rcx,%rax,4), %al
movb %al, -0x29(%rbp)
movq %r12, %rdi
callq 0x2b7a6
cmpb $0x23, %r15b
jne 0x16e72
cmpb $0x1a, -0x29(%rbp)
jne 0x16e72
movswq 0x2(%rbx), %rax
movq 0x8(%r14), %rcx
leaq (%rax,%rax,2), %rax
movswq (%rbx), %rdx
movq (%rcx,%rax,8), %rax
orw $0x8, (%rax,%rdx,4)
jmp 0x16ee8
movswq 0x2(%rbx), %rax
movq 0x8(%r14), %rcx
leaq (%rax,%rax,2), %rax
movswq (%rbx), %rdx
movq (%rcx,%rax,8), %rax
andw $-0x9, (%rax,%rdx,4)
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16f02
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740
// File: /workspace/github_cpp_makefile_star2_O3/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
movl %eax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %edx
sarl %edx
movl %edx, %esi
callq 0x2b798
cmpl $0x8, %r15d
je 0x16fe6
leaq -0x1c(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
leaq -0x20(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
movl %r15d, %edx
callq 0x2b818
leaq -0x20(%rbp), %rdi
movl (%rdi), %eax
leaq -0x1c(%rbp), %r15
movl %eax, (%r15)
callq 0x2b7a6
movswl (%r14), %eax
imull $0x5556, %eax, %eax     # imm = 0x5556
movl %eax, %ecx
shrl $0x1f, %ecx
shrl $0x10, %eax
addl %ecx, %eax
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 0x2b7a6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x1c(%rbp), %rdi
callq 0x2b7a6
jmp 0x17005
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b7a6
movq %r14, %rdi
callq 0x4740
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movb 0x3(%rsi), %dl
movl %ecx, %r8d
xorb $0x54, %r8b
movl %edx, %edi
xorb $0x17, %dil
movl $0x182e0005, %eax       # imm = 0x182E0005
orb %dil, %r8b
je 0x1705c
movl %ecx, %r8d
xorb $0x22, %r8b
movl $0x1d7e0405, %eax       # imm = 0x1D7E0405
orb %dil, %r8b
je 0x1705c
movl %ecx, %edi
xorb $0x3b, %dil
xorb $0x1a, %dl
movl $0x1c2e0005, %eax       # imm = 0x1C2E0005
orb %dil, %dl
jne 0x1705e
popq %rbp
retq
cmpl $0x5c, %ecx
je 0x1705c
cmpl $0x2b, %ecx
je 0x1705c
cmpl $0x23, %ecx
jne 0x17074
movl $0x1a230000, %eax       # imm = 0x1A230000
jmp 0x1705c
movl (%rsi), %eax
jmp 0x1705c
// File: /workspace/github_cpp_makefile_star2_O3/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), %eax
movswl (%rdi), %edx
imull $0x5556, %edx, %ecx     # imm = 0x5556
movl %ecx, %edi
shrl $0x1f, %edi
shrl $0x10, %ecx
addl %edi, %ecx
cmpw %ax, %cx
jle 0x17320
movswl 0x2(%rsi), %esi
movl $0x7, %eax
cmpw %si, %cx
jg 0x1736c
addl %edx, %edx
movslq %edx, %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rax
shrq $0x3f, %rax
shrq $0x20, %rcx
addl %eax, %ecx
xorl %eax, %eax
cmpl %esi, %ecx
setg %al
addl $0x5, %eax
jmp 0x1736c
addl %edx, %edx
movslq %edx, %rdx
imulq $0x55555556, %rdx, %rdx # imm = 0x55555556
movq %rdx, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rdx
addl %edi, %edx
movswl 0x2(%rsi), %esi
cmpl %eax, %edx
jle 0x17358
xorl %eax, %eax
cmpw %si, %cx
jg 0x1736c
xorl %eax, %eax
cmpl %esi, %edx
setg %al
leal 0x4(,%rax,4), %eax
jmp 0x1736c
movl $0x1, %eax
cmpw %si, %cx
jg 0x1736c
xorl %eax, %eax
cmpl %esi, %edx
setg %al
xorl $0x3, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %r15d
movl %esi, %r14d
movq %rdi, %rbx
imull $0x5556, %edx, %r12d    # imm = 0x5556
movl %r12d, %eax
shrl $0x1f, %eax
shrl $0x10, %r12d
addl %eax, %r12d
movswq %r12w, %r13
callq 0x41d0
cqto
idivq %r13
addl %r12d, %edx
movq (%rbx), %rax
movw %dx, (%rax)
callq 0x41d0
cqto
idivq %r13
addl %r12d, %edx
movq (%rbx), %rax
movw %dx, 0x2(%rax)
cmpb $0x2, %r14b
jl 0x180bd
movswl %r15w, %r15d
addl $-0xf, %r15d
movzbl %r14b, %ecx
leaq -0x4(,%rcx,4), %rcx
movq %rcx, -0x30(%rbp)
xorl %r12d, %r12d
movabsq $0x4924924924924925, %r13 # imm = 0x4924924924924925
movzwl (%rax,%r12), %r14d
callq 0x41d0
movq %rax, %rcx
imulq %r13
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x2, %rdx
addl %eax, %edx
movl %edx, %eax
shll $0x4, %eax
addl %edx, %edx
subl %eax, %edx
addl %edx, %ecx
leal (%r14,%rcx), %eax
addl $0xf, %eax
movq (%rbx), %rcx
movw %ax, 0x4(%rcx,%r12)
movzwl 0x2(%rcx,%r12), %r14d
callq 0x41d0
movq %rax, %rcx
imulq %r13
movq %rdx, %rax
shrq $0x3f, %rax
shrl %edx
addl %eax, %edx
leal (,%rdx,8), %eax
subl %eax, %edx
addl %edx, %ecx
addw %r14w, %cx
addl $-0x3, %ecx
movq (%rbx), %rax
movw %cx, 0x6(%rax,%r12)
movswl 0x4(%rax,%r12), %ecx
cmpl %ecx, %r15d
jg 0x180af
callq 0x41d0
movq %rax, %rcx
movabsq $0x6666666666666667, %rdx # imm = 0x6666666666666667
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrl $0x2, %edx
addl %eax, %edx
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %ecx
addl $0x2, %ecx
movq (%rbx), %rax
movw %cx, 0x4(%rax,%r12)
callq 0x41d0
movq %rax, %rcx
imulq %r13
movq %rdx, %rax
shrq $0x3f, %rax
shrl $0x2, %edx
addl %eax, %edx
movl %edx, %eax
shll $0x4, %eax
addl %edx, %edx
subl %eax, %edx
addl %edx, %ecx
movq (%rbx), %rax
addw 0x6(%rax,%r12), %cx
addl $0xf, %ecx
movw %cx, 0x6(%rax,%r12)
movswl %cx, %ecx
cmpl %ecx, %r15d
jg 0x180af
callq 0x41d0
movq %rax, %rcx
movabsq $0x6666666666666667, %rdx # imm = 0x6666666666666667
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x2, %rdx
addl %eax, %edx
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %ecx
addl $0x2, %ecx
movq (%rbx), %rax
movw %cx, 0x6(%rax,%r12)
addq $0x4, %r12
cmpq %r12, -0x30(%rbp)
jne 0x17f8c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::upd_num_boulders()
void upd_num_boulders()
{
	boulders_left = 0;
	for(list<OccEnt>::const_iterator b_it = boulders.begin();
		b_it != boulders.end(); ++b_it)
	{
		if(!b_it->isvoid() &&
			Game::curmap->coords_in_sector(b_it->getpos()) == obj_sector)
			++boulders_left; // a boulder is in the target sector
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movw $0x0, 0x2a5cf(%rip)     # 0x45490
leaq 0x2afb8(%rip), %r15     # 0x45e80
movq (%r15), %r12
cmpq %r15, %r12
je 0x1af1a
leaq -0x2c(%rbp), %rbx
cmpb $0x0, 0x1e(%r12)
jne 0x1af11
movq 0x29d85(%rip), %rdi     # 0x44c68
movl 0x18(%r12), %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rsi
callq 0x172ce
movl %eax, %r14d
movl 0x2551f(%rip), %r13d    # 0x4041c
movq %rbx, %rdi
callq 0x2b7a6
cmpl %r13d, %r14d
jne 0x1af11
incw 0x2a57f(%rip)           # 0x45490
movq (%r12), %r12
cmpq %r15, %r12
jne 0x1aed4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::start()
void Game::start()
{
	// It is possible that !nextmap is forced by a player before
	// the map is ready. Hence this check:
	while(init_phase != IPH_DONE)
		init_game();

	// Base maptime is [n] minutes where n depends on gamemode:
	map_over_turn = game_mode_mins[gamemode]
		*60*1000/Config::int_settings[Config::IS_TURNMS];
	// But we enforce a lower/upper limit dependent on map size:
	if(map_over_turn < 14*curmap->get_size())
		map_over_turn = 14*curmap->get_size();
	// (The range here is roughly 2--30 minutes on normal settings.)
	else if(map_over_turn > 15*curmap->get_size() + 2900)
		map_over_turn = 15*curmap->get_size() + 2900;
	// (And here roughly 14--44 minutes)
	
	if(gamemode == GM_STEAL)
		objective_str.erase(5); /* leaving just "Steal"; from now on the
		sector is given in the status string */

	send_times(cur_players.end());
	send_team_upds(cur_players.end());
	send_flag_upds(cur_players.end());
	for(list<Player>::iterator it = cur_players.begin();
		it != cur_players.end(); ++it)
	{
		// reduce intermission time from total time spent on server:
		it->stats_i->last_seen += time(NULL) - it->last_switched_cl;
		time(&(it->last_switched_cl));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x6, 0x29d25(%rip)     # 0x44c70
je 0x1af54
callq 0x1a9a4
jmp 0x1af44
movl 0x292ca(%rip), %ecx     # 0x44224
leaq 0x13e73(%rip), %rax     # 0x2edd4
movsbl (%rcx,%rax), %eax
imull $0xea60, %eax, %eax     # imm = 0xEA60
leaq 0x2792e(%rip), %rsi     # 0x428a0
xorl %edx, %edx
divl 0x14(%rsi)
movw %ax, 0x254a2(%rip)      # 0x40420
movzwl %ax, %edx
movq 0x29ce0(%rip), %rax     # 0x44c68
movswl (%rax), %eax
movl %eax, %esi
shll $0x4, %esi
subl %eax, %esi
subl %eax, %esi
cmpl %esi, %edx
jl 0x1afb4
leal (%rax,%rax,4), %esi
leal (%rsi,%rsi,2), %esi
addl $0xb54, %esi            # imm = 0xB54
cmpl %edx, %esi
jge 0x1afbb
leal (%rax,%rax,4), %eax
leal (%rax,%rax,2), %esi
addl $0xb54, %esi            # imm = 0xB54
movw %si, 0x25465(%rip)      # 0x40420
cmpl $0x2, %ecx
jne 0x1afe3
movq 0x29c81(%rip), %rcx     # 0x44c48
cmpq $0x4, %rcx
jbe 0x1b03c
movq $0x5, 0x29c70(%rip) # 0x44c48
movq 0x29c61(%rip), %rax     # 0x44c40
movb $0x0, 0x5(%rax)
leaq 0x280d6(%rip), %rbx     # 0x430c0
movq %rbx, %rdi
callq 0x1b056
movq %rbx, %rdi
callq 0x19e31
movq %rbx, %rdi
callq 0x1b1ac
movq (%rbx), %r14
cmpq %rbx, %r14
je 0x1b037
xorl %edi, %edi
callq 0x43b0
leaq 0xc8(%r14), %rdi
subq 0xc8(%r14), %rax
movq 0x90(%r14), %rcx
addq %rax, 0x138(%rcx)
callq 0x43b0
movq (%r14), %r14
jmp 0x1b005
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x116c6(%rip), %rdi     # 0x2c709
leaq 0x116ab(%rip), %rsi     # 0x2c6f5
movl $0x5, %edx
xorl %eax, %eax
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::send_times(std::_List_const_iterator<Player>)
void Game::send_times(const list<Player>::const_iterator to)
{
	// A convenient place as any to do a periodic check on what bots have
	// finished (or crashed or been killed or ...):
	num_bots();

	Network::send_buffer.clear();
	// mid and maptime are the same for all clients:
	Network::send_buffer.add((unsigned char)MID_TIME_UPD);
	Network::send_buffer.add((unsigned short)(
		(map_over_turn - curturn)*int_settings[IS_TURNMS]/1000));
	// but the spawn time is team-specific!
	unsigned char sts[3] = {
		// green spawn time:
		(unsigned char)((spawn_cycle - ((curturn + spawn_cycle/2) % spawn_cycle))
			*int_settings[IS_TURNMS]/1000),
		// purple spawn time:
		(unsigned char)((spawn_cycle - (curturn % spawn_cycle))*int_settings[IS_TURNMS]/1000),
		0 }; // specs don't spawn

	if(to == cur_players.end()) // need to send to all
	{
		for(list<Player>::const_iterator i = cur_players.begin();
			i != cur_players.end(); ++i)
		{
			Network::send_buffer.set_amount(3); // reset to overwrite
			Network::send_buffer.add(sts[i->team]);
			Network::send_to_player(*i);
		}
	}
	else
	{
		Network::send_buffer.add(sts[to->team]);
		Network::send_to_player(*to);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x13d91
leaq 0x260b4(%rip), %r14     # 0x41128
movq %r14, %rdi
callq 0x2af20
movq %r14, %rdi
movl $0xe, %esi
callq 0x2af34
movzwl 0x25390(%rip), %eax     # 0x40420
movzwl 0x29bc9(%rip), %ecx     # 0x44c60
subl %ecx, %eax
leaq 0x27800(%rip), %r15     # 0x428a0
imull 0x14(%r15), %eax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
shrq $0x26, %rax
movzwl %ax, %esi
movq %r14, %rdi
callq 0x2af48
movzbl 0x29bb2(%rip), %eax     # 0x44c74
movzwl %ax, %esi
movzwl 0x29b94(%rip), %ecx     # 0x44c60
movl %esi, %eax
shrl %eax
addl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %esi, %eax
subl %edx, %eax
movl 0x14(%r15), %edi
imull %edi, %eax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
shrq $0x26, %rax
movb %al, -0x23(%rbp)
movl %ecx, %eax
xorl %edx, %edx
divw %si
movzwl %dx, %eax
subl %eax, %esi
imull %edi, %esi
imulq $0x10624dd3, %rsi, %rax # imm = 0x10624DD3
shrq $0x26, %rax
movb %al, -0x22(%rbp)
movb $0x0, -0x21(%rbp)
cmpq 0x24e99(%rip), %rbx     # 0x3ffb0
je 0x1b14e
movl 0xbc(%rbx), %eax
addq $0x10, %rbx
movzbl -0x23(%rbp,%rax), %esi
leaq 0x25ff9(%rip), %r14     # 0x41128
movq %r14, %rdi
callq 0x2af34
movq %rbx, %rdi
movq %r14, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xf719
leaq 0x27f6b(%rip), %r15     # 0x430c0
movq (%r15), %r12
cmpq %r15, %r12
je 0x1b19f
leaq 0x25fc4(%rip), %rbx     # 0x41128
movq %rbx, %rdi
movl $0x3, %esi
callq 0x2b12c
leaq 0x10(%r12), %r14
movl 0xbc(%r12), %eax
movzbl -0x23(%rbp,%rax), %esi
movq %rbx, %rdi
callq 0x2af34
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf719
movq (%r12), %r12
cmpq %r15, %r12
jne 0x1b164
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::send_flag_upds(std::_List_const_iterator<Player>)
void Game::send_flag_upds(const list<Player>::const_iterator to)
{
	unsigned char flagbuf[MAX_D+1] = { MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR,
		MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR,
		MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR, MAX_PREDEF_CPAIR };
	char ch, bp;
	for(list<NOccEnt>::const_iterator it = noccents[NOE_FLAG].begin();
		it != noccents[NOE_FLAG].end(); ++it)
	{
		ch = Game::curmap->coords_in_sector(it->getpos());
		if(it->get_m() == T_NO_TEAM) // neutral flag
			flagbuf[ch] = C_NEUT_FLAG;
		else
		{
			bp = it->get_m();
			flagbuf[ch] = C_GREEN_PC
				+ bp // +1 if purple
				+ NUM_NORM_COLS*(it == *(--(team_flags[bp].end()))); // make lit if spawn flag
		}
	}

	Network::send_buffer.clear();
	Network::send_buffer.add((unsigned char)MID_FLAG_UPD);
	for(ch = 0; ch <= MAX_D; ++ch)
		Network::send_buffer.add(flagbuf[ch]);

	if(to == cur_players.end()) // send to all
		Network::broadcast();
	else // only send to 'to'
		Network::send_to_player(*to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, -0x40(%rbp)
movabsq $0x6e6e6e6e6e6e6e6e, %rax # imm = 0x6E6E6E6E6E6E6E6E
movq %rax, -0x38(%rbp)
movb $0x6e, -0x30(%rbp)
leaq 0x2abe6(%rip), %r12     # 0x45dc0
movq 0x78(%r12), %r13
addq $0x78, %r12
cmpq %r12, %r13
je 0x1b24f
leaq -0x2c(%rbp), %r14
leaq 0x2ad0d(%rip), %rbx     # 0x45f00
movq 0x29a6e(%rip), %rdi     # 0x44c68
movl 0x18(%r13), %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rsi
callq 0x172ce
movl %eax, %r15d
movq %r14, %rdi
callq 0x2b7a6
movsbq 0x1f(%r13), %rcx
movb $0x27, %al
cmpq $0x3, %rcx
je 0x1b23b
leaq (%rcx,%rcx,2), %rax
movq 0x8(%rbx,%rax,8), %rdx
movl $0x14, %eax
cmpq 0x10(%rdx), %r13
je 0x1b237
xorl %eax, %eax
addb %cl, %al
addb $0x1e, %al
movl %r15d, %ecx
movsbq %cl, %rcx
movb %al, -0x38(%rbp,%rcx)
movq (%r13), %r13
cmpq %r12, %r13
jne 0x1b1f3
leaq 0x25ed2(%rip), %r14     # 0x41128
movq %r14, %rdi
callq 0x2af20
movq %r14, %rdi
movl $0xf, %esi
callq 0x2af34
xorl %ebx, %ebx
movzbl -0x38(%rbp,%rbx), %esi
movq %r14, %rdi
callq 0x2af34
incq %rbx
cmpq $0x9, %rbx
jne 0x1b26d
movq -0x40(%rbp), %rdi
cmpq 0x24d22(%rip), %rdi     # 0x3ffb0
je 0x1b2a2
addq $0x10, %rdi
leaq 0x25e8d(%rip), %rsi     # 0x41128
callq 0xf719
jmp 0x1b2b3
leaq 0x25e7f(%rip), %rsi     # 0x41128
movl $0xffff, %edi           # imm = 0xFFFF
callq 0xe3b3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::validate_and_process(Axn const&, std::_List_iterator<Player>)
void validate_and_process(const Axn &axn, const list<Player>::iterator pit)
{
	if(axn.xncode <= XN_MOVE // these are always "sensible"
		|| short(axn.xncode - XN_SHOOT) == short(pit->cl))
		process_action(axn, pit);
	else
	{
		// Resend class info; ("client plays a healer but is sending a
		// shoot action; it must think it is still playing an archer!")
		send_full_state_refresh(pit);
		pit->action_queue.clear(); // discard rest of so-far-received actions, too
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzbl (%rdi), %eax
cmpl $0x5, %eax
jb 0x1c15c
addl $0xfffb, %eax           # imm = 0xFFFB
movzwl %ax, %eax
movswl 0xc0(%rbx), %ecx
cmpl %ecx, %eax
jne 0x1c16a
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x22a44
movq %rbx, %rdi
callq 0x19b5d
addq $0xe8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1d668
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::send_state_upd(std::_List_iterator<Player>)
void send_state_upd(const list<Player>::iterator it)
{
	Network::send_buffer.clear();
	Network::send_buffer.add((unsigned char)MID_STATE_UPD);
	Network::send_buffer.add(
		static_cast<unsigned char>(it->cl_props.hp));
	Network::send_buffer.add(
		static_cast<unsigned char>(it->cl_props.tohit));
	Network::send_buffer.add(
		static_cast<unsigned char>(it->cl_props.dam_add));
	Network::send_buffer.add((unsigned char)it->cl_props.dv);
	Network::send_buffer.add((unsigned char)(it->poisoner != cur_players.end()));
	Network::send_buffer.add((unsigned char)it->sector);
	Network::send_buffer.add(it->torch_symbol(it->is_alive() && it->own_pc->torch_is_lit()));
	Network::send_to_player(*it);
	it->needs_state_upd = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x24f8d(%rip), %r15     # 0x41128
movq %r15, %rdi
callq 0x2af20
movq %r15, %rdi
movl $0xb, %esi
callq 0x2af34
leaq 0x10(%rbx), %r14
movzbl 0x153(%rbx), %esi
movq %r15, %rdi
callq 0x2af34
movzbl 0x154(%rbx), %esi
movq %r15, %rdi
callq 0x2af34
movzbl 0x157(%rbx), %esi
movq %r15, %rdi
callq 0x2af34
movzbl 0x158(%rbx), %esi
movq %r15, %rdi
callq 0x2af34
movq 0x160(%rbx), %rax
xorl %esi, %esi
cmpq 0x23db0(%rip), %rax     # 0x3ffb0
setne %sil
movq %r15, %rdi
callq 0x2af34
movzbl 0x16c(%rbx), %esi
movq %r15, %rdi
callq 0x2af34
movq %r14, %rdi
callq 0x12496
testb %al, %al
je 0x1c233
movq 0x148(%rbx), %rax
movb 0x20(%rax), %al
jmp 0x1c235
xorl %eax, %eax
movzbl %al, %esi
movq %r14, %rdi
callq 0x125a0
movzbl %al, %esi
leaq 0x24ede(%rip), %r15     # 0x41128
movq %r15, %rdi
callq 0x2af34
movq %r14, %rdi
movq %r15, %rsi
callq 0xf719
movb $0x0, 0x15d(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::send_state_change(std::_List_const_iterator<Player>)
void Game::send_state_change(const list<Player>::const_iterator to)
{
	Network::send_buffer.clear();
	Network::send_buffer.add((unsigned char)MID_STATE_CHANGE);
	Network::send_buffer.add((unsigned char)to->next_cl);
	Network::send_buffer.add((unsigned char)to->team);
	Network::send_to_player(*to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x24828(%rip), %r14     # 0x41128
movq %r14, %rdi
callq 0x2af20
movq %r14, %rdi
movl $0xc, %esi
callq 0x2af34
leaq 0x10(%rbx), %r15
movzbl 0xc4(%rbx), %esi
movq %r14, %rdi
callq 0x2af34
movzbl 0xbc(%rbx), %esi
movq %r14, %rdi
callq 0x2af34
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf719
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::player_left_team(std::_List_iterator<Player>)
void player_left_team(const list<Player>::iterator pit)
{
	pit->own_vp->move_watchers();
	if(!intermission)
	{
		if(pit->is_alive())
			kill_player(pit);
		Game::del_owneds(pit);
		Game::send_times(pit);
	}
	post_join_msg(pit);
	Game::send_team_upds(cur_players.end());
	active_teambal_check();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xd0(%rdi), %rdi
callq 0x1ec86
leaq 0x235e5(%rip), %rax     # 0x40408
cmpb $0x0, (%rax)
jne 0x1ce4d
leaq 0x10(%rbx), %rdi
callq 0x12496
testb %al, %al
je 0x1ce3d
movq %rbx, %rdi
callq 0x25636
movq %rbx, %rdi
callq 0x1d23a
movq %rbx, %rdi
callq 0x1b056
movq %rbx, %rdi
callq 0x1ced8
leaq 0x26264(%rip), %rdi     # 0x430c0
callq 0x19e31
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1d3fb
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::check_class_limit(e_Team, e_Class)
bool check_class_limit(const e_Team t, const e_Class c)
{
	if(int_settings[IS_CLASSLIMIT])
	{
		unsigned char num = 0;
		for(list<Player>::const_iterator it = cur_players.begin();
			it != cur_players.end(); ++it)
		{
			// Note: checking next_cl, not current class!
			if((it->team == t || it->team == T_SPEC) && it->next_cl == c
				&& ++num == int_settings[IS_CLASSLIMIT])
				return true;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x25a29(%rip), %rax     # 0x428a0
movl 0x10(%rax), %eax
testl %eax, %eax
sete %r8b
leaq 0x26239(%rip), %rcx     # 0x430c0
movq (%rcx), %rdx
cmpq %rcx, %rdx
sete %r9b
orb %r8b, %r9b
jne 0x1ced0
xorl %r8d, %r8d
movl 0xbc(%rdx), %r9d
cmpl %edi, %r9d
setne %r10b
cmpl $0x2, %r9d
setne %r9b
testb %r9b, %r10b
jne 0x1cec8
cmpl %esi, 0xc4(%rdx)
jne 0x1cec8
incb %r8b
movzbl %r8b, %r9d
cmpl %r9d, %eax
je 0x1ced4
movq (%rdx), %rdx
cmpq %rcx, %rdx
jne 0x1ce99
xorl %eax, %eax
popq %rbp
retq
movb $0x1, %al
jmp 0x1ced2
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::post_spawn_msg(std::_List_const_iterator<Player>)
void post_spawn_msg(const list<Player>::const_iterator pit)
{
	string s = "You will spawn as a " + team_name[pit->team];
	s += ' ';
	s += classnames[pit->next_cl];
	s += '.';
	Network::construct_msg(s, team_colour[pit->team]);
	Network::send_to_player(*pit);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl 0xbc(%rdi), %eax
shlq $0x5, %rax
leaq 0x27216(%rip), %rdx     # 0x44230
addq %rax, %rdx
leaq 0x120c6(%rip), %rsi     # 0x2f0ea
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x11c74
movq %r14, %rdi
movl $0x20, %esi
callq 0x4340
movl 0xc4(%rbx), %eax
shlq $0x5, %rax
leaq 0x27282(%rip), %rcx     # 0x442d0
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
leaq -0x30(%rbp), %rdi
callq 0x4130
leaq -0x30(%rbp), %rdi
movl $0x2e, %esi
callq 0x4340
movl 0xbc(%rbx), %eax
leaq 0x11df4(%rip), %rcx     # 0x2ee6f
movzbl (%rax,%rcx), %esi
leaq -0x30(%rbp), %rdi
callq 0xf3f0
addq $0x10, %rbx
leaq 0x24095(%rip), %rsi     # 0x41128
movq %rbx, %rdi
callq 0xf719
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d0b4
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x43f0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d0d9
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %rbx, %rdi
callq 0x4740
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::team_switch(std::_List_iterator<Player>)
void Game::team_switch(const list<Player>::iterator pit)
{
	if(pit->team != T_SPEC)
	{
		if(int_settings[IS_TEAMBALANCE] != TB_OFF
			&& num_players[pit->team] <= num_players[opp_team[pit->team]])
		{
			string s = "You cannot switch team at this time.";
		 	Network::construct_msg(s, team_colour[pit->team]);
		 	Network::send_to_player(*pit);
		}
		else // ok w.r.t. team balance
		{
			// do the change:
			--num_players[pit->team];
			++num_players[(pit->team = opp_team[pit->team])];

			// Switch class until find one not limited by classlimit (ALL of
			// them cannot be limited due to check in settings.cpp!)
			e_Class newcl = pit->next_cl;
			while(check_class_limit(pit->team, newcl))
			{
				if((newcl = e_Class(newcl + 1)) == NO_CLASS)
					newcl = e_Class(0);
			}
			pit->next_cl = newcl;

			player_left_team(pit);
			post_spawn_msg(pit);
			send_state_change(pit);
			pit->own_vp->clear_memory();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl 0xbc(%rdi), %eax
cmpq $0x2, %rax
jne 0x1d109
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
leaq 0x2578d(%rip), %rcx     # 0x428a0
cmpl $0x0, 0x4(%rcx)
leaq 0x27103(%rip), %rcx     # 0x44221
movb (%rax,%rcx), %dl
leaq 0x11d4c(%rip), %rsi     # 0x2ee74
movl (%rsi,%rax,4), %r14d
je 0x1d134
cmpb (%r14,%rcx), %dl
jbe 0x1d1ae
decb %dl
movb %dl, (%rax,%rcx)
movl %r14d, 0xbc(%rbx)
incb (%r14,%rcx)
movl 0xc4(%rbx), %r15d
movl %r14d, %edi
movl %r15d, %esi
callq 0x1ce6c
testb %al, %al
je 0x1d177
xorl %r12d, %r12d
incl %r15d
cmpl $0xb, %r15d
cmovel %r12d, %r15d
movl %r14d, %edi
movl %r15d, %esi
callq 0x1ce6c
testb %al, %al
jne 0x1d15d
movl %r15d, 0xc4(%rbx)
movq %rbx, %rdi
callq 0x1ce07
movq %rbx, %rdi
callq 0x1cffb
movq %rbx, %rdi
callq 0x1c8ec
movq 0xd0(%rbx), %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1de3c
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x11ebc(%rip), %rsi     # 0x2f079
leaq 0x11ed9(%rip), %rdx     # 0x2f09d
leaq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0xe01c
movl 0xbc(%rbx), %eax
leaq 0x11c92(%rip), %rcx     # 0x2ee6f
movzbl (%rax,%rcx), %esi
movq %r14, %rdi
callq 0xf3f0
addq $0x10, %rbx
leaq 0x23f34(%rip), %rsi     # 0x41128
movq %rbx, %rdi
callq 0xf719
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x1d0fc
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x1d0fc
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x1d232
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %rbx, %rdi
callq 0x4740
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/game.cpp
// Function: (anonymous namespace)::active_teambal_check()
void active_teambal_check()
{
	if(Config::int_settings[IS_TEAMBALANCE] == TB_ACTIVE)
	{
		if(abs(num_players[T_GREEN] - num_players[T_PURPLE]) >= 2)
		{
			// teams are unbalanced; were they already?
			if(!team_unbalance)
			{
				team_unbalance = true;
				time(&teams_unbal_since);
			}
			// in any case, give the request:
			Network::to_chat("The teams are unbalanced, please fix them!");
		}
		else // teams are balanced (once more)
			team_unbalance = false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x25493(%rip), %rax     # 0x428a0
cmpl $0x2, 0x4(%rax)
jne 0x1d497
movzbl 0x26e03(%rip), %eax     # 0x44221
movzbl 0x26dfd(%rip), %ecx     # 0x44222
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpb $0x2, %cl
jb 0x1d490
cmpb $0x0, 0x28046(%rip)     # 0x45480
jne 0x1d44f
movb $0x1, 0x2803d(%rip)     # 0x45480
leaq 0x2803e(%rip), %rdi     # 0x45488
callq 0x43b0
leaq -0x20(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11ca1(%rip), %rsi     # 0x2f0ff
leaq 0x11cc4(%rip), %rdx     # 0x2f129
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0xe01c
movq %rbx, %rdi
callq 0xf579
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x1d497
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x1d497
movb $0x0, 0x27fe9(%rip)     # 0x45480
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x1d4b8
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x43f0
movq %rbx, %rdi
callq 0x4740
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::newmap()
void ViewPoint::newmap()
{
	Game::curmap->make_right_size(ownview);
	// Fill empty; the tiles will be updated with the actual map data as they
	// become visible. The only thing we need from the actual map already at
	// this point are the lit statuses:
	Coords c;
	for(c.y = ownview.size()-1; c.y >= 0; --c.y)
	{
		for(c.x = ownview.size()-1; c.x >= 0; --c.x)
		{
			ownview[c.y][c.x] = EMPTY_TILE;
			if(Game::curmap->get_tile(c).flags & TF_LIT)
				ownview[c.y][c.x].flags |= TF_LIT;
		}
	}
	pos.x = pos.y = ownview.size()/2;
	poschanged = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x26f11(%rip), %r12     # 0x44c68
movq (%r12), %rdi
leaq 0x8(%rbx), %r14
movq %r14, %rsi
callq 0x16582
leaq -0x24(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
movq 0x10(%rbx), %rdx
subq 0x8(%rbx), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
movl %edx, %ecx
decw %cx
movw %cx, 0x2(%r15)
js 0x1de18
movl 0x10(%rbx), %edx
subl 0x8(%rbx), %edx
shrl $0x3, %edx
imull $0xffffaaab, %edx, %edx # imm = 0xFFFFAAAB
decw %dx
movw %dx, -0x24(%rbp)
js 0x1ddff
movswq %cx, %rcx
movq (%r14), %rsi
leaq (%rcx,%rcx,2), %rcx
movq (%rsi,%rcx,8), %rcx
movzwl %dx, %edx
movl $0x6d3f0004, (%rcx,%rdx,4) # imm = 0x6D3F0004
movq (%r12), %rdx
movzwl -0x22(%rbp), %ecx
movswq %cx, %rsi
movq 0x8(%rdx), %rdi
leaq (%rsi,%rsi,2), %rsi
movswq -0x24(%rbp), %rdx
movq (%rdi,%rsi,8), %rdi
testb $0x10, (%rdi,%rdx,4)
je 0x1ddac
movq (%r14), %rdi
movq (%rdi,%rsi,8), %rsi
orw $0x10, (%rsi,%rdx,4)
jmp 0x1ddac
decw %cx
movw %cx, -0x22(%rbp)
jns 0x1dd9d
movq 0x10(%rbx), %rdx
subq 0x8(%rbx), %rdx
sarq $0x3, %rdx
imulq %rax, %rdx
shrl %edx
movw %dx, 0x4(%rbx)
movw %dx, 0x2(%rbx)
movb $0x1, 0x6(%rbx)
leaq -0x24(%rbp), %rdi
callq 0x2b7a6
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::fill_loslittbl_xy(Coords const&, char, char, bool)
bool ViewPoint::fill_loslittbl_xy(const Coords &c, const char x, const char y,
	const bool vis_in_dark)
{
	// We might be outside of the map, in which case the next point in
	// this line will *also* be outside of the map; check:
	if(Game::curmap->point_out_of_map(c))
		return true;
	// else safe to fetch the tile:
	Tile *tp = &(ownview[c.y][c.x]);
	if(!loslittbl[x][y]) // not already considered
	{
		/* Determine lit status. Note that if the static lit status
		 * of the tile has changed (by a wall being dug out), the
		 * view won't notice this until the tile is within the
		 * "visible-even-if-not-lit" radius. This could be a bug,
		 * but we shall call it a feature. */
		if(tp->flags & TF_LIT // statically lit
			|| is_dynlit(c))
		{
			loslittbl[x][y] = IS_LIT|IN_LOS;
			// update our view of this tile:
			*tp = Game::curmap->get_tile(c);
		}
		else if(vis_in_dark) // not lit, still in LOS if in smaller radius
		{
			loslittbl[x][y] = IN_LOS;
			// upd our view of this tile:
			*tp = Game::curmap->get_tile(c);
		}
	}
	// see if need to continue on this ray:
	return !(tp->flags & TF_SEETHRU);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r13
leaq 0x26dd4(%rip), %rax     # 0x44c68
movq (%rax), %rdi
callq 0x16f24
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x1df2c
movl %r14d, -0x2c(%rbp)
movswq 0x2(%rbx), %rax
movq 0x8(%r13), %rcx
leaq (%rax,%rax,2), %rax
movswq (%rbx), %r13
movq (%rcx,%rax,8), %r14
movsbq %r12b, %rax
movsbq %r15b, %rcx
leaq (%rax,%rax,2), %rdx
shlq $0x3, %rdx
subq %rax, %rdx
leaq 0x27915(%rip), %r15     # 0x457f0
addq %rdx, %r15
cmpb $0x0, (%rcx,%r15)
movzwl (%r14,%r13,4), %eax
jne 0x1df27
addq %rcx, %r15
testb $0x10, %al
jne 0x1defd
movq %rbx, %rdi
callq 0x2106c
testb %al, %al
je 0x1df3b
movb $0x3, (%r15)
leaq 0x26d60(%rip), %rax     # 0x44c68
movq (%rax), %rax
movswq 0x2(%rbx), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq (%rbx), %rdx
movq (%rax,%rcx,8), %rax
movl (%rax,%rdx,4), %eax
movl %eax, (%r14,%r13,4)
testb $0x4, %al
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, -0x2c(%rbp)
je 0x1df47
movb $0x1, (%r15)
jmp 0x1df01
movzwl (%r14,%r13,4), %eax
jmp 0x1df27
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::render_pc_indir(Coords const&, char*) const
bool ViewPoint::render_pc_indir(const Coords &c, char* const target) const
{
	list<PCEnt>::iterator it = any_pc_at(c);
	if(it != PCs.end() && it->is_seen_by_team(owner->team) && !it->isvoid())
	{
		it->draw(target, false);
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2122a
cmpq 0x21788(%rip), %rax     # 0x3ffa8
je 0x1e837
movq 0x28(%r14), %rcx
movl 0x2c(%rax), %edx
cmpl 0xbc(%rcx), %edx
jne 0x1e837
cmpb $0x0, 0x1e(%rax)
je 0x1e83e
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
addq $0x10, %rax
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x21d1a
movb $0x1, %al
jmp 0x1e839
nop
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::render_trap_at(Coords const&, char*, bool) const
bool ViewPoint::render_trap_at(const Coords &c, char* const target, const bool lit) const
{
	list<Trap>::iterator tr_it = any_trap_at(c);
	if(tr_it->is_seen_by(owner->team))
	{
		tr_it->draw(target, lit);
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r14d
movq %rdx, %rbx
movq %rdi, %r12
movq %rsi, %rdi
callq 0x2134d
movq %rax, %r15
addq $0x10, %r15
movq 0x28(%r12), %rax
movzbl 0xbc(%rax), %esi
movq %r15, %rdi
callq 0x21df0
movl %eax, %r12d
testb %al, %al
je 0x1eaef
movzbl %r14b, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21d1a
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::drop_watcher(unsigned short)
void ViewPoint::drop_watcher(const unsigned short ID)
{
	for(vector< list<Player>::iterator >::iterator it = followers.begin();
		it != followers.end(); ++it)
	{
		if((*it)->stats_i->ID == ID)
		{
			followers.erase(it);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
movq 0x38(%rbx), %rax
cmpq %rax, %rdi
je 0x1ec7f
movq %rax, %rdx
subq %rdi, %rdx
addq $-0x8, %rdx
movq (%rdi), %rcx
movq 0x90(%rcx), %rcx
cmpw %si, 0x10(%rcx)
je 0x1ec65
addq $0x8, %rdi
addq $-0x8, %rdx
cmpq %rax, %rdi
jne 0x1ec46
jmp 0x1ec7f
leaq 0x8(%rdi), %rsi
cmpq %rax, %rsi
je 0x1ec77
callq 0x46a0
movq 0x38(%rbx), %rax
addq $-0x8, %rax
movq %rax, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::move_watchers()
void ViewPoint::move_watchers()
{
	vector< list<Player>::iterator >::iterator it = followers.begin();
	while(it != followers.end())
	{
		if(*it != owner)
		{
			(*it)->own_vp->set_pos(pos);
			((*it)->viewn_vp = (*it)->own_vp)->add_watcher((*it));
			it = followers.erase(it);
		}
		else
			++it;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x30(%rdi), %r14
movq 0x38(%rdi), %rdx
cmpq %rdx, %r14
je 0x1ed2a
movq %rdi, %rbx
leaq 0x2(%rdi), %r15
leaq 0x25fb5(%rip), %r12     # 0x44c68
movq (%r14), %rax
cmpq 0x28(%rbx), %rax
je 0x1ed21
movq 0xd0(%rax), %r13
movq (%r12), %rdi
movq %r15, %rsi
callq 0x16f24
testb %al, %al
jne 0x1ecdf
movl (%r15), %eax
movl %eax, 0x2(%r13)
movb $0x1, 0x6(%r13)
movq (%r14), %rax
movq 0xd0(%rax), %rdi
movq %rdi, 0xd8(%rax)
movq (%r14), %rsi
callq 0x1ebea
movq %r14, %rsi
addq $0x8, %rsi
movq 0x38(%rbx), %rdx
cmpq %rdx, %rsi
je 0x1ed17
subq %rsi, %rdx
movq %r14, %rdi
callq 0x46a0
movq 0x38(%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, 0x38(%rbx)
jmp 0x1ed25
addq $0x8, %r14
cmpq %rdx, %r14
jne 0x1ecb3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/actives.cpp
// Function: events_around(Coords const&)
bool events_around(const Coords &pos)
{
	for(set<Coords>::const_iterator it = event_set.begin();
		it != event_set.end(); ++it)
	{
		if(it->dist_walk(pos) <= VIEWSIZE/2)
			return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x269ea(%rip), %r14     # 0x45ff0
leaq 0x269d3(%rip), %r12     # 0x45fe0
cmpq %r12, %r14
je 0x1f63d
movq %rdi, %rbx
leaq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x2b7e4
cmpw $0xc, %ax
setl %r15b
jl 0x1f640
movq %r14, %rdi
callq 0x4470
movq %rax, %r14
cmpq %r12, %rax
jne 0x1f615
jmp 0x1f640
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/actives.cpp
// Function: (anonymous namespace)::next_unused_tile(Coords&, std::vector<Coords, std::allocator<Coords>>&, bool)
void next_unused_tile(Coords &c, vector<Coords> &useds, const bool force = false)
{
	init_nearby(c);
	if(force)
	{
		// find first not yet used:
		while(find(useds.begin(), useds.end(), c) != useds.end())
			c = next_nearby();
		if(all_placem_syms.find(Game::curmap->get_tile(c).symbol) == string::npos)
			*(Game::curmap->mod_tile(c)) = T_FLOOR; // change the map to force placement
	}
	else
	{
		// Find next (A) unused and (B) free spot
		while(find(useds.begin(), useds.end(), c) != useds.end()
			|| all_placem_syms.find(Game::curmap->get_tile(c).symbol) == string::npos)
			c = next_nearby();
	}
	// Found it:
	useds.push_back(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
callq 0x22925
testl %r15d, %r15d
je 0x2052e
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq %r14, %rdx
callq 0x18a6a
cmpq 0x8(%rbx), %rax
je 0x204c1
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x2294e
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movq %r15, %rdi
callq 0x2b7a6
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq %r14, %rdx
callq 0x18a6a
cmpq 0x8(%rbx), %rax
jne 0x20496
leaq 0x247a0(%rip), %r15     # 0x44c68
movq (%r15), %rax
movswq 0x2(%r14), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq (%r14), %rdx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax,%rdx,4), %esi
leaq 0x258ac(%rip), %rdi     # 0x45d98
xorl %edx, %edx
callq 0x4550
cmpq $-0x1, %rax
jne 0x20518
movq (%r15), %rax
movswq 0x2(%r14), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq (%r14), %rdx
movq (%rax,%rcx,8), %rax
movl $0x1c2e0005, (%rax,%rdx,4) # imm = 0x1C2E0005
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2059b
movl (%r14), %eax
movl %eax, (%rsi)
addq $0x4, 0x8(%rbx)
jmp 0x205a6
leaq 0x24733(%rip), %r13     # 0x44c68
leaq 0x2585c(%rip), %r15     # 0x45d98
leaq -0x2c(%rbp), %r12
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq %r14, %rdx
callq 0x18a6a
cmpq 0x8(%rbx), %rax
jne 0x20583
movq (%r13), %rax
movswq 0x2(%r14), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq (%r14), %rdx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax,%rdx,4), %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x4550
cmpq $-0x1, %rax
jne 0x20518
movq %r12, %rdi
callq 0x2294e
movl -0x2c(%rbp), %eax
movl %eax, (%r14)
movq %r12, %rdi
callq 0x2b7a6
jmp 0x20540
movq %rbx, %rdi
movq %r14, %rdx
callq 0x18b6a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/actives.cpp
// Function: clear_action_inds()
void clear_action_inds()
{
	map<Coords, unsigned char>::iterator it = axn_indicators.begin();
	while(it != axn_indicators.end())
	{
		if(it->second < NUM_ACTIONS)
		{
			Game::curmap->mod_tile(it->first)->flags &= ~(TF_ACTION);
			event_set.insert(it->first);
			axn_indicators.erase(it++);
		}
		else
		{
			it->second -= NUM_ACTIONS;
			++it;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x255ed(%rip), %rbx     # 0x45f48
leaq 0x255d6(%rip), %r13     # 0x45f38
cmpq %r13, %rbx
je 0x209de
leaq 0x2566a(%rip), %r14     # 0x45fd8
leaq 0x255bb(%rip), %r15     # 0x45f30
movb 0x24(%rbx), %al
cmpb $0x5, %al
ja 0x209c9
leaq 0x20(%rbx), %rsi
leaq 0x242e1(%rip), %rax     # 0x44c68
movq (%rax), %rax
movswq 0x22(%rbx), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq 0x20(%rbx), %rdx
movq (%rax,%rcx,8), %rax
andw $0xff7f, (%rax,%rdx,4)  # imm = 0xFF7F
movq %r14, %rdi
callq 0x21934
movq %rbx, %rdi
callq 0x4260
movq %rax, %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x219f0
movq %r12, %rbx
jmp 0x209d9
addb $-0x6, %al
movb %al, 0x24(%rbx)
movq %rbx, %rdi
callq 0x4260
movq %rax, %rbx
cmpq %r13, %rbx
jne 0x20975
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/actives.cpp
// Function: clear_sounds()
void clear_sounds()
{
	for(map<Coords, e_Sound>::const_iterator sit = reg_sounds.begin();
		sit != reg_sounds.end(); ++sit)
	{
		Game::curmap->mod_tile(sit->first)->flags &= ~(TF_SOUND);
		event_set.insert(sit->first);
	}
	reg_sounds.clear();
	for(map<Coords, string>::const_iterator vit = voices.begin();
		vit != voices.end(); ++vit)
	{
		Game::curmap->mod_tile(vit->first)->flags &= ~(TF_SOUND);
		event_set.insert(vit->first);
	}
	voices.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x254c3(%rip), %rbx     # 0x45f78
leaq 0x254ac(%rip), %r15     # 0x45f68
cmpq %r15, %rbx
je 0x20b0b
leaq 0x241a0(%rip), %r12     # 0x44c68
leaq 0x25509(%rip), %r14     # 0x45fd8
movq (%r12), %rax
leaq 0x20(%rbx), %rsi
movswq 0x22(%rbx), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq 0x20(%rbx), %rdx
movq (%rax,%rcx,8), %rax
andw $0xfeff, (%rax,%rdx,4)  # imm = 0xFEFF
movq %r14, %rdi
callq 0x21934
movq %rbx, %rdi
callq 0x4470
movq %rax, %rbx
cmpq %r15, %rax
jne 0x20acf
leaq 0x2544e(%rip), %rdi     # 0x45f60
callq 0x1d8e2
movq 0x2548a(%rip), %rbx     # 0x45fa8
leaq 0x25473(%rip), %r15     # 0x45f98
cmpq %r15, %rbx
je 0x20b74
leaq 0x24137(%rip), %r12     # 0x44c68
leaq 0x254a0(%rip), %r14     # 0x45fd8
movq (%r12), %rax
leaq 0x20(%rbx), %rsi
movswq 0x22(%rbx), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq 0x20(%rbx), %rdx
movq (%rax,%rcx,8), %rax
andw $0xfeff, (%rax,%rdx,4)  # imm = 0xFEFF
movq %r14, %rdi
callq 0x21934
movq %rbx, %rdi
callq 0x4470
movq %rax, %rbx
cmpq %r15, %rax
jne 0x20b38
leaq 0x25415(%rip), %rdi     # 0x45f90
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1d968
// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/actives.cpp
// Function: update_static_light(Coords const&)
void update_static_light(const Coords &c)
{
	// Run the algorithm on two base radii to cover all spots.
	/* NOTE: this works for TORCH_LIGHT_RADIUS 7-9; if it is <=6 or >=10,
	 * adjustments are called for! */
	update_static_light_r(c, TORCH_LIGHT_RADIUS);
	update_static_light_r(c, TORCH_LIGHT_RADIUS-1);
	update_static_light_r(c, TORCH_LIGHT_RADIUS-2);
	// the LOS-algorithm doesn't consider the position itself:
	Game::curmap->mod_tile(c)->flags |= TF_LIT;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x8, %esi
callq 0x20be0
movq %rbx, %rdi
movl $0x7, %esi
callq 0x20be0
movq %rbx, %rdi
movl $0x6, %esi
callq 0x20be0
leaq 0x240ac(%rip), %rax     # 0x44c68
movq (%rax), %rax
movswq 0x2(%rbx), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq (%rbx), %rdx
movq (%rax,%rcx,8), %rax
orw $0x10, (%rax,%rdx,4)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq