private void handleAddSwitch(Instruction instr) {

		AddressSet caseRange = new AddressSet();
		int caseNum = 0;
		int caseSize = -1;
		Address instrAddr = instr.getMinAddress();

		boolean caseUpdate = false;
		Reference[] refs =
			program.getReferenceManager().getReferencesFrom(instr.getMinAddress(), Reference.MNEMONIC);
		if (refs.length == 1) { // final case may not have been examined yet
			// Assume that switch should always have 3 or more cases
			return;
		}
		for (Reference ref : refs) {
			if (ref.getReferenceType().isFlow()) {
				caseUpdate = true;
				break;
			}
		}

		AddressSet casePoints = new AddressSet();

		Address caseAddr = instrAddr.add(2);
		while (true) {
			if (caseSize > 0) {
				caseAddr = caseAddr.add(caseSize);
			}
			if (caseUpdate) {
				// Look beyond final case for possible new final case
				if (refMgr.getReference(instr.getMinAddress(), caseAddr, Reference.MNEMONIC) == null) {
					if (listing.getUndefinedDataAt(caseAddr) != null &&
						testDisassmbleFinalCaseAt(caseAddr, caseSize, caseRange)) {
						// Final case
						refMgr.addMemoryReference(instr.getMinAddress(), caseAddr,
							RefType.COMPUTED_JUMP, SourceType.ANALYSIS, Reference.MNEMONIC);
						disassemblyPoints.addRange(caseAddr, caseAddr);
					}
					break;
				}
			}
			else if (refMgr.hasReferencesTo(caseAddr)) {
				break;
			}
			int bytesConsumed = testDisassmbleCaseAt(caseAddr, caseSize);
			if (bytesConsumed == 0) {
				// Check final case which may fall into break code for previous cases
				if (caseNum > 1 && listing.getUndefinedDataAt(caseAddr) != null) {
					// Defer final case check until other cases are disassembled
					secondPassPoints.addRange(instrAddr, instrAddr);
				}
				break;
			}

			++caseNum;
			caseSize = bytesConsumed;
			caseRange.addRange(caseAddr, caseAddr.add(caseSize - 1));

			if (!caseUpdate) {
				casePoints.addRange(caseAddr, caseAddr);
			}
		}

		if (casePoints.getNumAddresses() > 1) {
			AddressIterator caseAddresses = casePoints.getAddresses(true);
			while (caseAddresses.hasNext()) {
				caseAddr = caseAddresses.next();
				refMgr.addMemoryReference(instr.getMinAddress(), caseAddr, RefType.COMPUTED_JUMP,
					SourceType.ANALYSIS, Reference.MNEMONIC);
				disassemblyPoints.addRange(caseAddr, caseAddr);
			}
		}
	}
Constructor for private use.
@param program
Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/PicSwitchAnalyzer.java