// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: PlayerNoise
void PlayerNoise(edict_t *who, vec3_t where, int type)
{
	edict_t		*noise;

	if (type == PNOISE_WEAPON)
	{
		if (who->client->silencer_shots)
		{
			who->client->silencer_shots--;
			return;
		}
	}

	if (deathmatch->value)
		return;

	if (who->flags & FL_NOTARGET)
		return;


	if (!who->mynoise)
	{
		noise = G_Spawn();
		noise->classname = "player_noise";
		VectorSet (noise->mins, -8, -8, -8);
		VectorSet (noise->maxs, 8, 8, 8);
		noise->owner = who;
		noise->svflags = SVF_NOCLIENT;
		who->mynoise = noise;

		noise = G_Spawn();
		noise->classname = "player_noise";
		VectorSet (noise->mins, -8, -8, -8);
		VectorSet (noise->maxs, 8, 8, 8);
		noise->owner = who;
		noise->svflags = SVF_NOCLIENT;
		who->mynoise2 = noise;
	}

	if (type == PNOISE_SELF || type == PNOISE_WEAPON)
	{
		noise = who->mynoise;
		level.sound_entity = noise;
		level.sound_entity_framenum = level.framenum;
	}
	else // type == PNOISE_IMPACT
	{
		noise = who->mynoise2;
		level.sound2_entity = noise;
		level.sound2_entity_framenum = level.framenum;
	}

	VectorCopy (where, noise->s.origin);
	VectorSubtract (where, noise->maxs, noise->absmin);
	VectorAdd (where, noise->maxs, noise->absmax);
	noise->teleport_time = level.time;
	gi.linkentity (noise);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x1, %edx
jne 0x4c1d4
movq 0x58(%r14), %rax
movl 0xf1c(%rax), %ecx
testl %ecx, %ecx
je 0x4c1d4
decl %ecx
movl %ecx, 0xf1c(%rax)
jmp 0x4c378
movq 0x1cce5(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4c378
jp 0x4c378
testb $0x20, 0x11c(%r14)
jne 0x4c378
cmpq $0x0, 0x2d8(%r14)
jne 0x4c29c
callq 0x19700
leaq 0xeca3(%rip), %r15      # 0x5aec0
movq %r15, 0x138(%rax)
movaps 0xb1a5(%rip), %xmm0     # 0x573d0
movups %xmm0, 0xcc(%rax)
movsd 0xb1a6(%rip), %xmm0     # 0x573e0
movsd %xmm0, 0xdc(%rax)
movq %r14, 0x110(%rax)
movl $0x1, %r12d
movl %r12d, 0xc8(%rax)
movq %rax, 0x2d8(%r14)
callq 0x19700
movq %r15, 0x138(%rax)
movaps 0xb160(%rip), %xmm0     # 0x573d0
movups %xmm0, 0xcc(%rax)
movsd 0xb161(%rip), %xmm0     # 0x573e0
movsd %xmm0, 0xdc(%rax)
movq %r14, 0x110(%rax)
movl %r12d, 0xc8(%rax)
movq %rax, 0x2e0(%r14)
xorl %eax, %eax
cmpl $0x2, %ebp
setae %al
movq 0x2d8(%r14,%rax,8), %rdi
movl %eax, %ecx
shll $0x4, %ecx
movq 0x1cae8(%rip), %rax     # 0x68da0
movq %rdi, 0x110(%rcx,%rax)
movl (%rax), %edx
movl %edx, 0x118(%rcx,%rax)
movss (%rbx), %xmm0
movss %xmm0, 0x4(%rdi)
movss 0x4(%rbx), %xmm0
movss %xmm0, 0x8(%rdi)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0xc(%rdi)
movss (%rbx), %xmm0
movss 0xd8(%rdi), %xmm1
movss 0xdc(%rdi), %xmm2
subss %xmm1, %xmm0
movss %xmm0, 0xe4(%rdi)
movss 0x4(%rbx), %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0xe8(%rdi)
movss 0x8(%rbx), %xmm0
movss 0xe0(%rdi), %xmm3
subss %xmm3, %xmm0
movss %xmm0, 0xec(%rdi)
addss (%rbx), %xmm1
movss %xmm1, 0xf0(%rdi)
addss 0x4(%rbx), %xmm2
movss %xmm2, 0xf4(%rdi)
addss 0x8(%rbx), %xmm3
movss %xmm3, 0xf8(%rdi)
movss 0x4(%rax), %xmm0
movss %xmm0, 0x304(%rdi)
movq 0x1c296(%rip), %rax     # 0x68600
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x90(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq