private int findNextUnreservedRopReg(int startReg, int width, Alignment alignment) {
    int reg = alignment.nextClearBit(reservedRopRegs, startReg);

    while (true) {
      int i = 1;

      while (i < width && !reservedRopRegs.get(reg + i)) {
        i++;
      }

      if (i == width) {
        return reg;
      }

      reg = alignment.nextClearBit(reservedRopRegs, reg + i);
    }
  }
Finds a range of unreserved rop registers.

@param startReg {@code >= 0;} a rop register to start the search at
@param width {@code > 0;} the width, in registers, required.
@param alignment the alignment constraint.
@return {@code >= 0;} start of available register range.
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java