// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x254(%rax)
jle 0x644da
movq 0x1e8da(%rip), %rax     # 0x82da0
movss 0xc8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x644da
jp 0x644da
jmp 0x644df
jmp 0x64709
movq -0x8(%rbp), %rax
movss 0x268(%rax), %xmm0
movq 0x1e8ae(%rip), %rax     # 0x82da0
ucomiss 0x4(%rax), %xmm0
jbe 0x64546
movq -0x8(%rbp), %rdi
callq 0x18b80
movl %eax, -0xc(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x6451c
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movl %ecx, 0x40(%rax)
jmp 0x64544
cmpl $0x2, -0xc(%rbp)
jne 0x64542
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0x44(%rax)
jmp 0x64544
jmp 0x64546
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xf04(%rax), %xmm0
movq 0x1e843(%rip), %rax     # 0x82da0
cvtsi2ssl (%rax), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x645d4
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xf04(%rax), %xmm0
movq 0x1e823(%rip), %rax     # 0x82da0
cvtsi2ssl (%rax), %xmm1
subss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x10(%rbp)
cmpl $0x1e, -0x10(%rbp)
jg 0x6459d
movl -0x10(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x645d2
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x1, 0x1100(%rax)
jne 0x645c0
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x10000, %ecx          # imm = 0x10000
movl %ecx, 0x40(%rax)
jmp 0x645d0
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, 0x40(%rax)
jmp 0x645d2
jmp 0x645d4
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xf08(%rax), %xmm0
movq 0x1e7b5(%rip), %rax     # 0x82da0
cvtsi2ssl (%rax), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6464d
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xf08(%rax), %xmm0
movq 0x1e795(%rip), %rax     # 0x82da0
cvtsi2ssl (%rax), %xmm1
subss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x10(%rbp)
cmpl $0x1e, -0x10(%rbp)
jg 0x6462b
movl -0x10(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x6464b
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x1c00, %ecx           # imm = 0x1C00
movl %ecx, 0x44(%rax)
jmp 0x6464d
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x6467f
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x1c00, %ecx           # imm = 0x1C00
movl %ecx, 0x44(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0xf68(%rax)
je 0x646a1
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movl %ecx, 0x44(%rax)
movq 0x1e150(%rip), %rax     # 0x827f8
cmpq $0x0, (%rax)
je 0x646d5
movq 0x1e143(%rip), %rax     # 0x827f8
movq (%rax), %rax
movq 0x110(%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x646d5
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x40000, %ecx          # imm = 0x40000
movl %ecx, 0x40(%rax)
movq 0x1e184(%rip), %rax     # 0x82860
cmpq $0x0, (%rax)
je 0x64709
movq 0x1e177(%rip), %rax     # 0x82860
movq (%rax), %rax
movq 0x110(%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x64709
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x80000, %ecx          # imm = 0x80000
movl %ecx, 0x40(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop