// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rdi, -0x38(%rbp)
movb $0x0, 0x10(%rdi)
leaq 0xa015(%rip), %rsi      # 0x101a3
leaq -0x1c0(%rbp), %r15
leaq -0xa0(%rbp), %rdx
movq %r15, %rdi
callq 0x40b0
leaq -0x1a0(%rbp), %r12
leaq 0x9ff4(%rip), %rsi      # 0x101a6
leaq -0x70(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq -0x180(%rbp), %r12
leaq 0x9fdd(%rip), %rsi      # 0x101a9
leaq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq -0x160(%rbp), %r12
leaq 0x9fc6(%rip), %rsi      # 0x101ac
leaq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq -0x140(%rbp), %r12
leaq 0x9faf(%rip), %rsi      # 0x101af
leaq -0x2c(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq -0x120(%rbp), %r12
leaq 0x9f98(%rip), %rsi      # 0x101b2
leaq -0x2b(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq -0x100(%rbp), %r12
leaq 0x9f84(%rip), %rsi      # 0x101b8
leaq -0x2a(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq -0xe0(%rbp), %r12
leaq 0x9f67(%rip), %rsi      # 0x101b5
leaq -0x29(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
leaq 0x7c0(%r14), %rax
movq %rax, -0x78(%rbp)
leaq 0x820(%r14), %rax
movq %rax, -0x40(%rbp)
xorl %esi, %esi
leaq -0xc0(%rbp), %r13
movq 0x7c8(%r14), %rax
subq 0x7c0(%r14), %rax
sarq $0x3, %rax
cmpq %rsi, %rax
jbe 0x649f
movq -0x78(%rbp), %rdi
movq %rsi, -0x80(%rbp)
callq 0x825e
movq (%rax), %r15
movq 0xfe0(%r14), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x9260
movl %eax, %r12d
testb %al, %al
je 0x62f7
movq (%r15), %rax
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq *0x28(%rax)
movq %rbx, %rdi
leaq 0x9fbe(%rip), %rsi      # 0x1029e
callq 0x4aba
testb %al, %al
je 0x62f7
leaq -0xa0(%rbp), %rdi
callq 0x40e0
jmp 0x635d
movq (%r15), %rax
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq *0x28(%rax)
movq %rbx, %rdi
leaq 0x9f8d(%rip), %rsi      # 0x1029e
callq 0x4ac7
testb %al, %al
je 0x633d
cmpb $0x1, 0x4(%r14)
jne 0x633d
movq 0xfe0(%r14), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x9260
movl %eax, %ebx
jmp 0x633f
xorl %ebx, %ebx
leaq -0x70(%rbp), %rdi
callq 0x40e0
testb %r12b, %r12b
je 0x6359
leaq -0xa0(%rbp), %rdi
callq 0x40e0
testb %bl, %bl
je 0x638d
movq 0xfe0(%r14), %rdx
movq (%r15), %rax
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq *0x50(%rax)
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x42b0
movq %rbx, %rdi
callq 0x40e0
jmp 0x6493
movq (%r15), %rax
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq *0x28(%rax)
movq %r12, %rdi
leaq 0x9f00(%rip), %rsi      # 0x102a7
callq 0x4aba
movl %eax, %ebx
movq %r12, %rdi
callq 0x40e0
testb %bl, %bl
je 0x6493
callq 0x4070
movl %eax, %ebx
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movq %rax, %rcx
movl %ebx, %eax
cltd
pushq $0x8
popq %rsi
idivl %esi
movq %rcx, -0x48(%rbp)
movslq %edx, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %rsi
addq $-0x1c0, %rsi           # imm = 0xFE40
movq %r13, %rdi
callq 0x4200
leaq -0x48(%rbp), %rdi
movq %r13, %rsi
callq 0x4ad8
movq %rax, -0x50(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4bfe
movq %r13, %rdi
callq 0x40e0
movq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x533c
testb %al, %al
je 0x63be
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movq %rax, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
sarq $0x20, %rbx
cltq
imulq $0x4f, %rbx, %rcx
addq -0x40(%rbp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x70(%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, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
sarq $0x20, %rbx
cltq
imulq $0x4f, %rbx, %rcx
addq -0x40(%rbp), %rcx
movb %r12b, (%rax,%rcx)
movq -0x80(%rbp), %rsi
incq %rsi
jmp 0x6279
movl $0xe0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x1c0, %rdi           # imm = 0xFE40
callq 0x40e0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x64a4
movq -0x38(%rbp), %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x64e0
jmp 0x64e0
jmp 0x64e0
jmp 0x64e0
jmp 0x64e0
jmp 0x64e0
movq %rax, %rbx
addq $-0x20, %r12
movq %r12, %rdi
callq 0x40e0
cmpq %r15, %r12
jne 0x64e3
jmp 0x6572
movq %rax, %rbx
jmp 0x6572
jmp 0x653e
jmp 0x653e
jmp 0x653e
jmp 0x653e
jmp 0x653e
jmp 0x653e
jmp 0x651e
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x40e0
jmp 0x652c
jmp 0x653e
movq %rax, %rbx
jmp 0x6531
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
jmp 0x654d
jmp 0x653e
movq %rax, %rbx
testb %r12b, %r12b
je 0x6552
leaq -0xa0(%rbp), %rdi
jmp 0x654d
jmp 0x653e
jmp 0x653e
movq %rax, %rbx
jmp 0x6552
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x40e0
movl $0xe0, %r14d
leaq (%r14,%rbp), %rdi
addq $-0x1c0, %rdi           # imm = 0xFE40
callq 0x40e0
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x6558
movq -0x38(%rbp), %rdi
callq 0x40e0
movq %rbx, %rdi
callq 0x4280
nop