// File: 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
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
leaq 0x56dc2(%rip), %rdi     # 0x93008
callq 0x3cac0
movq %rax, -0x10(%rbp)
leaq 0x56db2(%rip), %rdi     # 0x93008
callq 0x3cb20
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3caf0
testb $0x1, %al
jne 0x3c275
jmp 0x3c376
leaq -0x10(%rbp), %rdi
callq 0x3cb50
movq %rax, %rdi
callq 0x3d0f0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x18a20
leaq -0x20(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x3d5a0
testb $0x1, %al
jne 0x3c2ad
jmp 0x3c368
leaq -0x10(%rbp), %rdi
callq 0x3cb50
movq %rax, %rdi
callq 0x3ce40
testb $0x1, %al
jne 0x3c33d
movq 0x55b0f(%rip), %rax     # 0x91dd8
movq %rax, -0x110(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x3cb50
movq %rax, %rsi
leaq -0x2c(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x1b190
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0x100(%rbp)
jmp 0x3c308
movq -0x100(%rbp), %rax
movzwl (%rax), %ecx
andl $-0x41, %ecx
movw %cx, (%rax)
leaq -0x2c(%rbp), %rdi
callq 0x60460
jmp 0x3c33d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0x60460
jmp 0x3c792
leaq -0x50(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3ceb0
movq -0x50(%rbp), %rsi
leaq 0x56cb3(%rip), %rdi     # 0x93008
callq 0x3ce60
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x3c371
leaq -0x10(%rbp), %rdi
callq 0x3cb80
jmp 0x3c24f
leaq 0x56ca3(%rip), %rdi     # 0x93020
callq 0x3cbc0
movq %rax, -0x58(%rbp)
leaq 0x56c93(%rip), %rdi     # 0x93020
callq 0x3cc20
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3cbf0
testb $0x1, %al
jne 0x3c3ac
jmp 0x3c4b3
leaq -0x58(%rbp), %rdi
callq 0x3cc50
movq %rax, %rdi
callq 0x3d0f0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x18a20
leaq -0x68(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x3d5a0
testb $0x1, %al
jne 0x3c3e4
jmp 0x3c4a5
leaq -0x58(%rbp), %rdi
callq 0x3cc50
movq %rax, %rdi
callq 0x3ce40
testb $0x1, %al
jne 0x3c474
movq 0x559d8(%rip), %rax     # 0x91dd8
movq %rax, -0x128(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3cc50
movq %rax, %rsi
leaq -0x74(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x1b190
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0x118(%rbp)
jmp 0x3c43f
movq -0x118(%rbp), %rax
movzwl (%rax), %ecx
andl $-0x41, %ecx
movw %cx, (%rax)
leaq -0x74(%rbp), %rdi
callq 0x60460
jmp 0x3c474
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x74(%rbp), %rdi
callq 0x60460
jmp 0x3c792
leaq -0x88(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3cf20
movq -0x88(%rbp), %rsi
leaq 0x56b8e(%rip), %rdi     # 0x93020
callq 0x3ced0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x3c4ae
leaq -0x58(%rbp), %rdi
callq 0x3cc80
jmp 0x3c386
leaq 0x56b7e(%rip), %rdi     # 0x93038
callq 0x3ccc0
movq %rax, -0x90(%rbp)
leaq 0x56b6b(%rip), %rdi     # 0x93038
callq 0x3cd20
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3ccf0
testb $0x1, %al
jne 0x3c4f5
jmp 0x3c62d
leaq -0x90(%rbp), %rdi
callq 0x3cd50
movq %rax, %rdi
callq 0x3d0f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x18a20
leaq -0xa0(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x3d5a0
testb $0x1, %al
jne 0x3c53c
jmp 0x3c61c
leaq -0x90(%rbp), %rdi
callq 0x3cd50
movq %rax, %rdi
callq 0x3ce40
testb $0x1, %al
jne 0x3c5df
movq 0x55879(%rip), %rax     # 0x91dd8
movq %rax, -0x140(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3cd50
movq %rax, %rsi
leaq -0xac(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x1b190
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0x130(%rbp)
jmp 0x3c5a4
movq -0x130(%rbp), %rax
movzwl (%rax), %ecx
andl $-0x41, %ecx
movw %cx, (%rax)
leaq -0xac(%rbp), %rdi
callq 0x60460
jmp 0x3c5df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xac(%rbp), %rdi
callq 0x60460
jmp 0x3c792
leaq -0xc0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3cf90
movq -0xc0(%rbp), %rsi
leaq 0x56a38(%rip), %rdi     # 0x93038
callq 0x3cf40
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x3c628
leaq -0x90(%rbp), %rdi
callq 0x3cd80
jmp 0x3c4c6
leaq 0x569a4(%rip), %rdi     # 0x92fd8
callq 0x3da10
movq %rax, -0xc8(%rbp)
leaq 0x56991(%rip), %rdi     # 0x92fd8
callq 0x3da70
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x3da40
testb $0x1, %al
jne 0x3c66f
jmp 0x3c789
leaq -0xc8(%rbp), %rdi
callq 0x3daa0
movq %rax, %rdi
callq 0x3dad0
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x18a20
leaq -0xd8(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x3d5a0
testb $0x1, %al
jne 0x3c6b6
jmp 0x3c778
movq 0x5571b(%rip), %rax     # 0x91dd8
movq %rax, -0x158(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3daa0
movq %rax, %rsi
leaq -0xe4(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x1b190
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0x148(%rbp)
jmp 0x3c702
movq -0x148(%rbp), %rax
movzwl (%rax), %ecx
andl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
movw %cx, (%rax)
leaq -0xe4(%rbp), %rdi
callq 0x60460
leaq -0xf8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3db40
movq -0xf8(%rbp), %rsi
leaq 0x56896(%rip), %rdi     # 0x92fd8
callq 0x3daf0
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x3c784
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe4(%rbp), %rdi
callq 0x60460
jmp 0x3c792
leaq -0xc8(%rbp), %rdi
callq 0x3db60
jmp 0x3c640
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5920
nopl (%rax,%rax)