private AddressRange getMappedRange(MemoryBlock mappedBlock, AddressRange mappedSourceRange) {
		Address start, end;

		long sourceRangeLength = mappedSourceRange.getLength();
		if (sourceRangeLength <= 0) {
			throw new AssertException("invalid mapped source range length");
		}
		MemoryBlockSourceInfo info = mappedBlock.getSourceInfos().get(0);

		long startOffset =
			mappedSourceRange.getMinAddress().subtract(info.getMappedRange().get().getMinAddress());
		boolean isBitMapped = mappedBlock.getType() == MemoryBlockType.BIT_MAPPED;
		try {
			if (isBitMapped) {
				startOffset *= 8;
				start = mappedBlock.getStart().addNoWrap(startOffset);
				long endOffset = startOffset + (sourceRangeLength * 8) - 1;
				// since end may only partially consume a byte we must limit end address
				end = (endOffset < mappedBlock.getSize())
						? mappedBlock.getStart().addNoWrap(endOffset)
						: mappedBlock.getEnd();
			}
			else { // Byte mapped
				ByteMappingScheme byteMappingScheme = info.getByteMappingScheme().get();
				start = byteMappingScheme.getMappedAddress(mappedBlock, startOffset, false);
				long endOffset = startOffset + sourceRangeLength - 1;
				end = byteMappingScheme.getMappedAddress(mappedBlock, endOffset, true);
				if (start == null || start.compareTo(end) > 0) {
					return null; // mappedSourceRange corresponds to non-mapped/skipped bytes
				}
			}
		}
		catch (AddressOverflowException e) {
			throw new AddressOutOfBoundsException(e.getMessage());
		}
		return new AddressRangeImpl(start, end);
	}
Converts the given address range back from the source range back to the mapped range. NOTE:
It is important that the specified mappedSourceRange is restricted to the mapped source area
of the specified mappedBlock.

@param mappedBlock mapped memory block
@param mappedSourceRange source range which maps into mappedBlock.
@return mapped range or null if source range not mapped to block
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/mem/MemoryMapDB.java