// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x23cd0
movq 0xf392(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
leaq 0x13498(%rip), %rax     # 0x370d0
movl 0x54(%rax), %esi
leaq 0x1348e(%rip), %rax     # 0x370d0
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x23c59
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x34(%rbp)
jmp 0x23c6b
movq 0xf360(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
callq 0x6340
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x2e, %eax
je 0x23cad
movsbl -0x11(%rbp), %eax
cmpl $0x23, %eax
je 0x23cad
movsbl -0x11(%rbp), %eax
cmpl $0x22, %eax
je 0x23cad
leaq 0xa07a(%rip), %rdi      # 0x2dd0d
movb $0x0, %al
callq 0xd8f0
leaq 0xf66c(%rip), %rax      # 0x3330d
movb $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x23ea3
leaq 0xa07b(%rip), %rdi      # 0x2dd2f
xorl %esi, %esi
callq 0x14b90
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x23cce
movb $0x0, -0x1(%rbp)
jmp 0x23ea3
jmp 0x23cd8
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x23eb0
testb $0x1, %al
jne 0x23cfa
movb $0x1, -0x1(%rbp)
jmp 0x23ea3
movq -0x30(%rbp), %rax
cmpl $0x2, 0x24(%rax)
jl 0x23d88
movq -0x30(%rbp), %rax
cmpl $0x29, 0x20(%rax)
je 0x23d88
movl $0x50, %edi
callq 0xe4d0
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x24(%rax)
movq -0x30(%rbp), %rdi
callq 0xae90
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x50, %edx
callq 0x62c0
movq -0x30(%rbp), %rax
movl $0x1, 0x24(%rax)
movq -0x30(%rbp), %rdi
callq 0xae90
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x23d9c
movq -0x20(%rbp), %rsi
leaq 0x1333d(%rip), %rdi     # 0x370d0
addq $0x68, %rdi
callq 0xe360
movsbl -0x11(%rbp), %eax
cmpl $0x22, %eax
jne 0x23dd2
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x23060
movq %rax, %rsi
leaq 0x9f77(%rip), %rdi      # 0x2dd34
movb $0x0, %al
callq 0xd8f0
movq -0x20(%rbp), %rdi
callq 0xe490
jmp 0x23e98
leaq 0x12efb(%rip), %rax     # 0x36cd4
cmpl $0x1, (%rax)
jne 0x23e15
movq -0x30(%rbp), %rax
leaq 0x132e7(%rip), %rcx     # 0x370d0
movq 0x50(%rcx), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x25c30
cmpq $0x0, -0x10(%rbp)
jne 0x23e10
leaq 0x9f42(%rip), %rdi      # 0x2dd4b
movb $0x0, %al
callq 0xd8f0
jmp 0x23e96
movq -0x20(%rbp), %rsi
leaq 0x12e98(%rip), %rdi     # 0x36cb8
callq 0xe3e0
movq 0xf194(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
leaq 0x1329a(%rip), %rax     # 0x370d0
movl 0x54(%rax), %esi
leaq 0x13290(%rip), %rax     # 0x370d0
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x23e4f
jmp 0x23e65
movq 0xf16a(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x64c0
movq -0x30(%rbp), %rax
leaq 0x13260(%rip), %rcx     # 0x370d0
movq 0x50(%rcx), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x23060
movq %rax, %rsi
leaq 0x9ef1(%rip), %rdi      # 0x2dd80
movb $0x0, %al
callq 0xd8f0
jmp 0x23e98
movb $0x0, %al
callq 0xaba0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop