Program: 85339
Project: 85339
Buggy source:
private void fixLongJumps(List<BuilderInstruction> instructions,LabelAssigner labelAssigner,StmtVisitor stmtV){
  boolean hasChanged=true;
  l0:   while (hasChanged) {
    hasChanged=false;
    Map<Label,Integer> labelToInsOffset=new HashMap<Label,Integer>();
    for (int i=0; i < instructions.size(); i++) {
      BuilderInstruction bi=instructions.get(i);
      Stmt origStmt=stmtV.getStmtForInstruction(bi);
      if (origStmt != null) {
        Label lbl=labelAssigner.getLabelUnsafe(origStmt);
        if (lbl != null) {
          labelToInsOffset.put(lbl,i);
        }
      }
    }
    for (int j=0; j < instructions.size(); j++) {
      BuilderInstruction bj=instructions.get(j);
      if (bj instanceof BuilderOffsetInstruction) {
        BuilderOffsetInstruction boj=(BuilderOffsetInstruction)bj;
        Label targetLbl=boj.getTarget();
        Integer offset=labelToInsOffset.get(targetLbl);
        if (offset == null)         continue;
        Insn jumpInsn=stmtV.getInsnForInstruction(boj);
        if (jumpInsn instanceof InsnWithOffset) {
          InsnWithOffset offsetInsn=(InsnWithOffset)jumpInsn;
          int distance=getDistanceBetween(instructions,j,offset);
          if (Math.abs(distance) > offsetInsn.getMaxJumpOffset()) {
            insertIntermediateJump(offset,j,stmtV,instructions,labelAssigner);
            hasChanged=true;
            continue l0;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Fixes long jumps that exceed the maximum distance for the respective jump type
 * @param instructions The list of generated dalvik instructions
 * @param labelAssigner The label assigner that maps statements to labels
 * @param stmtV The statement visitor used to produce the dalvik instructions
 */
private void fixLongJumps(List<BuilderInstruction> instructions,LabelAssigner labelAssigner,StmtVisitor stmtV){
  boolean hasChanged;
  l0:   do {
    hasChanged=false;
    Map<Label,Integer> labelToInsOffset=new HashMap<Label,Integer>();
    for (int i=0; i < instructions.size(); i++) {
      BuilderInstruction bi=instructions.get(i);
      Stmt origStmt=stmtV.getStmtForInstruction(bi);
      if (origStmt != null) {
        Label lbl=labelAssigner.getLabelUnsafe(origStmt);
        if (lbl != null) {
          labelToInsOffset.put(lbl,i);
        }
      }
    }
    for (int j=0; j < instructions.size(); j++) {
      BuilderInstruction bj=instructions.get(j);
      if (bj instanceof BuilderOffsetInstruction) {
        BuilderOffsetInstruction boj=(BuilderOffsetInstruction)bj;
        Label targetLbl=boj.getTarget();
        Integer offset=labelToInsOffset.get(targetLbl);
        if (offset == null)         continue;
        Insn jumpInsn=stmtV.getInsnForInstruction(boj);
        if (jumpInsn instanceof InsnWithOffset) {
          InsnWithOffset offsetInsn=(InsnWithOffset)jumpInsn;
          int distance=getDistanceBetween(instructions,j,offset);
          if (Math.abs(distance) > offsetInsn.getMaxJumpOffset()) {
            insertIntermediateJump(offset,j,stmtV,instructions,labelAssigner);
            hasChanged=true;
            continue l0;
          }
        }
      }
    }
  }
 while (hasChanged);
}