// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movl %edx, %ebp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
movq 0x3f765(%rip), %r13     # 0x69600
callq *0x138(%r13)
testl %ebp, %ebp
jne 0x29eaf
cmpl $0x2, %eax
jl 0x2a07c
movq %r14, %rdi
callq 0x195b0
testl %eax, %eax
je 0x2a07c
movl $0x2c0, %ecx            # imm = 0x2C0
addq 0x58(%r14), %rcx
cmpl $0x0, 0xc(%rsp)
leaq 0x2c5f8(%rip), %rax     # 0x564cc
leaq 0x2c5ea(%rip), %rdx     # 0x564c5
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x18e10
movb $0x0, 0x210(%rsp)
testl %ebp, %ebp
je 0x29f36
xorl %edi, %edi
callq *0x140(%r13)
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x19640
movq %r15, %rdi
callq 0x18680
movw $0x20, 0x210(%rsp,%rax)
callq *0x148(%r13)
movq %rax, %r15
jmp 0x29f5b
callq *0x148(%r13)
movq %rax, %r15
cmpb $0x22, (%rax)
jne 0x29f5b
movq %r15, %r12
incq %r12
movq %r12, %rdi
callq 0x18680
movb $0x0, (%r15,%rax)
movq %r12, %r15
leaq 0x210(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x19640
movq %r14, %rdi
movq %r12, %rsi
movq %r12, %rdx
movl $0x200, %ecx            # imm = 0x200
callq 0x18050
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x19640
movq %r15, %rdi
callq 0x18680
cmpq $0x97, %rax
jb 0x29fa9
movb $0x0, 0xa6(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x18680
movq 0x58(%r14), %rcx
movq 0x10e0(%rcx), %rdx
addq %rax, %rax
negq %rax
addq %rdx, %rax
addq $-0x3c, %rax
movq %rax, 0x10e0(%rcx)
movq %r15, %rdi
callq 0x18680
movw $0xa, 0x10(%rsp,%rax)
movq 0x3fccd(%rip), %rax     # 0x69cb8
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x29ffd
jnp 0x2a008
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq *0x8(%r13)
movq 0x3fd31(%rip), %r13     # 0x69d40
cmpl $0x0, 0x610(%r13)
jle 0x2a07c
movl $0x4a8, %ebp            # imm = 0x4A8
xorl %r15d, %r15d
movq 0x3f530(%rip), %rbx     # 0x69558
movq (%rbx), %r12
cmpl $0x0, 0x60(%r12,%rbp)
je 0x2a066
cmpq $0x0, 0x58(%r12,%rbp)
je 0x2a066
addq %rbp, %r12
cmpl $0x0, 0xc(%rsp)
je 0x2a054
movq %r14, %rdi
movq %r12, %rsi
callq 0x18700
testl %eax, %eax
je 0x2a066
movl $0x3, %esi
movq %r12, %rdi
leaq 0x10(%rsp), %rdx
callq 0x18da0
movslq 0x610(%r13), %rax
incq %r15
addq $0x4a8, %rbp            # imm = 0x4A8
cmpq %rax, %r15
jl 0x2a028
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq