public SsaInsn getDefinitionForRegister(int reg) {
    if (backMode) {
      throw new RuntimeException("No def list in back mode");
    }

    if (definitionList != null) {
      return definitionList[reg];
    }

    definitionList = new SsaInsn[getRegCount()];

    forEachInsn(
        new SsaInsn.Visitor() {
          @Override
          public void visitMoveInsn(NormalSsaInsn insn) {
            definitionList[insn.getResult().getReg()] = insn;
          }

          @Override
          public void visitPhiInsn(PhiInsn phi) {
            definitionList[phi.getResult().getReg()] = phi;
          }

          @Override
          public void visitNonMoveInsn(NormalSsaInsn insn) {
            RegisterSpec result = insn.getResult();
            if (result != null) {
              definitionList[insn.getResult().getReg()] = insn;
            }
          }
        });

    return definitionList[reg];
  }
Returns the insn that defines the given register

@param reg register in question
@return insn (actual instance from code) that defined this reg or null if reg is not defined.
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/SsaMethod.java