// File: /workspace/github_c_makefile_star2_O1/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 0x4ca9d
movq 0x1d499(%rip), %rcx     # 0x69da0
movl (%rcx), %ecx
subl 0xdf0(%rdx), %ecx
cmpl $0x3b, %ecx
jg 0x4ca91
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 0x6a67(%rip), %rcx      # 0x533a3
leaq 0xf06a(%rip), %rdx      # 0x5b9ad
cmoveq %rcx, %rdx
cmpl $0x1, %eax
leaq 0x6a46(%rip), %r9       # 0x53397
cmovneq %rdx, %r9
movq 0x1d294(%rip), %rax     # 0x69bf0
movq (%rax), %r10
movq 0x1d0c2(%rip), %rax     # 0x69a28
movq (%rax), %r11
subq $0x8, %rsp
leaq 0x7f42(%rip), %r15      # 0x548b6
leaq 0xf03d(%rip), %rdx      # 0x5b9b8
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 0x1ccd3(%rip), %rax     # 0x696a0
cmpb $0x0, (%rax)
je 0x4ca4f
movq 0x1ccc7(%rip), %rsi     # 0x696a0
leaq 0x200(%rsp), %rbx
movq %rbx, %rdi
callq 0x182a0
leaq 0x8514(%rip), %rsi      # 0x54f04
movq %rbx, %rdi
callq 0x194b0
testq %rax, %rax
je 0x4ca4f
movl $0x64, %ebp
leaq 0xf02e(%rip), %r15      # 0x5ba37
movq %rsp, %r12
leaq 0x5f0(%rsp), %r13
leaq 0x84e9(%rip), %rbx      # 0x54f04
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 0x4ca1b
movq 0x1cbaa(%rip), %rbx     # 0x69600
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