// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: PlayVoiceSound
void PlayVoiceSound(edict_t *ent, char *sound)
{
	char	command [MAX_INFO_STRING];
	char	*s, *gender;

	//bat
	//if (ent->client->ctf.teamnum == CTF_TEAM_OBSERVER)
	if (ent->client->ctf.teamnum <= CTF_TEAM_OBSERVER)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Observers can't use voice.\n");
		return;
	}

#ifdef NOVOICE_OK
	if ((int)ctfflags->value & CTF_NOVOICE)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "It's quiet time, no talking.\n");
		return;
	}
#endif

	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), "voice/%s.wav", sound);
	}
	else // Append gender
	{
		if (s[0] == 'f' || s[0] == 'F') // Female
		{
			gender = "fem";
		}
		else
		{
			gender = "male";
		}

		Com_sprintf (command, sizeof(command), "voice/%s_%s.wav", gender, sound);
	}

	gi.sound(ent, CHAN_AUTO, gi.soundindex(command), 1, ATTN_IDLE, 0);

	gi.dprintf("%s (voicetext): %s\n",
			ent->client->pers.netname, command);

	ent->client->spam_band_count -= CTF_SPAM_BAND_VOICE; //75 units of spam control for the voice
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $-0x1, 0x1100(%rax)
jg 0x2bf8e
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x4562d(%rip), %rdx     # 0x715b1
callq 0x18f20
jmp 0x2c129
movq -0x8(%rbp), %rdi
callq 0x197f0
cmpl $0x0, %eax
jne 0x2bfa1
jmp 0x2c129
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0xc0, %rdi
leaq 0x43379(%rip), %rsi     # 0x6f330
callq 0x18cb0
movq %rax, -0x218(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
je 0x2c003
movq -0x10(%rbp), %rdi
leaq 0x45593(%rip), %rsi     # 0x7156d
movl $0x5, %edx
callq 0x18200
cmpl $0x0, %eax
je 0x2c003
movq -0x10(%rbp), %rdi
leaq 0x4557f(%rip), %rsi     # 0x71573
movl $0x4, %edx
callq 0x18200
cmpl $0x0, %eax
jne 0x2c023
leaq -0x210(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x200, %esi            # imm = 0x200
leaq 0x455b3(%rip), %rdx     # 0x715cd
movb $0x0, %al
callq 0x18f90
jmp 0x2c084
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
je 0x2c041
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jne 0x2c051
leaq 0x4553f(%rip), %rax     # 0x71587
movq %rax, -0x220(%rbp)
jmp 0x2c05f
leaq 0x43018(%rip), %rax     # 0x6f070
movq %rax, -0x220(%rbp)
leaq -0x210(%rbp), %rdi
movq -0x220(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0x200, %esi            # imm = 0x200
leaq 0x4555d(%rip), %rdx     # 0x715da
movb $0x0, %al
callq 0x18f90
movq 0x56575(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x228(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x230(%rbp)
movq 0x56558(%rip), %rax     # 0x82600
movq 0x48(%rax), %rax
leaq -0x210(%rbp), %rdi
callq *%rax
movq -0x230(%rbp), %rdi
movl %eax, %edx
movq -0x228(%rbp), %rax
xorl %esi, %esi
movss 0x43e1d(%rip), %xmm0    # 0x6feec
movss 0x43e11(%rip), %xmm1    # 0x6fee8
xorps %xmm2, %xmm2
callq *%rax
movq 0x5651d(%rip), %rax     # 0x82600
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
leaq -0x210(%rbp), %rdx
leaq 0x454df(%rip), %rdi     # 0x715ea
movb $0x0, %al
callq *%rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x10e0(%rax), %rcx
subq $0x4b, %rcx
movq %rcx, 0x10e0(%rax)
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)