// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Say_f
void Cmd_Say_f (edict_t *ent, qboolean team, qboolean arg0)
{
	int		j;
	edict_t	*other;
	char	*p;
	char	temp[MAX_INFO_STRING];
	char	text[MAX_INFO_STRING];

	if (gi.argc () < 2 && !arg0)
		return;

	if (!ctf_SpamCheck(ent))
		return;

	if (team)
		Com_sprintf (text, sizeof(text), "(%s): ", ent->client->pers.netname);
	else
		Com_sprintf (text, sizeof(text), "%s: ", ent->client->pers.netname);

	strcpy(temp, "");

	if (arg0)
	{
		strcat (temp, gi.argv(0));
		strcat (temp, " ");
		strcat (temp, gi.args());
	}
	else
	{
		p = gi.args();

		if (*p == '"')
		{
			p++;
			p[strlen(p)-1] = 0;
		}
		strcat(temp, p);
	}

	// Temporary
	//sprintf(text, "infoent info_position \"%s\"\n", temp);
	//ForceCommand(ent, text);
	//return;
	//

	string_replace(ent, temp, temp, sizeof temp);
	strcat(text, temp);

	// don't let text be too long for malicious reasons
	if (strlen(text) > 150)
		text[150] = 0;

	ent->client->spam_band_count -= ((long)strlen(text) * 2 + CTF_SPAM_BAND_SAY); //surt spam control

	strcat(text, "\n");

	if (dedicated->value)
		gi.dprintf(text);

	for (j = 1; j <= game.maxclients; j++)
	{
		other = &g_edicts[j];
		if (!other->inuse)
			continue;
		if (!other->client)
			continue;
		if (team)
		{
			if (!OnSameTeam(ent, other))
				continue;
		}
		ctf_SafePrint(other, PRINT_CHAT, text);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp            # imm = 0x450
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq 0x52094(%rip), %rax     # 0x82600
callq *0x138(%rax)
cmpl $0x2, %eax
jge 0x30582
cmpl $0x0, -0x10(%rbp)
jne 0x30582
jmp 0x3082a
movq -0x8(%rbp), %rdi
callq 0x197f0
cmpl $0x0, %eax
jne 0x30595
jmp 0x3082a
cmpl $0x0, -0xc(%rbp)
je 0x305cd
leaq -0x430(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
addq $0xc0, %rcx
addq $0x200, %rcx            # imm = 0x200
movl $0x200, %esi            # imm = 0x200
leaq 0x41ebd(%rip), %rdx     # 0x72481
movb $0x0, %al
callq 0x18f90
jmp 0x305fd
leaq -0x430(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
addq $0xc0, %rcx
addq $0x200, %rcx            # imm = 0x200
movl $0x200, %esi            # imm = 0x200
leaq 0x41e92(%rip), %rdx     # 0x72488
movb $0x0, %al
callq 0x18f90
leaq -0x230(%rbp), %rdi
leaq 0x40975(%rip), %rsi     # 0x70f80
callq 0x182c0
cmpl $0x0, -0x10(%rbp)
je 0x30681
leaq -0x230(%rbp), %rax
movq %rax, -0x440(%rbp)
xorl %edi, %edi
movq 0x51fd3(%rip), %rax     # 0x82600
callq *0x140(%rax)
movq -0x440(%rbp), %rdi
movq %rax, %rsi
callq 0x19880
leaq -0x230(%rbp), %rdi
leaq 0x3eaf3(%rip), %rsi     # 0x6f143
callq 0x19880
leaq -0x230(%rbp), %rax
movq %rax, -0x438(%rbp)
movq 0x51f96(%rip), %rax     # 0x82600
callq *0x148(%rax)
movq -0x438(%rbp), %rdi
movq %rax, %rsi
callq 0x19880
jmp 0x306e0
movq 0x51f78(%rip), %rax     # 0x82600
callq *0x148(%rax)
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x306d0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x448(%rbp)
movq -0x28(%rbp), %rdi
callq 0x186e0
movq %rax, %rcx
movq -0x448(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
leaq -0x230(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x19880
movq -0x8(%rbp), %rdi
leaq -0x230(%rbp), %rsi
leaq -0x230(%rbp), %rdx
movl $0x200, %ecx            # imm = 0x200
callq 0x18050
leaq -0x430(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x19880
leaq -0x430(%rbp), %rdi
callq 0x186e0
cmpq $0x96, %rax
jbe 0x3072a
movb $0x0, -0x39a(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x186e0
movq %rax, %rdx
shlq %rdx
addq $0x3c, %rdx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x10e0(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x10e0(%rax)
leaq -0x430(%rbp), %rdi
leaq 0x407a1(%rip), %rsi     # 0x70f08
callq 0x19880
movq 0x52545(%rip), %rax     # 0x82cb8
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30787
jp 0x30787
jmp 0x3079d
movq 0x51e72(%rip), %rax     # 0x82600
movq 0x8(%rax), %rcx
leaq -0x430(%rbp), %rdi
movb $0x0, %al
callq *%rcx
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq 0x52592(%rip), %rcx     # 0x82d40
cmpl 0x610(%rcx), %eax
jg 0x3082a
movq 0x51d9b(%rip), %rax     # 0x82558
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x307de
jmp 0x3081c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x307eb
jmp 0x3081c
cmpl $0x0, -0xc(%rbp)
je 0x30807
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x18770
cmpl $0x0, %eax
jne 0x30805
jmp 0x3081c
jmp 0x30807
movq -0x20(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movl $0x3, %esi
callq 0x18f20
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x307a4
addq $0x450, %rsp            # imm = 0x450
popq %rbp
retq
nopw %cs:(%rax,%rax)