// File: /workspace/github_c_makefile_star2_O2/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 0x23b3a(%rip), %rax     # 0x2d893
movb $0x0, (%rax)
movq 0x10(%rdi), %r14
movq 0x50(%r14), %rax
movq %rax, (%rsp)
testl %esi, %esi
je 0x9dba
leaq 0x13da8(%rip), %rdi     # 0x1db1b
xorl %eax, %eax
callq 0xb267
pushq $0x1
popq %rdi
callq 0x932c
testb %al, %al
je 0x9d96
leaq 0x17637(%rip), %rdi     # 0x213c4
xorl %eax, %eax
callq 0xb178
jmp 0x9dba
movslq 0x80(%r14), %rax
imulq $0x70, %rax, %rax
leaq 0x20608(%rip), %rcx     # 0x2a3b0
movq (%rcx,%rax), %rsi
leaq 0x13b61(%rip), %rdi     # 0x1d914
xorl %eax, %eax
callq 0xb178
movq 0x20(%r14), %rax
leaq 0x23f8b(%rip), %rcx     # 0x2dd50
movq (%rcx), %rcx
addq %rax, 0x20(%rcx)
leaq 0x23ab5(%rip), %rax     # 0x2d888
movb $0x0, (%rax)
callq 0xaa03
movsbl 0x8d(%r14), %edi
callq 0xd4b0
cmpb $0x4c, 0x8d(%r14)
jne 0x9f41
movq %rsp, %rdi
callq 0x6f44
testq %rax, %rax
je 0x9f41
movq %rax, %r15
cmpl $0x0, 0x58(%rax)
jne 0x9e29
movq %r15, %rsi
addq $0x10, %rsi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x1af79
testb %al, %al
je 0x9f41
leaq 0x204b0(%rip), %r13     # 0x2a2e0
imull $0xa, (%r13), %edi
addl $0x32, %edi
xorl %eax, %eax
callq 0xc004
movl 0x58(%r15), %ecx
addl %ecx, %eax
addl $0x2, %eax
movl %eax, 0x58(%r15)
pushq $0x3
popq %rdi
movq %r14, %rsi
callq 0xaab7
testl %eax, %eax
jne 0x9ecf
imull $0xa, (%r13), %edi
addl $0x32, %edi
xorl %eax, %eax
callq 0xc004
movl %eax, 0xc(%rsp)
imull $0xa, (%r13), %edi
addl $0x32, %edi
xorl %eax, %eax
callq 0xc004
movl %eax, %r12d
imull $0xa, (%r13), %edi
addl $0x32, %edi
xorl %eax, %eax
callq 0xc004
movl %eax, 0x8(%rsp)
imull $0xa, (%r13), %edi
addl $0x32, %edi
xorl %eax, %eax
callq 0xc004
movl %eax, %ebp
imull $0xa, (%r13), %edi
addl $0x32, %edi
xorl %eax, %eax
callq 0xc004
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 0x20062(%rip), %r12     # 0x29f38
movq (%r12), %rdi
movl 0x10(%r15), %edx
movl 0x14(%r15), %esi
callq 0x6470
cmpl $-0x1, %eax
je 0x9ef8
movq (%r12), %rdi
pushq $0x2a
popq %rsi
callq 0x64a0
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x12f50
testl %eax, %eax
jne 0x9f41
leaq 0x23d42(%rip), %r12     # 0x2dc50
leaq 0x50(%r12), %rdi
callq 0xe29f
leaq 0x26ab1(%rip), %r15     # 0x309d0
movq (%r15), %rdi
movl 0x50(%r12), %edx
movl 0x54(%r12), %esi
callq 0x6470
cmpl $-0x1, %eax
je 0x9f41
movq (%r15), %rdi
pushq $0x40
popq %rsi
callq 0x64a0
movq 0x68(%r14), %r15
leaq 0x10(%rsp), %r14
movq %r15, (%r14)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xa93f
testq %r15, %r15
je 0x9f85
movq (%r15), %rbx
movq 0x10(%r15), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0xb7f4
movq %r15, %rdi
xorl %esi, %esi
callq 0x1ae63
movq %rbx, %r15
jmp 0x9f58
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq