public int indexOfRegister(int reg) {
    int sz = size();
    for (int i = 0; i < sz; i++) {
      RegisterSpec rs;

      rs = get(i);

      if (rs.getReg() == reg) {
        return i;
      }
    }

    return -1;
  }
Returns the index of a RegisterSpec in this list that uses the specified register, or -1 if
none in this list uses the register.

@param reg Register to find
@return index of RegisterSpec or -1
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/RegisterSpecList.java