// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/chores.cpp
// Function: kill_player(std::_List_iterator<Player>)
void kill_player(const list<Player>::iterator pit)
{
	if(pit->cl_props.hp > 0)
		pit->cl_props.hp = 0; // if they're negative, we don't overwrite that
	pit->doing_a_chore = pit->warned_of_chasm = 0;
	event_set.insert(pit->own_pc->getpos());
	Tile* tp = Game::curmap->mod_tile(pit->own_pc->getpos());
	// if was carrying item, drop it
	if(pit == pl_with_item)
	{
		pl_with_item = cur_players.end();
		the_item.setpos(pit->own_pc->getpos());
		// Change item colour for certain tile types:
		if(tp->flags & TF_DROWNS) // water
			the_item.set_col(C_WATER_TRAP);
		else if(tp->flags & TF_KILLS) // chasm
			the_item.set_col(C_BROWN_PC);
		else
			the_item.set_col(C_LIGHT_TRAP);
		obj_sector = Game::curmap->coords_in_sector(pit->own_pc->getpos());
		Game::send_team_upds(cur_players.end());
		string msg = "Treasure dropped!";
		Network::construct_msg(msg, C_PORTAL_IN_LIT);
		Network::broadcast();
	}
	
	// If was a planewalker on a trip, return to view own corpse:
	if(pit->cl == C_PLANEWALKER && pit->limiter)
		pit->own_vp->set_pos(pit->own_pc->getpos());
	// (limiter and pv are reset upon next spawn)

	tp->flags &= ~(TF_OCCUPIED);
	pit->own_pc->makevoid();
	
	pit->action_queue.clear();
	pit->poisoner = cur_players.end();

	// If requested to change class:
	if(pit->next_cl != pit->cl)
		Game::send_state_change(pit);

	pit->stats_i->time_played[pit->cl] += time(NULL) - pit->last_switched_cl;
	time(&(pit->last_switched_cl));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x153(%rdi)
jle 0x2565a
movb $0x0, 0x153(%rbx)
xorl %eax, %eax
movb %al, 0x172(%rbx)
movb %al, 0x142(%rbx)
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
leaq -0x48(%rbp), %rsi
movl %eax, (%rsi)
leaq 0x20959(%rip), %rdi     # 0x45fd8
callq 0xfa8a
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2b7a6
leaq 0x1f5d1(%rip), %r13     # 0x44c68
movq (%r13), %rax
movq 0x148(%rbx), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, (%r14)
movswq %cx, %r15
shrl $0x10, %ecx
movswq %cx, %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %r12
shlq $0x2, %r15
leaq -0x48(%rbp), %rdi
callq 0x2b7a6
leaq 0x20935(%rip), %rax     # 0x46008
cmpq %rbx, (%rax)
jne 0x257ba
leaq 0x1d9dd(%rip), %rcx     # 0x430c0
movq %rcx, (%rax)
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r14)
leaq 0x2091e(%rip), %rcx     # 0x46018
movl %eax, 0x8(%rcx)
movq %r14, %rdi
callq 0x2b7a6
movzwl (%r12,%r15), %eax
btl $0x9, %eax
setae %cl
addb %cl, %cl
orb $0x20, %cl
btl $0xa, %eax
movzbl %cl, %eax
movl $0x21, %ecx
cmovael %eax, %ecx
leaq 0x208ec(%rip), %rax     # 0x46018
movb %cl, 0xd(%rax)
movq (%r13), %rdi
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r14)
leaq -0x48(%rbp), %rsi
callq 0x172ce
leaq 0x1accc(%rip), %rcx     # 0x4041c
movl %eax, (%rcx)
leaq -0x48(%rbp), %rdi
callq 0x2b7a6
leaq 0x1d95e(%rip), %rdi     # 0x430c0
callq 0x19e31
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xfcc8(%rip), %rsi      # 0x3543e
leaq 0xfcd2(%rip), %rdx      # 0x3544f
leaq -0x48(%rbp), %rdi
callq 0xe01c
leaq -0x48(%rbp), %rdi
movl $0x3c, %esi
callq 0xf3f0
leaq 0x1b98d(%rip), %rsi     # 0x41128
movl $0xffff, %edi           # imm = 0xFFFF
callq 0xe3b3
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x257ba
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
cmpl $0xa, 0xc0(%rbx)
jne 0x257f1
cmpb $0x0, 0x140(%rbx)
je 0x257f1
movq 0xd0(%rbx), %rdi
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
leaq -0x48(%rbp), %rsi
movl %eax, (%rsi)
callq 0x1eb62
leaq -0x48(%rbp), %rdi
callq 0x2b7a6
andb $-0x41, (%r12,%r15)
movq 0x148(%rbx), %rax
movb $0x1, 0xe(%rax)
leaq 0xe8(%rbx), %rdi
callq 0x1d668
leaq 0x1d8ac(%rip), %rax     # 0x430c0
movq %rax, 0x160(%rbx)
movl 0xc4(%rbx), %eax
cmpl 0xc0(%rbx), %eax
je 0x25831
movq %rbx, %rdi
callq 0x1c8ec
xorl %edi, %edi
callq 0x43b0
leaq 0xc8(%rbx), %rdi
subq 0xc8(%rbx), %rax
movq 0x90(%rbx), %rcx
movl 0xc0(%rbx), %edx
addq %rax, 0xc0(%rcx,%rdx,8)
callq 0x43b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x25892
movq %rax, %rbx
jmp 0x2589e
jmp 0x25892
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x2589e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x2589e
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740