// File: /workspace/github_cpp_makefile_star2_O1/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)
movb $0x1, %r12b
movq 0xa6ae(%rip), %r15      # 0x14fd0
movq 0xa6b7(%rip), %r13      # 0x14fe0
leaq 0x5c38(%rip), %rbp      # 0x10568
movl $0x13, %edx
movq %r15, %rdi
leaq 0x5042(%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 0xaa58
movq %rbx, %rdi
leaq 0x5bff(%rip), %rsi      # 0x1056b
callq 0x2070
testl %eax, %eax
je 0xaa58
movq %rbx, %rdi
leaq 0x5bed(%rip), %rsi      # 0x10570
callq 0x2070
testl %eax, %eax
je 0xaa58
movq %rbx, %rdi
leaq 0x5bdb(%rip), %rsi      # 0x10575
callq 0x2070
testl %eax, %eax
je 0xaa58
movq %rbx, %rdi
leaq 0x5bca(%rip), %rsi      # 0x1057b
callq 0x2070
testl %eax, %eax
je 0xaa58
movq %rbx, %rdi
leaq 0x5bba(%rip), %rsi      # 0x10582
callq 0x2070
testl %eax, %eax
je 0xaa58
movl $0x2e, %edx
movq %r15, %rdi
leaq 0x5ba3(%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 0x4cb4(%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 0xa94f
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 0xaaa8
movl $0x25, %r14d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x48(%rax)
leaq 0x5b14(%rip), %rsi      # 0x105b6
je 0xab54
movq %rbx, %rdi
leaq 0x5ab9(%rip), %rsi      # 0x1056b
callq 0x2070
movl $0x27, %r14d
testl %eax, %eax
jne 0xaad6
movq 0x8(%rsp), %rax
cmpq $0x0, 0x60(%rax)
jne 0xaad6
leaq 0x5b08(%rip), %rsi      # 0x105dc
jmp 0xab54
movq %rbx, %rdi
leaq 0x5a90(%rip), %rsi      # 0x10570
callq 0x2070
testl %eax, %eax
jne 0xaafc
movq 0x8(%rsp), %rax
cmpq $0x0, 0x58(%rax)
leaq 0x5b0a(%rip), %rsi      # 0x10604
je 0xab54
movq %rbx, %rdi
leaq 0x5a6f(%rip), %rsi      # 0x10575
callq 0x2070
testl %eax, %eax
jne 0xab28
movl $0x28, %r14d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x50(%rax)
leaq 0x5b06(%rip), %rsi      # 0x1062c
je 0xab54
movq %rbx, %rdi
leaq 0x5a49(%rip), %rsi      # 0x1057b
callq 0x2070
testl %eax, %eax
jne 0xab70
movl $0x29, %r14d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x68(%rax)
leaq 0x5b03(%rip), %rsi      # 0x10655
jne 0xab70
movq %r15, %rdi
movq %r14, %rdx
callq 0x21c0
movl %r12d, %ecx
movl %ecx, %r12d
testb $0x1, %cl
jne 0xa930
jmp 0xabe0
movq %rbx, %rdi
leaq 0x5a01(%rip), %rsi      # 0x1057b
callq 0x2070
xorl %ecx, %ecx
testl %eax, %eax
jne 0xab62
movq 0x8(%rsp), %rax
cmpq $0x0, 0x68(%rax)
je 0xab62
movq 0x8(%rsp), %rax
cmpb $0x0, 0x78(%rax)
je 0xaba0
xorl %ecx, %ecx
jmp 0xab62
movl $0x40, %edx
movq %r15, %rdi
leaq 0x5ad0(%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
movl %r12d, %ecx
jmp 0xab62
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xabf4
movq %rax, %r14
movq (%rbx), %rdi
movq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xac0f
movq (%rax), %rsi
incq %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x2270
nop