code: private static final int binarySearch(long[] list, int limit, long ce) {
          if (limit == 0) { return ~0; }
          int start = 0;
          for (;;) {
              int i = (int)(((long)start + (long)limit) / 2);
              int cmp = compareInt64AsUnsigned(ce, list[i]);
              if (cmp == 0) {
                  return i;
              } else if (cmp < 0) {
                  if (i == start) {
                      return ~start;  // insert ce before i
                  }
                  limit = i;
              } else {
                  if (i == start) {
                      return ~(start + 1);  // insert ce after i
                  }
                  start = i;
              }
          }
      }
docs: Like Java Collections.binarySearch(List, String, Comparator).
  
  @return the index>=0 where the item was found,
  or the index<0 for inserting the string at ~index in sorted order