// File: /workspace/github_cpp_makefile_star2_O2/malcolmyeh[P]CC3K/floor.cc
// Function: Floor::movePlayer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string Floor::movePlayer(std::string direction) {
	
	Posn p = this->player->getPosition().getNew(direction);
	std::string dir[8] = {"ea", "we", "no", "so", "ne", "nw", "sw", "se"};
	std::string dir2[8] = {"East", "West", "North", "South", "Northeast", "Northwest", "Southwest", "Southeast"};
	std::string log;
	if (validMove(p)){
		std::string gold;
		bool g;
		if (displayGrid[p.y][p.x] == 'G') {
			gold = pickGold(p);
			if (gold == "invalid") {
				return gold;
			}
			g = true;
		}
		std::string barrier;
		bool b;
		if (displayGrid[p.y][p.x] == 'B') {
			if (this->suit->isGuarded()) {
				return "invalid";
			}
			b = true;
			this->setSpawned(true);
			this->player->setBarrier(true);
			barrier = "You have acquired a Barrier Suit. ";
		}
		
		if (p == this->stair->getPosition()){
			return "newfloor";
		}
		log += "You move ";
		for (int i = 0; i < 8; i++) {
			if (dir[i] == direction) {
				log += dir2[i] + ". ";
				break;
			}
		}
		if (g) {
			log += gold;
		}
		if (b){
			log += barrier;
		}
		std::string potion;
		potion = seePotion(p);
		if (potion != "invalid") {
			log += potion;
		}
		displayGrid[this->player->getPosition().y][this->player->getPosition().x] = defaultGrid[this->player->getPosition().y][this->player->getPosition().x];
		displayGrid[p.y][p.x] = this->player->getSymbol();
		this->player->move(p);
		return log;
	}
	return "invalid";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r12
