private static List<Parameter> determineParameters(Function destinationFunction,
			Function sourceFunction, boolean useCustomStorage,
			java.util.function.Function<DataType, DataType> prepareDataType)
			throws InvalidInputException {
		Program destinationProgram = destinationFunction.getProgram();
		List<Parameter> parameters = new ArrayList<>();
		Parameter[] sourceParameters = sourceFunction.getParameters();
		for (Parameter sourceParameter : sourceParameters) {
			String name = sourceParameter.getName();
			VariableStorage storage =
				(useCustomStorage) ? sourceParameter.getVariableStorage().clone(destinationProgram)
						: VariableStorage.UNASSIGNED_STORAGE;
			DataType dataType = prepareDataType.apply(sourceParameter.getDataType());
			if (dataType.isZeroLength()) {
				storage = VariableStorage.UNASSIGNED_STORAGE;
			}

			SourceType source = sourceParameter.getSource();
			Parameter parameter =
				new ParameterImpl(name, dataType, storage, destinationProgram, source);
			String comment = sourceParameter.getComment();
			if (comment != null) {
				parameter.setComment(comment);
			}
			parameters.add(parameter);
		}
		return parameters;
	}
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