public void encode(Encoder encoder, PcodeInjectLibrary injectLibrary) throws IOException {
		if (compatModel != null) {
			encoder.openElement(ELEM_MODELALIAS);
			encoder.writeString(ATTRIB_NAME, name);
			encoder.writeString(ATTRIB_PARENT, compatModel.name);
			encoder.closeElement(ELEM_MODELALIAS);
			return;
		}
		encoder.openElement(ELEM_PROTOTYPE);
		encoder.writeString(ATTRIB_NAME, name);
		if (extrapop != PrototypeModel.UNKNOWN_EXTRAPOP) {
			encoder.writeSignedInteger(ATTRIB_EXTRAPOP, extrapop);
		}
		else {
			encoder.writeString(ATTRIB_EXTRAPOP, "unknown");
		}
		encoder.writeSignedInteger(ATTRIB_STACKSHIFT, stackshift);
		if (hasThis) {
			encoder.writeBool(ATTRIB_HASTHIS, true);
		}
		if (isConstruct) {
			encoder.writeBool(ATTRIB_CONSTRUCTOR, true);
		}
		if (inputListType != InputListType.STANDARD) {
			encoder.writeString(ATTRIB_STRATEGY, "register");
		}
		inputParams.encode(encoder, true);
		outputParams.encode(encoder, false);
		if (hasUponEntry || hasUponReturn) {
			InjectPayload payload =
				injectLibrary.getPayload(InjectPayload.CALLMECHANISM_TYPE, getInjectName());
			payload.encode(encoder);
		}
		if (unaffected != null) {
			encoder.openElement(ELEM_UNAFFECTED);
			encodeVarnodes(encoder, unaffected);
			encoder.closeElement(ELEM_UNAFFECTED);
		}
		if (killedbycall != null) {
			encoder.openElement(ELEM_KILLEDBYCALL);
			encodeVarnodes(encoder, killedbycall);
			encoder.closeElement(ELEM_KILLEDBYCALL);
		}
		if (likelytrash != null) {
			encoder.openElement(ELEM_LIKELYTRASH);
			encodeVarnodes(encoder, likelytrash);
			encoder.closeElement(ELEM_LIKELYTRASH);
		}
		if (internalstorage != null) {
			encoder.openElement(ELEM_INTERNAL_STORAGE);
			encodeVarnodes(encoder, internalstorage);
			encoder.closeElement(ELEM_INTERNAL_STORAGE);
		}
		if (returnaddress != null) {
			encoder.openElement(ELEM_RETURNADDRESS);
			encodeVarnodes(encoder, returnaddress);
			encoder.closeElement(ELEM_RETURNADDRESS);
		}
		if (localRange != null && !localRange.isEmpty()) {
			encoder.openElement(ELEM_LOCALRANGE);
			encodeAddressSet(encoder, localRange);
			encoder.closeElement(ELEM_LOCALRANGE);
		}
		if (paramRange != null && !paramRange.isEmpty()) {
			encoder.openElement(ELEM_PARAMRANGE);
			encodeAddressSet(encoder, paramRange);
			encoder.closeElement(ELEM_PARAMRANGE);
		}
		encoder.closeElement(ELEM_PROTOTYPE);
	}
Encode this object to an output stream
@param encoder is the stream encoder
@param injectLibrary is a library containing any inject payloads associated with the model
@throws IOException for errors writing to the underlying stream
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/PrototypeModel.java