// File: /workspace/github_c_makefile_star2_O2/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 0x48098
movq 0x58(%r14), %rax
movl 0xf1c(%rax), %ecx
testl %ecx, %ecx
je 0x48098
decl %ecx
movl %ecx, 0xf1c(%rax)
jmp 0x4823a
movq 0x1ee21(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4823a
jp 0x4823a
testb $0x20, 0x11c(%r14)
jne 0x4823a
cmpq $0x0, 0x2d8(%r14)
jne 0x4815e
callq 0x198d0
leaq 0xed9f(%rip), %r15      # 0x56e80
movq %r15, 0x138(%rax)
movaps 0xb2c1(%rip), %xmm0     # 0x533b0
movups %xmm0, 0xcc(%rax)
movsd 0xb2c2(%rip), %xmm0     # 0x533c0
movsd %xmm0, 0xdc(%rax)
movq %r14, 0x110(%rax)
pushq $0x1
popq %r12
movl %r12d, 0xc8(%rax)
movq %rax, 0x2d8(%r14)
callq 0x198d0
movq %r15, 0x138(%rax)
movaps 0xb27e(%rip), %xmm0     # 0x533b0
movups %xmm0, 0xcc(%rax)
movsd 0xb27f(%rip), %xmm0     # 0x533c0
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 0x1ec26(%rip), %rax     # 0x66da0
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 0x1e3d4(%rip), %rax     # 0x66600
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x90(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq