public void replaceVariables(Address originEntryPoint, List<Variable> varList,
			TaskMonitor monitor) throws CancelledException {
		Address resultEntryPoint = originToResultTranslator.getAddress(originEntryPoint);
		Function f1 = resultProgram.getFunctionManager().getFunctionAt(resultEntryPoint);
		Function f2 = originProgram.getFunctionManager().getFunctionAt(originEntryPoint);
		if (f1 == null || f2 == null) {
			return;
		}
		boolean replaceParams = false;
		for (Variable var : varList) {
			monitor.checkCancelled();
			if (var instanceof Parameter) {
				replaceParams = true;
				break;
			}
		}
		if (replaceParams) {
			replaceFunctionParameters(originEntryPoint, monitor);
		}
		for (Variable var : varList) {
			monitor.checkCancelled();
			if (!(var instanceof Parameter)) {
				replaceVariable(f2, var, f1);
			}
		}
	}
<CODE>replaceFunctionVariables</CODE> replaces the
function variables/parameters in program1 with that from the origin program.
@param originEntryPoint the entry point address of the function to modify.
This address should be derived from program1.
@param varList the list of variables to replace.
@param monitor the task monitor for notifying the user of progress.
@throws CancelledException if the user canceled the operation via the task monitor.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java