// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: G_SetClientSound
void G_SetClientSound (edict_t *ent)
{
	char	*weap;

	if (ent->client->pers.game_helpchanged != game.helpchanged)
	{
		ent->client->pers.game_helpchanged = game.helpchanged;
		ent->client->pers.helpchanged = 1;
	}

	// help beep (no more than three times)
	if (ent->client->pers.helpchanged && ent->client->pers.helpchanged <= 3 && !(level.framenum&63) )
	{
		ent->client->pers.helpchanged++;
		gi.sound (ent, CHAN_VOICE, gi.soundindex ("misc/pc_up.wav"), 1, ATTN_STATIC, 0);
	}


	if (ent->client->pers.weapon)
		weap = ent->client->pers.weapon->classname;
	else
		weap = "";

	if (ent->waterlevel && (ent->watertype&(CONTENTS_LAVA|CONTENTS_SLIME)) )
		ent->s.sound = snd_fry;
	else if (strcmp(weap, "weapon_railgun") == 0)
		ent->s.sound = gi.soundindex("weapons/rg_hum.wav");
	else if (strcmp(weap, "weapon_bfg") == 0)
		ent->s.sound = gi.soundindex("weapons/bfg_hum.wav");
// SKWiD MOD
	else if (strcmp(weap, "weapon_plasma") == 0)
		ent->s.sound = gi.soundindex(PLASMA_SOUND_IDLE);
// END
	else if (ent->client->weapon_sound)
		ent->s.sound = ent->client->weapon_sound;
	else
		ent->s.sound = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x748(%rax), %eax
movq 0x1e58f(%rip), %rcx     # 0x82d40
cmpl 0x400(%rcx), %eax
je 0x647e6
movq 0x1e580(%rip), %rax     # 0x82d40
movl 0x400(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0x748(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0x74c(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0x74c(%rax)
je 0x64880
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x3, 0x74c(%rax)
jg 0x64880
movq 0x1e58d(%rip), %rax     # 0x82da0
movl (%rax), %eax
andl $0x3f, %eax
cmpl $0x0, %eax
jne 0x64880
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x74c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x74c(%rax)
movq 0x1ddc5(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x1100f(%rip), %rdi     # 0x75861
movq 0x1dda7(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x20(%rbp), %rdi
movl %eax, %edx
movq -0x18(%rbp), %rax
movl $0x2, %esi
movss 0xb679(%rip), %xmm0     # 0x6feec
movss 0xb695(%rip), %xmm1     # 0x6ff10
xorps %xmm2, %xmm2
callq *%rax
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x730(%rax)
je 0x648aa
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x730(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x648b5
leaq 0xc6cf(%rip), %rax      # 0x70f80
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30c(%rax)
je 0x648e9
movq -0x8(%rbp), %rax
movl 0x308(%rax), %eax
andl $0x18, %eax
cmpl $0x0, %eax
je 0x648e9
movq 0x1dc25(%rip), %rax     # 0x82500
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x649ba
movq -0x10(%rbp), %rdi
leaq 0xb6cb(%rip), %rsi      # 0x6ffbf
callq 0x18bf0
cmpl $0x0, %eax
jne 0x6491d
leaq 0xee82(%rip), %rdi      # 0x73787
movq 0x1dcf4(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x649b8
movq -0x10(%rbp), %rdi
leaq 0xb68c(%rip), %rsi      # 0x6ffb4
callq 0x18bf0
cmpl $0x0, %eax
jne 0x6494e
leaq 0xef22(%rip), %rdi      # 0x7385b
movq 0x1dcc0(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x649b6
movq -0x10(%rbp), %rdi
leaq 0xe646(%rip), %rsi      # 0x72f9f
callq 0x18bf0
cmpl $0x0, %eax
jne 0x6497f
leaq 0x12f91(%rip), %rdi     # 0x778fb
movq 0x1dc8f(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x649b4
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xf20(%rax)
je 0x649a7
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xf20(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x649b2
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
jmp 0x649b4
jmp 0x649b6
jmp 0x649b8
jmp 0x649ba
addq $0x20, %rsp
popq %rbp
retq