// File: /workspace/github_c_makefile_star2_O2/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, %ebx
movq %rdi, 0x8(%rsp)
movq 0x3ed1c(%rip), %r13     # 0x66600
callq *0x138(%r13)
testl %ebp, %ebp
jne 0x278f8
cmpl $0x2, %eax
jl 0x27ad6
movq 0x8(%rsp), %rdi
callq 0x19770
testl %eax, %eax
je 0x27ad6
movl $0x2c0, %ecx            # imm = 0x2C0
movq 0x8(%rsp), %rax
addq 0x58(%rax), %rcx
testl %ebx, %ebx
leaq 0x29bab(%rip), %rax     # 0x514cc
leaq 0x29b9d(%rip), %rdx     # 0x514c5
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x18f30
movb $0x0, 0x210(%rsp)
testl %ebp, %ebp
je 0x27983
xorl %edi, %edi
callq *0x140(%r13)
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x19800
movq %r15, %rdi
callq 0x186c0
movw $0x20, 0x210(%rsp,%rax)
callq *0x148(%r13)
movq %rax, %r15
jmp 0x279a8
callq *0x148(%r13)
movq %rax, %r15
cmpb $0x22, (%rax)
jne 0x279a8
movq %r15, %r12
incq %r12
movq %r12, %rdi
callq 0x186c0
movb $0x0, (%r15,%rax)
movq %r12, %r15
leaq 0x210(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x19800
movq 0x8(%rsp), %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 0x19800
movq %r15, %rdi
callq 0x186c0
cmpq $0x97, %rax
jb 0x279f8
movb $0x0, 0xa6(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x186c0
movq 0x8(%rsp), %rcx
movq 0x58(%rcx), %rcx
movq 0x10e0(%rcx), %rdx
addq %rax, %rax
negq %rax
addq %rdx, %rax
addq $-0x3c, %rax
movq %rax, 0x10e0(%rcx)
movq %r15, %rdi
callq 0x186c0
movw $0xa, 0x10(%rsp,%rax)
movq 0x3f279(%rip), %rax     # 0x66cb8
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x27a51
jnp 0x27a5c
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq *0x8(%r13)
movq 0x3f2dd(%rip), %rax     # 0x66d40
movl 0x610(%rax), %ebp
pushq $0x1
popq %r15
movl $0x4a8, %r12d           # imm = 0x4A8
movq 0x3eade(%rip), %r14     # 0x66558
movslq %ebp, %rax
cmpq %rax, %r15
jg 0x27ad6
movq (%r14), %r13
cmpl $0x0, 0x60(%r13,%r12)
je 0x27aca
cmpq $0x0, 0x58(%r13,%r12)
je 0x27aca
addq %r12, %r13
testl %ebx, %ebx
je 0x27aad
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x18750
testl %eax, %eax
je 0x27aca
movq %r13, %rdi
pushq $0x3
popq %rsi
leaq 0x10(%rsp), %rdx
callq 0x18ec0
movq 0x3f27c(%rip), %rax     # 0x66d40
movl 0x610(%rax), %ebp
incq %r15
addq $0x4a8, %r12            # imm = 0x4A8
jmp 0x27a7a
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq