// File: lotuskip[P]yuxtapa/server/chores.cpp
// Function: player_death(std::_List_iterator<Player>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void player_death(const list<Player>::iterator pit, const string &way,
	const bool corpse)
{
	string msg = pit->nick + way;
	Network::construct_msg(msg, DEF_MSG_COL);
	Network::broadcast();
	pit->stats_i->deaths++;
	pit->needs_state_upd = true;
	Coords pos;
	// Item carrier leaves no corpse! Also, if the place is a water square,
	// do not generate a corpse:
	if(corpse && pit != pl_with_item &&
		!(Game::curmap->mod_tile((pos = pit->own_pc->getpos()))->flags & TF_DROWNS))
	{
		// If there is already a corpse there, this corpse "overrules" the
		// older one. But if there is some other noccent there, do not cover
		// it with a corpse.
		list<NOccEnt>::iterator enoe = any_noccent_at(pos, NOE_CORPSE);
		if(enoe != noccents[NOE_CORPSE].end())
		{
			enoe->set_col(team_colour[pit->team]);
			enoe->set_misc(CORPSE_DECAY_TURNS);
		}
		else
		{
			Tile* tp = Game::curmap->mod_tile(pos);
			if(!(tp->flags & TF_NOCCENT))
			{
				noccents[NOE_CORPSE].push_back(NOccEnt(pos, '%',
					team_colour[pit->team], CORPSE_DECAY_TURNS)); 
				tp->flags |= TF_NOCCENT;
			}
		}
	}
	kill_player(pit);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rsi
addq $0x88, %rsi
movq -0x10(%rbp), %rdx
leaq -0x38(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x24cb0
movq -0x90(%rbp), %rdi
movl $0xf, %esi
callq 0x1ab10
jmp 0x51824
leaq 0x3ca6d(%rip), %rsi     # 0x8e298
movl $0xffff, %edi           # imm = 0xFFFF
callq 0x19160
jmp 0x51837
leaq -0x8(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x1b050
movq %rax, %rdi
subq $-0x80, %rdi
callq 0x1b390
movq -0x98(%rbp), %rdi
movq 0x30(%rax), %rcx
incq %rcx
movq %rcx, 0x30(%rax)
callq 0x1b050
movb $0x1, 0x14d(%rax)
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x60430
jmp 0x51880
movb -0x11(%rbp), %cl
movb $0x0, -0x55(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x99(%rbp)
je 0x51932
leaq -0x50(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x18a20
leaq -0x50(%rbp), %rdi
leaq 0x418c8(%rip), %rsi     # 0x93178
callq 0x24f10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x99(%rbp)
jne 0x518c6
jmp 0x51932
leaq 0x4050b(%rip), %rax     # 0x91dd8
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq 0x138(%rax), %rsi
leaq -0x54(%rbp), %rdi
callq 0x1b190
jmp 0x518f2
movq -0xa8(%rbp), %rdi
movb $0x1, -0x55(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x48(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0xb0(%rbp)
jmp 0x51915
movq -0xb0(%rbp), %rax
movzwl (%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
movb %al, -0xb1(%rbp)
testb $0x1, -0x55(%rbp)
jne 0x51946
jmp 0x5194f
leaq -0x54(%rbp), %rdi
callq 0x60460
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0x5195e
jmp 0x51aeb
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x49390
movq %rax, -0xc0(%rbp)
jmp 0x51972
movq -0xc0(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0x415ac(%rip), %rdi     # 0x92f30
callq 0x3c9d0
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3cdc0
testb $0x1, %al
jne 0x519a3
jmp 0x51a3c
leaq -0x60(%rbp), %rdi
callq 0x3cdf0
movq %rax, -0xc8(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq -0xc8(%rbp), %rdi
movl 0xac(%rax), %eax
leaq 0x18928(%rip), %rcx     # 0x6a2f8
movsbl (%rax,%rcx), %esi
callq 0x49ff0
jmp 0x519db
leaq -0x60(%rbp), %rdi
callq 0x3cdf0
movq %rax, %rdi
movl $0x3c, %esi
callq 0x58430
jmp 0x519f3
jmp 0x51ae9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x51b28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x51b1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x55(%rbp)
jne 0x51a2e
jmp 0x51a37
leaq -0x54(%rbp), %rdi
callq 0x60460
jmp 0x51b1f
leaq 0x40395(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0xd0(%rbp)
jmp 0x51a58
movq -0xd0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movzwl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x51ae7
leaq -0x8(%rbp), %rdi
callq 0x1b050
movl 0xac(%rax), %eax
leaq 0x18870(%rip), %rcx     # 0x6a2f8
movsbl (%rax,%rcx), %ecx
leaq -0x80(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x25, %edx
movl $0x3c, %r8d
callq 0x4d720
jmp 0x51aa6
leaq 0x41483(%rip), %rdi     # 0x92f30
leaq -0x80(%rbp), %rsi
callq 0x4bae0
jmp 0x51ab8
leaq -0x80(%rbp), %rdi
callq 0x49cd0
movq -0x70(%rbp), %rax
movzwl (%rax), %ecx
orl $0x20, %ecx
movw %cx, (%rax)
jmp 0x51ae7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x49cd0
jmp 0x51b1f
jmp 0x51ae9
jmp 0x51aeb
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x546a0
jmp 0x51b04
leaq -0x48(%rbp), %rdi
callq 0x60460
leaq -0x38(%rbp), %rdi
callq 0x5a48
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x60460
leaq -0x38(%rbp), %rdi
callq 0x5a48
movq -0x40(%rbp), %rdi
callq 0x5920
nopw (%rax,%rax)