// File: /workspace/github_cpp_makefile_star2_O2/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 0x1fe80
movb $0x0, 0x153(%rbx)
xorl %eax, %eax
movb %al, 0x172(%rbx)
movb %al, 0x142(%rbx)
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
leaq -0x50(%rbp), %rsi
movl %eax, (%rsi)
leaq 0x23123(%rip), %rdi     # 0x42fc8
callq 0xc5be
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x24d9e
leaq 0x21d9b(%rip), %r13     # 0x41c58
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
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %r12
shlq $0x2, %r15
leaq -0x50(%rbp), %rdi
callq 0x24d9e
leaq 0x230ff(%rip), %rax     # 0x42ff8
cmpq %rbx, (%rax)
jne 0x1ffc5
leaq 0x201a7(%rip), %rcx     # 0x400b0
movq %rcx, (%rax)
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r14)
leaq 0x230e8(%rip), %rcx     # 0x43008
movl %eax, 0x8(%rcx)
movq %r14, %rdi
callq 0x24d9e
movzwl (%r12,%r15), %eax
btl $0x9, %eax
setae %cl
addb %cl, %cl
orb $0x20, %cl
btl $0xa, %eax
movzbl %cl, %eax
pushq $0x21
popq %rcx
cmovael %eax, %ecx
leaq 0x230b8(%rip), %rax     # 0x43008
movb %cl, 0xd(%rax)
movq (%r13), %rdi
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r14)
leaq -0x50(%rbp), %rsi
callq 0x128ac
leaq 0x1d4a0(%rip), %rcx     # 0x3d414
movl %eax, (%rcx)
leaq -0x50(%rbp), %rdi
callq 0x24d9e
leaq 0x2012a(%rip), %rdi     # 0x400b0
callq 0x152e9
leaq 0xf505(%rip), %rsi      # 0x2f497
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0xb292
leaq -0x50(%rbp), %rdi
pushq $0x3c
popq %rsi
callq 0xc0f2
leaq 0x1e166(%rip), %rsi     # 0x3e118
movl $0xffff, %edi           # imm = 0xFFFF
callq 0xb61b
leaq -0x50(%rbp), %rdi
callq 0x47e8
cmpl $0xa, 0xc0(%rbx)
jne 0x1fffc
cmpb $0x0, 0x140(%rbx)
je 0x1fffc
movq 0xd0(%rbx), %rdi
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
leaq -0x50(%rbp), %rsi
movl %eax, (%rsi)
callq 0x194b2
leaq -0x50(%rbp), %rdi
callq 0x24d9e
andb $-0x41, (%r12,%r15)
movq 0x148(%rbx), %rax
movb $0x1, 0xe(%rax)
leaq 0xe8(%rbx), %rdi
callq 0x17e6e
leaq 0x20091(%rip), %rax     # 0x400b0
movq %rax, 0x160(%rbx)
movl 0xc4(%rbx), %eax
cmpl 0xc0(%rbx), %eax
je 0x2003c
movq %rbx, %rdi
callq 0x1732d
xorl %edi, %edi
callq 0x43c0
leaq 0xc8(%rbx), %rdi
subq 0xc8(%rbx), %rax
movq 0x90(%rbx), %rcx
movl 0xc0(%rbx), %edx
addq %rax, 0xc0(%rcx,%rdx,8)
callq 0x43c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20091
movq %rax, %rbx
jmp 0x2009d
jmp 0x20091
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x47e8
jmp 0x2009d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x24d9e
movq %rbx, %rdi
callq 0x4710