def add(self, addr: int, size: int, tags: int) -> None:
        """
        Add interval starting at `addr` of `size` bytes.

        When binning, intervals endpoints are aligned to 2^nbits. Gaps between added intervals are populated with
        implicit intervals having tag value of 0. Overlapping intervals will have tag bits OR'd together.

        Adjacent intervals in the interval map have unique tags. When intervals are added to the map, any adjacent stops
        with identical tags will be eliminated so the map retains this property.

        For example: if an interval(addr=0, size=100, tags=1) is added, followed by (100, 100, 1), the resulting
        interval in the map will be (0, 200, 1).
        """
        assert addr >= 0
        assert size >= 0
        assert tags != 0

        if size == 0:
            return

        max_bin_offset = (1 << self._nbits) - 1
        mask = ~max_bin_offset

        start_addr = addr & mask  # Round down to bin alignment
        end_addr = (addr + size + max_bin_offset) & mask  # Round up to bin alignment

        if self._is_already_covered(start_addr, end_addr, tags):
            return

        self._insert_stop(start_addr)
        self._insert_stop(end_addr)
        for affected_addr in self._map.irange(start_addr, end_addr, inclusive=(True, False)):
            self._map[affected_addr] |= tags
        self._eliminate_extraneous_stops(start_addr, end_addr)

        Add interval starting at `addr` of `size` bytes.

        When binning, intervals endpoints are aligned to 2^nbits. Gaps between added intervals are populated with
        implicit intervals having tag value of 0. Overlapping intervals will have tag bits OR'd together.

        Adjacent intervals in the interval map have unique tags. When intervals are added to the map, any adjacent stops
        with identical tags will be eliminated so the map retains this property.

        For example: if an interval(addr=0, size=100, tags=1) is added, followed by (100, 100, 1), the resulting
        interval in the map will be (0, 200, 1).
        
angrmanagement/data/tagged_interval_map.py