public void merge(TaskMonitor monitor) throws CancelledException {
		monitor.setMessage(
			"Auto-merging " + registerName + " Register Values and determining conflicts.");

		determineConflicts(monitor);

		// Auto merge any program context changes from my program where the
		// resulting program has the mem addresses but the latest doesn't.
		AddressRangeIterator arIter = autoSet.getAddressRanges();
		while (arIter.hasNext() && !monitor.isCancelled()) {
			try {
				AddressRange range = arIter.next();
				Address rangeMin = range.getMinAddress();
				Address rangeMax = range.getMaxAddress();
				resultContext.remove(rangeMin, rangeMax, resultReg);
				AddressRangeIterator it =
					myContext.getRegisterValueAddressRanges(resultReg, rangeMin, rangeMax);
				while (it.hasNext()) {
					AddressRange valueRange = it.next();
					BigInteger value =
						myContext.getValue(resultReg, valueRange.getMinAddress(), false);
					resultContext.setValue(resultReg, valueRange.getMinAddress(),
						valueRange.getMaxAddress(), value);
				}
			}
			catch (ContextChangeException e) {
				// processor context-register is not handled here and should not occur
				throw new AssertException(e);
			}
		}

		int totalConflicts = rvrs.length;
		if (totalConflicts == 0) {
			return;
		}

		listingMergePanel = mergeManager.getListingMergePanel();
		conflictInfoPanel = new ConflictInfoPanel();
		listingMergePanel.setTopComponent(conflictInfoPanel);

		// Merge the conflicts.
		monitor.setMessage("Resolving " + registerName + " Register Value conflicts.");
		boolean askUser = (conflictOption == ASK_USER);
		for (int conflictIndex = 0; conflictIndex < totalConflicts; conflictIndex++) {
			AddressRange range = rvrs[conflictIndex];
			Address rangeMin = range.getMinAddress();
			Address rangeMax = range.getMaxAddress();
			BigInteger myValue = myContext.getValue(resultReg, rangeMin, false);
			BigInteger latestValue = latestContext.getValue(resultReg, rangeMin, false);
			BigInteger originalValue = originalContext.getValue(resultReg, rangeMin, false);
			// If we have a register context choice then a "Use For All" has already occurred.
			if (contextChoice != ASK_USER) {
				if (conflictOption != contextChoice) {
					conflictOption = contextChoice;
				}
				askUser = (conflictOption == ASK_USER);
			}
			if (askUser) {
				conflictInfoPanel.setRegisterInfo(registerName);
				conflictInfoPanel.setCodeUnitInfo(new AddressRangeImpl(rangeMin, rangeMax),
					conflictIndex + 1, totalConflicts);
				// Display dialog to allow user to choose latest or my register value.
				showMergePanel(rangeMin, rangeMax, latestValue, myValue, originalValue);
				// apply() will set the conflictOption and do the merge.
				if (conflictOption == CANCELED) {
					throw new CancelledException();
				}
				continue;
			}
			merge(rangeMin, rangeMax, resultReg);
		}
	}
Merges all the register values for the named register being managed by this merge manager.
@param monitor the monitor that provides feedback to the user.
@throws CancelledException if the user cancels
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/RegisterMergeManager.java