// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Drop_f
void Cmd_Drop_f (edict_t *ent)
{
	int			index;
	gitem_t		*it;
	char		*s;

	char message[MAX_INFO_STRING];

	s = gi.args();
	it = 0;

	//assert(false);

	if (!s || s[0] == 0)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Drop what?\n");
		return;
	}

	// CTF CODE -- LM_JORM
	if (Q_stricmp(s, "hook") == 0)
		s = "grappling hook";
	if (Q_stricmp(s, "flag") == 0)
		s = "Enemy Flag";

	if ((Q_stricmp(s, "rune") == 0) ||
		(Q_stricmp(s, "artifact") == 0) ||
		(Q_stricmp(s, "tech") == 0))
	{
		if (ent->client->rune)
		{
			it = ent->client->rune->item;
			if (it)  // We are carrying a rune
			{
				index = ITEM_INDEX(it);
				if (it->drop)
					it->drop (ent, it);
				else
				{
					sprintf(message, "Can't drop %s\n", s);
					ctf_SafePrint(ent, PRINT_HIGH, message);
				}
			}
		}
		return;
	}

	if (Q_stricmp(s, "ammo") == 0)
	{
		if (ent->client->pers.weapon->ammo)
			it =  FindItem (ent->client->pers.weapon->ammo);
	}

	// END CTF CODE -- LM_JORM

	if (!it)
		it = FindItem (s);
	if (!it)
	{
		sprintf(message, "unknown item: %s\n", s);
		ctf_SafePrint(ent, PRINT_HIGH, message);
		return;
	}
	if (!it->drop)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Item is not dropable.\n");
		return;
	}
	index = ITEM_INDEX(it);
	if (!ent->client->pers.inventory[index])
	{
		sprintf(message, "Out of item: %s\n", s);
		ctf_SafePrint(ent, PRINT_HIGH, message);
		return;
	}

	it->drop (ent, it);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq 0x557da(%rip), %rax     # 0x82600
callq *0x148(%rax)
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2ce4b
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2ce65
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x448b1(%rip), %rdx     # 0x7170c
callq 0x18f20
jmp 0x2d0bc
movq -0x20(%rbp), %rdi
leaq 0x4a0cd(%rip), %rsi     # 0x76f3d
callq 0x186f0
cmpl $0x0, %eax
jne 0x2ce85
leaq 0x4a0b2(%rip), %rax     # 0x76f33
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x4ac8b(%rip), %rsi     # 0x77b1b
callq 0x186f0
cmpl $0x0, %eax
jne 0x2cea5
leaq 0x44828(%rip), %rax     # 0x716c9
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x4348f(%rip), %rsi     # 0x7033f
callq 0x186f0
cmpl $0x0, %eax
je 0x2cee8
movq -0x20(%rbp), %rdi
leaq 0x4332a(%rip), %rsi     # 0x701ef
callq 0x186f0
cmpl $0x0, %eax
je 0x2cee8
movq -0x20(%rbp), %rdi
leaq 0x4483e(%rip), %rsi     # 0x71718
callq 0x186f0
cmpl $0x0, %eax
jne 0x2cf90
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0xf68(%rax)
je 0x2cf8b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf68(%rax), %rax
movq 0x330(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2cf89
movq -0x18(%rbp), %rax
movq 0x55f16(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2cf59
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
jmp 0x2cf87
leaq -0x220(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x447b2(%rip), %rsi     # 0x7171d
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
jmp 0x2cf89
jmp 0x2cf8b
jmp 0x2d0bc
movq -0x20(%rbp), %rdi
leaq 0x44692(%rip), %rsi     # 0x7162d
callq 0x186f0
cmpl $0x0, %eax
jne 0x2cfd9
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x730(%rax), %rax
cmpq $0x0, 0x60(%rax)
je 0x2cfd7
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x730(%rax), %rax
movq 0x60(%rax), %rdi
callq 0x18a90
movq %rax, -0x18(%rbp)
jmp 0x2cfd9
cmpq $0x0, -0x18(%rbp)
jne 0x2cfed
movq -0x20(%rbp), %rdi
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2d027
leaq -0x220(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x446ce(%rip), %rsi     # 0x716d4
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
jmp 0x2d0bc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2d049
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x446ea(%rip), %rdx     # 0x7172c
callq 0x18f20
jmp 0x2d0bc
movq -0x18(%rbp), %rax
movq 0x55dec(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x0, 0x318(%rax,%rcx,4)
jne 0x2d0aa
leaq -0x220(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x4466f(%rip), %rsi     # 0x716fb
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
jmp 0x2d0bc
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)