// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rsi, %r14
movq %rdi, -0x38(%rbp)
movq 0xfe0(%rsi), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
leaq -0x58(%rbp), %r15
movq %rax, (%r15)
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4200
movq %r15, %rdi
movq %r12, %rsi
callq 0x4ad8
leaq -0x80(%rbp), %rbx
movq %rax, (%rbx)
leaq -0xa0(%rbp), %rdi
callq 0x40e0
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x7c0(%r14), %rax
movq %rax, -0x30(%rbp)
pushq $-0x8
popq %r12
pushq $-0x1
popq %r13
leaq -0x78(%rbp), %r15
incq %r13
movq 0x7c8(%r14), %rax
subq 0x7c0(%r14), %rax
sarq $0x3, %rax
cmpq %r13, %rax
jbe 0x80a8
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, -0x78(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4bd2
addq $0x8, %r12
testb %al, %al
je 0x7f42
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rsi
movq (%rsi), %rax
leaq -0x78(%rbp), %rdi
callq *0x28(%rax)
leaq 0x82f2(%rip), %rsi      # 0x1029e
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x4ac7
movl %eax, %r15d
movq %rbx, %rdi
callq 0x40e0
testb %r15b, %r15b
je 0x7fd4
cmpb $0x0, 0x4(%r14)
jne 0x7fd4
movb $0x1, 0x4(%r14)
movq 0xfe0(%r14), %rbx
movq -0x30(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdx
movq (%rbx), %rax
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq *0x50(%rax)
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x42b0
leaq -0x78(%rbp), %rdi
callq 0x40e0
movq %r15, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testl %eax, %eax
jne 0x819a
movq %r15, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rsi
movq (%rsi), %rax
leaq -0x78(%rbp), %rdi
callq *0x28(%rax)
leaq 0x825c(%rip), %rsi      # 0x102a7
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x4ac7
movl %eax, %r15d
movq %rbx, %rdi
callq 0x40e0
testb %r15b, %r15b
movq -0x30(%rbp), %rbx
je 0x80fc
movq %rbx, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
testq %rax, %rax
je 0x80c5
movq %rbx, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0xce00
jmp 0x80fc
leaq 0x86e3(%rip), %rsi      # 0x10792
leaq -0x78(%rbp), %rdx
movq -0x38(%rbp), %rdi
callq 0x40b0
movq -0x38(%rbp), %rbx
jmp 0x81da
movq %rbx, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
testq %rax, %rax
je 0x80fc
movq %rbx, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0xce64
movq %rbx, %rdi
movq %r13, %rsi
callq 0x825e
movq (%rax), %r13
addq (%rbx), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x828e
movq (%r13), %rax
movq %r13, %rdi
callq *0x38(%rax)
movq %rax, %rbx
movq (%r13), %rax
movq %r13, %rdi
callq *0x38(%rax)
leaq 0x820(%r14), %r15
sarq $0x20, %rbx
cltq
imulq $0x4f, %rbx, %rcx
addq %r15, %rcx
movb $0x2e, (%rax,%rcx)
movq %r13, %rdi
callq 0x924c
testb %al, %al
je 0x8190
leaq 0x8604(%rip), %rsi      # 0x1075e
leaq -0x58(%rbp), %rdi
callq 0x4290
movq 0xfd8(%r14), %rdi
callq 0x4c42
movq %rax, %rbx
movq 0xfd8(%r14), %rdi
callq 0x4c42
sarq $0x20, %rbx
cltq
imulq $0x4f, %rbx, %rcx
addq %rcx, %r15
movb $0x2f, (%rax,%r15)
movq (%r13), %rax
movq %r13, %rdi
callq *0x60(%rax)
movq -0x38(%rbp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq -0x58(%rbp), %rcx
leaq -0x48(%rbp), %rdx
cmpq %rdx, %rcx
je 0x81bf
movq %rcx, (%rbx)
movq -0x48(%rbp), %rax
movq %rax, 0x10(%rbx)
jmp 0x81c5
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq -0x50(%rbp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x40e0
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8225
jmp 0x8225
jmp 0x8225
jmp 0x8225
jmp 0x8225
jmp 0x8225
jmp 0x8225
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x40e0
jmp 0x8228
jmp 0x8225
jmp 0x8225
jmp 0x8225
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x822c
jmp 0x8225
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x40e0
movq %rbx, %rdi
callq 0x4280
nop