private void scoreAcrossExecutablePair(List<FunctionPair> pairs, int i, int j) {
		int size = j - i;
		FunctionPair pair1 = pairs.get(i);
		if (size == 1) {				// If only one pair between the two executable
			scorePair(pair1);			// we can score it immediately
		}
		else if (size == 2) {			// If there are two pairs between the two executables
			FunctionPair pair2 = pairs.get(i + 1);
			if (pair1.funcA == pair2.funcA || pair1.funcB == pair2.funcB) {		// If there is a function in common
				scorePair(pair1);												// only score one of the pairs
			}
			else {
				scorePair(pair1);												// otherwise we can score both pairs
				scorePair(pair2);
			}
		}
		else if (pair1.funcA.getExecutableRecord()
			.getXrefIndex() == pair1.funcB.getExecutableRecord().getXrefIndex()) {
			// Pairs coming from the same executable
			for (; i < j; ++i) {
				FunctionPair pair = pairs.get(i);
				if (pair.funcA == pair.funcB) {				// Only score function paired with itself
					scorePair(pair);
				}
			}
		}
		else {
			HashSet<Long> aUsed = new HashSet<Long>();		// Each function can be score only once (for these executables)
			HashSet<Long> bUsed = new HashSet<Long>();		// Keep track of which functions are used
			for (; i < j; ++i) {									// Run through the pairs (highest similarity first)
				FunctionPair pair = pairs.get(i);
				Long aAddress = pair.funcA.getAddress();
				if (aUsed.contains(aAddress)) {				// If the left-side function has been used before
					continue;								// skip this pair
				}
				Long bAddress = pair.funcB.getAddress();
				if (bUsed.contains(bAddress)) {				// If the right-side function has been used before
					continue;								// skip this pair
				}
				aUsed.add(aAddress);						// Mark the two functions as used
				bUsed.add(bAddress);
				scorePair(pair);
			}
		}
	}
For function pairs between the same two executables, do the final filtering
to create symmetric score contributions and accumulate the contributions in the matrix
@param pairs is the full list of pairs in the cluster
@param i is the first function pair sharing this pair of executables
@param j is the last(+1) function pair sharing this pair of executables
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/ExecutableScorer.java