findLastKey = function(l, r) {
    if (l >= r) {
      return l;
    }
    var favorR = compare(c.compareRange(keys[r], keyRange));
    if (favorR == lf.index.Favor.TIE) {
      return r;
    } else if (favorR == lf.index.Favor.RHS) {
      return l;
    }

    var mid = getMidPoint(l, r);
    if (mid == r) {
      return l;
    }
    var favorM = compare(c.compareRange(keys[mid], keyRange));
    if (favorM == lf.index.Favor.TIE) {
      return findLastKey(mid, r);
    } else if (favorM == lf.index.Favor.LHS) {
      return findLastKey(l, mid - 1);
    } else {
      return -1;  // Shall not be here.
    }
  }
Find the last key that is in range.
@param {number} l Left index, must be already covered by range.
@param {number} r Right index
@return {number} Index of the key, -1 if not found.