// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: make_noise(int, int, noise*)
void make_noise(int x,int y,noise* n)
{
for(std::vector<actor*>::iterator a = actors.begin(); a != actors.end(); ++a)
{
	if(!(*a)->dead && !(*a)->is_hologram)
	{
		int d2 = d22(x,y,(*a)->x,(*a)->y);
		float rel_vol = n->volume - 2*log((float)d2+1);
		float clarity = (rel_vol - (*a)->sound_threshold);
		float clarity2 = abs(clarity-ideal_clarity);
		if(clarity > 0)
		{
			(*a)->sound_threshold  = std::max((*a)->sound_threshold,rel_vol - ideal_clarity);
		}
		if((*a)->most_noticeable_sound < clarity)
		{
			int d = (int)ceil(sqrt((float)d2)/2);
			int xx, yy;
			(*a)->sound_threshold = rel_vol - ideal_clarity;
			if(clarity2 <= ideal_clarity/4)
			{
				xx = x; yy = y;
			}
			else if(clarity2 <= ideal_clarity/2)
			{
				xx = x-d/2 + rand()%(d+1);
				yy = y-d/2 + rand()%(d+1);
			}
			else if(clarity2 <= ideal_clarity)
			{
				xx = x-d + rand()%(2*d+1);
				yy = y-d + rand()%(2*d+1);
			}
			else
			{
				xx=-500;
				yy=-500;
			}
			react_to_noise(*a,n,xx,yy);
		}

		
	}
}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r13
movl %esi, %ebp
movl %edi, %r14d
movq 0xba120(%rip), %rbx     # 0xc33e0
movq %rdx, 0x8(%rsp)
cmpq 0xba11c(%rip), %rbx     # 0xc33e8
je 0x946a
movq (%rbx), %rax
cmpb $0x0, 0x1c(%rax)
jne 0x9461
cmpb $0x0, 0x9(%rax)
jne 0x9461
movl %r14d, %ecx
subl 0x20(%rax), %ecx
imull %ecx, %ecx
movl %ebp, %edx
subl 0x24(%rax), %edx
imull %edx, %edx
addl %ecx, %edx
cvtsi2ss %edx, %xmm0
movss (%r13), %xmm1
movss %xmm1, (%rsp)
movss %xmm0, 0x4(%rsp)
addss 0xacfb(%rip), %xmm0     # 0x14014
callq 0x53d0
addss %xmm0, %xmm0
movss (%rsp), %xmm2
subss %xmm0, %xmm2
movq (%rbx), %r15
movss 0x3c(%r15), %xmm1
movss %xmm2, (%rsp)
movaps %xmm2, %xmm0
subss %xmm1, %xmm0
movaps %xmm0, %xmm3
addss 0xaced(%rip), %xmm3     # 0x14038
ucomiss 0xad2e(%rip), %xmm0     # 0x14080
jbe 0x936b
movss (%rsp), %xmm2
addss 0xacd7(%rip), %xmm2     # 0x14038
maxss %xmm1, %xmm2
movss %xmm2, 0x3c(%r15)
ucomiss 0x40(%r15), %xmm0
jbe 0x9461
andps 0xadb3(%rip), %xmm3     # 0x14130
movaps %xmm3, 0x10(%rsp)
sqrtss 0x4(%rsp), %xmm0
movss 0xacec(%rip), %xmm1     # 0x1407c
mulss %xmm1, %xmm0
callq 0x5190
movaps 0x10(%rsp), %xmm2
movss (%rsp), %xmm1
addss 0xac8d(%rip), %xmm1     # 0x14038
movss %xmm1, 0x3c(%r15)
movss 0xacc3(%rip), %xmm1     # 0x1407c
ucomiss %xmm2, %xmm1
movl %r14d, %r12d
movl %ebp, %ecx
jae 0x9453
cvttss2si %xmm0, %r15d
movss 0xac40(%rip), %xmm0     # 0x14014
ucomiss %xmm2, %xmm0
jae 0x941c
movl $0xfffffe0c, %r12d      # imm = 0xFFFFFE0C
movss 0xac5d(%rip), %xmm0     # 0x14044
ucomiss %xmm2, %xmm0
movl $0xfffffe0c, %ecx       # imm = 0xFFFFFE0C
jb 0x9453
movl %r14d, %eax
subl %r15d, %eax
movl %eax, (%rsp)
callq 0x5080
movl %ebp, %r13d
subl %r15d, %r13d
leal 0x1(,%r15,2), %ecx
cltd
idivl %ecx
movl %edx, %r12d
addl (%rsp), %r12d
movl %ecx, %r15d
jmp 0x9440
movl %r15d, %eax
cltd
pushq $-0x2
popq %rcx
idivl %ecx
movl %eax, %r13d
callq 0x5080
incl %r15d
cltd
idivl %r15d
movl %edx, %r12d
addl %r14d, %r12d
addl %r13d, %r12d
addl %ebp, %r13d
callq 0x5080
cltd
idivl %r15d
movl %edx, %ecx
addl %r13d, %ecx
movq 0x8(%rsp), %r13
movq (%rbx), %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x912f
addq $0x8, %rbx
jmp 0x92c5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq