// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, 0x4fabc(%rip)     # 0x97180
movq 0x58(%rdi), %rax
movq %rax, 0x4fab9(%rip)     # 0x97188
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x476f8
movq 0x58(%rbx), %rax
cmpl $0x0, 0xe04(%rax)
je 0x47794
movq %rbx, %rdi
callq 0x19670
jmp 0x4779c
movq 0x58(%rbx), %rax
cmpl $0x0, 0xf40(%rax)
je 0x4770d
movq %rbx, %rdi
callq 0x19d08
movq 0x4fa74(%rip), %rax     # 0x97188
leaq 0x1c0(%rbx), %r14
pushq $-0x6
popq %rcx
movsd 0xf472(%rip), %xmm0     # 0x56b98
testq %rcx, %rcx
je 0x4775a
cvtss2sd 0x10(%rbx,%rcx,2), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movw %dx, 0xa(%rax,%rcx)
cvtss2sd 0x1cc(%rbx,%rcx,2), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movw %dx, 0x10(%rax,%rcx)
addq $0x2, %rcx
jmp 0x47726
movq 0x1f63f(%rip), %rcx     # 0x66da0
movss 0xc8(%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x47778
jnp 0x478fd
movsd 0xf3f0(%rip), %xmm0     # 0x56b70
movsd %xmm0, 0x6c(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x199d0
movq %rbx, %rdi
callq 0x199d0
movq %rbx, %rdi
callq 0x19b90
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x477b8
movq 0x58(%rbx), %rax
jmp 0x47838
movq %rbx, %rdi
callq 0x190e0
movq %rbx, %rdi
callq 0x18270
movq %rbx, %rdi
callq 0x18d30
movq %rbx, %rdi
callq 0x18790
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)
andq $0x0, 0xe8c(%rax)
cmpl $0x0, 0xe24(%rax)
je 0x4787b
movq 0x1f678(%rip), %rcx     # 0x66ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4785a
jnp 0x4787b
movq 0x1f53f(%rip), %rax     # 0x66da0
testb $0x1f, (%rax)
jne 0x479e5
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x18bb0
jmp 0x478bc
cmpl $0x0, 0xe34(%rax)
je 0x478d3
movq 0x1f635(%rip), %rcx     # 0x66ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4789d
jnp 0x478d3
movq 0x1f4fc(%rip), %rax     # 0x66da0
testb $0x1f, (%rax)
jne 0x479e5
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x180e0
movq 0x1ed3d(%rip), %rax     # 0x66600
movq %rbx, %rdi
xorl %esi, %esi
callq *0xb8(%rax)
jmp 0x479e5
cmpl $0x0, 0xf74(%rax)
je 0x479db
movq 0x1f4b9(%rip), %rax     # 0x66da0
testb $0x7, (%rax)
jne 0x479e5
movq %rbx, %rdi
callq 0x18310
jmp 0x479e5
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x4f84b(%rip), %rsi     # 0x97158
leaq 0x4f834(%rip), %rdx     # 0x97148
leaq 0x4f855(%rip), %rcx     # 0x97170
callq 0x183d0
callq 0x19140
movq 0x58(%rbx), %rax
movss 0xebc(%rax), %xmm0
movss 0xddef(%rip), %xmm1     # 0x55728
addss %xmm0, %xmm1
movss 0xdddf(%rip), %xmm2     # 0x55724
cmpltss %xmm0, %xmm2
andps %xmm2, %xmm1
andnps %xmm0, %xmm2
orps %xmm1, %xmm2
divss 0x75b1(%rip), %xmm2     # 0x4ef0c
movss %xmm2, 0x10(%rbx)
movss 0xec0(%rax), %xmm0
movss %xmm0, 0x14(%rbx)
andl $0x0, 0x18(%rbx)
movq %r14, %rsi
callq 0x18ce0
mulss 0x7587(%rip), %xmm0     # 0x4ef08
movss %xmm0, 0x18(%rbx)
movss 0x1c0(%rbx), %xmm0
movss 0x1c4(%rbx), %xmm1
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
sqrtss %xmm0, %xmm0
movq 0x1f59b(%rip), %rax     # 0x66f48
movss %xmm0, (%rax)
movss 0x754b(%rip), %xmm1     # 0x4ef04
ucomiss %xmm0, %xmm1
jbe 0x479fc
movq 0x1f483(%rip), %rax     # 0x66e48
andl $0x0, (%rax)
movq 0x4f7b9(%rip), %rax     # 0x97188
andl $0x0, 0xec8(%rax)
xorps %xmm0, %xmm0
jmp 0x47a5a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x188c0
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x479f4
andl $0x0, 0x4c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpq $0x0, 0x2b8(%rbx)
je 0x47a26
movq 0x1f43b(%rip), %rax     # 0x66e48
ucomiss 0xf1cc(%rip), %xmm0     # 0x56be0
jbe 0x47a33
movl $0x3e800000, (%rax)     # imm = 0x3E800000
movss 0x7a4c(%rip), %xmm0     # 0x4f470
jmp 0x47a5a
movq 0x1f41b(%rip), %rax     # 0x66e48
movss (%rax), %xmm0
jmp 0x47a5a
ucomiss 0xa1f2(%rip), %xmm0     # 0x51c2c
jbe 0x47a4c
movl $0x3e000000, (%rax)     # imm = 0x3E000000
movss 0xf19e(%rip), %xmm0     # 0x56be8
jmp 0x47a5a
movl $0x3d800000, (%rax)     # imm = 0x3D800000
movss 0xf18a(%rip), %xmm0     # 0x56be4
movq 0x4f727(%rip), %rax     # 0x97188
addss 0xec8(%rax), %xmm0
movss %xmm0, 0xec8(%rax)
testb $0x1, 0x10(%rax)
je 0x47a7f
mulss 0x7489(%rip), %xmm0     # 0x4ef08
cvttss2si %xmm0, %eax
movq 0x1f106(%rip), %rcx     # 0x66b90
movl %eax, (%rcx)
cvtss2sd %xmm0, %xmm0
mulsd 0xd980(%rip), %xmm0     # 0x55418
callq 0x19700
cvtsd2ss %xmm0, %xmm0
andps 0x7498(%rip), %xmm0     # 0x4ef40
movq 0x1f1c9(%rip), %rax     # 0x66c78
movss %xmm0, (%rax)
movq %rbx, %rdi
callq 0x18600
movq %rbx, %rdi
callq 0x18330
movq %rbx, %rdi
callq 0x19030
movq %rbx, %rdi
callq 0x199c0
movq %rbx, %rdi
callq 0x192b0
jmp 0x476da