private static void analyzeIfNeeded(AutoAnalysisManager mgr, AddressSetView startSet,
			AddressSetView disassembledSet, TaskMonitor monitor) {
		if (disassembledSet == null || disassembledSet.isEmpty()) {
			return;
		}

		if (mgr == null || monitor.isCancelled()) {
			return;
		}

		AddressRange firstRange = disassembledSet.getFirstRange();
		Address rangeEnd = firstRange.getMaxAddress();
		Address nextAddr = rangeEnd.next();
		if (nextAddr != null && startSet.contains(rangeEnd) && startSet.contains(nextAddr)) {
			mgr.startAnalysis(monitor, false);
		}
	}
Determine if intermediate analysis is required to reduce the risk of disassembling data
regions when performing static disassembly over a contiguous range if addresses. This method
attemps to identify this situation by checking the first range of disassembledSet against the
startSet. Analysis will be triggered if startSet contains both the max address of the first
range of disassembledSet (M where M=disassembledSet.firstRange().getMaxAddress()) and the
next address (M.next()) which will be the next seed point.

@param mgr auto analysis manager or null if analysis disabled
@param startSet disassembly seed points (prior to removing disassembledSet)
@param disassembledSet last set of disassembled addresses using startSet min-address as seed
           point
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/disassemble/DisassembleCommand.java