// File: /workspace/github_c_makefile_star2_O3/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 0x4b43d
pushq %r14
pushq %rbx
pushq %rax
movq 0x1da96(%rip), %r14     # 0x68da0
movss 0xc8(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4b436
jp 0x4b436
movq %rdi, %rbx
movss 0x268(%rdi), %xmm0
ucomiss 0x4(%r14), %xmm0
jbe 0x4b35d
movq %rbx, %rdi
callq 0x18ab0
cmpl $0x2, %eax
je 0x4b34f
cmpl $0x1, %eax
jne 0x4b35d
orb $0x2, 0x41(%rbx)
jmp 0x4b35d
movabsq $0x80000000100, %rax    # imm = 0x80000000100
orq %rax, 0x40(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl (%r14), %xmm0
movq 0x58(%rbx), %rax
movss 0xf04(%rax), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x4b3a6
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
cmpl $0x1f, %ecx
setl %dl
testb $0x4, %cl
sete %cl
testb %cl, %dl
jne 0x4b3a6
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 0x4b3d9
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
cmpl $0x1f, %ecx
setl %dl
testb $0x4, %cl
sete %cl
testb %cl, %dl
jne 0x4b3d9
movabsq $0x1c0000000100, %rcx   # imm = 0x1C0000000100
orq %rcx, 0x40(%rbx)
testb $0x10, 0x11c(%rbx)
je 0x4b3f0
movabsq $0x1c0000000100, %rcx   # imm = 0x1C0000000100
orq %rcx, 0x40(%rbx)
cmpq $0x0, 0xf68(%rax)
je 0x4b3fe
orb $0x2, 0x45(%rbx)
movq 0x1d3f3(%rip), %rax     # 0x687f8
movq (%rax), %rax
testq %rax, %rax
je 0x4b41a
cmpq %rbx, 0x110(%rax)
jne 0x4b41a
orb $0x4, 0x42(%rbx)
movq 0x1d43f(%rip), %rax     # 0x68860
movq (%rax), %rax
testq %rax, %rax
je 0x4b436
cmpq %rbx, 0x110(%rax)
jne 0x4b436
orb $0x8, 0x42(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq