docs: function gallopLeft(value, array, start, length, hint, compare) {
    let lastOffset = 0;
    let maxOffset = 0;
    let offset = 1;
  
    if (compare(value, array[start + hint]) > 0) {
      maxOffset = length - hint;
  
      while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
        lastOffset = offset;
        offset = (offset << 1) + 1;
  
        if (offset <= 0) {
          offset = maxOffset;
        }
      }
  
      if (offset > maxOffset) {
        offset = maxOffset;
      }
  
      // Make offsets relative to start
      lastOffset += hint;
      offset += hint;
  
      // value <= array[start + hint]
    } else {
      maxOffset = hint + 1;
      while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
        lastOffset = offset;
        offset = (offset << 1) + 1;
  
        if (offset <= 0) {
          offset = maxOffset;
        }
      }
      if (offset > maxOffset) {
        offset = maxOffset;
      }
  
      // Make offsets relative to start
      let tmp = lastOffset;
      lastOffset = hint - offset;
      offset = hint - tmp;
    }
  
    /*
     * Now array[start+lastOffset] < value <= array[start+offset], so value
     * belongs somewhere in the range (start + lastOffset, start + offset]. Do a
     * binary search, with invariant array[start + lastOffset - 1] < value <=
     * array[start + offset].
     */
    lastOffset++;
    while (lastOffset < offset) {
      let m = lastOffset + ((offset - lastOffset) >>> 1);
  
      if (compare(value, array[start + m]) > 0) {
        lastOffset = m + 1;
  
      } else {
        offset = m;
      }
    }
    return offset;
  }