private void analyzeFunction(Function function, TaskMonitor monitor) throws CancelledException {

		if (function == null) {
			return;
		}
		int purge = function.getStackPurgeSize();
		if (purge == -1 || purge > 128 || purge < -128) {
			Instruction purgeInstruction = locatePurgeInstruction(function, monitor);
			if (purgeInstruction != null) {
				purge = getPurgeValue(purgeInstruction);
				// if couldn't find it, don't set it!
				if (purge != -1) {
					function.setStackPurgeSize(purge);
				}
				setPrototypeModel(function, purgeInstruction);
			}
		}
	}
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