// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $-0x1, 0x1100(%rax)
jg 0x2bbfe
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x4594b(%rip), %rdx     # 0x7153f
callq 0x18f20
jmp 0x2beb5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x30, %eax
cmpl $0x0, %eax
jne 0x2bc2e
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x45935(%rip), %rdx     # 0x71559
callq 0x18f20
jmp 0x2beb5
movq -0x8(%rbp), %rdi
callq 0x197f0
cmpl $0x0, %eax
jne 0x2bc41
jmp 0x2beb5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0xc0, %rdi
leaq 0x436d9(%rip), %rsi     # 0x6f330
callq 0x18cb0
movq %rax, -0x228(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
je 0x2bca3
movq -0x10(%rbp), %rdi
leaq 0x458f3(%rip), %rsi     # 0x7156d
movl $0x5, %edx
callq 0x18200
cmpl $0x0, %eax
je 0x2bca3
movq -0x10(%rbp), %rdi
leaq 0x458df(%rip), %rsi     # 0x71573
movl $0x4, %edx
callq 0x18200
cmpl $0x0, %eax
jne 0x2bcc3
leaq -0x210(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x200, %esi            # imm = 0x200
leaq 0x458be(%rip), %rdx     # 0x71578
movb $0x0, %al
callq 0x18f90
jmp 0x2bd24
movq -0x228(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
je 0x2bce1
movq -0x228(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jne 0x2bcf1
leaq 0x4589f(%rip), %rax     # 0x71587
movq %rax, -0x230(%rbp)
jmp 0x2bcff
leaq 0x43378(%rip), %rax     # 0x6f070
movq %rax, -0x230(%rbp)
leaq -0x210(%rbp), %rdi
movq -0x230(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0x200, %esi            # imm = 0x200
leaq 0x4586e(%rip), %rdx     # 0x7158b
movb $0x0, %al
callq 0x18f90
movl $0x1, -0x214(%rbp)
movl -0x214(%rbp), %eax
movq 0x57005(%rip), %rcx     # 0x82d40
cmpl 0x610(%rcx), %eax
jg 0x2be68
movq 0x5680a(%rip), %rax     # 0x82558
movq (%rax), %rax
movslq -0x214(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x2bd7b
jmp 0x2be54
movq -0x220(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x2bd8e
jmp 0x2be54
movq -0x8(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x18770
cmpl $0x0, %eax
jne 0x2bda8
jmp 0x2be54
movq -0x220(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x30, %eax
cmpl $0x0, %eax
jne 0x2bdc6
jmp 0x2be54
movq -0x220(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2bdf2
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x18d80
movq -0x220(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x2be52
leaq -0x430(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
movq -0x10(%rbp), %rcx
leaq 0x4576a(%rip), %rsi     # 0x7159d
movb $0x0, %al
callq 0x19940
movq -0x220(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
jmp 0x2be54
movl -0x214(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x214(%rbp)
jmp 0x2bd2e
movq 0x56791(%rip), %rax     # 0x82600
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
movq -0x10(%rbp), %rdx
leaq 0x45709(%rip), %rdi     # 0x7159d
movb $0x0, %al
callq *%rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x10e0(%rax), %rcx
subq $0x96, %rcx
movq %rcx, 0x10e0(%rax)
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nop