movq 0xfe0(%rsi), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
leaq -0x320(%rbp), %rbx
movq %rax, (%rbx)
leaq -0x118(%rbp), %r15
movq %r15, %rdi
movq %r13, -0xd8(%rbp)
movq %r13, %rsi
callq 0x4200
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4ad8
movq %r14, -0x40(%rbp)
movq %rax, -0x38(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x40e0
leaq 0x9ba2(%rip), %rsi      # 0x101a3
leaq -0x320(%rbp), %r15
leaq -0x220(%rbp), %rdx
movq %r15, %rdi
callq 0x40b0
leaq -0x300(%rbp), %r13
leaq 0x9b81(%rip), %rsi      # 0x101a6
leaq -0x68(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x2e0(%rbp), %r13
leaq 0x9b6a(%rip), %rsi      # 0x101a9
leaq -0x90(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x2c0(%rbp), %r13
leaq 0x9b50(%rip), %rsi      # 0x101ac
leaq -0xd0(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x2a0(%rbp), %r13
leaq 0x9b36(%rip), %rsi      # 0x101af
leaq -0xb0(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x280(%rbp), %r13
leaq 0x9b1c(%rip), %rsi      # 0x101b2
leaq -0xf8(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x260(%rbp), %r13
leaq 0x9b05(%rip), %rsi      # 0x101b8
leaq -0x2a(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x240(%rbp), %r13
leaq 0x9ae8(%rip), %rsi      # 0x101b5
leaq -0x29(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq 0x9bce(%rip), %rsi      # 0x102ae
leaq -0x220(%rbp), %r13
leaq -0x68(%rbp), %rdx
movq %r13, %rdi
callq 0x40b0
leaq -0x200(%rbp), %rbx
leaq 0x9bb2(%rip), %rsi      # 0x102b3
leaq -0x90(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x1e0(%rbp), %rbx
leaq 0x9b9a(%rip), %rsi      # 0x102b8
leaq -0xd0(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x1c0(%rbp), %rbx
leaq 0x9b83(%rip), %rsi      # 0x102be
leaq -0xb0(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x1a0(%rbp), %rbx
leaq 0x9b6c(%rip), %rsi      # 0x102c4
leaq -0xf8(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x180(%rbp), %rbx
leaq 0x9b59(%rip), %rsi      # 0x102ce
leaq -0x2a(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x160(%rbp), %rbx
leaq 0x9b49(%rip), %rsi      # 0x102d8
leaq -0x29(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x140(%rbp), %rbx
leaq 0x9b39(%rip), %rsi      # 0x102e2
leaq -0x41(%rbp), %rdx
movq %rbx, %rdi
callq 0x40b0
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq -0x38(%rbp), %rdx
movq %rdx, %rax
sarq $0x20, %rax
movslq %edx, %rcx
imulq $0x4f, %rax, %rax
movq -0x40(%rbp), %rsi
addq %rax, %rsi
addq $0x820, %rsi            # imm = 0x820
movzbl (%rcx,%rsi), %ecx
addl $-0x23, %ecx
cmpl $0x24, %ecx
ja 0x6b27
movabsq $0x1080001901, %rsi     # imm = 0x1080001901
btq %rcx, %rsi
jae 0x6b27
movq %r12, %rbx
movq -0x40(%rbp), %rcx
leaq 0x820(%rcx), %rsi
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
andq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movslq %edx, %rcx
movq %rsi, -0x70(%rbp)
addq %rsi, %rax
movb (%rcx,%rax), %al
cmpb $0x47, %al
jne 0x68bb
leaq -0xd0(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x6d42
leaq -0x90(%rbp), %rdi
leaq -0xd0(%rbp), %r14
movq %r14, %rsi
callq 0x41d0
movq %r14, %rdi
callq 0x40e0
leaq 0x9a7b(%rip), %rsi      # 0x102ec
leaq -0x90(%rbp), %rdi
callq 0x4ac7
testb %al, %al
je 0x68a8
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq -0x90(%rbp), %rcx
cmpq %r12, %rcx
je 0x6b75
movq %rcx, (%rbx)
movq -0x80(%rbp), %rax
movq %rax, 0x10(%rbx)
jmp 0x6b7d
movslq -0x34(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x4f, %rax, %rax
addq -0x70(%rbp), %rax
movb (%rcx,%rax), %al
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
cmpb $0x42, %al
movq %rbx, %r12
jne 0x692e
movq -0x40(%rbp), %rax
movq 0xfe8(%rax), %rdi
callq 0xce5a
testb %al, %al
je 0x6904
leaq 0x99fc(%rip), %rsi      # 0x102ec
leaq -0xb0(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
jmp 0x6b67
movq -0x40(%rbp), %rax
movb $0x1, 0x5(%rax)
movq 0xfe0(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x9186
leaq 0x99d2(%rip), %rsi      # 0x102f4
leaq -0xd0(%rbp), %rdi
callq 0x42a0
movq -0x40(%rbp), %rax
movq 0xfd8(%rax), %rdi
callq 0x4c42
leaq -0xb0(%rbp), %rsi
movq %rax, (%rsi)
leaq -0x38(%rbp), %rdi
callq 0x4bd2
testb %al, %al
je 0x6970
leaq 0x99bb(%rip), %rsi      # 0x10317
leaq -0xb0(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
jmp 0x6b67
leaq 0x99a9(%rip), %rsi      # 0x10320
leaq -0x68(%rbp), %rdi
callq 0x4290
xorl %ebx, %ebx
addq $-0x20, %rbx
cmpq $-0x120, %rbx           # imm = 0xFEE0
je 0x69e2
leaq 0x20(%r15), %r14
movq %r15, %rdi
movq -0xd8(%rbp), %rsi
callq 0x846c
movq %r14, %r15
testb %al, %al
je 0x6982
subq %rbx, %r13
addq $-0x20, %r13
leaq 0xa20f(%rip), %rdx      # 0x10bc6
leaq -0xb0(%rbp), %rdi
movq %r13, %rsi
callq 0x848f
leaq -0x68(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x42b0
leaq -0xb0(%rbp), %rdi
callq 0x40e0
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x42b0
leaq -0x68(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x42b0
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq -0x38(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
movq -0x40(%rbp), %r15
movq %r15, %rsi
callq 0x6eb6
leaq -0xb0(%rbp), %rbx
leaq -0xf8(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41d0
movq %r14, %rdi
callq 0x40e0
leaq 0x9898(%rip), %rsi      # 0x102ec
movq %rbx, %rdi
callq 0x4aba
testb %al, %al
je 0x6a70
leaq -0x68(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x42b0
movq 0xfe0(%r15), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, %rbx
movq 0xfe0(%r15), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
sarq $0x20, %rbx
imulq $0x4f, %rbx, %rcx
addq %r15, %rcx
cltq
movb 0x6(%rax,%rcx), %r14b
movq 0xfe0(%r15), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, %rbx
movq 0xfe0(%r15), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
sarq $0x20, %rbx
cltq
imulq $0x4f, %rbx, %rcx
addq -0x70(%rbp), %rcx
movb %r14b, (%rax,%rcx)
movq 0xfe0(%r15), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movslq -0x34(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x4f, %rcx, %rcx
movq -0x70(%rbp), %rsi
addq %rcx, %rsi
movb %al, (%rdx,%rsi)
movq 0xfe0(%r15), %rdi
movq -0x38(%rbp), %rsi
movq (%rdi), %rax
callq *0x40(%rax)
leaq 0x10(%r12), %rax
movq %rax, (%r12)
movq -0x68(%rbp), %rcx
leaq -0x58(%rbp), %rdx
cmpq %rdx, %rcx
je 0x6b3f
movq %rcx, (%r12)
movq -0x58(%rbp), %rax
movq %rax, 0x10(%r12)
jmp 0x6b45
leaq 0x97be(%rip), %rsi      # 0x102ec
leaq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x40b0
jmp 0x6baa
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq -0x60(%rbp), %rax
movq %rax, 0x8(%r12)
movq %rdx, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x40e0
leaq -0xd0(%rbp), %rdi
callq 0x40e0
jmp 0x6b9e
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq -0x88(%rbp), %rax
movq %rax, 0x8(%rbx)
movq %r12, -0x90(%rbp)
andq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%rbp)
movq %rbx, %r12
leaq -0x90(%rbp), %rdi
callq 0x40e0
leaq -0x68(%rbp), %rdi
callq 0x40e0
movl $0xe0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x220, %rdi           # imm = 0xFDE0
callq 0x40e0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x6bb8
movl $0xe0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x320, %rdi           # imm = 0xFCE0
callq 0x40e0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x6bd7
movq %r12, %rax
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6c2e
jmp 0x6ca3
movq %rax, %r14
jmp 0x6cbe
jmp 0x6ca3
jmp 0x6c2e
jmp 0x6c2e
jmp 0x6c2e
jmp 0x6c2e
jmp 0x6c2e
jmp 0x6ca3
movq %rax, %r14
jmp 0x6cb2
movq %rax, %r14
leaq -0xb0(%rbp), %rdi
callq 0x40e0
jmp 0x6ca6
jmp 0x6ca3
jmp 0x6c4d
jmp 0x6c4d
jmp 0x6c4d
jmp 0x6c4d
jmp 0x6c4d
jmp 0x6c4d
movq %rax, %r14
addq $-0x20, %rbx
movq %rbx, %rdi
callq 0x40e0
cmpq %r13, %rbx
jne 0x6c50
jmp 0x6ce6
movq %rax, %r14
jmp 0x6ce6
jmp 0x6c77
jmp 0x6c77
jmp 0x6c77
jmp 0x6c77
jmp 0x6c77
jmp 0x6c77
movq %rax, %r14
addq $-0x20, %r13
movq %r13, %rdi
callq 0x40e0
cmpq %r15, %r13
jne 0x6c7a
jmp 0x6d05
movq %rax, %r14
jmp 0x6d05
movq %rax, %r14
leaq -0x118(%rbp), %rdi
callq 0x40e0
jmp 0x6d05
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x40e0
leaq -0x90(%rbp), %rdi
callq 0x40e0
leaq -0x68(%rbp), %rdi
callq 0x40e0
movl $0xe0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x220, %rdi           # imm = 0xFDE0
callq 0x40e0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x6ccc
movl $0xe0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x320, %rdi           # imm = 0xFCE0
callq 0x40e0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x6ceb
movq %r14, %rdi
callq 0x4280
nop