public RegisterSpecList withExpandedRegisters(
      int base, boolean duplicateFirst, BitSet compatRegs) {
    int sz = size();

    if (sz == 0) {
      // Don't bother making a new zero-element instance.
      return this;
    }

    Expander expander = new Expander(this, compatRegs, base, duplicateFirst);

    for (int regIdx = 0; regIdx < sz; regIdx++) {
      expander.expandRegister(regIdx);
    }

    return expander.getResult();
  }
Returns an instance that is identical to this one, except that all incompatible register
numbers are renumbered sequentially from the given base, with the first number duplicated if
indicated. If a null BitSet is given, it indicates all registers are incompatible.

@param base the base register number
@param duplicateFirst whether to duplicate the first number
@param compatRegs {@code null-ok;} either a {@code non-null} set of compatible registers, or
    {@code null} to indicate all registers are incompatible
@return {@code non-null;} an appropriately-constructed instance
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/RegisterSpecList.java