// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: ClientBeginServerFrame
void ClientBeginServerFrame (edict_t *ent)
{
	gclient_t	*client;
	int			buttonMask;


	// CTF CODE -- LM_JORM
	RuneThinkHook(ent);
	if (VoteStarted)
		Check_Vote();               //Vampire -- Checking if the time is up for the voting menu
	// END CTF CODE -- LM_JORM
	
	if (level.intermissiontime)
		return;

	client = ent->client;

	if (deathmatch->value &&
		client->pers.spectator != client->resp.spectator &&
		(level.time - client->respawn_time) >= 5) {
		spectator_respawn(ent);
		return;
	}


	// STATS-BEGIN LM_Hati
	if (!(level.framenum % STATS_PLAYER_SAMPLE_RATE))
	{
		if (client->p_stats_player)
		{
			stats_add(ent, STATS_PING_TOTAL, client->ping);
			stats_add(ent, STATS_PING_SAMPLES, 1);
		}
		
		// Alert referee if others have failed his pingalerts
		// Only referees can have ping alerts
		if (ent->client->ctf.extra_flags & CTF_EXTRAFLAGS_REFEREE)
			PingAlert(ent);
	}
	// STATS-END LM_Hati
	
	// run weapon animations if it hasn't been done by a ucmd_t
	if (!client->weapon_thunk && !client->resp.spectator)
		Think_Weapon (ent);
	else
		client->weapon_thunk = false;


	//sprintf(DBuffer, "resp cnt %ld", Respawn_Count);
	//Debug_Show(DBuffer);


	if(ent->deadflag)
	{
		// wait for any button just going down
		if ( level.time > client->respawn_time)
		{
			// in deathmatch, only wait for attack button
			if (deathmatch->value)
				buttonMask = BUTTON_ATTACK;
			else
				buttonMask = -1;

			if ( ( client->latched_buttons & buttonMask ) ||
				(deathmatch->value && ((int)dmflags->value & DF_FORCE_RESPAWN) ) )
			{
				respawn(ent);
				client->latched_buttons = 0;
			}
		}
		return;
	}

#ifdef MONSTERS_OK
	// add player trail so monsters can follow
	if (!deathmatch->value)
		if (!visible (ent, PlayerTrail_LastSpot() ) )
			PlayerTrail_Add (ent->s.old_origin);
#endif

	client->latched_buttons = 0;

	if (!client->ctf.goodskin)
	{
		char *s, set[MAX_INFO_STRING];
		s = Info_ValueForKey (ent->client->pers.userinfo, "skin");
		sprintf(set, "skin %s\n", s);
		ForceCommand(ent, set);
		client->ctf.goodskin = true;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x18330
movq 0x25949(%rip), %rax     # 0x826a8
cmpl $0x0, (%rax)
je 0x5cd69
callq 0x18ba0
movq 0x26030(%rip), %rax     # 0x82da0
movss 0xc8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5cd84
jp 0x5cd84
jmp 0x5cd89
jmp 0x5cfc5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x10(%rbp)
movq 0x26124(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5cdb0
jp 0x5cdb0
jmp 0x5cdf9
movq -0x10(%rbp), %rax
movl 0x750(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xe04(%rcx), %eax
je 0x5cdf9
movq 0x25fd3(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xf28(%rax), %xmm0
movss 0x13122(%rip), %xmm1    # 0x6ff08
ucomiss %xmm1, %xmm0
jb 0x5cdf9
movq -0x8(%rbp), %rdi
callq 0x19500
jmp 0x5cfc5
movq 0x25fa0(%rip), %rax     # 0x82da0
movl (%rax), %eax
movl $0x14, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x5ce67
movq -0x10(%rbp), %rax
cmpq $0x0, 0x9138(%rax)
je 0x5ce46
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq 0xb8(%rax), %rdx
xorl %esi, %esi
callq 0x19550
movq -0x8(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x19550
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x5ce65
movq -0x8(%rbp), %rdi
callq 0x184c0
jmp 0x5ce67
movq -0x10(%rbp), %rax
cmpl $0x0, 0xe48(%rax)
jne 0x5ce8c
movq -0x10(%rbp), %rax
cmpl $0x0, 0xe04(%rax)
jne 0x5ce8c
movq -0x8(%rbp), %rdi
callq 0x197d0
jmp 0x5ce9a
movq -0x10(%rbp), %rax
movl $0x0, 0xe48(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x260(%rax)
je 0x5cf54
movq 0x25eee(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
ucomiss 0xf28(%rax), %xmm0
jbe 0x5cf52
movq 0x25ff1(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5cee3
jp 0x5cee3
jmp 0x5ceec
movl $0x1, -0x14(%rbp)
jmp 0x5cef3
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl 0xe44(%rax), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x5cf39
movq 0x25fb4(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5cf20
jp 0x5cf20
jmp 0x5cf50
movq 0x256f1(%rip), %rax     # 0x82618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x5cf50
movq -0x8(%rbp), %rdi
callq 0x19850
movq -0x10(%rbp), %rax
movl $0x0, 0xe44(%rax)
jmp 0x5cf52
jmp 0x5cfc5
movq -0x10(%rbp), %rax
movl $0x0, 0xe44(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x110c(%rax)
jne 0x5cfc5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0xc0, %rdi
leaq 0x123ab(%rip), %rsi     # 0x6f330
callq 0x18cb0
movq %rax, -0x20(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x1a330(%rip), %rsi     # 0x772d0
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x18d80
movq -0x10(%rbp), %rax
movl $0x1, 0x110c(%rax)
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nop