// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/things.c
// Function: drop
bool drop(struct linked_list *item)
{
	char ch;
	struct linked_list *ll, *nll;
	struct object *op;

	if (item == NULL) {
		ch = mvinch(hero.y, hero.x);
		if (ch != FLOOR && ch != PASSAGE && ch != POOL) {
			msg("There is something there already.");
			after = FALSE;
			return SOMTHERE;
		}
		if ((ll = get_item("drop", 0)) == NULL)
			return FALSE;
	}
	else {
		ll = item;
	}
	op = OBJPTR(ll);
	if (!dropcheck(op))
		return CANTDROP;
	/*
	 * Take it out of the pack
	 */
	if (op->o_count >= 2 && op->o_type != WEAPON) {
		nll = new_item(sizeof *op);
		op->o_count--;
		op->o_vol = itemvol(op);
		op = OBJPTR(nll);
		*op = *(OBJPTR(ll));
		op->o_count = 1;
		op->o_vol = itemvol(op);
		ll = nll;
	}
	else {
		detach(pack, ll);
	}
	if (ch == POOL) {
		msg("%s sinks out of sight.",inv_name(op, TRUE));
		discard(ll);
	}
	else {			/* put on dungeon floor */
		if (levtype == POSTLEV) {
			op->o_pos = hero;	/* same place as hero */
			fall(ll,FALSE);
			if (item == NULL)	/* if item wasn't sold */
				msg("Thanks for your donation to the Fiend's flea market.");
		}
		else {
			attach(lvl_obj, ll);
			mvaddch(hero.y, hero.x, op->o_type);
			op->o_pos = hero;
			msg("Dropped %s", inv_name(op, TRUE));
		}
	}
	updpack();			/* new pack weight */
	return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq %rdi, %r12
testq %rdi, %rdi
je 0x1b392
movq 0x10(%r12), %r15
movq %r15, %rdi
callq 0x1b54e
movb $0x1, %bl
testb %al, %al
je 0x1b53d
cmpl $0x2, 0x24(%r15)
jl 0x1b37a
cmpl $0x29, 0x20(%r15)
jne 0x1b417
leaq 0x128df(%rip), %rdi     # 0x2dc60
addq $0x68, %rdi
movq %r12, %rsi
callq 0xbd4c
jmp 0x1b45f
movq 0xeb97(%rip), %rbx      # 0x29f30
movq (%rbx), %rdi
leaq 0x128bd(%rip), %rax     # 0x2dc60
movl 0x50(%rax), %edx
movl 0x54(%rax), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0x1b3f8
movq (%rbx), %rdi
callq 0x6330
movl %eax, %ebp
cmpb $0x2e, %bpl
ja 0x1b3f8
movzbl %bpl, %eax
movabsq $0x400c00000000, %rcx   # imm = 0x400C00000000
btq %rax, %rcx
jae 0x1b3f8
leaq 0x8217(%rip), %rdi      # 0x235f5
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x10749
movq %rax, %r12
testq %rax, %rax
jne 0x1b351
jmp 0x1b53d
leaq 0x81d4(%rip), %rdi      # 0x235d3
xorl %eax, %eax
callq 0xb620
leaq 0xef00(%rip), %rax      # 0x2a30d
movb $0x0, (%rax)
movb $0x1, %bl
jmp 0x1b53d
movl $0x50, %edi
callq 0xbdfa
movq %rax, %r13
decl 0x24(%r15)
movq %r15, %rdi
callq 0x978c
movl %eax, 0x44(%r15)
movq 0x10(%r13), %r15
movq 0x10(%r12), %rsi
movl $0xa, %ecx
movq %r15, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0x1, 0x24(%r15)
movq %r15, %rdi
callq 0x978c
movl %eax, 0x44(%r15)
movq %r13, %r12
cmpb $0x22, %bpl
jne 0x1b494
movq %r15, %rdi
movl $0x1, %esi
callq 0x1aa04
leaq 0x8181(%rip), %rdi      # 0x235fa
leaq 0x12a10(%rip), %rsi     # 0x2de90
xorl %eax, %eax
callq 0xb620
movq %r12, %rdi
callq 0xbdda
jmp 0x1b536
leaq 0x123c9(%rip), %rax     # 0x2d864
cmpl $0x1, (%rax)
jne 0x1b4cd
leaq 0x127b9(%rip), %rax     # 0x2dc60
movq 0x50(%rax), %rax
movq %rax, (%r15)
movq %r12, %rdi
xorl %esi, %esi
callq 0x1c9f8
testq %r14, %r14
jne 0x1b536
leaq 0x814d(%rip), %rdi      # 0x23611
xorl %eax, %eax
callq 0xb620
jmp 0x1b536
leaq 0x12374(%rip), %rdi     # 0x2d848
movq %r12, %rsi
callq 0xbd73
movq 0xea4d(%rip), %r12      # 0x29f30
movq (%r12), %rdi
leaq 0x12772(%rip), %r14     # 0x2dc60
movl 0x50(%r14), %edx
movl 0x54(%r14), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0x1b50d
movq (%r12), %rdi
movl 0x20(%r15), %esi
callq 0x64c0
movq 0x50(%r14), %rax
movq %rax, (%r15)
movq %r15, %rdi
movl $0x1, %esi
callq 0x1aa04
leaq 0x811e(%rip), %rdi      # 0x23646
leaq 0x12961(%rip), %rsi     # 0x2de90
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
callq 0x9560
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq