// File: /workspace/github_cpp_makefile_star2_O3/angelapwen[P]text-based-game/space.cpp
// Function: Space::moveValidation[abi:cxx11]() const
string Space::moveValidation() const{
	string input;

	bool isNull = true; // Bool flag to break loop when input is valid

	while(isNull) {
		cout << "\nMake your choice: ";
		cin >> input;

		// Try again if input is not one of the directions
		while (input != "up" && input != "down" && input != "left" && input !=
	          "right" && input != "corner" && input != "exit") {
			cout << "Input must be a valid direction for this room." << endl;
			cout << "Please try again: ";
			cin.clear();
			cin.ignore(256, '\n');
			cin >> input;
		}

		cin.clear();
		cin.ignore(256, '\n');

		// Check if direction input points to nullptr
		if (input == "up" && top == nullptr) {
			cout << "Up does not lead anywhere. Try again.";
		}
		else if (input == "down" && bottom == nullptr) {
			cout << "Down does not lead anywhere. Try again.";
		}
		else if (input == "left" && left == nullptr) {
			cout << "Left does not lead anywhere. Try again.";
		}
		else if (input == "right" && right == nullptr) {
			cout << "Right does not lead anywhere. Try again.";
		}
		// Else if corner does not lead anywhere
		else if (input == "corner" && corner == nullptr) {
			cout << "Corner does not lead anywhere. Try again.";
		}
		// Else if corner is an option, but access is off
		else if (input == "corner" && corner != nullptr && !cornerAccess) {
			cout << "Nice try, but you can't access the secret corner passageway "
			  "now!" << endl;
		}
		// If it doesn't point to nullptr, break loop
		else {
			isNull = false;
		}
	}
	return input;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0xa6e9(%rip), %r15      # 0x14fd0
movq 0xa6f2(%rip), %r13      # 0x14fe0
leaq 0x5c73(%rip), %rbp      # 0x10568
leaq 0x5c6f(%rip), %r12      # 0x1056b
movl $0x13, %edx
movq %r15, %rdi
leaq 0x5076(%rip), %rsi      # 0xf981
callq 0x21c0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21e0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2070
testl %eax, %eax
je 0xaa20
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2070
testl %eax, %eax
je 0xaa20
movq %rbx, %rdi
leaq 0x5c25(%rip), %rsi      # 0x10570
callq 0x2070
testl %eax, %eax
je 0xaa20
movq %rbx, %rdi
leaq 0x5c13(%rip), %rsi      # 0x10575
callq 0x2070
testl %eax, %eax
je 0xaa20
movq %rbx, %rdi
leaq 0x5c02(%rip), %rsi      # 0x1057b
callq 0x2070
testl %eax, %eax
je 0xaa20
movq %rbx, %rdi
leaq 0x5bf2(%rip), %rsi      # 0x10582
callq 0x2070
testl %eax, %eax
je 0xaa20
movl $0x2e, %edx
movq %r15, %rdi
leaq 0x5bdb(%rip), %rsi      # 0x10587
callq 0x21c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movl $0x12, %edx
movq %r15, %rdi
leaq 0x4cec(%rip), %rsi      # 0xf6d3
callq 0x21c0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
xorl %esi, %esi
callq 0x2250
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movl $0xa, %edx
callq 0x20e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21e0
jmp 0xa91b
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
xorl %esi, %esi
callq 0x2250
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movl $0xa, %edx
callq 0x20e0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2070
testl %eax, %eax
jne 0xaa70
movl $0x25, %r14d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x48(%rax)
leaq 0x5b4c(%rip), %rsi      # 0x105b6
je 0xab18
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2070
movl $0x27, %r14d
testl %eax, %eax
jne 0xaa9a
movq 0x8(%rsp), %rax
cmpq $0x0, 0x60(%rax)
jne 0xaa9a
leaq 0x5b44(%rip), %rsi      # 0x105dc
jmp 0xab18
movq %rbx, %rdi
leaq 0x5acc(%rip), %rsi      # 0x10570
callq 0x2070
testl %eax, %eax
jne 0xaac0
movq 0x8(%rsp), %rax
cmpq $0x0, 0x58(%rax)
leaq 0x5b46(%rip), %rsi      # 0x10604
je 0xab18
movq %rbx, %rdi
leaq 0x5aab(%rip), %rsi      # 0x10575
callq 0x2070
testl %eax, %eax
jne 0xaaec
movl $0x28, %r14d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x50(%rax)
leaq 0x5b42(%rip), %rsi      # 0x1062c
je 0xab18
movq %rbx, %rdi
leaq 0x5a85(%rip), %rsi      # 0x1057b
callq 0x2070
testl %eax, %eax
jne 0xab28
movl $0x29, %r14d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x68(%rax)
leaq 0x5b3f(%rip), %rsi      # 0x10655
jne 0xab28
movq %r15, %rdi
movq %r14, %rdx
callq 0x21c0
jmp 0xa8fc
movq %rbx, %rdi
leaq 0x5a49(%rip), %rsi      # 0x1057b
callq 0x2070
testl %eax, %eax
movq 0x8(%rsp), %rax
jne 0xab8d
cmpq $0x0, 0x68(%rax)
je 0xab8d
cmpb $0x0, 0x78(%rax)
jne 0xab8d
movl $0x40, %edx
movq %r15, %rdi
leaq 0x5b23(%rip), %rsi      # 0x1067f
callq 0x21c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
jmp 0xa8fc
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaba1
movq %rax, %r14
movq (%rbx), %rdi
movq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xabbc
movq (%rax), %rsi
incq %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x2270