// File: /workspace/github_c_makefile_star2_O2/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:
andq $0x0, 0x40(%rdi)
cmpl $0x0, 0x254(%rdi)
jle 0x473a6
pushq %r14
pushq %rbx
pushq %rax
movq 0x1fb22(%rip), %r14     # 0x66da0
movss 0xc8(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4739f
jp 0x4739f
movq %rdi, %rbx
movss 0x268(%rdi), %xmm0
ucomiss 0x4(%r14), %xmm0
jbe 0x472d1
movq %rbx, %rdi
callq 0x18b50
cmpl $0x2, %eax
je 0x472c3
cmpl $0x1, %eax
jne 0x472d1
orb $0x2, 0x41(%rbx)
jmp 0x472d1
movabsq $0x80000000100, %rax    # imm = 0x80000000100
orq %rax, 0x40(%rbx)
cvtsi2ssl (%r14), %xmm0
movq 0x58(%rbx), %rax
movss 0xf04(%rax), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x47317
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
cmpl $0x1f, %ecx
setl %dl
testb $0x4, %cl
sete %cl
testb %cl, %dl
jne 0x47317
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
movabsq $0x1c0000000100, %rcx   # imm = 0x1C0000000100
jbe 0x4734c
subss %xmm0, %xmm1
cvttss2si %xmm1, %edx
cmpl $0x1f, %edx
setl %sil
testb $0x4, %dl
sete %dl
testb %dl, %sil
jne 0x4734c
orq %rcx, 0x40(%rbx)
testb $0x10, 0x11c(%rbx)
je 0x47359
orq %rcx, 0x40(%rbx)
cmpq $0x0, 0xf68(%rax)
je 0x47367
orb $0x2, 0x45(%rbx)
movq 0x1f48a(%rip), %rax     # 0x667f8
movq (%rax), %rax
testq %rax, %rax
je 0x47383
cmpq %rbx, 0x110(%rax)
jne 0x47383
orb $0x4, 0x42(%rbx)
movq 0x1f4d6(%rip), %rax     # 0x66860
movq (%rax), %rax
testq %rax, %rax
je 0x4739f
cmpq %rbx, 0x110(%rax)
jne 0x4739f
orb $0x8, 0x42(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq