private Instruction locatePurgeInstruction(Function func, TaskMonitor monitor) {
		AddressSetView body = func.getBody();
		Instruction purgeInstruction;

		purgeInstruction = findPurgeInstruction(body);
		if (purgeInstruction != null) {
			return purgeInstruction;
		}

		// look harder, maybe something wrong with body, compute with flow.
		body = CreateFunctionCmd.getFunctionBody(program, func.getEntryPoint(), monitor);
		return findPurgeInstruction(body);
	}
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