int instructionSetAddedToProgram(InstructionSet instructionSet,
			DisassemblerConflictHandler conflictHandler) {

		int disassembleCount = 0;

		AddressSet conflictAddrs = new AddressSet();

		// check for disassembly errors and deferred call queuing
		for (InstructionBlock block : instructionSet) {
			InstructionError conflict = block.getInstructionConflict();
			if (conflict != null) {
				// mark disassembly error
				conflictHandler.markInstructionError(conflict);
				Address conflictAddr = conflict.getInstructionAddress();
				Address blockEndAddr = block.getMaxAddress();
				// add portion of block not added to conflictAddrs
				if (conflictAddr.compareTo(blockEndAddr) <= 0) {
					conflictAddrs.addRange(conflictAddr, blockEndAddr);
				}
			}

			int instrCount = block.getInstructionsAddedCount();
			if (instrCount == 0) {
				continue;
			}

			// Add deferred flows for instructions which were successfully added
			List<InstructionBlockFlow> blockFlows = block.getBlockFlows();
			if (blockFlows != null) {
				for (InstructionBlockFlow blockFlow : blockFlows) {
					Type flowType = blockFlow.getType();
					if (flowType != Type.CALL && processedBranchFlows.contains(blockFlow)) {
						continue;
					}
					if (conflict == null || conflict.getInstructionAddress().compareTo(
						blockFlow.getFlowFromAddress()) > 0) {
						// Add good flows to priorityBranchSet to ensure that future context is
						// properly consumed with a guaranteed block start.  We don't
						// want block to be dependent upon a parent block
						if (flowType == Type.CALL) {
							orderedSeedQueue.add(blockFlow);
						}
						else {
							priorityQueue.add(blockFlow);
						}
					}
				}
			}
			disassembleCount += instrCount;
		}

		// check for empty block errors
		Iterator<InstructionBlock> emptyBlockIterator = instructionSet.emptyBlockIterator();
		while (emptyBlockIterator.hasNext()) {
			InstructionBlock emptyBlock = emptyBlockIterator.next();
			Address flowFromAddress = emptyBlock.getFlowFromAddress();
			if (flowFromAddress != null && conflictAddrs.contains(flowFromAddress)) {
				continue; // skip if flow from instruction was never added
			}
			InstructionError conflict = emptyBlock.getInstructionConflict();
			if (conflict != null) {
				conflictHandler.markInstructionError(conflict);
			}
		}

		return disassembleCount;
	}
@param instructionSet
@return number of instructions added to program
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/disassemble/DisassemblerQueue.java