// File: /workspace/github_cpp_makefile_star2_O2/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 0x2b363(%rip), %r14     # 0x42e88
movq (%r14), %r12
leaq -0x24(%rbp), %r15
cmpq %r14, %r12
je 0x17b89
cmpq %rbx, 0x20(%r12)
je 0x17b3e
movq (%r12), %r12
jmp 0x17b2c
cmpb $0x0, 0x1e(%r12)
jne 0x17b79
movq 0x2a10b(%rip), %rax     # 0x41c58
movl 0x18(%r12), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rax
andw $-0x41, (%rax,%rdx,4)
movq %r15, %rdi
callq 0x24d9e
movq %r14, %rdi
movq %r12, %rsi
callq 0x17db8
movq %rax, %r12
jmp 0x17b2c
leaq 0x2b310(%rip), %r14     # 0x42ea0
movq (%r14), %r12
leaq -0x24(%rbp), %r15
cmpq %r14, %r12
je 0x17bf4
cmpq %rbx, 0x20(%r12)
je 0x17ba9
movq (%r12), %r12
jmp 0x17b97
cmpb $0x0, 0x1e(%r12)
jne 0x17be4
movq 0x2a0a0(%rip), %rax     # 0x41c58
movl 0x18(%r12), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rax
andw $-0x41, (%rax,%rdx,4)
movq %r15, %rdi
callq 0x24d9e
movq %r14, %rdi
movq %r12, %rsi
callq 0x17dd0
movq %rax, %r12
jmp 0x17b97
leaq 0x2b2bd(%rip), %r14     # 0x42eb8
movq (%r14), %r12
leaq -0x24(%rbp), %r15
cmpq %r14, %r12
je 0x17c5f
cmpq %rbx, 0x20(%r12)
je 0x17c14
movq (%r12), %r12
jmp 0x17c02
cmpb $0x0, 0x1e(%r12)
jne 0x17c4f
movq 0x2a035(%rip), %rax     # 0x41c58
movl 0x18(%r12), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rax
andw $-0x41, (%rax,%rdx,4)
movq %r15, %rdi
callq 0x24d9e
movq %r14, %rdi
movq %r12, %rsi
callq 0x17de8
movq %rax, %r12
jmp 0x17c02
leaq 0x2b1f2(%rip), %r14     # 0x42e58
movq (%r14), %r12
leaq -0x24(%rbp), %r15
cmpq %r14, %r12
je 0x17cc3
cmpq %rbx, 0x28(%r12)
je 0x17c7f
movq (%r12), %r12
jmp 0x17c6d
movq 0x29fd2(%rip), %rax     # 0x41c58
movl 0x18(%r12), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rax
andw $0xf7ff, (%rax,%rdx,4)  # imm = 0xF7FF
movq %r15, %rdi
callq 0x24d9e
movq %r14, %rdi
movq %r12, %rsi
callq 0x17f5c
movq %rax, %r12
jmp 0x17c6d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq