public void replaceFunctionVariableName(Address originEntryPoint, Variable var,
			TaskMonitor monitor) throws DuplicateNameException, InvalidInputException {
		if (var instanceof Parameter) {
			replaceFunctionParameterName(originEntryPoint, ((Parameter) var).getOrdinal(), monitor);
			return;
		}
		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());
			SourceType source;
			if (fromVar != null) {
				source = fromVar.getSource();
			}
			else if (toVar != null) {
				source = toVar.getSource();
			}
			else {
				source = var.getSource();
			}
			String fromName = (fromVar != null) ? fromVar.getName() : null;
			if (toVar != null) {
				for (int i = 0; i < Integer.MAX_VALUE; i++) {
					String newName =
						(i == 0) ? fromName : fromName + ProgramMerge.SYMBOL_CONFLICT_SUFFIX + i;
					try {
						toVar.setName(newName, source);
						if (i > 0) {
							infoMsg.append("Variable '" + fromName + "' was merged as '" + newName +
								"' in function " + f1.getName() + ".\n");
						}
						return;
					}
					catch (DuplicateNameException e) {
						continue;
					}
				}
				toVar.setName(fromName, source); // Get it to throw the first duplicate name exception.
			}
		}
	}
<CODE>replaceFunctionVariableName</CODE> replaces the name on the indicated
function variable in program1 with the name from the equivalent variable in program2.
@param originEntryPoint the entry point address of the function to modify.
This address should be derived from the origin program.
@param var a variable that is equivalent to the one in program1 to be changed.
The variable passed here could be from another program.
@param monitor the task monitor for notifying the user of progress.
@throws InvalidInputException
@throws DuplicateNameException
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java