public boolean areAnyPinned(RegisterSpecList oldSpecs, int newReg, int targetCategory) {
    int sz = oldSpecs.size();

    for (int i = 0; i < sz; i++) {
      RegisterSpec oldSpec = oldSpecs.get(i);
      int r = oldToNew(oldSpec.getReg());

      /*
       * If oldSpec is a category-2 register, then check both newReg
       * and newReg - 1.
       */
      if (r == newReg
          || (oldSpec.getCategory() == 2 && (r + 1) == newReg)
          || (targetCategory == 2 && (r == newReg + 1))) {
        return true;
      }
    }

    return false;
  }
Checks to see if any of a set of old-namespace registers are pinned to the specified
new-namespace reg + category. Takes into account the category of the old-namespace registers.

@param oldSpecs {@code non-null;} set of old-namespace regs
@param newReg {@code >= 0;} new-namespace register
@param targetCategory {@code 1..2;} the number of adjacent new-namespace registers (starting at
    ropReg) to consider
@return true if any of the old-namespace register have been mapped to the new-namespace
    register + category
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/InterferenceRegisterMapper.java