// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %eax
cmpl $0x0, 0xf74(%rdx)
je 0x4bdb6
movq 0x1d180(%rip), %rcx     # 0x68da0
movl (%rcx), %ecx
subl 0xdf0(%rdx), %ecx
cmpl $0x3b, %ecx
jg 0x4bdaa
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1978, %rsp           # imm = 0x1978
movq %rdi, %r14
movl 0x1100(%rdx), %eax
cmpl $0x2, %eax
leaq 0x674e(%rip), %rcx      # 0x523a3
leaq 0xf081(%rip), %rdx      # 0x5acdd
cmoveq %rcx, %rdx
cmpl $0x1, %eax
leaq 0x672d(%rip), %r9       # 0x52397
cmovneq %rdx, %r9
movq 0x1cf7b(%rip), %rax     # 0x68bf0
movq (%rax), %r10
movq 0x1cda9(%rip), %rax     # 0x68a28
movq (%rax), %r11
subq $0x8, %rsp
leaq 0x7c59(%rip), %r15      # 0x538e6
leaq 0xf054(%rip), %rdx      # 0x5ace8
leaq 0x5f8(%rsp), %rbx
movq %rbx, %rdi
movl $0x1388, %esi           # imm = 0x1388
xorl %ecx, %ecx
movl $0x28, %r8d
xorl %eax, %eax
pushq 0x8(%r11)
pushq $0x55
pushq $0x0
pushq %r15
pushq 0x8(%r10)
callq 0x18e10
addq $0x30, %rsp
movq %rbx, %rdi
callq 0x18680
movw $0x2022, 0x5f0(%rsp,%rax) # imm = 0x2022
movb $0x0, 0x5f2(%rsp,%rax)
movq 0x1c9ba(%rip), %rax     # 0x686a0
cmpb $0x0, (%rax)
je 0x4bd68
movq 0x1c9ae(%rip), %rsi     # 0x686a0
leaq 0x200(%rsp), %rbx
movq %rbx, %rdi
callq 0x182a0
leaq 0x823b(%rip), %rsi      # 0x53f44
movq %rbx, %rdi
callq 0x194b0
testq %rax, %rax
je 0x4bd68
movl $0x64, %ebp
leaq 0xf045(%rip), %r15      # 0x5ad67
movq %rsp, %r12
leaq 0x5f0(%rsp), %r13
leaq 0x8210(%rip), %rbx      # 0x53f44
movq %r12, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x18e10
addl $0x8, %ebp
movq %r13, %rdi
movq %r12, %rsi
callq 0x19640
xorl %edi, %edi
movq %rbx, %rsi
callq 0x194b0
testq %rax, %rax
jne 0x4bd34
movq 0x1c891(%rip), %rbx     # 0x68600
movl $0x4, %edi
callq *0xc8(%rbx)
leaq 0x5f0(%rsp), %rdi
callq *0xe8(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq *0xb8(%rbx)
movl $0x1, %eax
addq $0x1978, %rsp           # imm = 0x1978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0xf74(%rdx)
xorl %eax, %eax
retq