// File: /workspace/github_c_makefile_star2_O3/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 0x23840(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
movq 0x10(%rdi), %r14
movq 0x50(%r14), %rax
movq %rax, (%rsp)
testl %esi, %esi
je 0xa0c6
leaq 0x15a9e(%rip), %rdi     # 0x1fb1b
xorl %eax, %eax
callq 0xb737
movl $0x1, %edi
callq 0x9513
testb %al, %al
je 0xa0a2
leaq 0x1932b(%rip), %rdi     # 0x233c4
xorl %eax, %eax
callq 0xb620
jmp 0xa0c6
movslq 0x80(%r14), %rax
imulq $0x70, %rax, %rax
leaq 0x2030c(%rip), %rcx     # 0x2a3c0
movq (%rcx,%rax), %rsi
leaq 0x15855(%rip), %rdi     # 0x1f914
xorl %eax, %eax
callq 0xb620
movq 0x20(%r14), %rax
leaq 0x23c8f(%rip), %rcx     # 0x2dd60
movq (%rcx), %rcx
addq %rax, 0x20(%rcx)
leaq 0x237b9(%rip), %rax     # 0x2d898
movb $0x0, (%rax)
callq 0xaea5
movsbl 0x8d(%r14), %edi
callq 0xdca2
cmpb $0x4c, 0x8d(%r14)
jne 0xa29d
movq %rsp, %rdi
callq 0x701c
testq %rax, %rax
je 0xa29d
movq %rax, %r15
cmpl $0x0, 0x58(%rax)
jne 0xa135
movq %r15, %rsi
addq $0x10, %rsi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x1cb16
testb %al, %al
je 0xa29d
leaq 0x201b4(%rip), %r13     # 0x2a2f0
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc674
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 0x11fbc
addl %ebp, %eax
movl $0x11, %ebp
subl %eax, %ebp
movl $0x1, %edi
movl $0x14, %esi
callq 0xc695
cmpl %ebp, %eax
jge 0xa225
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc674
movl %eax, 0xc(%rsp)
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc674
movl %eax, %r12d
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc674
movl %eax, 0x8(%rsp)
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc674
movl %eax, %ebp
movl (%r13), %eax
leal (%rax,%rax,4), %eax
leal 0x32(,%rax,2), %edi
xorl %eax, %eax
callq 0xc674
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 0x1fd04(%rip), %r12     # 0x29f30
movq (%r12), %rdi
movl 0x10(%r15), %edx
movl 0x14(%r15), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0xa250
movq (%r12), %rdi
movl $0x2a, %esi
callq 0x64c0
movl $0x1, %esi
movq %r15, %rdi
callq 0x13d18
testl %eax, %eax
jne 0xa29d
leaq 0x239f8(%rip), %r12     # 0x2dc60
leaq 0x50(%r12), %rdi
callq 0xeba8
leaq 0x26767(%rip), %r15     # 0x309e0
movq (%r15), %rdi
movl 0x50(%r12), %edx
movl 0x54(%r12), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0xa29d
movq (%r15), %rdi
movl $0x40, %esi
callq 0x64c0
movq 0x68(%r14), %r14
movq %r14, 0x10(%rsp)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xadd9
testq %r14, %r14
je 0xa2e6
leaq 0x10(%rsp), %rbx
movq (%r14), %r15
movq 0x10(%r14), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbd4c
movq %r14, %rdi
xorl %esi, %esi
callq 0x1c9f8
movq %r15, %r14
testq %r15, %r15
jne 0xa2bb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq