'Convert a ValueSet object into a list of addresses.
:param addr: A ValueSet object (which describes an address)
:param is_write: Is this address used in a write or not
:param convert_to_valueset: True if you want to have a list of ValueSet instances instead of AddressWrappers,
False otherwise
:param target_region: Which region to normalize the address to. To leave the decision to SimuVEX, set it to None
:return: A list of AddressWrapper or ValueSet objects'

def normalize_address(self, addr, is_write=False, convert_to_valueset=False, target_region=None):

    if (type(addr) in (int, long)):
        addr = self.state.se.BVV(addr, self.state.arch.bits)
    addr_with_regions = self._normalize_address_type(addr)
    address_wrappers = []
    for (region, addr_si) in addr_with_regions:
        if is_write:
            concrete_addrs = addr_si.eval(WRITE_TARGETS_LIMIT)
            if (len(concrete_addrs) == WRITE_TARGETS_LIMIT):
                self.state.history.add_event('mem', message=('too    many    targets    to    write    to.    address    =    %s' % addr_si))
        else:
            concrete_addrs = addr_si.eval(READ_TARGETS_LIMIT)
            if (len(concrete_addrs) == READ_TARGETS_LIMIT):
                self.state.history.add_event('mem', message=('too    many    targets    to    read    from.    address    =    %s' % addr_si))
        for c in concrete_addrs:
            aw = self._normalize_address(region, c, target_region=target_region)
            address_wrappers.append(aw)
    if convert_to_valueset:
        return [i.to_valueset(self.state) for i in address_wrappers]
    else:
        return address_wrappers
