// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: ClientShowMOD
int ClientShowMOD(edict_t *ent)
{
	char	string[5000];
	char	temp[1000], temp2[MAX_INFO_STRING];
	char	*line;
	char    *color;
	int		time, i;
	
	if (!ent->client->showmod)
		return  1;
	
	time = (level.framenum - ent->client->resp.enterframe);
	if (time < 60) // We just entered the game
	{
		//ent->client->ps.stats[STAT_LAYOUTS] = 1;
		/*
		// Don't show the message if we are moving or pulling up menus
		if (ent->client->showscores || ent->client->showinventory ||
			(ent->client->latched_buttons|ent->client->buttons))
		{
			return 0;
		}

		if (time % 20)
			return 0;
		*/

		switch (ent->client->ctf.teamnum)
		{
			case CTF_TEAM_RED: color = "Red"; break;
			case CTF_TEAM_BLUE: color = "Blue"; break;
			default: color = "Unassigned"; break;
		}
	
		Com_sprintf(string, sizeof(string),
			"xv %i yv %i cstring2 \""
			"You are on the %s team!\n\n"
			"Welcome to %s\nRunning %s\n"
			"Pak File is available at:\n\" "
			"xv %i yv %i cstring2 \""
			"%s\n\n",
			0,40,
			color,
			hostname->string,
			GAMEVERSION,
			0,85,
			mod_website->string);
		
		strcat(string, "\" ");

		if (motd[0]) // if we have a MOTD
		{
			strcpy(temp, motd);
			i = 100;
			line = strtok(temp, "\n");
			while (line)
			{
				Com_sprintf(temp2, sizeof(temp2),				
					"xv 0 yv %d cstring \"%s\" ",
					i, line);
				i+=8;
				strcat(string, temp2);
				line = strtok(NULL, "\n");
			}
		}

			

			   	
		gi.WriteByte (svc_layout);
		gi.WriteString (string);
		gi.unicast (ent, false);
		
	

		/*
		Com_sprintf(string, sizeof(string),
			"You are on the %s team!\n\nWelcome to %s\nRunning LM CTF\n"
			"Skins are available at:\nhttp://www.planetquake.com/lmctf/\n", 
			color,
			hostname->string);

		if (motd[0]) // if we have a MOTD
		{
			strcat(string, motd);
		}

		gi.centerprintf(ent, "%s", string);
		

		ent->client->ps.stats[STAT_LAYOUTS] = 0;
		*/
		return 1;
	}
	else
		ent->client->showmod = false;
	return 0;
}

// Assembly:
movq 0x58(%rdi), %rdx
pushq $0x1
popq %rax
cmpl $0x0, 0xf74(%rdx)
je 0x47c54
movq 0x1f2a5(%rip), %rcx     # 0x66da0
movl (%rcx), %ecx
subl 0xdf0(%rdx), %ecx
cmpl $0x3b, %ecx
jg 0x47c4b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x19a8, %rsp           # imm = 0x19A8
movq %rdi, %r14
movl 0x1100(%rdx), %eax
cmpl $0x2, %eax
leaq 0x6873(%rip), %rcx      # 0x4e3a3
leaq 0xf166(%rip), %rdx      # 0x56c9d
cmoveq %rcx, %rdx
cmpl $0x1, %eax
leaq 0x6852(%rip), %r9       # 0x4e397
cmovneq %rdx, %r9
movq 0x1f0a0(%rip), %rax     # 0x66bf0
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x1eeca(%rip), %rcx     # 0x66a28
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x7d75(%rip), %rcx      # 0x4f8e6
movq %rcx, 0x8(%rsp)
andl $0x0, 0x10(%rsp)
movq %rax, (%rsp)
movl $0x55, 0x18(%rsp)
leaq 0xf11a(%rip), %rdx      # 0x56ca8
leaq 0x620(%rsp), %rbx
pushq $0x28
popq %r8
movq %rbx, %rdi
movl $0x1388, %esi           # imm = 0x1388
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x18f30
movq %rbx, %rdi
callq 0x186c0
movw $0x2022, 0x620(%rsp,%rax) # imm = 0x2022
movb $0x0, 0x622(%rsp,%rax)
movq 0x1ead4(%rip), %rax     # 0x666a0
cmpb $0x0, (%rax)
je 0x47c55
movq 0x1eac4(%rip), %rsi     # 0x666a0
leaq 0x230(%rsp), %rbx
movq %rbx, %rdi
callq 0x182c0
leaq 0x8351(%rip), %r15      # 0x4ff44
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19660
pushq $0x64
popq %rbp
leaq 0xf11f(%rip), %r12      # 0x56d27
leaq 0x30(%rsp), %r13
leaq 0x620(%rsp), %rbx
testq %rax, %rax
je 0x47c55
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x18f30
addl $0x8, %ebp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19800
xorl %edi, %edi
movq %r15, %rsi
callq 0x19660
jmp 0x47c15
andl $0x0, 0xf74(%rdx)
xorl %eax, %eax
retq
movq 0x1e9a4(%rip), %rbx     # 0x66600
pushq $0x4
popq %rdi
callq *0xc8(%rbx)
leaq 0x620(%rsp), %rdi
callq *0xe8(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq *0xb8(%rbx)
pushq $0x1
popq %rax
addq $0x19a8, %rsp           # imm = 0x19A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq