// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: TossClientWeapon
void TossClientWeapon (edict_t *self)
{
	gitem_t		*item;
	edict_t		*drop;
	qboolean	quad;
	float		spread;

	if (!deathmatch->value)
		return;

	item = self->client->pers.weapon;
	if (!item)
		return;
	if (! self->client->pers.inventory[self->client->ammo_index] )
		item = NULL;
	if (item && (strcmp (item->pickup_name, "Blaster") == 0))
		item = NULL;
	
	// CTF CODE -- LM_JORM
	if (item && !strcmp (item->pickup_name, "Grappling Hook"))
		item = NULL;
	// END CTF CODE -- LM_JORM
	if (!((int)(dmflags->value) & DF_QUAD_DROP))
		quad = false;
	else
		quad = (self->client->quad_framenum > (level.framenum + 10));

	if (item && quad)
		spread = 22.5;
	else
		spread = 0.0;

	if (item)
	{
		self->client->v_angle[YAW] -= spread;
		drop = Drop_Item (self, item);
		self->client->v_angle[YAW] += spread;
		drop->spawnflags = DROPPED_PLAYER_ITEM;
	}

	if (quad)
	{
		self->client->v_angle[YAW] += spread;
		drop = Drop_Item (self, FindItemByClassname ("item_quad"));
		self->client->v_angle[YAW] -= spread;
		drop->spawnflags |= DROPPED_PLAYER_ITEM;
		drop->touch = Touch_Item;
		drop->nextthink = level.time + (self->client->quad_framenum - level.framenum) * FRAMETIME;
		drop->think = G_FreeEdict;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x27966(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3f570
jnp 0x3f71b
movq %rdi, %rbx
movq 0x58(%rdi), %r12
movq 0x730(%r12), %r14
testq %r14, %r14
je 0x3f71b
movslq 0xe38(%r12), %rax
cmpl $0x0, 0x318(%r12,%rax,4)
je 0x3f5cb
movq 0x50(%r14), %r15
leaq 0x13271(%rip), %rsi     # 0x52817
movq %r15, %rdi
callq 0x18bc0
testl %eax, %eax
je 0x3f5cb
leaq 0x1023e(%rip), %rsi     # 0x4f7f7
movq %r15, %rdi
callq 0x18bc0
xorl %ecx, %ecx
testl %eax, %eax
cmoveq %rcx, %r14
jmp 0x3f5ce
xorl %r14d, %r14d
movq 0x27043(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xe, %eax
jb 0x3f5e7
xorl %ebp, %ebp
jmp 0x3f608
movss 0xf04(%r12), %xmm0
movq 0x277a8(%rip), %rax     # 0x66da0
movl (%rax), %eax
addl $0xa, %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
seta %bpl
testb $0x1, %bpl
jne 0x3f613
xorps %xmm1, %xmm1
jmp 0x3f61b
movss 0x16159(%rip), %xmm1    # 0x55774
testq %r14, %r14
jne 0x3f623
xorps %xmm1, %xmm1
movss %xmm1, 0xc(%rsp)
je 0x3f67a
movss 0xec0(%r12), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xec0(%r12)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18490
movss 0xc(%rsp), %xmm1
movq 0x58(%rbx), %r12
movss 0xec0(%r12), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xec0(%r12)
movl $0x20000, 0x140(%rax)   # imm = 0x20000
testb %bpl, %bpl
je 0x3f71b
movss 0xec0(%r12), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xec0(%r12)
leaq 0xf8de(%rip), %rdi      # 0x4ef80
callq 0x18180
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18490
movq 0x58(%rbx), %rcx
movss 0xec0(%rcx), %xmm0
subss 0xc(%rsp), %xmm0
movss %xmm0, 0xec0(%rcx)
orb $0x2, 0x142(%rax)
movq 0x271a6(%rip), %rdx     # 0x66880
movq %rdx, 0x220(%rax)
movq 0x276b8(%rip), %rdx     # 0x66da0
movss 0xf04(%rcx), %xmm0
cvtsi2ssl (%rdx), %xmm1
subss %xmm1, %xmm0
mulss 0xfb90(%rip), %xmm0     # 0x4f290
addss 0x4(%rdx), %xmm0
movss %xmm0, 0x200(%rax)
movq 0x26d1c(%rip), %rcx     # 0x66430
movq %rcx, 0x210(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq