// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x32f0
movb $0x1, -0x12(%rbp)
testb $0x1, -0x12(%rbp)
je 0xe1ba
movq 0xd1af(%rip), %rdi      # 0x1afd0
leaq 0x6b31(%rip), %rsi      # 0x14959
callq 0x3200
jmp 0xde2f
movq -0x40(%rbp), %rsi
movq 0xd1a6(%rip), %rdi      # 0x1afe0
callq 0x32b0
jmp 0xde41
jmp 0xde43
movq -0x40(%rbp), %rdi
leaq 0x771c(%rip), %rsi      # 0x1556a
callq 0x8fe0
movb %al, -0x41(%rbp)
jmp 0xde58
movb -0x41(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x42(%rbp)
jne 0xde6a
jmp 0xdf1a
movq -0x40(%rbp), %rdi
leaq 0x76f8(%rip), %rsi      # 0x1556d
callq 0x8fe0
movb %al, -0x43(%rbp)
jmp 0xde7f
movb -0x43(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x42(%rbp)
jne 0xde91
jmp 0xdf1a
movq -0x40(%rbp), %rdi
leaq 0x76d6(%rip), %rsi      # 0x15572
callq 0x8fe0
movb %al, -0x44(%rbp)
jmp 0xdea6
movb -0x44(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x42(%rbp)
jne 0xdeb5
jmp 0xdf1a
movq -0x40(%rbp), %rdi
leaq 0x76b7(%rip), %rsi      # 0x15577
callq 0x8fe0
movb %al, -0x45(%rbp)
jmp 0xdeca
movb -0x45(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x42(%rbp)
jne 0xded9
jmp 0xdf1a
movq -0x40(%rbp), %rdi
leaq 0x7699(%rip), %rsi      # 0x1557d
callq 0x8fe0
movb %al, -0x46(%rbp)
jmp 0xdeee
movb -0x46(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x42(%rbp)
jne 0xdefd
jmp 0xdf1a
movq -0x40(%rbp), %rdi
leaq 0x767c(%rip), %rsi      # 0x15584
callq 0x8fe0
movb %al, -0x47(%rbp)
jmp 0xdf12
movb -0x47(%rbp), %al
movb %al, -0x42(%rbp)
jmp 0xdf1a
movb -0x42(%rbp), %al
testb $0x1, %al
jne 0xdf26
jmp 0xdfc9
movq 0xd0a3(%rip), %rdi      # 0x1afd0
leaq 0x7655(%rip), %rsi      # 0x15589
callq 0x3200
movq %rax, -0x50(%rbp)
jmp 0xdf3f
movq -0x50(%rbp), %rdi
movq 0xd076(%rip), %rsi      # 0x1afc0
callq 0x3230
jmp 0xdf51
movq 0xd078(%rip), %rdi      # 0x1afd0
leaq 0x674c(%rip), %rsi      # 0x146ab
callq 0x3200
jmp 0xdf66
movq 0xd073(%rip), %rdi      # 0x1afe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x3350
jmp 0xdf80
movq 0xd059(%rip), %rdi      # 0x1afe0
movl $0x100, %esi            # imm = 0x100
movl $0xa, %edx
callq 0x3140
jmp 0xdf98
movq -0x40(%rbp), %rsi
movq 0xd03d(%rip), %rdi      # 0x1afe0
callq 0x32b0
jmp 0xdfaa
jmp 0xde43
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3130
jmp 0xe1d7
movq 0xd010(%rip), %rdi      # 0x1afe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x3350
jmp 0xdfe3
movq 0xcff6(%rip), %rdi      # 0x1afe0
movl $0x100, %esi            # imm = 0x100
movl $0xa, %edx
callq 0x3140
jmp 0xdffb
movq -0x40(%rbp), %rdi
leaq 0x7564(%rip), %rsi      # 0x1556a
callq 0x3f80
movb %al, -0x51(%rbp)
jmp 0xe010
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0xe019
jmp 0xe03e
movq -0x30(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0xe03e
movq 0xcfa5(%rip), %rdi      # 0x1afd0
leaq 0x7586(%rip), %rsi      # 0x155b8
callq 0x3200
jmp 0xe039
jmp 0xe1b5
movq -0x40(%rbp), %rdi
leaq 0x7524(%rip), %rsi      # 0x1556d
callq 0x3f80
movb %al, -0x52(%rbp)
jmp 0xe053
movb -0x52(%rbp), %al
testb $0x1, %al
jne 0xe05c
jmp 0xe081
movq -0x30(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0xe081
movq 0xcf62(%rip), %rdi      # 0x1afd0
leaq 0x7569(%rip), %rsi      # 0x155de
callq 0x3200
jmp 0xe07c
jmp 0xe1b3
movq -0x40(%rbp), %rdi
leaq 0x74e6(%rip), %rsi      # 0x15572
callq 0x3f80
movb %al, -0x53(%rbp)
jmp 0xe096
movb -0x53(%rbp), %al
testb $0x1, %al
jne 0xe09f
jmp 0xe0c4
movq -0x30(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0xe0c4
movq 0xcf1f(%rip), %rdi      # 0x1afd0
leaq 0x754e(%rip), %rsi      # 0x15606
callq 0x3200
jmp 0xe0bf
jmp 0xe1b1
movq -0x40(%rbp), %rdi
leaq 0x74a8(%rip), %rsi      # 0x15577
callq 0x3f80
movb %al, -0x54(%rbp)
jmp 0xe0d9
movb -0x54(%rbp), %al
testb $0x1, %al
jne 0xe0e2
jmp 0xe107
movq -0x30(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0xe107
movq 0xcedc(%rip), %rdi      # 0x1afd0
leaq 0x7533(%rip), %rsi      # 0x1562e
callq 0x3200
jmp 0xe102
jmp 0xe1af
movq -0x40(%rbp), %rdi
leaq 0x746b(%rip), %rsi      # 0x1557d
callq 0x3f80
movb %al, -0x55(%rbp)
jmp 0xe11c
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0xe125
jmp 0xe147
movq -0x30(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0xe147
movq 0xce99(%rip), %rdi      # 0x1afd0
leaq 0x7519(%rip), %rsi      # 0x15657
callq 0x3200
jmp 0xe145
jmp 0xe1ad
movq -0x40(%rbp), %rdi
leaq 0x742b(%rip), %rsi      # 0x1557d
callq 0x3f80
movb %al, -0x56(%rbp)
jmp 0xe15c
movb -0x56(%rbp), %al
testb $0x1, %al
jne 0xe165
jmp 0xe1a7
movq -0x30(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0xe1a7
movq -0x30(%rbp), %rax
testb $0x1, 0x78(%rax)
jne 0xe1a7
movq 0xce4f(%rip), %rdi      # 0x1afd0
leaq 0x74f9(%rip), %rsi      # 0x15681
callq 0x3200
movq %rax, -0x60(%rbp)
jmp 0xe193
movq -0x60(%rbp), %rdi
movq 0xce22(%rip), %rsi      # 0x1afc0
callq 0x3230
jmp 0xe1a5
jmp 0xe1ab
movb $0x0, -0x12(%rbp)
jmp 0xe1ad
jmp 0xe1af
jmp 0xe1b1
jmp 0xe1b3
jmp 0xe1b5
jmp 0xde10
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xe1cd
movq -0x40(%rbp), %rdi
callq 0x3130
movq -0x38(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3370