public static void demoFile(String file, boolean pauseP) {
    { String temp000 = Stella.findFileInLoadPath(file, Logic.$POWERLOOM_KB_FILE_EXTENSIONS$);

      file = ((temp000 != null) ? temp000 : file);
    }
    Stella.ensureFileExists(file, "demo-file");
    { int currentlevel = ((Integer)(Logic.$DEMO_LEVEL$.get())).intValue();
      Stella_Object command = null;
      Stella_Object result = null;
      boolean exitP = false;

      { InputFileStream inputstream = null;

        try {
          inputstream = Stella.openInputFile(file, Stella.NIL);
          { Object old$CarefulLogicCommandLoopExit$P000 = Logic.$CAREFUL_LOGIC_COMMAND_LOOP_EXIT$p.get();
            Object old$DemoLevel$000 = Logic.$DEMO_LEVEL$.get();

            try {
              Native.setBooleanSpecial(Logic.$CAREFUL_LOGIC_COMMAND_LOOP_EXIT$p, false);
              Native.setIntSpecial(Logic.$DEMO_LEVEL$, currentlevel + 1);
              inputstream.echoStream = Stella.STANDARD_OUTPUT;
              { Object old$Module$000 = Stella.$MODULE$.get();
                Object old$Context$000 = Stella.$CONTEXT$.get();

                try {
                  Native.setSpecial(Stella.$MODULE$, ((Module)(Stella.$MODULE$.get())));
                  Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
                  if (pauseP) {
                    {
                      System.out.println("Now reading from `" + file + "'.");
                      System.out.println("Type `?' at the pause prompt for a list of available commands.");
                    }
;
                  }
                  loop000 : for (;;) {
                    try {
                      System.out.println();
                      exitP = Logic.demoSkipToCommand(inputstream);
                      Logic.printDemoPrompt();
                      if (!(exitP)) {
                        { Object [] caller_MV_returnarray = new Object[1];

                          command = InputStream.readSExpression(inputstream, caller_MV_returnarray);
                          exitP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
                        }
                      }
                      if (exitP ||
                          Logic.logicCommandLoopExitP(command, new Object[1])) {
                        break loop000;
                      }
                      { Object [] caller_MV_returnarray = new Object[1];

                        pauseP = Logic.demoPauseP(pauseP, caller_MV_returnarray);
                        exitP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
                      }
                      if (exitP) {
                        break loop000;
                      }
                      result = Logic.evaluateLogicCommand(command, false);
                      Logic.printLogicCommandResult(result);
                    } catch (EvaluationException e) {
                      Stella.STANDARD_ERROR.nativeStream.print(">> Error: " + Stella.exceptionMessage(e));
                    }
                  }
                  {
                    System.out.println();
                    System.out.println();
                    System.out.println(Logic.$LOGIC_COMMAND_RESULT_INDENT$ + "Finished demo `" + file + "'.");
                  }
;

                } finally {
                  Stella.$CONTEXT$.set(old$Context$000);
                  Stella.$MODULE$.set(old$Module$000);
                }
              }

            } finally {
              Logic.$DEMO_LEVEL$.set(old$DemoLevel$000);
              Logic.$CAREFUL_LOGIC_COMMAND_LOOP_EXIT$p.set(old$CarefulLogicCommandLoopExit$P000);
            }
          }

        } finally {
          if (inputstream != null) {
            inputstream.free();
          }
        }
      }
    }
  }