// File: /workspace/github_c_makefile_star2_O1/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
jne 0x1b496
movq 0xeb01(%rip), %rbx      # 0x29f30
movq (%rbx), %rdi
leaq 0x12827(%rip), %rax     # 0x2dc60
movl 0x50(%rax), %edx
movl 0x54(%rax), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0x1b455
movq (%rbx), %rdi
callq 0x6330
movl %eax, %ebp
jmp 0x1b458
movb $-0x1, %bpl
cmpb $0x2e, %bpl
ja 0x1b607
movzbl %bpl, %eax
movabsq $0x400c00000000, %rcx   # imm = 0x400C00000000
btq %rax, %rcx
jae 0x1b607
leaq 0x80fc(%rip), %rdi      # 0x2357d
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x10881
movq %rax, %r12
testq %rax, %rax
je 0x1b5f6
movq 0x10(%r12), %r15
movq %r15, %rdi
callq 0x1b623
movb $0x1, %bl
testb %al, %al
je 0x1b5f6
cmpl $0x2, 0x24(%r15)
jl 0x1b4bb
cmpl $0x29, 0x20(%r15)
jne 0x1b4d0
leaq 0x1279e(%rip), %rdi     # 0x2dc60
addq $0x68, %rdi
movq %r12, %rsi
callq 0xbe00
jmp 0x1b518
movl $0x50, %edi
callq 0xbeb3
movq %rax, %r13
decl 0x24(%r15)
movq %r15, %rdi
callq 0x9804
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 0x9804
movl %eax, 0x44(%r15)
movq %r13, %r12
cmpb $0x22, %bpl
jne 0x1b54d
movq %r15, %rdi
movl $0x1, %esi
callq 0x1aaa4
leaq 0x8050(%rip), %rdi      # 0x23582
leaq 0x12957(%rip), %rsi     # 0x2de90
xorl %eax, %eax
callq 0xb6e0
movq %r12, %rdi
callq 0xbe93
jmp 0x1b5ef
leaq 0x12310(%rip), %rax     # 0x2d864
cmpl $0x1, (%rax)
jne 0x1b586
leaq 0x12700(%rip), %rax     # 0x2dc60
movq 0x50(%rax), %rax
movq %rax, (%r15)
movq %r12, %rdi
xorl %esi, %esi
callq 0x1cacd
testq %r14, %r14
jne 0x1b5ef
leaq 0x801c(%rip), %rdi      # 0x23599
xorl %eax, %eax
callq 0xb6e0
jmp 0x1b5ef
leaq 0x122bb(%rip), %rdi     # 0x2d848
movq %r12, %rsi
callq 0xbe2d
movq 0xe994(%rip), %r12      # 0x29f30
movq (%r12), %rdi
leaq 0x126b9(%rip), %r14     # 0x2dc60
movl 0x50(%r14), %edx
movl 0x54(%r14), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0x1b5c6
movq (%r12), %rdi
movl 0x20(%r15), %esi
callq 0x64c0
movq 0x50(%r14), %rax
movq %rax, (%r15)
movq %r15, %rdi
movl $0x1, %esi
callq 0x1aaa4
leaq 0x7fed(%rip), %rdi      # 0x235ce
leaq 0x128a8(%rip), %rsi     # 0x2de90
xorl %eax, %eax
callq 0xb6e0
xorl %eax, %eax
callq 0x95e0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7f4d(%rip), %rdi      # 0x2355b
xorl %eax, %eax
callq 0xb6e0
leaq 0xecf1(%rip), %rax      # 0x2a30d
movb $0x0, (%rax)
movb $0x1, %bl
jmp 0x1b5f6