class UnusedLocalEliminator extends BodyTransformer {
  private static final Logger logger = LoggerFactory.getLogger(UnusedLocalEliminator.class);

  public UnusedLocalEliminator(Singletons.Global g) {
  }

  public static UnusedLocalEliminator v() {
    return G.v().soot_toolkits_scalar_UnusedLocalEliminator();
  }

  @Override
  protected void internalTransform(Body body, String phaseName, Map<String, String> options) {<FILL_FUNCTION_BODY>}
}

    if (Options.v().verbose()) {
      logger.debug("[" + body.getMethod().getName() + "] Eliminating unused locals...");
    }

    final Chain<Local> locals = body.getLocals();
    final int numLocals = locals.size();
    final int[] oldNumbers = new int[numLocals];
    {
      int i = 0;
      for (Local local : locals) {
        oldNumbers[i] = local.getNumber();
        local.setNumber(i);
        i++;
      }
    }

    BitSet usedLocals = new BitSet(numLocals);

    // Traverse statements noting all the uses and defs
    for (Unit s : body.getUnits()) {
      for (ValueBox vb : s.getUseBoxes()) {
        Value v = vb.getValue();
        if (v instanceof Local) {
          Local l = (Local) v;
          // assert locals.contains(l);
          usedLocals.set(l.getNumber());
        }
      }
      for (ValueBox vb : s.getDefBoxes()) {
        Value v = vb.getValue();
        if (v instanceof Local) {
          Local l = (Local) v;
          // assert locals.contains(l);
          usedLocals.set(l.getNumber());
        }
      }
    }

    // Remove all locals that are unused.
    for (Iterator<Local> localIt = locals.iterator(); localIt.hasNext();) {
      final Local local = localIt.next();
      final int lno = local.getNumber();
      if (!usedLocals.get(lno)) {
        localIt.remove();
      } else {
        local.setNumber(oldNumbers[lno]);
      }
    }
  
<methods>public non-sealed void <init>() ,public final void transform(soot.Body, java.lang.String, Map<java.lang.String,java.lang.String>) ,public final void transform(soot.Body, java.lang.String) ,public final void transform(soot.Body) <variables>private static final Map<java.lang.String,java.lang.String> enabledOnlyMap