// File: /workspace/github_cpp_makefile_star2_O2/angelapwen[P]text-based-game/space.cpp
// Function: Space::makeMove() const
char Space::makeMove() const {
	cout << "Your options are: " << endl;

	// Print the options available in the current room
	if (this->top != nullptr) {
		cout << "- up: " ;
		cout << "This would lead to the " << this->top->name << "." << endl;
	}
	if (this->bottom != nullptr) {
		cout << "- down: ";
		cout << "This would lead to the " << this->bottom->name << "." << endl;
	}
	if (this->left != nullptr) {
		cout << "- left: ";
		cout << "This would lead to the " << this->left->name << "." << endl;
	}
	if (this->right != nullptr) {
		cout << "- right: ";
		cout << "This would lead to the " << this->right->name << "." << endl;
	}

	// Display corner option only if the bool is true
	if (cornerAccess) {
		if (this->corner != nullptr) {
			cout << "- corner: ";
			cout << "This would lead to the " << this->corner->name << "." << endl;
		}
	}

	cout << "- exit: ";
	cout << "You may choose the Emergency Exit and leave your mission "
			"incomplete." << endl;

	cout << "Enter only up, down, left, right, corner, or exit." << endl;

	string choice = moveValidation();

	// Return the char value of the validated move
	if (choice == "up") {
		return 't';
	}

	else if (choice == "down") {
		return 'b';
	}

	else if (choice == "left") {
		return 'l';
	}

	else if (choice == "right") {
		return 'r';
	}

	// Else user picked corner
	else if (choice == "corner") {
		return 'c';
	}

	// Else user chose to exit
	else {
		return 'e';
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x9bf1(%rip), %rdi      # 0x10fd0
leaq 0x505e(%rip), %rsi      # 0xc444
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
cmpq $0x0, 0x48(%rbx)
je 0x7446
movq 0x9bcf(%rip), %r14      # 0x10fd0
leaq 0x504f(%rip), %rsi      # 0xc457
movq %r14, %rdi
callq 0x21a0
leaq 0x5047(%rip), %rsi      # 0xc45e
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x2bca(%rip), %rsi      # 0xa000
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
cmpq $0x0, 0x60(%rbx)
je 0x7499
movq 0x9b7c(%rip), %r14      # 0x10fd0
leaq 0x501b(%rip), %rsi      # 0xc476
movq %r14, %rdi
callq 0x21a0
leaq 0x4ff4(%rip), %rsi      # 0xc45e
movq %r14, %rdi
callq 0x21a0
movq 0x60(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x2b77(%rip), %rsi      # 0xa000
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
cmpq $0x0, 0x58(%rbx)
je 0x74ec
movq 0x9b29(%rip), %r14      # 0x10fd0
leaq 0x4fd1(%rip), %rsi      # 0xc47f
movq %r14, %rdi
callq 0x21a0
leaq 0x4fa1(%rip), %rsi      # 0xc45e
movq %r14, %rdi
callq 0x21a0
movq 0x58(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x2b24(%rip), %rsi      # 0xa000
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
cmpq $0x0, 0x50(%rbx)
je 0x753f
movq 0x9ad6(%rip), %r14      # 0x10fd0
leaq 0x4f87(%rip), %rsi      # 0xc488
movq %r14, %rdi
callq 0x21a0
leaq 0x4f4e(%rip), %rsi      # 0xc45e
movq %r14, %rdi
callq 0x21a0
movq 0x50(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x2ad1(%rip), %rsi      # 0xa000
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
cmpb $0x1, 0x78(%rbx)
jne 0x7598
cmpq $0x0, 0x68(%rbx)
je 0x7598
movq 0x9a7d(%rip), %r14      # 0x10fd0
leaq 0x4f38(%rip), %rsi      # 0xc492
movq %r14, %rdi
callq 0x21a0
leaq 0x4ef5(%rip), %rsi      # 0xc45e
movq %r14, %rdi
callq 0x21a0
movq 0x68(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x2a78(%rip), %rsi      # 0xa000
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq 0x9a31(%rip), %r14      # 0x10fd0
leaq 0x4ef7(%rip), %rsi      # 0xc49d
movq %r14, %rdi
callq 0x21a0
leaq 0x4ef1(%rip), %rsi      # 0xc4a6
movq %r14, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x4f1f(%rip), %rsi      # 0xc4eb
movq %r14, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7676
leaq 0x4f2b(%rip), %rsi      # 0xc51e
movq %r14, %rdi
callq 0x2aab
movb $0x74, %bl
testb %al, %al
jne 0x7661
leaq 0x4f19(%rip), %rsi      # 0xc521
leaq 0x8(%rsp), %rdi
callq 0x2aab
movb $0x62, %bl
testb %al, %al
jne 0x7661
leaq 0x4f07(%rip), %rsi      # 0xc526
leaq 0x8(%rsp), %rdi
callq 0x2aab
movb $0x6c, %bl
testb %al, %al
jne 0x7661
leaq 0x4ef5(%rip), %rsi      # 0xc52b
leaq 0x8(%rsp), %rdi
callq 0x2aab
movb $0x72, %bl
testb %al, %al
jne 0x7661
leaq 0x4ee4(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x2aab
movl %eax, %ebx
xorb $0x1, %bl
addb %bl, %bl
addb $0x63, %bl
leaq 0x8(%rsp), %rdi
callq 0x20b0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
nop