// File: /workspace/github_c_makefile_star2_O3/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 0x3e952(%rip), %r13     # 0x68600
callq *0x138(%r13)
testl %ebp, %ebp
jne 0x29cc2
cmpl $0x2, %eax
jl 0x29ea6
movq %r14, %rdi
callq 0x195b0
testl %eax, %eax
je 0x29ea6
movl $0x2c0, %ecx            # imm = 0x2C0
addq 0x58(%r14), %rcx
cmpl $0x0, 0xc(%rsp)
leaq 0x2b805(%rip), %rax     # 0x554ec
leaq 0x2b7f7(%rip), %rdx     # 0x554e5
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 0x29d49
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 0x29d6e
callq *0x148(%r13)
movq %rax, %r15
cmpb $0x22, (%rax)
jne 0x29d6e
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 0x29dbc
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 0x3eeba(%rip), %rax     # 0x68cb8
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x29e10
jnp 0x29e1b
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq *0x8(%r13)
movq 0x3ef1e(%rip), %rax     # 0x68d40
movl 0x610(%rax), %r13d
testl %r13d, %r13d
jle 0x29ea6
movq 0x3e723(%rip), %rax     # 0x68558
movq (%rax), %rbx
movl $0x4a8, %r15d           # imm = 0x4A8
xorl %ebp, %ebp
cmpl $0x0, 0x60(%rbx,%r15)
je 0x29e94
cmpq $0x0, 0x58(%rbx,%r15)
je 0x29e94
leaq (%rbx,%r15), %r12
cmpl $0x0, 0xc(%rsp)
je 0x29e6a
movq %r14, %rdi
movq %r12, %rsi
callq 0x18700
testl %eax, %eax
je 0x29e94
movl $0x3, %esi
movq %r12, %rdi
leaq 0x10(%rsp), %rdx
callq 0x18da0
movq 0x3e6d5(%rip), %rax     # 0x68558
movq (%rax), %rbx
movq 0x3eeb3(%rip), %rax     # 0x68d40
movl 0x610(%rax), %r13d
movslq %r13d, %rax
incq %rbp
addq $0x4a8, %r15            # imm = 0x4A8
cmpq %rax, %rbp
jl 0x29e40
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq