private static Variable determineReturnValue(Function destinationFunction,
			Function sourceFunction, boolean useCustomStorage,
			java.util.function.Function<DataType, DataType> prepareDataType)
			throws InvalidInputException {
		Program destinationProgram = destinationFunction.getProgram();
		Parameter sourceReturn = sourceFunction.getReturn();
		VariableStorage storage =
			(useCustomStorage) ? sourceReturn.getVariableStorage().clone(destinationProgram)
					: VariableStorage.UNASSIGNED_STORAGE;
		DataType dataType = prepareDataType.apply(sourceReturn.getDataType());
		if (dataType.isZeroLength()) {
			storage = VariableStorage.UNASSIGNED_STORAGE;
		}
		Parameter returnValue = new ReturnParameterImpl(dataType, storage, destinationProgram);
		return returnValue;
	}
Determines whether or not the two programs are considered to have the same processor
language and compiler specification.
@param program1 the first program
@param program2 the second program
@return true if the two programs have the same processor language and compiler spec.
Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java