// File: /workspace/github_c_makefile_star2_O1/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 0x266ec(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x437ea
jnp 0x4399c
movq %rdi, %rbx
movq 0x58(%rdi), %r14
movq 0x730(%r14), %r12
testq %r12, %r12
je 0x4399c
movslq 0xe38(%r14), %rax
cmpl $0x0, 0x318(%r14,%rax,4)
je 0x4382f
movq 0x50(%r12), %rdi
leaq 0x13f24(%rip), %rsi     # 0x57743
callq 0x18b20
xorl %r15d, %r15d
testl %eax, %eax
cmovneq %r12, %r15
jmp 0x43832
xorl %r15d, %r15d
testq %r15, %r15
je 0x43851
movq 0x50(%r15), %rdi
leaq 0x10f85(%rip), %rsi     # 0x547c7
callq 0x18b20
xorl %esi, %esi
testl %eax, %eax
cmovneq %r15, %rsi
jmp 0x43853
xorl %esi, %esi
movq 0x25dbe(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xe, %eax
jb 0x4386c
xorl %ebp, %ebp
jmp 0x4388f
movss 0xf04(%r14), %xmm0
movq 0x26524(%rip), %rax     # 0x69da0
movl (%rax), %eax
addl $0xa, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
seta %bpl
testb $0x1, %bpl
jne 0x4389a
xorps %xmm1, %xmm1
jmp 0x438a2
movss 0x16caa(%rip), %xmm1    # 0x5a54c
testq %rsi, %rsi
jne 0x438aa
xorps %xmm1, %xmm1
movss %xmm1, 0xc(%rsp)
je 0x438f8
movss 0xec0(%r14), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xec0(%r14)
movq %rbx, %rdi
callq 0x18460
movss 0xc(%rsp), %xmm1
movq 0x58(%rbx), %rcx
movss 0xec0(%rcx), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xec0(%rcx)
movl $0x20000, 0x140(%rax)   # imm = 0x20000
testb %bpl, %bpl
je 0x4399c
movq 0x58(%rbx), %rax
movss 0xec0(%rax), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xec0(%rax)
leaq 0x10660(%rip), %rdi     # 0x53f80
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 0x25f28(%rip), %rdx     # 0x69880
movq %rdx, 0x220(%rax)
movq 0x2643a(%rip), %rdx     # 0x69da0
movss 0xf04(%rcx), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl (%rdx), %xmm1
subss %xmm1, %xmm0
mulss 0x1090f(%rip), %xmm0    # 0x54290
addss 0x4(%rdx), %xmm0
movss %xmm0, 0x200(%rax)
movq 0x25a9b(%rip), %rcx     # 0x69430
movq %rcx, 0x210(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq