@Override
			public void stackReference(PcodeOp op, int instrOpIndex, int stackOffset, int size,
					int storageSpaceID, RefType refType, TaskMonitor monitor1)
					throws CancelledException {

				if (instrOpIndex < 0) {
					return;
				}
				Address fromAddr = op.getSeqnum().getTarget();
				Instruction instr = listing.getInstructionAt(fromAddr);
				if (instr == null) {
					return;
				}
				Address stackAddr = addrFactory.getStackSpace().getAddress(stackOffset);
				RefType rt = refType;
				Reference ref = refMgr.getReference(fromAddr, stackAddr, instrOpIndex);
				if (ref != null) {
					RefType existingRefType = ref.getReferenceType();
					if (existingRefType == rt) {
						return;
					}
					if (existingRefType == RefType.READ || existingRefType == RefType.WRITE) {
						rt = RefType.READ_WRITE;
					}
				}
				else if (refMgr.getReferencesFrom(fromAddr, instrOpIndex).length != 0) {
					// don't overwrite existing reference
					return;
				}
				if (!dontCreateNewVariables) {
					StackFrame stackFrame = func.getStackFrame();
					Variable existingVar = stackFrame.getVariableContaining(stackOffset);
					DataType type =
						size > 0 ? Undefined.getUndefinedDataType(size) : DataType.DEFAULT;
					if (existingVar != null && existingVar.getDataType() == DataType.DEFAULT) {
						func.removeVariable(existingVar);
						existingVar = null;
					}
					if (existingVar == null) {
						try {
							stackFrame.createVariable(null, stackOffset, type, SourceType.ANALYSIS);
// TODO: How can I tell when these stack variables are used as a pointer ?
						}
						catch (DuplicateNameException e) {
							throw new AssertException(); // unexpected
						}
						catch (InvalidInputException e) {
							Msg.error(this,
								"Failed to create stack variable at " + func.getEntryPoint() +
									", ref-from=" + fromAddr + ", stack-offset=" + stackOffset +
									", size=" + size + ": " + e.getMessage());
						}
					}
				}
				refMgr.addStackReference(fromAddr, instrOpIndex, stackOffset, rt,
					SourceType.ANALYSIS);
			}
Create locals and parameters based on references involving purely the stack pointer.
Pushes, Pops, and arithmetic manipulation of the stack pointer must be tracked.

@param func - function to analyze stack pointer references
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/FunctionResultStateStackAnalysisCmd.java