protected void initializeProcess() throws IOException, DecompileException {
		if (decompCallback == null) {
			throw new IOException("Program not opened in decompiler");
		}
		if (decompProcess == null) {
			decompProcess = DecompileProcessFactory.get();
		}
		else if (!decompProcess.isReady()) {
			DecompileProcessFactory.release(decompProcess);
			decompProcess = DecompileProcessFactory.get();
		}
		long uniqueBase = UniqueLayout.SLEIGH_BASE.getOffset(pcodelanguage);
		XmlEncode xmlEncode = new XmlEncode(false);
		pcodelanguage.encodeTranslator(xmlEncode, program.getAddressFactory(), uniqueBase);
		String tspec = xmlEncode.toString();
		xmlEncode.clear();
		dtmanage.encodeCoreTypes(xmlEncode);
		String coretypes = xmlEncode.toString();
		SleighLanguageDescription sleighdescription =
			(SleighLanguageDescription) pcodelanguage.getLanguageDescription();
		ResourceFile pspecfile = sleighdescription.getSpecFile();
		String pspecxml = fileToString(pspecfile);
		xmlEncode.clear();
		compilerSpec.encode(xmlEncode);
		String cspecxml = xmlEncode.toString();
		baseEncodingSet = new EncodeDecodeSet(program);

		decompCallback.setNativeMessage(null);
		decompProcess.registerProgram(decompCallback, pspecxml, cspecxml, tspec, coretypes,
			program);
		String nativeMessage = decompCallback.getNativeMessage();
		if ((nativeMessage != null) && (nativeMessage.length() != 0)) {
			throw new IOException("Could not register program: " + nativeMessage);
		}
		if (options != null) {
			baseEncodingSet.mainQuery.clear();
			options.encode(baseEncodingSet.mainQuery, this);
			decompProcess.setMaxResultSize(options.getMaxPayloadMBytes());
			decompProcess.sendCommand1Param("setOptions", baseEncodingSet.mainQuery,
				stringResponse);
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Did not accept decompiler options");
			}
		}
		if (actionname == null) {
			throw new IOException("Decompile action not specified");
		}
		if (!actionname.equals("decompile")) {
			decompProcess.sendCommand2Params("setAction", actionname, "", stringResponse);
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Could not set decompile action");
			}
		}
		if (!printSyntaxTree) {
			decompProcess.sendCommand2Params("setAction", "", "notree", stringResponse);
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Could not turn off syntax tree");
			}
		}
		if (!printCCode) {
			decompProcess.sendCommand2Params("setAction", "", "noc", stringResponse);
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Could not turn off C printing");
			}
		}
		if (sendParamMeasures) {
			decompProcess.sendCommand2Params("setAction", "", "parammeasures", stringResponse);
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Could not turn on sending of parameter measures");
			}
		}
		if (jumpLoad) {
			decompProcess.sendCommand2Params("setAction", "", "jumpload", stringResponse);
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Could not turn on jumptable loads");
			}
		}
		if (sigSettings != 0) {
			decompProcess.sendCommand1Param("setSignatureSettings", Integer.toString(sigSettings),
				stringResponse);
			if (stringResponse.isEmpty()) {
				if (decompCallback.getNativeMessage().startsWith("Bad command")) {
					throw new DecompileException("Decompiler",
						"Decompiler executable not built with signature module");
				}
				throw new DecompileException("Decompiler", decompCallback.getNativeMessage());
			}
			if (!stringResponse.toString().equals("t")) {
				throw new IOException("Could not set signature settings");
			}
		}
	}
This is the main routine for making sure that a decompiler
process is active and that it is initialized properly
@throws IOException for any problems with the pipe to the decompiler process
@throws DecompileException for errors initializing decompiler options etc.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/DecompInterface.java