public void clearValue(Address start, Address end, Register register) {

		AddressRange.checkValidRange(start, end);

		flushWriteCache();

		// if the mask is all on, then just clear any values that are stored in this range
		if (register == null || register.isBaseRegister()) {
			rangeMap.clearRange(start, end);
			return;
		}

		// Otherwise, mask off bits according to the mask passed in.
		List<AddressRange> list = new ArrayList<AddressRange>();
		AddressRangeIterator rangeIt = rangeMap.getAddressRangeIterator(start, end);
		while (rangeIt.hasNext()) {
			list.add(rangeIt.next());
		}
		for (AddressRange indexRange : list) {
			Address rangeStart = indexRange.getMinAddress();
			Address rangeEnd = indexRange.getMaxAddress();

			byte[] mask = register.getBaseMask();

			RegisterValue currentBaseValue =
				new RegisterValue(register.getBaseRegister(), rangeMap.getValue(rangeStart));
			RegisterValue newBaseValue = currentBaseValue.clearBitValues(mask);

			if (!newBaseValue.hasAnyValue()) {
				rangeMap.clearRange(rangeStart, rangeEnd);
			}
			else {
				rangeMap.set(rangeStart, rangeEnd, newBaseValue.toBytes());
			}
			start = rangeEnd.next();
		}
	}
Clears the address range of any set bits using the mask from the given register value.
existing values in the range that have values that are not part of the input mask are 
not changed. If register is null, just clear all the values in range
@param start the start of the range to clear the register value bits. 
@param end the end of the range(inclusive) to clear the register value bits.
@param register the register whos mask to use.  If null, clear all values in the given range.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/RegisterValueStore.java