// File: /workspace/github_cpp_makefile_star2_O1/lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::del_owneds(std::_List_const_iterator<Player>)
void Game::del_owneds(const list<Player>::const_iterator pit)
{
	// Note: this function is only called at instances when it is safe
	// to "simply remove" the entities instead of voiding them so that
	// they'd be removed later.
	list<Arrow>::iterator a_it = arrows.begin();
	while(a_it != arrows.end())
	{
		if(a_it->get_owner() == pit)
		{
			if(!a_it->isvoid())
				curmap->mod_tile(a_it->getpos())->flags &= ~(TF_OCCUPIED);
			a_it = arrows.erase(a_it);
		}
		else
			++a_it;
	}
	list<MM>::iterator m_it = MMs.begin();
	while(m_it != MMs.end())
	{
		if(m_it->get_owner() == pit)
		{
			if(!m_it->isvoid())
				curmap->mod_tile(m_it->getpos())->flags &= ~(TF_OCCUPIED);
			m_it = MMs.erase(m_it);
		}
		else
			++m_it;
	}
	list<Zap>::iterator z_it = zaps.begin();
	while(z_it != zaps.end())
	{
		if(z_it->get_owner() == pit)
		{
			if(!z_it->isvoid())
				curmap->mod_tile(z_it->getpos())->flags &= ~(TF_OCCUPIED);
			z_it = zaps.erase(z_it);
		}
		else
			++z_it;
	}
	list<Trap>::iterator tr_it = traps.begin();
	while(tr_it != traps.end())
	{
		if(tr_it->get_owner() == pit)
		{
			// (traps are never voided)
			curmap->mod_tile(tr_it->getpos())->flags &= ~(TF_TRAP);
			tr_it = traps.erase(tr_it);
		}
		else
			++tr_it;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x28b1e(%rip), %r14     # 0x45e98
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d3db
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x20(%r15)
je 0x1d391
movq (%r15), %r15
jmp 0x1d3d6
cmpb $0x0, 0x1e(%r15)
jne 0x1d3c8
movq 0x278c9(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq -0x22(%rbp), %rdx
movq 0x8(%rax), %rax
leaq (%rdx,%rdx,2), %rdx
movswq %cx, %rcx
movq (%rax,%rdx,8), %rax
andw $-0x41, (%rax,%rcx,4)
movq %r12, %rdi
callq 0x2bbf6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d5e0
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d386
leaq 0x28ace(%rip), %r14     # 0x45eb0
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d443
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x20(%r15)
je 0x1d3f9
movq (%r15), %r15
jmp 0x1d43e
cmpb $0x0, 0x1e(%r15)
jne 0x1d430
movq 0x27861(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq -0x22(%rbp), %rdx
movq 0x8(%rax), %rax
leaq (%rdx,%rdx,2), %rdx
movswq %cx, %rcx
movq (%rax,%rdx,8), %rax
andw $-0x41, (%rax,%rcx,4)
movq %r12, %rdi
callq 0x2bbf6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d618
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d3ee
leaq 0x28a7e(%rip), %r14     # 0x45ec8
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d4ab
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x20(%r15)
je 0x1d461
movq (%r15), %r15
jmp 0x1d4a6
cmpb $0x0, 0x1e(%r15)
jne 0x1d498
movq 0x277f9(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq -0x22(%rbp), %rdx
movq 0x8(%rax), %rax
leaq (%rdx,%rdx,2), %rdx
movswq %cx, %rcx
movq (%rax,%rdx,8), %rax
andw $-0x41, (%rax,%rcx,4)
movq %r12, %rdi
callq 0x2bbf6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d650
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d456
leaq 0x289b6(%rip), %r14     # 0x45e68
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d50d
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x28(%r15)
je 0x1d4c9
movq (%r15), %r15
jmp 0x1d508
movq 0x27798(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq -0x22(%rbp), %rdx
movq 0x8(%rax), %rax
leaq (%rdx,%rdx,2), %rdx
movswq %cx, %rcx
movq (%rax,%rdx,8), %rax
andw $0xf7ff, (%rax,%rcx,4)  # imm = 0xF7FF
movq %r12, %rdi
callq 0x2bbf6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d882
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d4be
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq