public List<Register> getRegistersFor(DataType dt, boolean allowEndianFixups) {
		int[] saveRegAllocation = saveRegAllocation();
		List<Register> result = new ArrayList<>();

		if (!countRegistersFor(dt, result)) {
			restoreRegAllocation(saveRegAllocation);
			return null;
		}
		
		if (allowEndianFixups && !isBigEndian && result.size() > 1) {
			Collections.reverse(result);
		}

		return new ArrayList<>(result);
	}
Returns a list of {@link Register registers} that will successfully store the specified
data type, as well as marking those registers as used and unavailable.

@param dt {@link DataType} to allocate register space for
@param allowEndianFixups boolean flag, if true the result (if it contains more than a single
location) will automatically be adjusted in little endian programs to match how storage
varnodes are laid-out, if false the result will not be adjusted 
@return list of {@link Register registers}, possibly empty if the data type was zero-length,
possibly null if the data type is not compatible with register storage
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/GoParamStorageAllocator.java