TypeCheck.getClearType(s), IfCmp.getGuardResult(n));
TypeCheck.getClearType(s), IfCmp.getGuardResult(n).copyRO());
  private boolean pushTypeCheckBelowIf(OPT_Instruction s, OPT_IR ir) {    if (s.operator() == CHECKCAST) {      OPT_Register r = TypeCheck.getRef(s).asRegister().register;      OPT_Instruction n = s.nextInstructionInCodeOrder();      /* find moves of the checked value, so that we can also       optimize cases where the checked value is moved before       it is used       */      while (n.operator() == REF_MOVE && Move.getVal(n)           instanceof OPT_RegisterOperand          && Move.getVal(n).asRegister().register == r) {        r = Move.getResult(n).asRegister().register;        n = n.nextInstructionInCodeOrder();      }      if (n.operator() == REF_IFCMP &&           IfCmp.getVal2(n) instanceof OPT_NullConstantOperand &&          IfCmp.getVal1(n) instanceof OPT_RegisterOperand &&          r == IfCmp.getVal1(n).asRegister().register) {        OPT_BasicBlock newBlock, patchBlock;        OPT_BasicBlock myBlock = n.getBasicBlock();        OPT_Instruction after = n.nextInstructionInCodeOrder();        if (IfCmp.getCond(n).isEQUAL())          /*  We fall through on non-NULL values, so the           checkcast must be on the not-taken path           from the branch.  There are 3 cases:           1. n is the last instruction in its basic block,            in which case control falls through to the next           block in code order.  This case is if the           instruction after n is a BBEND           */          if (after.operator() == BBEND)            patchBlock = myBlock.nextBasicBlockInCodeOrder();                     /* 2. n is followed by an unconditional goto.  In           this case control jumps to the target of the           goto.                                                */          else if (after.operator() == GOTO)            patchBlock = after.getBranchTarget();                     /* 3. n is followed by another conditional branch. In           this case, we will split the basic block to make           n the last instruction in the block, and then           we have the fall through case again.           */          else if (after.operator() == REF_IFCMP) {            patchBlock = myBlock.splitNodeAt(n, ir);            myBlock.insertOut(patchBlock);            ir.cfg.linkInCodeOrder(myBlock, patchBlock);          }           /* this is a bad thing */          else             return  false;         else           /* We branch on not-NULL values, so the checkcast            must be spliced in before the branch target           */          patchBlock = n.getBranchTarget();        /* add block between branch and appropriate successor */        newBlock = OPT_IRTools.makeBlockOnEdge(myBlock, patchBlock, ir);        /* put check in new block */        s.remove();        TypeCheck.mutate(s, CHECKCAST_NOTNULL, TypeCheck.getClearRef(s),             TypeCheck.getClearType(s), IfCmp.getGuardResult(n));        newBlock.prependInstruction(s);        return  true;      }    }    return  false;  }