private static Variable clearConflictingLocalVariables(Function function,
			VariableStorage storage, Address pcAddr) {

		int firstUseOffset = 0;
		if (pcAddr != null) {
			firstUseOffset = (int) pcAddr.subtract(function.getEntryPoint());
		}
		if (storage.isHashStorage()) {

			long hashVal = storage.getFirstVarnode().getOffset();
			for (Variable ul : function.getLocalVariables(VariableFilter.UNIQUE_VARIABLE_FILTER)) {
				// Note: assumes there is only one hash method used for unique locals
				if (ul.getFirstStorageVarnode().getOffset() == hashVal) {
					return ul;
				}
			}
			return null;
		}

		Variable matchingVariable = null;
		for (Variable otherVar : function.getLocalVariables()) {
			if (otherVar.getFirstUseOffset() != firstUseOffset) {
				// other than parameters we will have a hard time identifying
				// local variable conflicts due to differences in scope (i.e., first-use)
				continue;
			}

			VariableStorage otherStorage = otherVar.getVariableStorage();

			if (otherStorage.intersects(storage)) {
				if (matchingVariable == null && otherStorage.equals(storage)) {
					matchingVariable = otherVar;
					continue;
				}
				function.removeVariable(otherVar);
			}
		}

		return matchingVariable;
	}
Low-level routine for clearing any variables in the
database which conflict with this variable and return
one of them for re-use.  The returned variable still
exists within the function at the same first-use-offset.
@param function is the function containing the local variables
@param storage is the storage area to clear
@param pcAddr is the point of use
@return existing variable with identical storage and first-use offset or null
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunctionDBUtil.java