// File: /workspace/github_cpp_makefile_star2_O1/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 0xb506
addq $0x8, %rsi
leaq 0xbafb6(%rip), %rdi     # 0xc6468
callq 0x5170
movl %ebp, %eax
orl %ebx, %eax
js 0xb512
movl $0x96, %eax
cmpl %eax, %ebx
setge %cl
cmpl %eax, %ebp
setge %al
orb %cl, %al
jne 0xb512
movl 0x24(%r14), %ecx
movl %ebp, %eax
subl %ecx, %eax
subl 0x20(%r14), %ebx
jne 0xb55c
cmpl %ecx, %ebp
jne 0xb59c
leaq 0xbaf9b(%rip), %rdi     # 0xc6488
movq 0xbaf9c(%rip), %rdx     # 0xc6490
leaq 0xd662(%rip), %rcx      # 0x18b5d
movl $0x4, %r8d
jmp 0xb5e3
cmpb $0x0, 0x9(%r14)
je 0xb532
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xbaf6f(%rip), %rdi     # 0xc6488
movq 0xbaf70(%rip), %rdx     # 0xc6490
leaq 0xd63b(%rip), %rcx      # 0x18b62
movl $0x3, %r8d
jmp 0xb5e3
cmpb $0x1, 0x28(%rsi)
jne 0xb54b
movq (%r14), %rax
cmpl $0x2, 0x38(%rax)
je 0xb50d
movl %ebx, 0x30(%r14)
movl %ebp, 0x34(%r14)
jmp 0xb50d
cmpb $0x0, 0x1d(%r14)
jne 0xb50d
movl %ebx, 0x28(%r14)
movl %ebp, 0x2c(%r14)
jmp 0xb50d
cvtsi2ss %eax, %xmm0
cvtsi2ss %ebx, %xmm1
divss %xmm1, %xmm0
callq 0x51f0
mulss 0xcaef(%rip), %xmm0     # 0x18064
divss 0xcaeb(%rip), %xmm0     # 0x18068
movss 0xcae7(%rip), %xmm1     # 0x1806c
ucomiss %xmm0, %xmm1
jbe 0xb5ae
testl %ebx, %ebx
leaq 0xd5a6(%rip), %rax      # 0x18b39
leaq 0xd5a5(%rip), %rcx      # 0x18b3f
jmp 0xb5cb
testl %eax, %eax
leaq 0xd59a(%rip), %rax      # 0x18b3f
leaq 0xd58d(%rip), %rcx      # 0x18b39
jmp 0xb5cb
movss 0xcaba(%rip), %xmm1     # 0x18070
ucomiss %xmm0, %xmm1
jbe 0xb5ee
testl %ebx, %ebx
leaq 0xd581(%rip), %rax      # 0x18b45
leaq 0xd580(%rip), %rcx      # 0x18b4b
cmovgq %rax, %rcx
leaq 0xbaeb2(%rip), %rdi     # 0xc6488
movq 0xbaeb3(%rip), %rdx     # 0xc6490
movl $0x5, %r8d
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5380
movss 0xca7e(%rip), %xmm1     # 0x18074
ucomiss %xmm0, %xmm1
jbe 0xb60d
testl %ebx, %ebx
leaq 0xd542(%rip), %rax      # 0x18b46
leaq 0xd54d(%rip), %rsi      # 0x18b58
jmp 0xb63c
movss 0xca63(%rip), %xmm1     # 0x18078
ucomiss %xmm0, %xmm1
jbe 0xb62c
testl %ebx, %ebx
leaq 0xd52e(%rip), %rax      # 0x18b51
leaq 0xd52d(%rip), %rsi      # 0x18b57
jmp 0xb63c
testl %ebx, %ebx
leaq 0xd50a(%rip), %rax      # 0x18b3f
leaq 0xd4fd(%rip), %rsi      # 0x18b39
cmovgq %rax, %rsi
leaq 0xbae41(%rip), %rdi     # 0xc6488
popq %rbx
popq %r14
popq %rbp
jmp 0x5340