class Cluster {

    protected final List<Unit> constantInitializers;
    protected final Unit use;

    public Cluster(Unit use, List<Unit> constantInitializers) {
      this.use = use;
      this.constantInitializers = constantInitializers;
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("Constant intializers:\n");
      for (Unit r : constantInitializers) {
        sb.append("\n - ").append(toStringUnit(r));
      }
      return sb.toString();
    }

    private String toStringUnit(Unit u) {
      return u + " (" + System.identityHashCode(u) + ")";
    }
  }

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

    if (Options.v().verbose()) {
      logger.debug("[" + body.getMethod().getName() + "] Splitting for shared initialization of locals...");
    }

    if (throwAnalysis == null) {
      throwAnalysis = Scene.v().getDefaultThrowAnalysis();
    }

    if (!omitExceptingUnitEdges) {
      omitExceptingUnitEdges = Options.v().omit_excepting_unit_edges();
    }

    CopyPropagator.v().transform(body);
    ConstantPropagatorAndFolder.v().transform(body);

    DexNullThrowTransformer.v().transform(body);
    DexNullArrayRefTransformer.v().transform(body);
    FlowSensitiveConstantPropagator.v().transform(body);
    CopyPropagator.v().transform(body);

    DexNullThrowTransformer.v().transform(body);
    DexNullArrayRefTransformer.v().transform(body);

    DeadAssignmentEliminator.v().transform(body);
    CopyPropagator.v().transform(body);

    final ExceptionalUnitGraph graph
        = ExceptionalUnitGraphFactory.createExceptionalUnitGraph(body, throwAnalysis, omitExceptingUnitEdges);
    final LocalDefs defs = G.v().soot_toolkits_scalar_LocalDefsFactory().newLocalDefs(graph, true);
    final MultiMap<Local, Cluster> clustersPerLocal = new HashMultiMap<Local, Cluster>();

    final Chain<Unit> units = body.getUnits();
    for (Unit s : units) {
      for (ValueBox useBox : s.getUseBoxes()) {
        Value v = useBox.getValue();
        if (v instanceof Local) {
          Local luse = (Local) v;
          List<Unit> allAffectingDefs = defs.getDefsOfAt(luse, s);
          // Make sure we are only affected by Constant definitions via AssignStmt
          if (allAffectingDefs.isEmpty() || !allAffectingDefs.stream()
              .allMatch(u -> (u instanceof AssignStmt) && (((AssignStmt) u).getRightOp() instanceof Constant))) {
            continue;
          }
          clustersPerLocal.put(luse, new Cluster(s, allAffectingDefs));
        }
      }
    }

    final Chain<Local> locals = body.getLocals();
    int w = 0;
    for (Local lcl : clustersPerLocal.keySet()) {
      Set<Cluster> clusters = clustersPerLocal.get(lcl);
      if (clusters.size() <= 1) {
        // Not interesting
        continue;
      }
      for (Cluster cluster : clusters) {
        // we have an overlap, we need to split.
        Local newLocal = (Local) lcl.clone();
        newLocal.setName(newLocal.getName() + '_' + ++w);
        locals.add(newLocal);

        for (Unit u : cluster.constantInitializers) {
          AssignStmt assign = (AssignStmt) u;
          AssignStmt newAssign = Jimple.v().newAssignStmt(newLocal, assign.getRightOp());
          units.insertAfter(newAssign, assign);
          CopyPropagator.copyLineTags(newAssign.getUseBoxes().get(0), assign);
        }

        replaceLocalsInUnitUses(cluster.use, lcl, newLocal);
      }
    }
  
<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