// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: PlayTeamSound
void PlayTeamSound(edict_t *ent, char *sound)
{
	char	command [MAX_INFO_STRING];
	int j;
	edict_t	*other;
	char	*s, *gender;
	char message[MAX_INFO_STRING];

	//bat
	//if (ent->client->ctf.teamnum == CTF_TEAM_OBSERVER)
	if (ent->client->ctf.teamnum <= CTF_TEAM_OBSERVER)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Observers have no radio.\n");
		return;
	}

	if ( ! (ent->client->ctf.extra_flags &
			(CTF_EXTRAFLAGS_RADIO_TEXT | CTF_EXTRAFLAGS_RADIO_SOUND) )  )
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Your radio is off!\n");
		return;
	}

	if (!ctf_SpamCheck(ent))
		return;

	s = Info_ValueForKey (ent->client->pers.userinfo, "skin");

	// decide gender

	if (sound[0] == '_' || !strncmp(sound, "male_", 5)	|| !strncmp(sound, "fem_", 4))
	{
		Com_sprintf (command, sizeof(command), "play radio/%s\n", sound);
	}
	else // Append gender
	{
		if (s[0] == 'f' || s[0] == 'F') // Female
		{
			gender = "fem";
		}
		else
		{
			gender = "male";
		}

		Com_sprintf (command, sizeof(command), "play radio/%s_%s\n", gender, sound);
	}

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

		// Check if player has radio turned off
		if ( ! (other->client->ctf.extra_flags &
				(CTF_EXTRAFLAGS_RADIO_TEXT | CTF_EXTRAFLAGS_RADIO_SOUND) )  )
			continue;

		if (other->client->ctf.extra_flags & CTF_EXTRAFLAGS_RADIO_SOUND)
			ForceCommand (other, command);

		if (other->client->ctf.extra_flags & CTF_EXTRAFLAGS_RADIO_TEXT)
		{
			sprintf(message, "%s (radiotext): %s\n",
				ent->client->pers.netname, sound);
			ctf_SafePrint(other, PRINT_HIGH, message);
		}
	}
	gi.dprintf("%s (radiotext): %s\n",
			ent->client->pers.netname, sound);

	ent->client->spam_band_count -= CTF_SPAM_BAND_RADIO; //units of spam control for the radio
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, %rbx
movq 0x58(%rdi), %rax
cmpl $0x0, 0x1100(%rax)
js 0x24add
testb $0x30, 0x1108(%rax)
je 0x24ae6
movq %rsi, %r14
movq %rbx, %rdi
callq 0x19770
testl %eax, %eax
je 0x24c22
movl $0xc0, %edi
addq 0x58(%rbx), %rdi
leaq 0x298e0(%rip), %rsi     # 0x4e340
callq 0x18c70
cmpb $0x5f, (%r14)
movq %rbx, (%rsp)
movq %r14, 0x8(%rsp)
je 0x24b09
movq %rax, %r15
leaq 0x2bb47(%rip), %rsi     # 0x505c9
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x18200
testl %eax, %eax
je 0x24b09
leaq 0x2bb37(%rip), %rsi     # 0x505cf
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x18200
testl %eax, %eax
je 0x24b09
movb (%r15), %al
addb $-0x46, %al
testb $-0x21, %al
leaq 0x2bb2e(%rip), %rax     # 0x505e3
leaq 0x295c4(%rip), %rcx     # 0x4e080
cmoveq %rax, %rcx
leaq 0x2bb20(%rip), %rdx     # 0x505e7
leaq 0x10(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %r8
xorl %eax, %eax
callq 0x18f30
jmp 0x24b24
leaq 0x2bab7(%rip), %rdx     # 0x5059b
jmp 0x24aed
leaq 0x2bac8(%rip), %rdx     # 0x505b5
pushq $0x2
popq %rsi
movq %rbx, %rdi
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18ec0
leaq 0x2bac4(%rip), %rdx     # 0x505d4
leaq 0x10(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rcx
xorl %eax, %eax
callq 0x18f30
pushq $0x1
popq %r13
movl $0x4a8, %ebp            # imm = 0x4A8
movq 0x4220c(%rip), %r12     # 0x66d40
movslq 0x610(%r12), %rax
cmpq %rax, %r13
jg 0x24bee
movq 0x41a0c(%rip), %rax     # 0x66558
movq (%rax), %rbx
cmpl $0x0, 0x60(%rbx,%rbp)
je 0x24bdf
movq 0x58(%rbx,%rbp), %r14
testq %r14, %r14
je 0x24bdf
leaq (%rbx,%rbp), %r15
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x18750
testl %eax, %eax
je 0x24bdf
movl 0x1108(%r14), %eax
testb $0x30, %al
je 0x24bdf
testb $0x20, %al
je 0x24b9f
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x18d20
movq 0x58(%rbx,%rbp), %rax
movl 0x1108(%rax), %eax
testb $0x10, %al
je 0x24bdf
movq (%rsp), %rax
movq 0x58(%rax), %rdx
movl $0x2c0, %eax            # imm = 0x2C0
addq %rax, %rdx
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
leaq 0x2ba34(%rip), %rsi     # 0x505f9
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x198c0
movq %r15, %rdi
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x18ec0
incq %r13
addq $0x4a8, %rbp            # imm = 0x4A8
jmp 0x24b34
movq 0x41a0b(%rip), %rcx     # 0x66600
movl $0x2c0, %esi            # imm = 0x2C0
movq (%rsp), %rbx
addq 0x58(%rbx), %rsi
leaq 0x2b9f0(%rip), %rdi     # 0x505f9
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq *0x8(%rcx)
movq 0x58(%rbx), %rax
addq $-0x96, 0x10e0(%rax)
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq