// File: /workspace/github_c_makefile_star2_O3/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 0x2616c(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x42d6a
jnp 0x42f1b
movq %rdi, %rbx
movq 0x58(%rdi), %r12
movq 0x730(%r12), %r14
testq %r14, %r14
je 0x42f1b
movslq 0xe38(%r12), %rax
cmpl $0x0, 0x318(%r12,%rax,4)
je 0x42dc5
movq 0x50(%r14), %r15
leaq 0x13a97(%rip), %rsi     # 0x56837
movq %r15, %rdi
callq 0x18b20
testl %eax, %eax
je 0x42dc5
leaq 0x10a44(%rip), %rsi     # 0x537f7
movq %r15, %rdi
callq 0x18b20
xorl %ecx, %ecx
testl %eax, %eax
cmoveq %rcx, %r14
jmp 0x42dc8
xorl %r14d, %r14d
movq 0x25849(%rip), %rax     # 0x68618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xe, %eax
jb 0x42de1
xorl %ebp, %ebp
jmp 0x42e05
movss 0xf04(%r12), %xmm0
movq 0x25fae(%rip), %rax     # 0x68da0
movl (%rax), %eax
addl $0xa, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
seta %bpl
testb $0x1, %bpl
jne 0x42e10
xorps %xmm1, %xmm1
jmp 0x42e18
movss 0x16974(%rip), %xmm1    # 0x5978c
testq %r14, %r14
jne 0x42e20
xorps %xmm1, %xmm1
movss %xmm1, 0xc(%rsp)
je 0x42e77
movss 0xec0(%r12), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xec0(%r12)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18460
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 0x42f1b
movss 0xec0(%r12), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xec0(%r12)
leaq 0x100e1(%rip), %rdi     # 0x52f80
callq 0x18170
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18460
movq 0x58(%rbx), %rcx
movss 0xec0(%rcx), %xmm0
subss 0xc(%rsp), %xmm0
movss %xmm0, 0xec0(%rcx)
orb $0x2, 0x142(%rax)
movq 0x259a9(%rip), %rdx     # 0x68880
movq %rdx, 0x220(%rax)
movq 0x25ebb(%rip), %rdx     # 0x68da0
movss 0xf04(%rcx), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl (%rdx), %xmm1
subss %xmm1, %xmm0
mulss 0x10390(%rip), %xmm0    # 0x53290
addss 0x4(%rdx), %xmm0
movss %xmm0, 0x200(%rax)
movq 0x2551c(%rip), %rcx     # 0x68430
movq %rcx, 0x210(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq