public static VariableStorage decodeStorageFromAttributes(int size, Decoder decoder,
			PcodeFactory pcodeFactory) throws DecoderException {
		VariableStorage storage;
		try {
			Address varAddr = decodeFromAttributes(decoder);
			AddressSpace spc = varAddr.getAddressSpace();
			if (spc == null || varAddr == Address.NO_ADDRESS) {
				storage = VariableStorage.VOID_STORAGE;
			}
			else if (spc.getType() != AddressSpace.TYPE_VARIABLE) {
				if (size <= 0) {
					size = (int) decoder.readSignedInteger(ATTRIB_SIZE);
				}
				Program program = pcodeFactory.getDataTypeManager().getProgram();
				storage = new VariableStorage(program, varAddr, size);
			}
			else {
				decoder.rewindAttributes();
				Varnode.Join join = Varnode.decodePieces(decoder);
				storage = pcodeFactory.getJoinStorage(join.pieces);
			}
		}
		catch (InvalidInputException e) {
			throw new DecoderException("Invalid storage: " + e.getMessage());
		}
		return storage;
	}
Decode a VariableStorage object from the attributes in the current address element.
The start of storage corresponds to the decoded address. The size is either passed
in or is decoded from a size attribute.
@param size is the desired size of storage or -1 to use the size attribute
@param decoder is the stream decoder
@param pcodeFactory is used to resolve address spaces, etc.
@return the decoded VariableStorage
@throws DecoderException for any errors in the encoding or problems creating the storage
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/AddressXML.java