private int getStackOpIndex(VarnodeContext context, Instruction cu, int offset) {
		int opIndex = 0;
//		int opLocation = -1;
		for (; opIndex < cu.getNumOperands(); opIndex++) {
			Object obj[] = cu.getOpObjects(opIndex);
//	        if (obj.length <= 1) {
//	        	continue;
//	        }
			int local_offset = 0;
			for (int i = 0; obj != null && i < obj.length; i++) {
				// check if any register is the stack pointer
				// if it is, need to compute stack depth offset for function
				//
				if (obj[i] instanceof Register) {
					Register reg = (Register) obj[i];
					Varnode vnode = context.getRegisterVarnodeValue(reg);
					if (vnode == null) {
						continue;
					}
					String spaceName = vnode.getAddress().getAddressSpace().getName();
					if (spaceName.startsWith("track_") || context.isStackSpaceName(spaceName)) {
//						opLocation = opIndex;
						local_offset += (int) vnode.getOffset();
					}
					else {
						continue;
					}
				}
				else if (obj[i] instanceof Scalar) {
					Scalar sc = (Scalar) obj[i];
					local_offset += sc.getSignedValue();
				}
				else {
					continue;
				}
				if (local_offset == offset) {
					return opIndex;
				}
			}
		}
		return -1;
	}
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/NewFunctionStackAnalysisCmd.java