// File: /workspace/github_cpp_makefile_star2_O1/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 $0x1b8, %rsp            # imm = 0x1B8
movq %rsi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, -0x30(%rbp)
movb $0x0, 0x10(%rdi)
leaq -0x1d0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16413(%rip), %rsi     # 0x1d1cd
leaq 0x1640e(%rip), %rdx     # 0x1d1cf
leaq -0x1e0(%rbp), %r12
movq %r12, %rdi
movq %rbx, -0x88(%rbp)
callq 0x501a
leaq -0x1c0(%rbp), %r13
leaq -0x1b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x163e0(%rip), %rsi     # 0x1d1d0
leaq 0x163db(%rip), %rdx     # 0x1d1d2
movq %r13, %rdi
callq 0x501a
leaq -0x1a0(%rbp), %r13
leaq -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x163bb(%rip), %rsi     # 0x1d1d3
leaq 0x163b6(%rip), %rdx     # 0x1d1d5
movq %r13, %rdi
callq 0x501a
leaq -0x180(%rbp), %r13
leaq -0x170(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16396(%rip), %rsi     # 0x1d1d6
leaq 0x16391(%rip), %rdx     # 0x1d1d8
movq %r13, %rdi
callq 0x501a
leaq -0x160(%rbp), %r13
leaq -0x150(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16371(%rip), %rsi     # 0x1d1d9
leaq 0x1636c(%rip), %rdx     # 0x1d1db
movq %r13, %rdi
callq 0x501a
leaq -0x140(%rbp), %r13
leaq -0x130(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1634c(%rip), %rsi     # 0x1d1dc
leaq 0x16347(%rip), %rdx     # 0x1d1de
movq %r13, %rdi
callq 0x501a
leaq -0x120(%rbp), %r13
leaq -0x110(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1632a(%rip), %rsi     # 0x1d1e2
leaq 0x16325(%rip), %rdx     # 0x1d1e4
movq %r13, %rdi
callq 0x501a
leaq -0x100(%rbp), %r13
leaq -0xf0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x162ff(%rip), %rsi     # 0x1d1df
leaq 0x162fa(%rip), %rdx     # 0x1d1e1
movq %r13, %rdi
callq 0x501a
movq 0x7c0(%r14), %rax
cmpq %rax, 0x7c8(%r14)
je 0x71db
leaq 0x820(%r14), %rcx
movq %rcx, -0x58(%rbp)
xorl %edx, %edx
movq %r14, -0x60(%rbp)
movq %rdx, -0x90(%rbp)
movq (%rax,%rdx,8), %r12
movq 0xfe0(%r14), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %r12, %rdi
movq %rax, %rsi
callq 0xb6a4
movl %eax, %r13d
testb %al, %al
leaq -0xe0(%rbp), %rbx
leaq -0xc0(%rbp), %r14
je 0x6f76
movq (%r12), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x28(%rax)
movq %rbx, %rdi
leaq 0x16367(%rip), %rsi     # 0x1d2ca
callq 0x4070
testl %eax, %eax
je 0x6f76
movb $0x1, %r13b
xorl %r14d, %r14d
movb $0x1, %bl
jmp 0x6fc1
movq (%r12), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x28(%rax)
movq %r14, %rdi
leaq 0x1633d(%rip), %rsi     # 0x1d2ca
callq 0x4070
movb $0x1, %r14b
testl %eax, %eax
jne 0x6fbf
movq -0x60(%rbp), %rax
cmpb $0x1, 0x4(%rax)
jne 0x6fbf
movq 0xfe0(%rax), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %r12, %rdi
movq %rax, %rsi
callq 0xb6a4
movl %eax, %ebx
jmp 0x6fc1
xorl %ebx, %ebx
testb %r14b, %r14b
movq -0x60(%rbp), %r14
je 0x6fec
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x6fec
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r13b, %r13b
je 0x7013
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x7013
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x4170
testb %bl, %bl
je 0x705f
movq 0xfe0(%r14), %rdx
movq (%r12), %rax
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq *0x50(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x4080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x71b3
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0x71b3
movq (%r12), %rax
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq *0x28(%rax)
movq %rbx, %rdi
leaq 0x16259(%rip), %rsi     # 0x1d2d3
callq 0x4070
movl %eax, %ebx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x709a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testl %ebx, %ebx
je 0x71b3
callq 0x4060
movl %eax, %ebx
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
leaq -0x80(%rbp), %r13
leal 0x7(%rbx), %ecx
testl %ebx, %ebx
cmovnsl %ebx, %ecx
andl $-0x8, %ecx
subl %ecx, %ebx
movq %rax, -0x98(%rbp)
movslq %ebx, %rax
shlq $0x5, %rax
leaq -0x70(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq -0x1e0(%rbp,%rax), %rsi
movq -0x1d8(%rbp,%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xa582
leaq -0x98(%rbp), %rdi
movq %r13, %rsi
callq 0x50b4
leaq -0x50(%rbp), %rdi
movq %rax, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x51e2
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x7134
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x5b1a
testb %al, %al
je 0x70a2
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
movq %rax, %rbx
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
sarq $0x20, %rbx
cltq
imulq $0x4f, %rbx, %rcx
addq -0x58(%rbp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x50(%rbp), %rsi
movq (%r12), %rax
movq %r12, %rdi
callq *0x40(%rax)
movq (%r12), %rax
movq %r12, %rdi
callq *0x30(%rax)
movl %eax, %ebx
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
movq %rax, %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
sarq $0x20, %r13
cltq
imulq $0x4f, %r13, %rcx
addq -0x58(%rbp), %rcx
movb %bl, (%rax,%rcx)
movq -0x90(%rbp), %rdx
incq %rdx
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rdx, %rcx
ja 0x6f14
movq $-0x100, %rbx
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x71f6
movq (%r15), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x71e2
movq -0x30(%rbp), %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7222
jmp 0x7222
jmp 0x7222
jmp 0x7222
jmp 0x7222
jmp 0x7222
movq %rax, %rbx
cmpq %r13, %r12
je 0x733e
addq $-0x10, %r13
leaq -0x1e0(%rbp), %r14
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x724e
movq (%r13), %rsi
incq %rsi
callq 0x4170
leaq -0x20(%r13), %rax
addq $-0x10, %r13
cmpq %r14, %r13
movq %rax, %r13
jne 0x7239
jmp 0x733e
movq %rax, %rbx
movq %r12, %r13
jmp 0x7225
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x72c1
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0x72c1
jmp 0x72f1
jmp 0x72f1
jmp 0x72f1
jmp 0x72f1
jmp 0x72f1
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7312
movq -0x40(%rbp), %rsi
jmp 0x730a
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x72e8
jmp 0x72f1
jmp 0x72f1
movq %rax, %rbx
testb %r13b, %r13b
je 0x72e8
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x72e8
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r13b, %r13b
jmp 0x7312
jmp 0x72f1
jmp 0x72f1
movq %rax, %rbx
jmp 0x7312
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x7312
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x4170
xorl %r14d, %r14d
movq -0x100(%rbp,%r14), %rdi
leaq (%r15,%r14), %rax
cmpq %rdi, %rax
je 0x7331
movq (%rax), %rsi
incq %rsi
callq 0x4170
addq $-0x20, %r14
cmpq $-0x100, %r14
jne 0x7315
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x735c
movq (%rax), %rsi
incq %rsi
callq 0x4170
movq %rbx, %rdi
callq 0x4250