// File: 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
subq $0x280, %rsp            # imm = 0x280
movq %rdx, -0x150(%rbp)
movq %rdi, -0x168(%rbp)
movq %rdi, %rax
movq %rax, -0x160(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x158(%rbp)
movq 0xfe0(%rax), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movq -0x150(%rbp), %rsi
movq %rax, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x40e0
movq -0x148(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5240
movq %rax, -0x140(%rbp)
jmp 0xc87e
movq -0x140(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4130
leaq -0x78(%rbp), %rdi
callq 0x4280
movl $0x0, -0x7c(%rbp)
movq -0x158(%rbp), %rdi
movslq -0x7c(%rbp), %rax
movq %rax, -0x170(%rbp)
addq $0x7c0, %rdi            # imm = 0x7C0
callq 0xd0a0
movq %rax, %rcx
movq -0x170(%rbp), %rax
cmpq %rcx, %rax
jae 0xcf1d
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x178(%rbp)
jmp 0xc8f3
movq -0x178(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movq %rax, -0x180(%rbp)
jmp 0xc90f
movq -0x180(%rbp), %rax
movq %rax, -0x84(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x84(%rbp), %rsi
callq 0x53f0
movb %al, -0x181(%rbp)
jmp 0xc935
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0xc944
jmp 0xcf0d
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x190(%rbp)
jmp 0xc964
movq -0x190(%rbp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x28(%rax), %rax
leaq -0xa8(%rbp), %rdi
callq *%rax
jmp 0xc980
leaq 0x11897(%rip), %rsi     # 0x1e21e
leaq -0xa8(%rbp), %rdi
callq 0x5210
movb %al, -0x191(%rbp)
jmp 0xc99b
leaq -0xa8(%rbp), %rdi
callq 0x4130
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0xc9b3
jmp 0xca32
movq -0x158(%rbp), %rdi
callq 0x8d70
movb %al, -0x192(%rbp)
jmp 0xc9c7
movb -0x192(%rbp), %al
testb $0x1, %al
jne 0xca30
jmp 0xc9d3
movq -0x158(%rbp), %rdi
movl $0x1, %esi
callq 0xcfb0
jmp 0xc9e6
jmp 0xca30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4130
jmp 0xcfa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xcf97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x4130
jmp 0xcf97
jmp 0xca32
movq -0x158(%rbp), %rdi
movq 0xfe0(%rdi), %rax
movq %rax, -0x1a8(%rbp)
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x1a0(%rbp)
jmp 0xca60
movq -0x1a8(%rbp), %rsi
movq -0x1a0(%rbp), %rax
movq (%rax), %rdx
movq (%rsi), %rax
movq 0x50(%rax), %rax
leaq -0xc8(%rbp), %rdi
callq *%rax
jmp 0xca83
leaq -0x78(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4240
jmp 0xca95
leaq -0xc8(%rbp), %rdi
callq 0x4130
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x1b0(%rbp)
jmp 0xcac1
movq -0x1b0(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movl %eax, -0x1b4(%rbp)
jmp 0xcadc
movl -0x1b4(%rbp), %eax
cmpl $0x0, %eax
jne 0xcef1
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x1c0(%rbp)
jmp 0xcb0b
movq -0x1c0(%rbp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x28(%rax), %rax
leaq -0xe8(%rbp), %rdi
callq *%rax
jmp 0xcb27
leaq 0x116f9(%rip), %rsi     # 0x1e227
leaq -0xe8(%rbp), %rdi
callq 0x5210
movb %al, -0x1c1(%rbp)
jmp 0xcb42
leaq -0xe8(%rbp), %rdi
callq 0x4130
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0xcb5d
jmp 0xccd0
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x1d0(%rbp)
jmp 0xcb7d
movq -0x1d0(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movq %rax, -0x1d8(%rbp)
jmp 0xcb99
movq -0x1d8(%rbp), %rax
cmpq $0x0, %rax
je 0xcc35
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x1e0(%rbp)
jmp 0xcbca
movq -0x1e0(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movq %rax, -0x1e8(%rbp)
jmp 0xcbe6
movq -0x1e8(%rbp), %rdi
xorl %esi, %esi
callq 0x18310
jmp 0xcbf6
jmp 0xccce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4130
jmp 0xcf97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x4130
jmp 0xcf97
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x1f0(%rbp)
jmp 0xcc55
movq -0x1f0(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x70(%rax), %rax
callq *%rax
movq %rax, -0x1f8(%rbp)
jmp 0xcc71
movq -0x1f8(%rbp), %rax
cmpq $0x0, %rax
je 0xcccc
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x200(%rbp)
jmp 0xcc9e
movq -0x200(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x70(%rax), %rax
callq *%rax
movq %rax, -0x208(%rbp)
jmp 0xccba
movq -0x208(%rbp), %rdi
xorl %esi, %esi
callq 0x18430
jmp 0xccca
jmp 0xcccc
jmp 0xccce
jmp 0xccd0
movq -0x158(%rbp), %rdi
addq $0x7c0, %rdi            # imm = 0x7C0
movslq -0x7c(%rbp), %rsi
callq 0xd0c0
movq %rax, -0x210(%rbp)
jmp 0xccf0
movq -0x158(%rbp), %rdi
movq -0x210(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
addq $0x7c0, %rdi            # imm = 0x7C0
movq %rdi, -0x220(%rbp)
callq 0xd180
movq %rax, -0x108(%rbp)
movslq -0x7c(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0xd1b0
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xd1f0
movq -0x220(%rbp), %rdi
movq -0xf8(%rbp), %rsi
callq 0xd110
movq %rax, -0x218(%rbp)
jmp 0xcd68
movq -0x158(%rbp), %rax
movq -0x218(%rbp), %rcx
movq %rcx, -0x110(%rbp)
addq $0x820, %rax            # imm = 0x820
movq %rax, -0x230(%rbp)
movq -0xf0(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movq %rax, -0x228(%rbp)
jmp 0xcda3
movq -0x230(%rbp), %rax
movq -0x228(%rbp), %rcx
movq %rcx, -0x118(%rbp)
movslq -0x114(%rbp), %rcx
imulq $0x4f, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
movq -0xf0(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movq %rax, -0x238(%rbp)
jmp 0xcde6
movq -0x240(%rbp), %rax
movq -0x238(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movslq -0x120(%rbp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0xf0(%rbp), %rdi
callq 0x11ea0
movb %al, -0x241(%rbp)
jmp 0xce1a
movb -0x241(%rbp), %al
testb $0x1, %al
jne 0xce29
jmp 0xcece
leaq 0x118ae(%rip), %rsi     # 0x1e6de
leaq -0x78(%rbp), %rdi
callq 0x41a0
jmp 0xce3b
movq -0x158(%rbp), %rax
movq %rax, %rcx
addq $0x820, %rcx            # imm = 0x820
movq %rcx, -0x258(%rbp)
movq 0xfd8(%rax), %rdi
callq 0x5500
movq %rax, -0x250(%rbp)
jmp 0xce68
movq -0x158(%rbp), %rax
movq -0x258(%rbp), %rcx
movq -0x250(%rbp), %rdx
movq %rdx, -0x128(%rbp)
movslq -0x124(%rbp), %rdx
imulq $0x4f, %rdx, %rdx
addq %rdx, %rcx
movq %rcx, -0x268(%rbp)
movq 0xfd8(%rax), %rdi
callq 0x5500
movq %rax, -0x260(%rbp)
jmp 0xceae
movq -0x268(%rbp), %rax
movq -0x260(%rbp), %rcx
movq %rcx, -0x130(%rbp)
movslq -0x130(%rbp), %rcx
movb $0x2f, (%rax,%rcx)
movq -0xf0(%rbp), %rax
movq %rax, -0x270(%rbp)
cmpq $0x0, %rax
je 0xceef
movq -0x270(%rbp), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
jmp 0xcef1
movq -0x168(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4120
movl $0x1, -0x134(%rbp)
jmp 0xcf7e
jmp 0xcf0f
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xc8a2
leaq -0x135(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x4300
movq -0x168(%rbp), %rdi
movq -0x278(%rbp), %rdx
leaq 0x117cd(%rip), %rsi     # 0x1e712
callq 0x4270
jmp 0xcf4c
leaq -0x135(%rbp), %rdi
callq 0x4200
movl $0x1, -0x134(%rbp)
jmp 0xcf7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x135(%rbp), %rdi
callq 0x4200
jmp 0xcf97
leaq -0x78(%rbp), %rdi
callq 0x4130
movq -0x160(%rbp), %rax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x4130
movq -0x50(%rbp), %rdi
callq 0x42f0
nopl (%rax)