// File: /workspace/github_cpp_makefile_star2_O1/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 0x258bf
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 0x206f4(%rip), %rdi     # 0x45fd8
callq 0xfb84
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2bbf6
leaq 0x1f36c(%rip), %r13     # 0x44c68
movq (%r13), %rax
movq 0x148(%rbx), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, (%r14)
movswq 0x2(%r14), %rdx
movq 0x8(%rax), %rax
leaq (%rdx,%rdx,2), %rdx
movswq %cx, %r15
movq (%rax,%rdx,8), %r12
leaq -0x48(%rbp), %rdi
callq 0x2bbf6
leaq 0x206d6(%rip), %rax     # 0x46008
cmpq %rbx, (%rax)
jne 0x25a19
leaq 0x1d77e(%rip), %rcx     # 0x430c0
movq %rcx, (%rax)
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r14)
leaq 0x206bf(%rip), %rcx     # 0x46018
movl %eax, 0x8(%rcx)
movq %r14, %rdi
callq 0x2bbf6
movzwl (%r12,%r15,4), %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 0x2068d(%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 0x17406
leaq 0x1aa75(%rip), %rcx     # 0x40424
movl %eax, (%rcx)
leaq -0x48(%rbp), %rdi
callq 0x2bbf6
leaq 0x1d6ff(%rip), %rdi     # 0x430c0
callq 0x19f7b
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xfa79(%rip), %rsi      # 0x3544e
leaq 0xfa83(%rip), %rdx      # 0x3545f
leaq -0x48(%rbp), %rdi
callq 0xdfec
leaq -0x48(%rbp), %rdi
movl $0x3c, %esi
callq 0xf4ed
leaq 0x1b72e(%rip), %rsi     # 0x41128
movl $0xffff, %edi           # imm = 0xFFFF
callq 0xe383
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x25a19
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
cmpl $0xa, 0xc0(%rbx)
jne 0x25a50
cmpb $0x0, 0x140(%rbx)
je 0x25a50
movq 0xd0(%rbx), %rdi
movq 0x148(%rbx), %rax
movl 0x8(%rax), %eax
leaq -0x48(%rbp), %rsi
movl %eax, (%rsi)
callq 0x1ecfc
leaq -0x48(%rbp), %rdi
callq 0x2bbf6
andb $-0x41, (%r12,%r15,4)
movq 0x148(%rbx), %rax
movb $0x1, 0xe(%rax)
leaq 0xe8(%rbx), %rdi
callq 0x1d788
leaq 0x1d64d(%rip), %rax     # 0x430c0
movq %rax, 0x160(%rbx)
movl 0xc4(%rbx), %eax
cmpl 0xc0(%rbx), %eax
je 0x25a90
movq %rbx, %rdi
callq 0x1ca23
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 0x25af1
movq %rax, %rbx
jmp 0x25afd
jmp 0x25af1
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x25afd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43f0
jmp 0x25afd
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2bbf6
movq %rbx, %rdi
callq 0x4750