// File: /workspace/github_c_makefile_star2_O1/ajpaulson[P]srogue11/fight.c
// Function: killed
void killed(struct linked_list *item,bool pr)
{
	struct thing *tp;
	struct object *obj;
	struct linked_list *pitem, *nexti, *itspack;
	struct coord here;
	
	nochange = FALSE;
	tp = THINGPTR(item);
	here = tp->t_pos;
	if (pr) {
		addmsg("Defeated ");
		if (pl_on(ISBLIND))
			msg("it.");
		else
			msg("%s.", monsters[tp->t_indx].m_name);
	}
	him->s_exp += tp->t_stats.s_exp;
	isfight = FALSE;
	check_level();
	unhold(tp->t_type);					/* free player if held */
	if (tp->t_type == 'L') {
		struct room *rp;

		rp = roomin(&here);
		if (rp != NULL) {
			if (rp->r_goldval!=0 || fallpos(&here, &rp->r_gold, FALSE)) {
				rp->r_goldval += GOLDCALC;
				if (!save_throw(VS_MAGIC,tp))
					rp->r_goldval += GOLDCALC + GOLDCALC + GOLDCALC
								   + GOLDCALC + GOLDCALC;
				mvaddch(rp->r_gold.y, rp->r_gold.x, GOLD);
				if (!rf_on(rp,ISDARK)) {
					light(&hero);
					mvwaddch(cw, hero.y, hero.x, PLAYER);
				}
			}
		}
	}
	pitem = tp->t_pack;
	itspack = tp->t_pack;
	remove_monster(&here, item);
	while (pitem != NULL) {
		nexti = next(pitem);
		obj = OBJPTR(pitem);
		obj->o_pos = here;
		detach(itspack, pitem);
		fall(pitem, FALSE);
		pitem = nexti;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x23782(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
movq 0x10(%rdi), %r14
movq 0x50(%r14), %rax
movq %rax, (%rsp)
testl %esi, %esi
je 0xa184
leaq 0x159e0(%rip), %rdi     # 0x1fb1b
xorl %eax, %eax
callq 0xb7f7
movl $0x1, %edi
callq 0x9595
testb %al, %al
je 0xa160
leaq 0x191f5(%rip), %rdi     # 0x2334c
xorl %eax, %eax
callq 0xb6e0
jmp 0xa184
movslq 0x80(%r14), %rax
imulq $0x70, %rax, %rax
leaq 0x2024e(%rip), %rcx     # 0x2a3c0
movq (%rcx,%rax), %rsi
leaq 0x15797(%rip), %rdi     # 0x1f914
xorl %eax, %eax
callq 0xb6e0
movq 0x20(%r14), %rax
leaq 0x23bd1(%rip), %rcx     # 0x2dd60
movq (%rcx), %rcx
addq %rax, 0x20(%rcx)
leaq 0x236fb(%rip), %rax     # 0x2d898
movb $0x0, (%rax)
callq 0xaf58
movsbl 0x8d(%r14), %edi
callq 0xdd01
cmpb $0x4c, 0x8d(%r14)
jne 0xa35b
movq %rsp, %rdi
callq 0x7052
testq %rax, %rax
je 0xa35b
movq %rax, %r15
cmpl $0x0, 0x58(%rax)
jne 0xa1f3
movq %r15, %rsi
addq $0x10, %rsi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x1cbeb
testb %al, %al
je 0xa35b
leaq 0x200f6(%rip), %r13     # 0x2a2f0
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc72d
movl 0x58(%r15), %ecx
addl %ecx, %eax
addl $0x2, %eax
movl %eax, 0x58(%r15)
movl 0x28(%r14), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq %r14, %rdi
callq 0x1214b
addl %ebp, %eax
movl $0x11, %ebp
subl %eax, %ebp
movl $0x1, %edi
movl $0x14, %esi
callq 0xc74e
cmpl %ebp, %eax
jge 0xa2e3
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc72d
movl %eax, 0xc(%rsp)
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc72d
movl %eax, %r12d
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc72d
movl %eax, 0x8(%rsp)
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc72d
movl %eax, %ebp
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc72d
movl 0x58(%r15), %ecx
addl 0xc(%rsp), %r12d
addl 0x8(%rsp), %ebp
addl %r12d, %ebp
addl %eax, %ebp
leal (%rcx,%rbp), %eax
addl $0xa, %eax
movl %eax, 0x58(%r15)
movq 0x1fc46(%rip), %r12     # 0x29f30
movq (%r12), %rdi
movl 0x10(%r15), %edx
movl 0x14(%r15), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0xa30e
movq (%r12), %rdi
movl $0x2a, %esi
callq 0x64c0
movl $0x1, %esi
movq %r15, %rdi
callq 0x13e74
testl %eax, %eax
jne 0xa35b
leaq 0x2393a(%rip), %r12     # 0x2dc60
leaq 0x50(%r12), %rdi
callq 0xecbc
leaq 0x266a9(%rip), %r15     # 0x309e0
movq (%r15), %rdi
movl 0x50(%r12), %edx
movl 0x54(%r12), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0xa35b
movq (%r15), %rdi
movl $0x40, %esi
callq 0x64c0
movq 0x68(%r14), %r14
movq %r14, 0x10(%rsp)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xae8c
testq %r14, %r14
je 0xa3a4
leaq 0x10(%rsp), %rbx
movq (%r14), %r15
movq 0x10(%r14), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbe00
movq %r14, %rdi
xorl %esi, %esi
callq 0x1cacd
movq %r15, %r14
testq %r15, %r15
jne 0xa379
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq