// File: /workspace/github_cpp_makefile_star2_O3/malcolmyeh[P]CC3K/floor.cc
// Function: Floor::actEnemy[abi:cxx11]()
std::string Floor::actEnemy() {
	std::string combatLog;
	std::string dir[8] = {"ea", "we", "no", "so", "ne", "nw", "sw", "se"};
	for (int i = 0; i < enemies.size(); ++i) {
		Enemy *e = enemies.at(i);
		if ((e->withinRange(this->player->getPosition()) && e->getRace() != "Merchant") ||
		(e->getRace() == "Merchant" && this->getHostile() && e->withinRange(this->player->getPosition()))) {
			combatLog += e->dealDamage(this->player);
		} else if (e->getRace() != "Dragon"){
			Posn p;
			do {
				int num = rand() % 8;
				p = e->getPosition().getNew(dir[num]);
			} while(!validTile(p));
			displayGrid[e->getPosition().y][e->getPosition().x] = '.';
			e->move(p);
			displayGrid[e->getPosition().y][e->getPosition().x] = e->getSymbol();
		}
	}
	return combatLog; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, -0x30(%rbp)
leaq 0x10(%rdi), %rbx
movq %rbx, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, -0x58(%rbp)
movb $0x0, 0x10(%rdi)
leaq -0x1b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1640c(%rip), %rsi     # 0x1d1cd
leaq 0x16407(%rip), %rdx     # 0x1d1cf
leaq -0x1c0(%rbp), %r15
movq %r15, %rdi
movq %rbx, -0x68(%rbp)
callq 0x501a
leaq -0x1a0(%rbp), %r12
leaq -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x163dc(%rip), %rsi     # 0x1d1d0
leaq 0x163d7(%rip), %rdx     # 0x1d1d2
movq %r12, %rdi
callq 0x501a
leaq -0x180(%rbp), %r12
leaq -0x170(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x163b7(%rip), %rsi     # 0x1d1d3
leaq 0x163b2(%rip), %rdx     # 0x1d1d5
movq %r12, %rdi
callq 0x501a
leaq -0x160(%rbp), %r12
leaq -0x150(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16392(%rip), %rsi     # 0x1d1d6
leaq 0x1638d(%rip), %rdx     # 0x1d1d8
movq %r12, %rdi
callq 0x501a
leaq -0x140(%rbp), %r12
leaq -0x130(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1636d(%rip), %rsi     # 0x1d1d9
leaq 0x16368(%rip), %rdx     # 0x1d1db
movq %r12, %rdi
callq 0x501a
leaq -0x120(%rbp), %r12
leaq -0x110(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16348(%rip), %rsi     # 0x1d1dc
leaq 0x16343(%rip), %rdx     # 0x1d1de
movq %r12, %rdi
callq 0x501a
leaq -0x100(%rbp), %r12
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16326(%rip), %rsi     # 0x1d1e2
leaq 0x16321(%rip), %rdx     # 0x1d1e4
movq %r12, %rdi
callq 0x501a
leaq -0xe0(%rbp), %r12
leaq -0xd0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x162fb(%rip), %rsi     # 0x1d1df
leaq 0x162f6(%rip), %rdx     # 0x1d1e1
movq %r12, %rdi
callq 0x501a
movq -0x30(%rbp), %rsi
movq 0x7c0(%rsi), %rax
cmpq %rax, 0x7c8(%rsi)
je 0x71c0
leaq 0x820(%rsi), %rcx
movq %rcx, -0x60(%rbp)
xorl %edx, %edx
movq %rdx, -0x70(%rbp)
movq (%rax,%rdx,8), %r15
movq 0xfe0(%rsi), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0xb5e4
movl %eax, %r12d
testb %al, %al
je 0x6f68
movq (%r15), %rax
leaq -0xc0(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq *0x28(%rax)
movq %r13, %rdi
leaq 0x1636e(%rip), %rsi     # 0x1d2ca
callq 0x4070
movb $0x1, %r13b
testl %eax, %eax
jne 0x6fd3
movq (%r15), %rax
leaq -0x50(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq *0x28(%rax)
movq %r13, %rdi
leaq 0x16348(%rip), %rsi     # 0x1d2ca
callq 0x4070
testl %eax, %eax
jne 0x6fb2
movq -0x30(%rbp), %rax
cmpb $0x1, 0x4(%rax)
jne 0x6fb2
movq 0xfe0(%rax), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0xb5e4
movl %eax, %r13d
jmp 0x6fb5
xorl %r13d, %r13d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6fce
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r12b, %r12b
je 0x6ff5
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x6ff5
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r13b, %r13b
leaq -0x50(%rbp), %rdi
je 0x7045
movq -0x30(%rbp), %rax
movq 0xfe0(%rax), %rdx
movq (%r15), %rax
movq %r15, %rsi
callq *0x50(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x58(%rbp), %rdi
callq 0x4080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7197
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0x7197
movq (%r15), %rax
movq %rdi, %r12
movq %r15, %rsi
callq *0x28(%rax)
leaq -0x90(%rbp), %r13
movq %r12, %rdi
leaq 0x16271(%rip), %rsi     # 0x1d2d3
callq 0x4070
movl %eax, %r12d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7083
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testl %r12d, %r12d
je 0x7197
callq 0x4060
movl %eax, %r12d
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
leaq -0xa0(%rbp), %r14
leal 0x7(%r12), %ecx
testl %r12d, %r12d
cmovnsl %r12d, %ecx
andl $-0x8, %ecx
subl %ecx, %r12d
movq %rax, -0x78(%rbp)
movslq %r12d, %rax
shlq $0x5, %rax
movq %r13, -0xa0(%rbp)
movq -0x1c0(%rbp,%rax), %rsi
movq -0x1b8(%rbp,%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xa4be
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x50b8
movq %rax, -0x80(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x51e6
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x711b
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x5b3e
testb %al, %al
je 0x708c
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movq %rax, %r12
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
sarq $0x20, %r12
cltq
imulq $0x4f, %r12, %rcx
addq -0x60(%rbp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x50(%rbp), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x30(%rax)
movl %eax, %r12d
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movq %rax, %r13
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
sarq $0x20, %r13
cltq
imulq $0x4f, %r13, %rcx
addq -0x60(%rbp), %rcx
movb %r12b, (%rax,%rcx)
movq -0x70(%rbp), %rdx
incq %rdx
movq -0x30(%rbp), %rsi
movq 0x7c0(%rsi), %rax
movq 0x7c8(%rsi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rdx, %rcx
ja 0x6f18
movq $-0x100, %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x71db
movq (%rbx), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %rbx
addq $0x20, %r14
jne 0x71c7
movq -0x58(%rbp), %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7207
jmp 0x7207
jmp 0x7207
jmp 0x7207
jmp 0x7207
jmp 0x7207
movq %rax, %r14
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x7224
movq (%r12), %rsi
incq %rsi
callq 0x4170
leaq -0x20(%r12), %rax
addq $-0x10, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x720e
jmp 0x72fd
movq %rax, %r14
jmp 0x72fd
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7289
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0x7289
jmp 0x72ae
jmp 0x72ae
jmp 0x72ae
jmp 0x72ae
jmp 0x72ae
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x72d1
movq -0x40(%rbp), %rsi
jmp 0x72c9
jmp 0x72ae
jmp 0x72ae
jmp 0x72ae
movq %rax, %r14
testb %r12b, %r12b
je 0x72d1
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x72d1
movq -0xb0(%rbp), %rsi
jmp 0x72c9
jmp 0x72ae
jmp 0x72ae
movq %rax, %r14
jmp 0x72d1
movq %rax, %r14
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x72d1
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x4170
xorl %r15d, %r15d
movq -0xe0(%rbp,%r15), %rdi
leaq (%rbx,%r15), %rax
cmpq %rdi, %rax
je 0x72f0
movq (%rax), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %r15
cmpq $-0x100, %r15
jne 0x72d4
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x7318
movq (%rax), %rsi
incq %rsi
callq 0x4170
movq %r14, %rdi
callq 0x4250