private static Varnode combineDoubleShiftOperation(PcodeOp outerPcodeOp,
			Varnode[] outerInputValues, AddressFactory addrFactory) {
		if (!outerInputValues[1].isConstant() || !(outerInputValues[0] instanceof VarnodeOperation)) {
			return null;
		}
		VarnodeOperation innerOp = (VarnodeOperation) outerInputValues[0];
		PcodeOp innerPcodeOp = innerOp.getPCodeOp();
		Varnode[] innerInputValues = innerOp.getInputValues();
		if (innerInputValues.length != 2 || !innerInputValues[1].isConstant()) {
			return null;
		}

		int outerOpcode = outerPcodeOp.getOpcode();
		long shift = getUnsignedOffset(outerInputValues[1], outerInputValues[1].getSize());
		long combinedShift = 0;
		if (outerOpcode == PcodeOp.INT_RIGHT) {
			combinedShift = -shift;
		}
		else if (outerOpcode == PcodeOp.INT_LEFT) {
			combinedShift = shift;
		}
		else {
			return null;
		}

		int innerOpcode = innerPcodeOp.getOpcode();
		shift = getUnsignedOffset(outerInputValues[1], outerInputValues[1].getSize());
		if (innerOpcode == PcodeOp.INT_RIGHT) {
			combinedShift -= shift;
		}
		else if (innerOpcode == PcodeOp.INT_LEFT) {
			combinedShift += shift;
		}
		else {
			return null;
		}

		if (combinedShift == 0) {
			return innerInputValues[0];
		}

		int newOpcode = PcodeOp.INT_LEFT;
		if (combinedShift < 0) {
			newOpcode = PcodeOp.INT_RIGHT;
			combinedShift = -combinedShift;
		}
		Varnode newShift =
			new Varnode(addrFactory.getConstantAddress(combinedShift),
				outerInputValues[1].getSize());
		PcodeOp pcodeOp =
			new PcodeOp(outerPcodeOp.getSeqnum(), newOpcode, outerInputValues,
				outerPcodeOp.getOutput());
		return new VarnodeOperation(pcodeOp, new Varnode[] { innerInputValues[0], newShift });
	}
Generate simplified operation
@param pcodeOp pcode operation
@param values values associated with pcodeOp inputs
@return operation output result or simplification of an operation.
Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java