@Override
	synchronized public boolean applyTo(Program program, TaskMonitor monitor) {

		disassemblyPerformed = false;
		unalignedStart = false;

		// get the longMode register and set accordingly
		ProgramContext context = program.getProgramContext();
		Register longModeReg = context.getRegister("longMode");

		// Indicates we're not x86-64, or the spec has changed
		if (longModeReg == null) {
			languageError = "Requires x86:LE:64:default";
			return false;
		}
		RegisterValue ctx = new RegisterValue(context.getBaseContextRegister()).assign(longModeReg,
			size32Mode ? BigInteger.ZERO : BigInteger.ONE);

		super.setInitialContext(ctx);

		try {
			if (startSet != null) {
				// This is identity, no?
				AddressSet alignedSet = alignSet(1, startSet);
				if (alignedSet.isEmpty()) {
					unalignedStart = true;
					return false;
				}
				startSet = program.getListing().getUndefinedRanges(alignedSet, true, monitor);
				if (startSet.isEmpty()) {
					return true;
				}
			}
		}
		catch (CancelledException e) {
			return true;
		}

		return doDisassembly(monitor, program, 1);
	}
Constructor for X86_64DisassembleCommand.

@param start address to be the start of a disassembly.
@param restrictedSet addresses that can be disassembled. a null set implies no restrictions.
@param size32Mode pass true if disassembling in 32-bit compatibility mode, otherwise normal
           64-bit disassembly will be performed.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/disassemble/X86_64DisassembleCommand.java