// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x1, %edx
jne 0x4cee7
movq 0x58(%r14), %rax
movl 0xf1c(%rax), %ecx
testl %ecx, %ecx
je 0x4cee7
decl %ecx
movl %ecx, 0xf1c(%rax)
jmp 0x4d089
movq 0x1cfd2(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4d089
jp 0x4d089
testb $0x20, 0x11c(%r14)
jne 0x4d089
cmpq $0x0, 0x2d8(%r14)
jne 0x4cfa7
callq 0x19710
leaq 0xec40(%rip), %r15      # 0x5bb70
movq %r15, 0x138(%rax)
movabsq $0x4100000041000000, %r12 # imm = 0x4100000041000000
movq %r12, 0xd8(%rax)
movl $0x41000000, %r13d      # imm = 0x41000000
movl %r13d, 0xe0(%rax)
movq %r14, 0x110(%rax)
movaps 0xeb7d(%rip), %xmm0     # 0x5bae0
movups %xmm0, 0xc8(%rax)
movq %rax, 0x2d8(%r14)
callq 0x19710
movq %r15, 0x138(%rax)
movq %r12, 0xd8(%rax)
movl %r13d, 0xe0(%rax)
movq %r14, 0x110(%rax)
movaps 0xeb47(%rip), %xmm0     # 0x5bae0
movups %xmm0, 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 0x1cddd(%rip), %rax     # 0x69da0
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 0x1c58b(%rip), %rax     # 0x69600
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x90(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq