private void setPrototypeModel(Function function, Instruction purgeInstruction) {
		if (nearFarModels == null) {
			return;
		}
		if (purgeInstruction.getFlowType().isCall()) {
			return;
		}
		if (function.getSignatureSource() != SourceType.DEFAULT) {
			return;
		}
		PrototypeModel model = null;
		try {
			byte val = purgeInstruction.getBytes()[0];
			if (val == (byte) 0xc3) {
				model = nearFarModels[CDECL_NEAR];
			}
			else if (val == (byte) 0xcb) {
				model = nearFarModels[CDECL_FAR];
			}
			else if (val == (byte) 0xc2) {
				model = nearFarModels[STDCALL_NEAR];
			}
			else if (val == (byte) 0xca) {
				model = nearFarModels[STDCALL_FAR];
			}
		}
		catch (MemoryAccessException e) {
			return;
		}
		if (model == null) {
			return;
		}
		try {
			function.setCallingConvention(model.getName());
		}
		catch (InvalidInputException e) {
			// Ignore if we can't change it
		}
	}
Analyze a function to build a stack frame based on stack references.
@param function function to be analyzed
@param monitor the task monitor that is checked to see if the command has
been cancelled.
@throws CancelledException if the user canceled this command
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/FunctionPurgeAnalysisCmd.java