private static VTImpliedMatchInfo findImpliedMatch(AddressCorrelation correlator,
			Function sourceFunction, Function destinationFunction, Reference sourceRef,
			VTMatchSet possibleMatchSet, TaskMonitor monitor) throws CancelledException {

		// Get the reference type of the passed in reference and make sure it is either a call or
		// data reference
		RefType refType = sourceRef.getReferenceType();
		if (!(refType.isCall() || refType.isData())) {
			return null;
		}

		// Get the source reference's "to" address (the address the reference is pointing to)
		// and make sure it is in the current program memory space
		Address srcRefToAddress = sourceRef.getToAddress();
		if (!srcRefToAddress.isMemoryAddress()) {
			return null;
		}

		// Get corrected source reference "to" address if necessary (ie if thunk get the thunked
		// function)
		srcRefToAddress = getReference(sourceFunction.getProgram(), srcRefToAddress);

		// Get the source reference's "from" address (where the reference itself is located)
		Address srcRefFromAddress = sourceRef.getFromAddress();

		// Get the destination reference address corresponding to the given source reference address
		AddressCorrelationRange range =
			correlator.getCorrelatedDestinationRange(srcRefFromAddress, monitor);
		if (range == null) {
			return null;
		}
		Address destinationAddress = range.getMinAddress();
		ReferenceManager destRefMgr = destinationFunction.getProgram().getReferenceManager();
		Reference[] referencesFrom = destRefMgr.getReferencesFrom(destinationAddress);
		Reference destinationRef = findMatchingRef(refType, referencesFrom);
		if (destinationRef == null) {
			return null;
		}

		// Get the destination reference's "to" address
		Address destRefToAddress = destinationRef.getToAddress();

		// Get corrected destination reference "to" address if necessary (ie if thunk get the
		// thunked function)
		destRefToAddress = getReference(destinationFunction.getProgram(), destRefToAddress);

		// Create the initial empty matchInfo for this possible implied match
		VTImpliedMatchInfo matchInfo =
			new VTImpliedMatchInfo(possibleMatchSet, sourceRef, destinationRef);

		// Add the source and destination addresses of the possible implied match
		matchInfo.setSourceAddress(srcRefToAddress);
		matchInfo.setDestinationAddress(destRefToAddress);

		VTAssociationType type;

		if (refType.isData()) {
			type = DATA;
			if (sourceFunction.getProgram()
					.getListing()
					.getInstructionAt(srcRefToAddress) != null) {
				if (refType != RefType.DATA) {
					return null; // read/write reference to instruction - not sure what this is
				}
				// otherwise assume it is a function
				type = FUNCTION;
			}
		}
		else {
			type = FUNCTION;
		}

		if (type == FUNCTION) {
			if (sourceFunction.getProgram()
					.getFunctionManager()
					.getFunctionAt(srcRefToAddress) == null) {
				return null; // source function may not have been created here.
			}

			if (destinationFunction.getProgram()
					.getFunctionManager()
					.getFunctionAt(destRefToAddress) == null) {
				return null; // destination function may not have been created here.
			}
		}

		// Add association type, score, and confidence
		matchInfo.setAssociationType(type);
		matchInfo.setSimilarityScore(new VTScore(0));
		matchInfo.setConfidenceScore(new VTScore(1));

		// Update the length of the match
		updateVTSourceAndDestinationLengths(matchInfo);

		return matchInfo;
	}
Method for finding version tracking implied matches given an accepted matched
function. Each referenced data and function that exist in equivalent sections
of the matched source and destination functions will be returned in the given set.

@param sourceFunction The matched function from the source program
@param destinationFunction The matched function from the destination program
@param session The Version Tracking session
@param correlatorManager Keeps track of which section of the source function corresponds to
the which section of the destination function
@param monitor Handles user cancellations
@return a set of VTImpliedMatchInfo objects
@throws CancelledException if cancelled
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/util/ImpliedMatchUtils.java