// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/weapons.c
// Function: missile
int missile(int ydelta,int xdelta)
{
	struct object *obj, *nowwield;
	struct linked_list *item, *nitem;

	/*
	 * Get which thing we are hurling
	 */
	nowwield = cur_weapon;		/* must save current weap */
	if ((item = get_item("throw", WEAPON)) == NULL)
		return 0;
	obj = OBJPTR(item);
	if (!dropcheck(obj) || is_current(obj))
		return 0;
	if (obj == nowwield || obj->o_type != WEAPON) {
		int c;

		msg("Do you want to throw that %s? (y or n)",obj->o_typname);
		do {
			c = readchar();
			if (isupper(c))
				c = tolower(c);
			if (c == ESCAPE || c == 'n') {
				msg("");
				cur_weapon = nowwield;
				after = FALSE;		/* ooops, a mistake */
				return 0;
			}
		} while (c != 'y');	/* keep looking for good ans */
	}
	/*
	 * Get rid of the thing.  If it is a non-multiple item object, or
	 * if it is the last thing, just drop it.  Otherwise, create a new
	 * item with a count of one.
	 */
	if (obj->o_count < 2) {
		detach(pack, item);
	}
	else {
		obj->o_count--;
		obj->o_vol = itemvol(obj);
		nitem = new_item(sizeof *obj);
		obj = OBJPTR(nitem);
		*obj = *(OBJPTR(item));
		obj->o_count = 1;
		obj->o_vol = itemvol(obj);
		item = nitem;
	}
	updpack();						/* new pack weight */
	do_motion(obj, ydelta, xdelta);
	if (!isalpha(mvwinch(mw, obj->o_pos.y, obj->o_pos.x))
	  || !hit_monster(&obj->o_pos, obj))
		fall(item, TRUE);
	mvwaddch(cw, hero.y, hero.x, PLAYER);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0x1154b(%rip), %rax     # 0x36cc0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
leaq 0x89a1(%rip), %rdi      # 0x2e124
movl $0x29, %esi
callq 0x14b90
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x257a3
movl $0x0, -0x4(%rbp)
jmp 0x259f0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x23eb0
testb $0x1, %al
jne 0x257be
jmp 0x257cd
movq -0x18(%rbp), %rdi
callq 0xffc0
testb $0x1, %al
jne 0x257cd
jmp 0x257d9
movl $0x0, -0x4(%rbp)
jmp 0x259f0
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x257f1
movq -0x18(%rbp), %rax
cmpl $0x29, 0x20(%rax)
je 0x25881
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
leaq 0x892a(%rip), %rdi      # 0x2e12a
movb $0x0, %al
callq 0xd8f0
movb $0x0, %al
callq 0xdce0
movsbl %al, %eax
movl %eax, -0x34(%rbp)
callq 0x65b0
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x25839
movl -0x34(%rbp), %edi
callq 0x6320
movl %eax, -0x34(%rbp)
cmpl $0x1b, -0x34(%rbp)
je 0x25845
cmpl $0x6e, -0x34(%rbp)
jne 0x25877
leaq 0x8a63(%rip), %rdi      # 0x2e2af
movb $0x0, %al
callq 0xd8f0
movq -0x20(%rbp), %rcx
leaq 0x11462(%rip), %rax     # 0x36cc0
movq %rcx, (%rax)
leaq 0xdaa5(%rip), %rax      # 0x3330d
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x259f0
jmp 0x25879
cmpl $0x79, -0x34(%rbp)
jne 0x25807
jmp 0x25881
movq -0x18(%rbp), %rax
cmpl $0x2, 0x24(%rax)
jge 0x258a1
movq -0x28(%rbp), %rsi
leaq 0x1183a(%rip), %rdi     # 0x370d0
addq $0x68, %rdi
callq 0xe360
jmp 0x25915
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x24(%rax)
movq -0x18(%rbp), %rdi
callq 0xae90
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x44(%rax)
movl $0x50, %edi
callq 0xe4d0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x50, %edx
callq 0x62c0
movq -0x18(%rbp), %rax
movl $0x1, 0x24(%rax)
movq -0x18(%rbp), %rdi
callq 0xae90
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movb $0x0, %al
callq 0xaba0
movq -0x18(%rbp), %rdi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x25a00
callq 0x65b0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
leaq 0x14522(%rip), %rax     # 0x39e60
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x25962
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x44(%rbp)
jmp 0x25974
leaq 0x144f7(%rip), %rax     # 0x39e60
movq (%rax), %rdi
callq 0x6340
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movl -0x44(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2599d
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x25c00
testb $0x1, %al
jne 0x259ab
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x25c30
leaq 0x1449e(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x11714(%rip), %rax     # 0x370d0
movl 0x54(%rax), %esi
leaq 0x1170a(%rip), %rax     # 0x370d0
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x259d5
jmp 0x259e9
leaq 0x14474(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl $0x40, %esi
callq 0x64c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)