private void replaceThunks(AddressSet thunkSet, TaskMonitor monitor) throws CancelledException {
		long granularity;
		// Now that all the non-thunk functions have been processed, process the saved thunks.
		long totalThunks = thunkSet.getNumAddresses();
		granularity = (totalThunks / PROGRESS_COUNTER_GRANULARITY) + 1;
		monitor.initialize(totalThunks);
		AddressIterator thunkIter = thunkSet.getAddresses(true);
		for (int count = 0; thunkIter.hasNext(); count++) {
			monitor.checkCancelled();
			Address address = thunkIter.next();
			if (count % granularity == 0) {
				monitor.setProgress(count);
				monitor.setMessage("Replacing Thunk Function " + (count + 1) + " of " +
					totalThunks + "." + " Address = " + address.toString(true));
			}
			replaceFunction(address, monitor);
		}
		monitor.setProgress(totalThunks);
	}
<CODE>mergeFunctions</CODE> merges function differences within the specified
 address set.

@param addrSet the addresses to be merged.
The addresses in this set should be derived from program1.
@param monitor the task monitor for notifying the user of this merge's
progress.
@throws CancelledException if user cancels via the monitor.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java