def expand_address_range(address_range):
    """
    Expand an address if bits are marked as optional

    Args:
        address_range (str): The address to expand

    Returns:
        list(str): A list of addresses this address has been expanded to
    """

    if "X" in address_range:
        res = expand_address_range(address_range.replace("X", "0", 1))
        res.extend(expand_address_range(address_range.replace("X", "1", 1)))
    else:
        res = [address_range]

    return res