// File: /workspace/github_cpp_makefile_star2_O1/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 0xa582
movq %r12, %rdi
movq %r15, %rsi
callq 0x50b4
movq %rax, -0x78(%rbp)
movq -0x98(%rbp), %rdi
cmpq %r13, %rdi
je 0x9eda
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 0x9f48
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 0x51b6
testb %al, %al
jne 0x9f72
incq %r15
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
addq $0x8, %rbx
cmpq %r15, %rcx
ja 0x9f0a
movq -0x70(%rbp), %r14
leaq 0x10(%r14), %rax
movq %rax, (%r14)
leaq 0x13864(%rip), %rsi     # 0x1d7be
leaq 0x1386d(%rip), %rdx     # 0x1d7ce
movq %r14, %rdi
leaq -0x58(%rbp), %rbx
callq 0x501a
jmp 0xa283
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa2bb
movq (%rax,%rbx), %rsi
movq (%rsi), %rax
leaq -0x48(%rbp), %rdi
callq *0x28(%rax)
leaq 0x13325(%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 0x9fcd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
testl %r12d, %r12d
jne 0x9fde
cmpb $0x0, 0x4(%r14)
jne 0x9fde
movb $0x1, 0x4(%r14)
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa2cc
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 0xa037
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 0xa2aa
movq (%rax,%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testl %eax, %eax
jne 0xa240
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa2dd
movq (%rax,%rbx), %rsi
movq (%rsi), %rax
leaq -0x48(%rbp), %rdi
callq *0x28(%rax)
leaq 0x13239(%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 0xa0c2
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
testl %r12d, %r12d
jne 0xa176
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa2aa
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 0xa12c
cmpq %r15, %rdx
jbe 0xa2aa
movq (%rcx,%rbx), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x16212
jmp 0xa176
cmpq %r15, %rdx
jbe 0xa2aa
movq (%rcx,%rbx), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
testq %rax, %rax
je 0xa176
movq 0x7c0(%r14), %rax
movq 0x7c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0xa2aa
movq (%rax,%rbx), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x16288
movq 0x7c0(%r14), %rdi
movq 0x7c8(%r14), %rcx
movq %rcx, %rdx
subq %rdi, %rdx
movq %rdx, %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0xa2ee
leaq (%rdi,%rbx), %rsi
addq $0x8, %rsi
movq -0x8(%rsi), %r15
cmpq %rcx, %rsi
je 0xa1ba
addq %rbx, %rdi
subq %rbx, %rdx
addq $-0x8, %rdx
callq 0x4230
addq $-0x8, 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 0xb690
testb %al, %al
je 0xa237
leaq 0x13588(%rip), %rsi     # 0x1d78a
leaq -0x68(%rbp), %rdi
callq 0x4280
movq 0xfd8(%r14), %rdi
callq 0x5226
movq %rax, %r12
movq 0xfd8(%r14), %rdi
callq 0x5226
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), %r14
leaq 0x10(%r14), %rax
movq %rax, (%r14)
movq -0x68(%rbp), %rcx
leaq -0x58(%rbp), %rbx
cmpq %rbx, %rcx
je 0xa265
movq %rcx, (%r14)
movq -0x58(%rbp), %rax
movq %rax, 0x10(%r14)
jmp 0xa26b
movups (%rbx), %xmm0
movups %xmm0, (%rax)
movq -0x60(%rbp), %rax
movq %rax, 0x8(%r14)
movq %rbx, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq -0x68(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa298
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1351e(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x1350d(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x134fc(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x134eb(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x41e0
leaq 0x134da(%rip), %rdi     # 0x1d7cf
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x41e0
jmp 0xa348
jmp 0xa348
jmp 0xa348
jmp 0xa348
jmp 0xa348
jmp 0xa348
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xa34b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xa34b
jmp 0xa348
jmp 0xa348
jmp 0xa348
jmp 0xa348
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r13, %rdi
je 0xa364
movq -0x88(%rbp), %rsi
jmp 0xa35c
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa364
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq %rbx, %rdi
callq 0x4250