code: def optimized_binary_search_lower(tab, logsize):
      
      lo = 0
      intervalsize = (1 << logsize) >> 1
      while intervalsize > 0:
          if not tab[lo | intervalsize]:
              lo |= intervalsize
          intervalsize >>= 1
      return lo
docs: Binary search in a table using bit operations
  
      :param tab: boolean monotone table
         of size :math:`2^\\textrm{logsize}`
         with tab[0] = False
      :param int logsize:
      :returns: last i such that not tab[i]
      :complexity: O(logsize)