// File: /workspace/github_c_makefile_star2_O1/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, 0x4dc27(%rip)     # 0x9a080
movq 0x58(%rdi), %rax
movq %rax, 0x4dc24(%rip)     # 0x9a088
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x4c48d
movq 0x58(%rbx), %rax
cmpl $0x0, 0xe04(%rax)
je 0x4c528
movq %rbx, %rdi
callq 0x194c0
jmp 0x4c530
movq 0x58(%rbx), %rax
cmpl $0x0, 0xf40(%rax)
je 0x4c4a2
movq %rbx, %rdi
callq 0x19b10
movq $-0x3, %rax
movq 0x4dbd8(%rip), %rcx     # 0x9a088
movsd 0xf3f0(%rip), %xmm0     # 0x5b8a8
xorps %xmm1, %xmm1
cvtss2sd 0x10(%rbx,%rax,4), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movw %dx, 0xa(%rcx,%rax,2)
xorps %xmm1, %xmm1
cvtss2sd 0x1cc(%rbx,%rax,4), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movw %dx, 0x10(%rcx,%rax,2)
incq %rax
jne 0x4c4b8
movq 0x1d8ad(%rip), %rax     # 0x69da0
movss 0xc8(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4c50a
jnp 0x4c691
movq 0x4db77(%rip), %rax     # 0x9a088
movabsq $0x42b4000000000000, %rcx # imm = 0x42B4000000000000
movq %rcx, 0x6c(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19800
movq %rbx, %rdi
callq 0x19800
movq %rbx, %rdi
callq 0x199c0
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
jne 0x4c5c8
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)
movss 0x1c(%rax), %xmm0
movss %xmm0, 0xecc(%rax)
movq 0x20(%rax), %rcx
movq %rcx, 0xed0(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0xe7c(%rax)
movq $0x0, 0xe8c(%rax)
movq 0x58(%rbx), %rax
cmpl $0x0, 0xe24(%rax)
je 0x4c60f
movq 0x1d8e4(%rip), %rcx     # 0x69ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4c5ee
jnp 0x4c60f
movq 0x1d7ab(%rip), %rax     # 0x69da0
testb $0x1f, (%rax)
jne 0x4c7d5
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x18b10
jmp 0x4c650
cmpl $0x0, 0xe34(%rax)
je 0x4c667
movq 0x1d8a1(%rip), %rcx     # 0x69ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4c631
jnp 0x4c667
movq 0x1d768(%rip), %rax     # 0x69da0
testb $0x1f, (%rax)
jne 0x4c7d5
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x180e0
movq 0x1cfa9(%rip), %rax     # 0x69600
movq %rbx, %rdi
xorl %esi, %esi
callq *0xb8(%rax)
jmp 0x4c7d5
cmpl $0x0, 0xf74(%rax)
je 0x4c7cb
movq 0x1d725(%rip), %rax     # 0x69da0
testb $0x7, (%rax)
jne 0x4c7d5
movq %rbx, %rdi
callq 0x182e0
jmp 0x4c7d5
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x4d9b7(%rip), %rsi     # 0x9a058
leaq 0x4d9a0(%rip), %rdx     # 0x9a048
leaq 0x4d9c1(%rip), %rcx     # 0x9a070
callq 0x183a0
callq 0x19010
movq 0x58(%rbx), %rax
movss 0xebc(%rax), %xmm0
movss 0xde37(%rip), %xmm1     # 0x5a504
addss %xmm0, %xmm1
movss 0xde27(%rip), %xmm2     # 0x5a500
cmpltss %xmm0, %xmm2
andps %xmm2, %xmm1
andnps %xmm0, %xmm2
orps %xmm1, %xmm2
divss 0x781d(%rip), %xmm2     # 0x53f0c
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 0x4d92c(%rip), %xmm3    # 0x9a04c
mulss %xmm1, %xmm3
movss 0x4d91c(%rip), %xmm4    # 0x9a048
mulss %xmm0, %xmm4
movss 0x1c8(%rbx), %xmm2
mulss 0x4d910(%rip), %xmm2    # 0x9a050
addss %xmm3, %xmm4
addss %xmm4, %xmm2
movaps 0x77f1(%rip), %xmm3     # 0x53f40
andps %xmm2, %xmm3
movq 0x1d3ef(%rip), %rax     # 0x69b48
movq (%rax), %rax
movss 0x20(%rax), %xmm4
movq 0x1d650(%rip), %rax     # 0x69db8
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 0xa480(%rip), %xmm4     # 0x56c10
xorps %xmm3, %xmm4
xorps %xmm6, %xmm6
cmpltss %xmm6, %xmm2
movaps %xmm2, %xmm5
andnps %xmm3, %xmm5
andps %xmm4, %xmm2
orps %xmm5, %xmm2
mulss 0x7759(%rip), %xmm2     # 0x53f08
movss %xmm2, 0x18(%rbx)
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
ucomiss %xmm6, %xmm0
jb 0x4c7e9
sqrtss %xmm0, %xmm0
jmp 0x4c7ee
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18860
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x4c7e7
movl $0x0, 0x4c(%rbx)
popq %rbx
retq
callq 0x18e80
movq 0x1d753(%rip), %rax     # 0x69f48
movss %xmm0, (%rax)
movss 0x7703(%rip), %xmm1     # 0x53f04
ucomiss %xmm0, %xmm1
jbe 0x4c820
movq 0x1d63b(%rip), %rax     # 0x69e48
xorl %ecx, %ecx
movl %ecx, (%rax)
movq 0x4d870(%rip), %rax     # 0x9a088
movl %ecx, 0xec8(%rax)
jmp 0x4c859
cmpq $0x0, 0x2b8(%rbx)
je 0x4c859
movq 0x1d617(%rip), %rax     # 0x69e48
ucomiss 0xf0c0(%rip), %xmm0     # 0x5b8f8
jbe 0x4c842
movl $0x3e800000, (%rax)     # imm = 0x3E800000
jmp 0x4c859
ucomiss 0xa67b(%rip), %xmm0     # 0x56ec4
jbe 0x4c853
movl $0x3e000000, (%rax)     # imm = 0x3E000000
jmp 0x4c859
movl $0x3d800000, (%rax)     # imm = 0x3D800000
movq 0x1d5e8(%rip), %rax     # 0x69e48
movss (%rax), %xmm0
movq 0x4d81d(%rip), %rax     # 0x9a088
addss 0xec8(%rax), %xmm0
movss %xmm0, 0xec8(%rax)
testb $0x1, 0x10(%rax)
je 0x4c889
mulss 0x767f(%rip), %xmm0     # 0x53f08
cvttss2si %xmm0, %eax
movq 0x1d2fc(%rip), %rcx     # 0x69b90
movl %eax, (%rcx)
cvtss2sd %xmm0, %xmm0
mulsd 0xd986(%rip), %xmm0     # 0x5a228
callq 0x19550
cvtsd2ss %xmm0, %xmm0
andps 0x768e(%rip), %xmm0     # 0x53f40
movq 0x1d3bf(%rip), %rax     # 0x69c78
movss %xmm0, (%rax)
movq %rbx, %rdi
callq 0x185c0
movq %rbx, %rdi
callq 0x18300
movq %rbx, %rdi
callq 0x18f10
movq %rbx, %rdi
callq 0x197f0
movq %rbx, %rdi
callq 0x19140
jmp 0x4c46f