// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: ClientEndServerFrame
void ClientEndServerFrame (edict_t *ent)
{
	float	bobtime;
	int		i;

	current_player = ent;
	current_client = ent->client;
	
	// Paril
	if (!GamePaused())
	{
	// Paril
		if (ent->client->hookstate) // We are still grappled
		{
			Weapon_Hook_Fire(ent);
		}

		//
		// If the origin or velocity have changed since ClientThink(),
		// update the pmove values.  This will happen when the client
		// is pushed by a bmodel or kicked by an explosion.
		// 
		// If it wasn't updated here, the view position would lag a frame
		// behind the body position when pushed -- "sinking into plats"
		//
		for (i=0 ; i<3 ; i++)
		{
			current_client->ps.pmove.origin[i] = ent->s.origin[i]*8.0;
			current_client->ps.pmove.velocity[i] = ent->velocity[i]*8.0;
		}

		//
		// If the end of unit layout is displayed, don't give
		// the player any normal movement attributes
		//
		if (level.intermissiontime)
		{
			// FIXME: add view drifting here?
			current_client->ps.blend[3] = 0;
			current_client->ps.fov = 90;
			G_SetStats (ent);
			return;
		}

		AngleVectors (ent->client->v_angle, forward, right, up);

		// burn from lava, etc
		P_WorldEffects ();

		//
		// set model angles from view angles so other things in
		// the world can tell which direction you are looking
		//
		if (ent->client->v_angle[PITCH] > 180)
			ent->s.angles[PITCH] = (-360 + ent->client->v_angle[PITCH])/3;
		else
			ent->s.angles[PITCH] = ent->client->v_angle[PITCH]/3;
		ent->s.angles[YAW] = ent->client->v_angle[YAW];
		ent->s.angles[ROLL] = 0;
		ent->s.angles[ROLL] = SV_CalcRoll (ent->s.angles, ent->velocity)*4;

		//
		// calculate speed and cycle to be used for
		// all cyclic walking effects
		//
		xyspeed = sqrtf(ent->velocity[0]*ent->velocity[0] + ent->velocity[1]*ent->velocity[1]);

		if (xyspeed < 5)
		{
			bobmove = 0;
			current_client->bobtime = 0;	// start at beginning of cycle again
		}
		else if (ent->groundentity)
		{	// so bobbing only cycles when on ground
			if (xyspeed > 210)
				bobmove = 0.25;
			else if (xyspeed > 100)
				bobmove = 0.125;
			else
				bobmove = 0.0625;
		}
	
		bobtime = (current_client->bobtime += bobmove);

		if (current_client->ps.pmove.pm_flags & PMF_DUCKED)
			bobtime *= 4;

		bobcycle = (int)bobtime;
		bobfracsin = fabs(sin(bobtime*M_PI));

		// detect hitting the floor
		P_FallingDamage (ent);

		// apply all the damage taken this frame
		P_DamageFeedback (ent);

		// determine the view offsets
		SV_CalcViewOffset (ent);

		// determine the gun offsets
		SV_CalcGunOffset (ent);

		// determine the full screen color blend
		// must be after viewoffset, so eye contents can be
		// accurately determined
		// FIXME: with client prediction, the contents
		// should be determined by the client
		SV_CalcBlend (ent);
	// Paril
	}
	// Paril

	// chase cam stuff
	if (ent->client->resp.spectator)
		G_SetSpectatorStats(ent);
	else
		G_SetStats (ent);

	G_CheckChaseStats(ent);
	
	// Paril
	if (!GamePaused())
	{
	// Paril
		G_SetClientEvent (ent);

		G_SetClientEffects (ent);

		G_SetClientSound (ent);

		G_SetClientFrame (ent);

		VectorCopy (ent->velocity, ent->client->oldvelocity);
		VectorCopy (ent->client->ps.viewangles, ent->client->oldviewangles);

		// clear weapon kicks
		VectorClear (ent->client->kick_origin);
		VectorClear (ent->client->kick_angles);
	// Paril
	}
	// Paril
	
	if (ent->client->showscores &&  deathmatch->value)
	{
		if (!(level.framenum & 31) )
		{
			DeathmatchScoreboardMessage (ent, ent->enemy);
			gi.unicast (ent, false);
		}
	}
// ADC
	else if (ent->client->showsquadboard && deathmatch->value)
	{
		if (!(level.framenum & 31) )
		{
			SquadboardMessage (ent, ent->enemy);
			gi.unicast (ent, false);
		}
	}
// ADC
	else if (ent->client->showmod)
	{
		if (!(level.framenum & 7))
			ClientShowMOD(ent);
	}
	else 
		ClientShowID(ent, NULL); 
	
	// Paril
	if (GamePaused())
	{
		ent->s.sound = 0;
	}
	// Paril
// END CTF CODE -- LM_CTF
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x4d91b(%rip)     # 0x99080
movq 0x58(%rdi), %rax
movq %rax, 0x4d918(%rip)     # 0x99088
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x4b799
movq 0x58(%rbx), %rax
cmpl $0x0, 0xe04(%rax)
je 0x4b82c
movq %rbx, %rdi
callq 0x194c0
jmp 0x4b834
movq 0x58(%rbx), %rax
cmpl $0x0, 0xf40(%rax)
je 0x4b7ae
movq %rbx, %rdi
callq 0x19b00
movq $-0x3, %rcx
movq 0x4d8cc(%rip), %rax     # 0x99088
movsd 0xf414(%rip), %xmm0     # 0x5abd8
xorps %xmm1, %xmm1
cvtss2sd 0x10(%rbx,%rcx,4), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movw %dx, 0xa(%rax,%rcx,2)
xorps %xmm1, %xmm1
cvtss2sd 0x1cc(%rbx,%rcx,4), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movw %dx, 0x10(%rax,%rcx,2)
incq %rcx
jne 0x4b7c4
movq 0x1d5a1(%rip), %rcx     # 0x68da0
movss 0xc8(%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4b816
jnp 0x4b998
movsd 0xf392(%rip), %xmm0     # 0x5abb0
movsd %xmm0, 0x6c(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x197f0
movq %rbx, %rdi
callq 0x197f0
movq %rbx, %rdi
callq 0x199b0
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x4b850
movq 0x58(%rbx), %rax
jmp 0x4b8d3
movq %rbx, %rdi
callq 0x18fb0
movq %rbx, %rdi
callq 0x18250
movq %rbx, %rdi
callq 0x18c50
movq %rbx, %rdi
callq 0x18740
movss 0x1c0(%rbx), %xmm0
movq 0x58(%rbx), %rax
movss %xmm0, 0xed8(%rax)
movss 0x1c4(%rbx), %xmm0
movss %xmm0, 0xedc(%rax)
movss 0x1c8(%rbx), %xmm0
movss %xmm0, 0xee0(%rax)
movsd 0x1c(%rax), %xmm0
movsd %xmm0, 0xecc(%rax)
movss 0x24(%rax), %xmm0
movss %xmm0, 0xed4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0xe7c(%rax)
movq $0x0, 0xe8c(%rax)
cmpl $0x0, 0xe24(%rax)
je 0x4b916
movq 0x1d5dd(%rip), %rcx     # 0x68ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4b8f5
jnp 0x4b916
movq 0x1d4a4(%rip), %rax     # 0x68da0
testb $0x1f, (%rax)
jne 0x4bb0b
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x18b10
jmp 0x4b957
cmpl $0x0, 0xe34(%rax)
je 0x4b96e
movq 0x1d59a(%rip), %rcx     # 0x68ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4b938
jnp 0x4b96e
movq 0x1d461(%rip), %rax     # 0x68da0
testb $0x1f, (%rax)
jne 0x4bb0b
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x180e0
movq 0x1cca2(%rip), %rax     # 0x68600
movq %rbx, %rdi
xorl %esi, %esi
callq *0xb8(%rax)
jmp 0x4bb0b
cmpl $0x0, 0xf74(%rax)
je 0x4bb01
movq 0x1d41e(%rip), %rax     # 0x68da0
testb $0x7, (%rax)
jne 0x4bb0b
movq %rbx, %rdi
callq 0x182e0
jmp 0x4bb0b
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x4d6b0(%rip), %rsi     # 0x99058
leaq 0x4d699(%rip), %rdx     # 0x99048
leaq 0x4d6ba(%rip), %rcx     # 0x99070
callq 0x183a0
callq 0x19010
movq 0x58(%rbx), %rax
movss 0xebc(%rax), %xmm0
movss 0xdd74(%rip), %xmm1     # 0x59748
addss %xmm0, %xmm1
movss 0xdd64(%rip), %xmm2     # 0x59744
cmpltss %xmm0, %xmm2
andps %xmm2, %xmm1
andnps %xmm0, %xmm2
orps %xmm1, %xmm2
divss 0x751a(%rip), %xmm2     # 0x52f10
movss %xmm2, 0x10(%rbx)
movss 0xec0(%rax), %xmm0
movss %xmm0, 0x14(%rbx)
movl $0x0, 0x18(%rbx)
movss 0x1c0(%rbx), %xmm0
movss 0x1c4(%rbx), %xmm1
movss 0x4d625(%rip), %xmm3    # 0x9904c
mulss %xmm1, %xmm3
movss 0x4d615(%rip), %xmm4    # 0x99048
mulss %xmm0, %xmm4
movss 0x1c8(%rbx), %xmm2
mulss 0x4d609(%rip), %xmm2    # 0x99050
addss %xmm3, %xmm4
addss %xmm4, %xmm2
movaps 0x74ea(%rip), %xmm3     # 0x52f40
andps %xmm2, %xmm3
movq 0x1d0e8(%rip), %rax     # 0x68b48
movq (%rax), %rax
movss 0x20(%rax), %xmm4
movq 0x1d349(%rip), %rax     # 0x68db8
movq (%rax), %rax
movss 0x20(%rax), %xmm5
movaps %xmm3, %xmm6
mulss %xmm4, %xmm6
divss %xmm5, %xmm6
cmpltss %xmm5, %xmm3
andps %xmm3, %xmm6
andnps %xmm4, %xmm3
orps %xmm6, %xmm3
movaps 0xa239(%rip), %xmm4     # 0x55cd0
xorps %xmm3, %xmm4
cmpltss 0x7eed(%rip), %xmm2     # 0x53990
movaps %xmm2, %xmm5
andnps %xmm3, %xmm5
andps %xmm4, %xmm2
orps %xmm5, %xmm2
mulss 0x7455(%rip), %xmm2     # 0x52f0c
movss %xmm2, 0x18(%rbx)
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
sqrtss %xmm0, %xmm0
movq 0x1d475(%rip), %rax     # 0x68f48
movss %xmm0, (%rax)
movss 0x7429(%rip), %xmm1     # 0x52f08
ucomiss %xmm0, %xmm1
jbe 0x4bb1f
movq 0x1d35d(%rip), %rax     # 0x68e48
xorl %ecx, %ecx
movl %ecx, (%rax)
movq 0x4d592(%rip), %rax     # 0x99088
movl %ecx, 0xec8(%rax)
xorps %xmm0, %xmm0
jmp 0x4bb7d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18860
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x4bb1d
movl $0x0, 0x4c(%rbx)
popq %rbx
retq
cmpq $0x0, 0x2b8(%rbx)
je 0x4bb49
movq 0x1d318(%rip), %rax     # 0x68e48
ucomiss 0xf0e9(%rip), %xmm0     # 0x5ac20
jbe 0x4bb56
movl $0x3e800000, (%rax)     # imm = 0x3E800000
movss 0x7929(%rip), %xmm0     # 0x53470
jmp 0x4bb7d
movq 0x1d2f8(%rip), %rax     # 0x68e48
movss (%rax), %xmm0
jmp 0x4bb7d
ucomiss 0xa0ef(%rip), %xmm0     # 0x55c4c
jbe 0x4bb6f
movl $0x3e000000, (%rax)     # imm = 0x3E000000
movss 0xf0bb(%rip), %xmm0     # 0x5ac28
jmp 0x4bb7d
movl $0x3d800000, (%rax)     # imm = 0x3D800000
movss 0xf0a7(%rip), %xmm0     # 0x5ac24
movq 0x4d504(%rip), %rax     # 0x99088
addss 0xec8(%rax), %xmm0
movss %xmm0, 0xec8(%rax)
testb $0x1, 0x10(%rax)
je 0x4bba2
mulss 0x736a(%rip), %xmm0     # 0x52f0c
cvttss2si %xmm0, %eax
movq 0x1cfe3(%rip), %rcx     # 0x68b90
movl %eax, (%rcx)
cvtss2sd %xmm0, %xmm0
mulsd 0xd87d(%rip), %xmm0     # 0x59438
callq 0x19550
cvtsd2ss %xmm0, %xmm0
andps 0x7375(%rip), %xmm0     # 0x52f40
movq 0x1d0a6(%rip), %rax     # 0x68c78
movss %xmm0, (%rax)
movq %rbx, %rdi
callq 0x185c0
movq %rbx, %rdi
callq 0x18300
movq %rbx, %rdi
callq 0x18f10
movq %rbx, %rdi
callq 0x197e0
movq %rbx, %rdi
callq 0x19140
jmp 0x4b77b