// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: G_SetClientEffects
void G_SetClientEffects (edict_t *ent)
{
	int		pa_type;
	int		remaining;

	ent->s.effects = 0;
	ent->s.renderfx = 0;

	if (ent->health <= 0 || level.intermissiontime)
		return;

	if (ent->powerarmor_time > level.time)
	{
		pa_type = PowerArmorType (ent);
		if (pa_type == POWER_ARMOR_SCREEN)
		{
			ent->s.effects |= EF_POWERSCREEN;
		}
		else if (pa_type == POWER_ARMOR_SHIELD)
		{
			ent->s.effects |= EF_COLOR_SHELL;
			ent->s.renderfx |= RF_SHELL_GREEN;
		}
	}

	if (ent->client->quad_framenum > level.framenum)
	{
		remaining = ent->client->quad_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4) )
		{
			// CTF CODE -- LM_JORM			
			if (ent->client->ctf.teamnum == CTF_TEAM_RED) // RED
				ent->s.effects |= EF_PENT;
			else // if (ent->client->teamnum ==2) // Blue
				ent->s.effects |= EF_QUAD;
			// END CTF CODE -- LM_JORM
		}
	}

	if (ent->client->invincible_framenum > level.framenum)
	{
		remaining = ent->client->invincible_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4) )
		{
			// CTF CODE -- LM_JORM			
			ent->s.effects |= EF_COLOR_SHELL;
			ent->s.renderfx |= (RF_SHELL_RED|RF_SHELL_GREEN|RF_SHELL_BLUE);
			// END CTF CODE -- LM_JORM			
		}
	}

	// show cheaters!!!
	if (ent->flags & FL_GODMODE)
	{
		ent->s.effects |= EF_COLOR_SHELL;
		ent->s.renderfx |= (RF_SHELL_RED|RF_SHELL_GREEN|RF_SHELL_BLUE);
	}

	// CTF CODE -- LM_JORM
	if (ent->client->rune)
	{
		ent->s.renderfx |= 	RF_GLOW;
	}

	if (redflag && redflag->owner == ent)
		ent->s.effects |= EF_FLAG1;

	if (blueflag && blueflag->owner == ent)
		ent->s.effects |= EF_FLAG2;

	// END CTF CODE -- LM_JORM
}

// Assembly:
movq $0x0, 0x40(%rdi)
cmpl $0x0, 0x254(%rdi)
jle 0x4c139
pushq %r14
pushq %rbx
pushq %rax
movq 0x1dd88(%rip), %r14     # 0x69da0
movss 0xc8(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4c132
jp 0x4c132
movq %rdi, %rbx
movss 0x268(%rdi), %xmm0
ucomiss 0x4(%r14), %xmm0
jbe 0x4c065
movq %rbx, %rdi
callq 0x18ab0
cmpl $0x2, %eax
je 0x4c05d
cmpl $0x1, %eax
jne 0x4c065
orb $0x2, 0x41(%rbx)
jmp 0x4c065
orb $0x1, 0x41(%rbx)
orb $0x8, 0x45(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl (%r14), %xmm0
movq 0x58(%rbx), %rax
movss 0xf04(%rax), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x4c0ae
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
cmpl $0x1f, %ecx
setl %dl
testb $0x4, %cl
sete %cl
testb %cl, %dl
jne 0x4c0ae
xorl %ecx, %ecx
cmpl $0x1, 0x1100(%rax)
sete %cl
shll $0xf, %ecx
addl $0x8000, %ecx           # imm = 0x8000
orl %ecx, 0x40(%rbx)
movss 0xf08(%rax), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x4c0db
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
cmpl $0x1f, %ecx
setl %dl
testb $0x4, %cl
sete %cl
testb %cl, %dl
jne 0x4c0db
orb $0x1, 0x41(%rbx)
orb $0x1c, 0x45(%rbx)
testb $0x10, 0x11c(%rbx)
je 0x4c0ec
orb $0x1, 0x41(%rbx)
orb $0x1c, 0x45(%rbx)
cmpq $0x0, 0xf68(%rax)
je 0x4c0fa
orb $0x2, 0x45(%rbx)
movq 0x1d6f7(%rip), %rax     # 0x697f8
movq (%rax), %rax
testq %rax, %rax
je 0x4c116
cmpq %rbx, 0x110(%rax)
jne 0x4c116
orb $0x4, 0x42(%rbx)
movq 0x1d743(%rip), %rax     # 0x69860
movq (%rax), %rax
testq %rax, %rax
je 0x4c132
cmpq %rbx, 0x110(%rax)
jne 0x4c132
orb $0x8, 0x42(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq