// File: /workspace/github_cpp_makefile_star2_O3/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 0x28c45(%rip), %r14     # 0x45e98
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d2b6
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x20(%r15)
je 0x1d26a
movq (%r15), %r15
jmp 0x1d2b1
cmpb $0x0, 0x1e(%r15)
jne 0x1d2a3
movq 0x279f0(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
andw $-0x41, (%rax,%rdx,4)
movq %r12, %rdi
callq 0x2b7a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d4c0
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d25f
leaq 0x28bf3(%rip), %r14     # 0x45eb0
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d320
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x20(%r15)
je 0x1d2d4
movq (%r15), %r15
jmp 0x1d31b
cmpb $0x0, 0x1e(%r15)
jne 0x1d30d
movq 0x27986(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
andw $-0x41, (%rax,%rdx,4)
movq %r12, %rdi
callq 0x2b7a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d4f8
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d2c9
leaq 0x28ba1(%rip), %r14     # 0x45ec8
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d38a
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x20(%r15)
je 0x1d33e
movq (%r15), %r15
jmp 0x1d385
cmpb $0x0, 0x1e(%r15)
jne 0x1d377
movq 0x2791c(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
andw $-0x41, (%rax,%rdx,4)
movq %r12, %rdi
callq 0x2b7a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d530
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d333
leaq 0x28ad7(%rip), %r14     # 0x45e68
movq (%r14), %r15
cmpq %r14, %r15
je 0x1d3ee
leaq -0x24(%rbp), %r12
cmpq %rbx, 0x28(%r15)
je 0x1d3a8
movq (%r15), %r15
jmp 0x1d3e9
movq 0x278b9(%rip), %rax     # 0x44c68
movl 0x18(%r15), %ecx
movl %ecx, -0x24(%rbp)
movswq %cx, %rdx
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
andw $0xf7ff, (%rax,%rdx,4)  # imm = 0xF7FF
movq %r12, %rdi
callq 0x2b7a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d762
movq %rax, %r15
cmpq %r14, %r15
jne 0x1d39d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq