public Varnode getRegisterVarnodeValue(Register reg, Address fromAddr, Address toAddr,
			boolean signed) {

		if (reg == null) {
			return null;
		}
		Varnode rvnode = trans.getVarnode(reg);
		
		// use current regVals;
		int backupDepth = 0;
		Stack<HashMap<Address, Varnode>> state = regVals;
		
		// if has a stored stack state, setup to use that state
		TraceDepthState traceDepthState = addrStartState.get(toAddr);
		if (traceDepthState != null) {	
			state= traceDepthState.state();
			backupDepth = state.size() - traceDepthState.depth();
		}
		
		Varnode value = getMemoryValue(state, backupDepth, rvnode, signed);

		int sizeNeeded = reg.getBitLength() / 8;

		// lucky, got location and full size looking for
		if (value != null && (value.getSize() == sizeNeeded || value.getSize() == 0)) {
			return value;
		}

		return null;
	}
Get the value (value, space, size) of a register at the start of the last execution
flow taken for the instruction at toAddr.

@param reg register to retrieve the start value
@param fromAddr flow from address (not used currently, future use to retrieve multiple flows)
@param toAddr address of instruction to retrieve the register flow state
@param signed true if value is signed, will sext the top bit based on value size

@return instruction start state value for register, or null if no known state
Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java