private Varnode simplifyLoad(PcodeOp pcodeOp, Varnode[] values, ContextState currentState,
			TaskMonitor monitor) throws CancelledException {

		Varnode output = pcodeOp.getOutput();
		Varnode result;
		if (!values[0].isConstant()) {
			throw new AssertException("Expected constatnt address space ID");
		}
		int spaceId = (int) values[0].getOffset();
		AddressSpace addressSpace = addrFactory.getAddressSpace(spaceId);
		if (addressSpace == null) {
			throw new IllegalArgumentException("Unknown spaceID: " + spaceId);
		}
		int size = output.getSize();
		Varnode storageOffset = values[1];
		Varnode stackOffset = getStackOffset(pcodeOp, storageOffset, monitor);
		if (stackOffset != null) {
			// stackOffset is either constant or VarnodeOperation
			if (stackOffset.isConstant()) {
				long offset = getSignedOffset(stackOffset);
				AddressSpace stackSpace = addrFactory.getStackSpace();
				Varnode stackVarnode = new Varnode(stackSpace.getAddress(offset, true), size);
				result = currentState.get(stackVarnode, monitor);
				if (result == null) {
					result = stackVarnode;
				}
				if (analyzer != null) {
					int opIndex = findOpIndex(pcodeOp, pcodeOp.getInput(1));
					analyzer.stackReference(pcodeOp, opIndex, (int) offset, size, spaceId,
						RefType.READ, monitor);
				}
			}
			else if (stackOffset instanceof VarnodeOperation) {
				result = currentState.get(spaceId, storageOffset, size, monitor);
				if (analyzer != null) {
					int opIndex = findOpIndex(pcodeOp, pcodeOp.getInput(1));
					analyzer.stackReference(pcodeOp, opIndex, (VarnodeOperation) stackOffset, size,
						spaceId, RefType.READ, monitor);
				}
			}
			else {
				// stack pointer is likely invalid
				result = null;
			}
		}
		else if (storageOffset.isConstant()) {
			Varnode v =
 new Varnode(addressSpace.getAddress(storageOffset.getOffset(), true), size);
			result = currentState.get(v, monitor);
			if (result != null && result.isConstant()) {
				if (listing.getFunctionAt(v.getAddress()) != null) {
					externalThunkMap.put(result.getOffset(), v.getAddress());
				}
			}
			if (analyzer != null) {
				int opIndex = findOpIndex(pcodeOp, pcodeOp.getInput(1));
				analyzer.dataReference(pcodeOp, opIndex, v, RefType.READ, monitor);
			}
		}
		else {
			result = currentState.get(spaceId, storageOffset, size, monitor);
			if (analyzer != null) {
				int opIndex = findOpIndex(pcodeOp, pcodeOp.getInput(1));
				analyzer.indirectDataReference(pcodeOp, opIndex, storageOffset, size, spaceId,
					RefType.READ, monitor);
			}
		}
		if (result == null) {
			result = new VarnodeOperation(pcodeOp, values);
		}
		return result;
	}
Process an instruction pcode operation after performing simplification on the inputs and operation
@param pcodeOp
@param currentState
@param monitor task monitor
@return true if state can continue to be propagated, otherwise a new state is
required due to the processing of a branch operation.
@throws CancelledException
@throws InlineCallException
Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java