// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, (%rsp)
movb $0x0, 0x10(%rdi)
movq 0x9931(%rip), %r15      # 0x10fd0
movq 0x993a(%rip), %r13      # 0x10fe0
leaq 0x4e71(%rip), %rbp      # 0xc51e
leaq 0x4e6d(%rip), %r12      # 0xc521
pushq $0xa
popq %r14
movq %r15, %rdi
leaq 0x424b(%rip), %rsi      # 0xb90d
callq 0x21a0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21f0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x5586
testb %al, %al
je 0x77a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5586
testb %al, %al
je 0x77a0
movq %rbx, %rdi
leaq 0x4e24(%rip), %rsi      # 0xc526
callq 0x5586
testb %al, %al
je 0x77a0
movq %rbx, %rdi
leaq 0x4e12(%rip), %rsi      # 0xc52b
callq 0x5586
testb %al, %al
je 0x77a0
movq %rbx, %rdi
leaq 0x4e05(%rip), %rsi      # 0xc531
callq 0x5586
testb %al, %al
je 0x77a0
movq %rbx, %rdi
leaq 0x4df9(%rip), %rsi      # 0xc538
callq 0x5586
testb %al, %al
je 0x77a0
movq %r15, %rdi
leaq 0x4deb(%rip), %rsi      # 0xc53d
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq %r15, %rdi
leaq 0x3ef6(%rip), %rsi      # 0xb65f
callq 0x21a0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
xorl %esi, %esi
callq 0x2270
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movl %r14d, %edx
callq 0x2100
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21f0
jmp 0x76d2
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
xorl %esi, %esi
callq 0x2270
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movl %r14d, %edx
callq 0x2100
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2aab
testb %al, %al
je 0x77e7
movq (%rsp), %rax
cmpq $0x0, 0x48(%rax)
leaq 0x4d8b(%rip), %rsi      # 0xc56c
je 0x7877
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2aab
testb %al, %al
je 0x7808
movq (%rsp), %rax
cmpq $0x0, 0x60(%rax)
leaq 0x4d8c(%rip), %rsi      # 0xc592
je 0x7877
movq %rbx, %rdi
leaq 0x4d14(%rip), %rsi      # 0xc526
callq 0x2aab
testb %al, %al
je 0x782d
movq (%rsp), %rax
cmpq $0x0, 0x58(%rax)
leaq 0x4d8f(%rip), %rsi      # 0xc5ba
je 0x7877
movq %rbx, %rdi
leaq 0x4cf4(%rip), %rsi      # 0xc52b
callq 0x2aab
testb %al, %al
je 0x7852
movq (%rsp), %rax
cmpq $0x0, 0x50(%rax)
leaq 0x4d92(%rip), %rsi      # 0xc5e2
je 0x7877
movq %rbx, %rdi
leaq 0x4cd5(%rip), %rsi      # 0xc531
callq 0x2aab
testb %al, %al
je 0x7884
movq (%rsp), %rax
cmpq $0x0, 0x68(%rax)
leaq 0x4d96(%rip), %rsi      # 0xc60b
jne 0x7884
movq %r15, %rdi
callq 0x21a0
jmp 0x76b8
movq %rbx, %rdi
leaq 0x4ca3(%rip), %rsi      # 0xc531
callq 0x2aab
testb %al, %al
movq (%rsp), %rax
je 0x78c4
cmpq $0x0, 0x68(%rax)
je 0x78c4
cmpb $0x0, 0x78(%rax)
jne 0x78c4
movq %r15, %rdi
leaq 0x4d83(%rip), %rsi      # 0xc635
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
jmp 0x76b8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x78d8
movq %rax, %r14
movq %rbx, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2290
nop