private void applyFunctionPurge(SequenceNumber calledFrom, Address destAddr, Function func,
			ContextState currentState, TaskMonitor monitor) throws CancelledException {

		PrototypeModel callingConvention = null;
		if (func != null) {
			callingConvention = func.getCallingConvention();
		}
		if (callingConvention == null) {
			callingConvention = program.getCompilerSpec().getDefaultCallingConvention();
		}
		int stackShift = callingConvention.getStackshift();

		int purge = getFunctionPurge(program, func);
		if (purge == Function.UNKNOWN_STACK_DEPTH_CHANGE ||
			purge == Function.INVALID_STACK_DEPTH_CHANGE) {
			String name = func != null ? func.getName() : ("at " + destAddr);
			if (DEBUG) {
				Msg.debug(this, "Stack purge unknown for function " + name + " called from " +
					calledFrom.getTarget() + " - stack pointer invalidated");
			}
			currentState.store(getStackPointerVarnode(),
				getInvalidatedVarnode(calledFrom, getStackPointerVarnode()));
			return;
		}

		purge += stackShift;
		if (purge == 0) {
			return;
		}
		Varnode stackVarnode = getStackPointerVarnode();
		Varnode purgeVal =
			new Varnode(program.getAddressFactory().getConstantAddress(purge),
				stackVarnode.getSize());
		Varnode stackVal = currentState.get(stackVarnode, monitor);
		if (stackVal == null) {
			stackVal = stackVarnode;
		}
		Varnode purgeResult = null;
		if (stackVal instanceof VarnodeOperation) {
			//purgeResult = combineIntAddOffset(purgePcodeOp, (VarnodeOperation)stackVal, purge, monitor);
			purgeResult =
				pushDownIntAddOffset((VarnodeOperation) stackVal, purge, addrFactory, monitor);
		}
		if (purgeResult == null) {
			PcodeOp purgePcodeOp =
				new PcodeOp(calledFrom, PcodeOp.INT_ADD, new Varnode[] { stackVarnode, purgeVal },
					stackVarnode);
			purgeResult = new VarnodeOperation(purgePcodeOp, new Varnode[] { stackVal, purgeVal });
		}
		currentState.store(stackVarnode, purgeResult);
	}
Generate an INDIRECT pcodeop operation representing an unknown state
for an affectedVarnode resulting from a function call at the specified seq.
@param seq CALL or CALLIND pcodeop sequence
@param affectVarnode affected varnode (e.g., return register)
@return indirect varnode operation
Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java