private static Varnode pushDownIntAddOffset(VarnodeOperation op, long offset,
			AddressFactory addrFactory, TaskMonitor monitor) {
		PcodeOp pcodeOp = op.getPCodeOp();
		if (pcodeOp.getOpcode() == PcodeOp.INT_ADD || pcodeOp.getOpcode() == PcodeOp.INT_SUB) {
			Varnode[] opValues = op.getInputValues();
			if (opValues[1].isConstant()) {
				// push-down constant and combine with offset
				if (pcodeOp.getOpcode() == PcodeOp.INT_SUB) {
					offset = -offset;
				}
				long newOffset = getSignedOffset(opValues[1]) + offset;
				if (newOffset == 0) {
					return opValues[0];
				}
				Varnode[] simplifiedInputValues =
					new Varnode[] {
						opValues[0],
						new Varnode(addrFactory.getConstantAddress(newOffset &
							VALUE_MASK[op.getSize()]), op.getSize())	// new constant
					};
				return new VarnodeOperation(pcodeOp, simplifiedInputValues);
			}
			else if (opValues[0] instanceof VarnodeOperation) {
				Varnode newOpValue0 =
					pushDownIntAddOffset((VarnodeOperation) opValues[0], offset, addrFactory,
						monitor);
				if (newOpValue0 != null) {
					Varnode[] simplifiedInputValues = new Varnode[] { newOpValue0, opValues[1] };
					return new VarnodeOperation(pcodeOp, simplifiedInputValues);
				}
			}
		}
		return null;
	}
@return Varnode that represents the stack pointer register
Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java