public void replaceFunctionVariable(Address originEntryPoint, Variable var,
			TaskMonitor monitor) {
		if (var instanceof Parameter) {
			throw new IllegalArgumentException(
				"replaceFunctionVariable does not support parameters");
		}
		Address resultEntryPoint = originToResultTranslator.getAddress(originEntryPoint);
		Function f1 = resultProgram.getFunctionManager().getFunctionAt(resultEntryPoint);
		Function f2 = originProgram.getFunctionManager().getFunctionAt(originEntryPoint);
		if (f1 != null && f2 != null) {
			Variable toVar = findVariable(var, f1.getLocalVariables());
			Variable fromVar = findVariable(var, f2.getLocalVariables());
			// FUTURE: This may need to be changed to hold list of references
			// to the toVar variable so they can be pointed to the fromVar.
			if (toVar != null) {
				f1.removeVariable(toVar);
			}
			if (fromVar != null) {
				try {
					SourceType source = fromVar.getSource();
					VariableUtilities.checkVariableConflict(f1, fromVar,
						fromVar.getVariableStorage(), true);
					f1.addLocalVariable(fromVar, source);
				}
				catch (DuplicateNameException e) {
					Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
					errorMsg.append("DuplicateNameException replacing function variable: " +
						e.getMessage() + "\n");
				}
				catch (InvalidInputException e) {
					Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
					errorMsg.append("InvalidInputException replacing function variable: " +
						e.getMessage() + "\n");
				}
			}
		}
	}
<CODE>replaceFunctionVariable</CODE> replaces the name of the indicated
function variable 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 var a variable that is equivalent to the one in program1 to be replaced.
The variable passed here could be from another program.
@param monitor the task monitor for notifying the user of progress.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java