// File: /workspace/github_cpp_makefile_star2_O3/XxAdi101xX[P]ChamberCrawler/Main/MainHelpers.cc
// Function: getValidNeighbourCoordinates(std::vector<int, std::allocator<int>>)
vector<int> getValidNeighbourCoordinates(vector<int> base) {
	// safety check
	vector<vector<int>> checkedCoordinates;
	vector<int> tempCoordinates;

	do {
		tempCoordinates = rng.genNeighbourCoord(base);

		bool checked = false;

		// checks if neighbour was logged
		for (auto coordinates: checkedCoordinates) {
			if (coordinates == tempCoordinates) {
					checked = true;
					break;
				}
		}

		// if neighbour was not logged, log it
		if (!(checked)) {
			checkedCoordinates.emplace_back(tempCoordinates);
		}

		// checks if all neighbours were tried
		if (checkedCoordinates.size() == DIRECTION_ENUMERATION) {
			// no valid neighbour
			throw 1;
		}

		// reroll if coordinates are not for a FloorTile
		// or has an occupant already
	} while (!(isValidCoordinates(tempCoordinates))
		|| isOccupied(tempCoordinates));

		return tempCoordinates;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x38(%rsp)
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x20(%rsp), %rcx
movq %rax, 0x10(%rcx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rcx)
movq %rax, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0x120b4
movq %rsp, %rdi
leaq 0x16d1c(%rip), %rsi     # 0x29e08
movq %r15, %rdx
callq 0x1a524
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x1313e
subq %rdi, %rsi
callq 0x5280
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1313e
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x13155
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %r12
cmpq %r12, %r13
je 0x131e1
xorl %r15d, %r15d
movq %rsp, %rdi
movq %r13, %rsi
callq 0x120b4
movq (%rsp), %r14
movq 0x8(%rsp), %rax
movq %rax, %rdx
subq %r14, %rdx
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
subq %rsi, %rcx
cmpq %rcx, %rdx
jne 0x131a8
cmpq %r14, %rax
je 0x131ac
movq %r14, %rdi
callq 0x5290
testl %eax, %eax
sete %bpl
orb %bpl, %r15b
jmp 0x131b2
xorl %ebp, %ebp
jmp 0x131b2
movb $0x1, %bpl
movb $0x1, %r15b
testq %r14, %r14
je 0x131c7
movq 0x10(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x5280
addq $0x18, %r13
cmpq %r12, %r13
sete %al
orb %al, %bpl
je 0x13167
testb $0x1, %r15b
leaq 0x58(%rsp), %r15
jne 0x131ee
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x13a98
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cmpq $0xc0, %rax
je 0x13296
leaq 0x70(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x120b4
movq %r14, %rdi
callq 0x12c90
movb $0x1, %r14b
testb %al, %al
je 0x13254
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x120b4
leaq 0x40(%rsp), %rdi
callq 0x12d2d
movl %eax, %r14d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x13254
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1326e
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
testb %r14b, %r14b
jne 0x130d5
leaq 0x20(%rsp), %rdi
callq 0x13ad4
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x5160
movl $0x1, (%rax)
movq 0x15cd3(%rip), %rsi     # 0x28f80
movq %rax, %rdi
xorl %edx, %edx
callq 0x53c0
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x132f2
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
jmp 0x132f2
jmp 0x1330e
jmp 0x1330e
jmp 0x1330e
jmp 0x1330e
movq %rax, %r14
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x13311
movq 0x68(%rsp), %rsi
jmp 0x13304
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x13311
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
jmp 0x13311
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x13325
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x5280
leaq 0x20(%rsp), %rdi
callq 0x13ad4
movq %r14, %rdi
callq 0x53e0