class ProfilingGenerator extends BodyTransformer {
  public ProfilingGenerator(Singletons.Global g) {
  }

  public static ProfilingGenerator v() {
    return G.v().soot_jimple_toolkits_annotation_profiling_ProfilingGenerator();
  }

  public String mainSignature = Options.v().src_prec() != Options.src_prec_dotnet ? "void main(java.lang.String[])"
      : DotnetMethod.MAIN_METHOD_SIGNATURE;

  // private String mainSignature = "long runBenchmark(java.lang.String[])";

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

    ProfilingOptions options = new ProfilingOptions(opts);
    if (options.notmainentry()) {
      mainSignature = "long runBenchmark(java.lang.String[])";
    }

    {
      SootMethod m = body.getMethod();

      SootClass counterClass = Scene.v().loadClassAndSupport("MultiCounter");
      SootMethod reset = counterClass.getMethod("void reset()");
      SootMethod report = counterClass.getMethod("void report()");

      boolean isMainMethod = m.getSubSignature().equals(mainSignature);

      Chain units = body.getUnits();

      if (isMainMethod) {
        units.addFirst(Jimple.v().newInvokeStmt(Jimple.v().newStaticInvokeExpr(reset.makeRef())));
      }

      Iterator stmtIt = body.getUnits().snapshotIterator();
      while (stmtIt.hasNext()) {
        Stmt stmt = (Stmt) stmtIt.next();

        if (stmt instanceof InvokeStmt) {
          InvokeExpr iexpr = ((InvokeStmt) stmt).getInvokeExpr();

          if (iexpr instanceof StaticInvokeExpr) {
            SootMethod tempm = ((StaticInvokeExpr) iexpr).getMethod();

            if (tempm.getSignature().equals("<java.lang.System: void exit(int)>")) {
              units.insertBefore(Jimple.v().newInvokeStmt(Jimple.v().newStaticInvokeExpr(report.makeRef())), stmt);

            }
          }
        } else if (isMainMethod && (stmt instanceof ReturnStmt || stmt instanceof ReturnVoidStmt)) {
          units.insertBefore(Jimple.v().newInvokeStmt(Jimple.v().newStaticInvokeExpr(report.makeRef())), stmt);
        }
      }
    }
  
<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