// File: /workspace/github_cpp_makefile_star2_O3/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: react_to_noise(actor*, noise*, int, int)
void react_to_noise(actor* a,noise* n,int xx, int yy)
{
	if(a->is_player)
	{
		sound_this_turn = n->describe;
		if(on_map(xx,yy))
		{
			int dx = xx-a->x; int dy = yy-a->y;
			if(dx != 0)
			{
				float t = 180*atan(float(dy)/(float)dx)/PI;
				if(t<-67.5)
				{dir_this_turn = (dx>0?"North":"South");}
				else if(t<-22.5)
				{dir_this_turn = (dx>0?"NEast":"SWest");}
				else if(t<22.5)
				{dir_this_turn = (dx>0?"East":"West");}
				else if(t<67.5)
				{dir_this_turn = (dx>0?"SEast":"NWest");}
				else {dir_this_turn = (dx>0?"South":"North");}
			}
			else
			{
				if(dy == 0)
				{
					dir_this_turn = "here";
				}
				else {dir_this_turn = (dy>0)?"South":"North";}
			}
		}
		else{dir_this_turn = "???";}
	}
	else if(!a->is_hologram)
	{
		if(n->scary)
		{
			if(a->sspecies->size != 2)
			{
			a->runaway_x = xx;
			a->runaway_y = yy;
			}
		}
		else
		{
			if(!a->certain)
			{
				a->ai_x = xx;
				a->ai_y = yy;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movl %edx, %ebx
movq %rdi, %r14
cmpb $0x1, 0x8(%rdi)
jne 0xb173
addq $0x8, %rsi
leaq 0xbb339(%rip), %rdi     # 0xc6458
callq 0x5170
movl %ebp, %eax
orl %ebx, %eax
js 0xb17f
movl $0x96, %eax
cmpl %eax, %ebx
setge %cl
cmpl %eax, %ebp
setge %al
orb %cl, %al
jne 0xb17f
movl 0x24(%r14), %ecx
movl %ebp, %eax
subl %ecx, %eax
subl 0x20(%r14), %ebx
jne 0xb1c9
cmpl %ecx, %ebp
jne 0xb209
leaq 0xbb31e(%rip), %rdi     # 0xc6478
movq 0xbb31f(%rip), %rdx     # 0xc6480
leaq 0xda65(%rip), %rcx      # 0x18bcd
movl $0x4, %r8d
jmp 0xb250
cmpb $0x0, 0x9(%r14)
je 0xb19f
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xbb2f2(%rip), %rdi     # 0xc6478
movq 0xbb2f3(%rip), %rdx     # 0xc6480
leaq 0xda3e(%rip), %rcx      # 0x18bd2
movl $0x3, %r8d
jmp 0xb250
cmpb $0x1, 0x28(%rsi)
jne 0xb1b8
movq (%r14), %rax
cmpl $0x2, 0x38(%rax)
je 0xb17a
movl %ebx, 0x30(%r14)
movl %ebp, 0x34(%r14)
jmp 0xb17a
cmpb $0x0, 0x1d(%r14)
jne 0xb17a
movl %ebx, 0x28(%r14)
movl %ebp, 0x2c(%r14)
jmp 0xb17a
cvtsi2ss %eax, %xmm0
cvtsi2ss %ebx, %xmm1
divss %xmm1, %xmm0
callq 0x51f0
mulss 0xce82(%rip), %xmm0     # 0x18064
divss 0xce7e(%rip), %xmm0     # 0x18068
movss 0xce7a(%rip), %xmm1     # 0x1806c
ucomiss %xmm0, %xmm1
jbe 0xb21b
testl %ebx, %ebx
leaq 0xd9a9(%rip), %rax      # 0x18ba9
leaq 0xd9a8(%rip), %rcx      # 0x18baf
jmp 0xb238
testl %eax, %eax
leaq 0xd99d(%rip), %rax      # 0x18baf
leaq 0xd990(%rip), %rcx      # 0x18ba9
jmp 0xb238
movss 0xce4d(%rip), %xmm1     # 0x18070
ucomiss %xmm0, %xmm1
jbe 0xb25b
testl %ebx, %ebx
leaq 0xd984(%rip), %rax      # 0x18bb5
leaq 0xd983(%rip), %rcx      # 0x18bbb
cmovgq %rax, %rcx
leaq 0xbb235(%rip), %rdi     # 0xc6478
movq 0xbb236(%rip), %rdx     # 0xc6480
movl $0x5, %r8d
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5380
movss 0xce11(%rip), %xmm1     # 0x18074
ucomiss %xmm0, %xmm1
jbe 0xb27a
testl %ebx, %ebx
leaq 0xd945(%rip), %rax      # 0x18bb6
leaq 0xd950(%rip), %rsi      # 0x18bc8
jmp 0xb2a9
movss 0xcdf6(%rip), %xmm1     # 0x18078
ucomiss %xmm0, %xmm1
jbe 0xb299
testl %ebx, %ebx
leaq 0xd931(%rip), %rax      # 0x18bc1
leaq 0xd930(%rip), %rsi      # 0x18bc7
jmp 0xb2a9
testl %ebx, %ebx
leaq 0xd90d(%rip), %rax      # 0x18baf
leaq 0xd900(%rip), %rsi      # 0x18ba9
cmovgq %rax, %rsi
leaq 0xbb1c4(%rip), %rdi     # 0xc6478
popq %rbx
popq %r14
popq %rbp
jmp 0x5340