// File: /workspace/github_cpp_makefile_star2_O3/malcolmyeh[P]CC3K/floor.cc
// Function: Floor::atkPlayer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string Floor::atkPlayer(std::string direction){
	Posn p = this->player->getPosition().getNew(direction);
	std::string combatLog;
	for (int i = 0; i < this->enemies.size(); ++i){
		if (p == this->enemies.at(i)->getPosition()){
			if (this->enemies.at(i)->getRace() == "Merchant") {
				if (!this->getHostile()) { this->setHostile(true); }
			}
			combatLog += this->player->dealDamage(this->enemies.at(i));
			if (this->enemies.at(i)->getHP() == 0){
				if(this->enemies.at(i)->getRace() == "Dragon") {
					if (this->enemies.at(i)->getHoard() != NULL) {
						this->enemies.at(i)->getHoard()->setGuarded(false);
					} else if (this->enemies.at(i)->getSuit() != NULL) {
						this->enemies.at(i)->getSuit()->setGuarded(false);
					}
				}
				Enemy * temp = this->enemies.at(i);
				this->enemies.erase(this->enemies.begin()+i);
				displayGrid[temp->getPosition().y][temp->getPosition().x] = '.';
				if (temp->compass()) {
					combatLog += "You found the compass. The stairs are now visible. ";
					displayGrid[this->stair->getPosition().y][this->stair->getPosition().x] = '/';
				}
				delete temp;
			}
			return combatLog;
		}
	}
	return "Invalid attack. ";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, -0x70(%rbp)
movq 0xfe0(%rsi), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
leaq -0x68(%rbp), %r12
movq %rax, (%r12)
leaq -0x88(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %r15
movq %r15, %rdi
callq 0xa4be
movq %r12, %rdi
movq %r15, %rsi
callq 0x50b8
movq %rax, -0x78(%rbp)
movq -0x98(%rbp), %rdi
cmpq %r13, %rdi
je 0x9e18
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x7c0(%r14), %rax
cmpq %rax, 0x7c8(%r14)
je 0x9e86
xorl %ebx, %ebx
leaq -0x78(%rbp), %r12
leaq -0x48(%rbp), %r13
xorl %r15d, %r15d
movq (%rax,%rbx), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, -0x48(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x51ba
testb %al, %al
jne 0x9ec9
incq %r15
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
addq $0x8, %rbx
cmpq %r15, %rcx
ja 0x9e48
movq -0x70(%rbp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x13926(%rip), %rsi     # 0x1d7be
leaq 0x1392f(%rip), %rdx     # 0x1d7ce
movq %rbx, %rdi
callq 0x501a
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa1d4
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xa1d4
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa1f7
movq (%rax,%rbx), %rsi
movq (%rsi), %rax
leaq -0x48(%rbp), %rdi
callq *0x28(%rax)
leaq 0x133ce(%rip), %rsi     # 0x1d2ca
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x4070
movl %eax, %r12d
movq (%r13), %rdi
leaq -0x38(%rbp), %r13
cmpq %r13, %rdi
je 0x9f24
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
testl %r12d, %r12d
jne 0x9f35
cmpb $0x0, 0x4(%r14)
jne 0x9f35
movb $0x1, 0x4(%r14)
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa208
movq 0xfe0(%r14), %rsi
movq (%rax,%rbx), %rdx
movq (%rsi), %rax
leaq -0x48(%rbp), %rdi
callq *0x50(%rax)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x4080
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x9f8e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa1e6
movq (%rax,%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testl %eax, %eax
jne 0xa1a1
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa219
movq (%rax,%rbx), %rsi
movq (%rsi), %rax
leaq -0x48(%rbp), %rdi
callq *0x28(%rax)
leaq 0x132e2(%rip), %rsi     # 0x1d2d3
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x4070
movl %eax, %r12d
movq (%r13), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa019
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
testl %r12d, %r12d
jne 0xa0cd
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa1e6
movq (%rax,%rbx), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq 0x7c0(%r14), %rcx
movq 0x7c8(%r14), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
testq %rax, %rax
je 0xa083
cmpq %r15, %rdx
jbe 0xa1e6
movq (%rcx,%rbx), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x1609e
jmp 0xa0cd
cmpq %r15, %rdx
jbe 0xa1e6
movq (%rcx,%rbx), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
testq %rax, %rax
je 0xa0cd
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa1e6
movq (%rax,%rbx), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x16114
movq 0x7c0(%r14), %rdi
movq 0x7c8(%r14), %rcx
movq %rcx, %rdx
subq %rdi, %rdx
movq %rdx, %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0xa22a
leaq (%rdi,%rbx), %rsi
addq $0x8, %rsi
movq -0x8(%rsi), %r15
cmpq %rcx, %rsi
je 0xa118
addq %rbx, %rdi
subq %rbx, %rdx
addq $-0x8, %rdx
callq 0x4230
movq 0x7c8(%r14), %rcx
addq $-0x8, %rcx
movq %rcx, 0x7c8(%r14)
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movq %rax, %r12
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
leaq 0x820(%r14), %rbx
sarq $0x20, %r12
cltq
imulq $0x4f, %r12, %rcx
addq %rbx, %rcx
movb $0x2e, (%rax,%rcx)
movq %r15, %rdi
callq 0xb5d0
testb %al, %al
je 0xa198
leaq 0x13627(%rip), %rsi     # 0x1d78a
leaq -0x68(%rbp), %rdi
callq 0x4280
movq 0xfd8(%r14), %rdi
callq 0x522a
movq %rax, %r12
movq 0xfd8(%r14), %rdi
callq 0x522a
sarq $0x20, %r12
cltq
imulq $0x4f, %r12, %rcx
addq %rcx, %rbx
movb $0x2f, (%rax,%rbx)
movq (%r15), %rax
movq %r15, %rdi
callq *0x60(%rax)
movq -0x70(%rbp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq -0x68(%rbp), %rcx
leaq -0x58(%rbp), %rdx
cmpq %rdx, %rcx
je 0xa1c6
movq %rcx, (%rbx)
movq -0x58(%rbp), %rax
movq %rax, 0x10(%rbx)
jmp 0xa1cc
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq -0x60(%rbp), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x135e2(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x135d1(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x135c0(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x135af(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x1359e(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41e0
jmp 0xa284
jmp 0xa284
jmp 0xa284
jmp 0xa284
jmp 0xa284
jmp 0xa284
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xa287
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xa287
jmp 0xa284
jmp 0xa284
jmp 0xa284
jmp 0xa284
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r13, %rdi
je 0xa2a0
movq -0x88(%rbp), %rsi
jmp 0xa298
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa2a0
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq %rbx, %rdi
callq 0x4250