public boolean isRegALocal(RegisterSpec spec) {
    SsaInsn defn = getDefinitionForRegister(spec.getReg());

    if (defn == null) {
      // version 0 registers are never used as locals
      return false;
    }

    // Does the definition have a local associated with it?
    if (defn.getLocalAssignment() != null) return true;

    // If not, is there a mark-local insn?
    for (SsaInsn use : getUseListForRegister(spec.getReg())) {
      Insn insn = use.getOriginalRopInsn();

      if (insn != null && insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
        return true;
      }
    }

    return false;
  }
Checks to see if the given SSA reg is ever associated with a local local variable. Each SSA reg
may be associated with at most one local var.

@param spec {@code non-null;} ssa reg
@return true if reg is ever associated with a local
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/SsaMethod.java