* @param output
   */
  public static void translateLoomFile(String input, String output) {
    { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();
      Object old$PrintprettyP$000 = Stella.$PRINTPRETTYp$.get();

      try {
        Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
        Native.setBooleanSpecial(Stella.$PRINTPRETTYp$, true);
        { InputFileStream in = null;

          try {
            in = Stella.openInputFile(input, Stella.NIL);
            { OutputFileStream out = null;

              try {
                out = Stella.openOutputFile(output, Stella.NIL);
                { Cons translation = Stella.NIL;
                  SExpressionIterator iter = InputStream.sExpressions(in);
                  Stella_Object form = Logic.safeGetNextSExpression(iter);
                  boolean dialectEmittedP = false;

                  {
                    out.nativeStream.println(";; Automatic Translation for file " + input);
                    out.nativeStream.println();
                  }
;
                  while (form != null) {
                    translation = Logic.translateOneLoomForm(form);
                    if (translation == null) {
                    }
                    else if (translation == Stella.NIL) {
                    }
                    else if (Stella_Object.isaP(translation.value, Logic.SGT_STELLA_CONS)) {
                      dialectEmittedP = true;
                      {
                        out.nativeStream.println(Cons.list$(Cons.cons(Logic.SYM_LOGIC_IN_DIALECT, Cons.cons(Logic.KWD_KIF, Cons.cons(Stella.NIL, Stella.NIL)))));
                        out.nativeStream.println();
                      }
;
                      { Stella_Object subform = null;
                        Cons iter000 = translation;

                        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
                          subform = iter000.value;
                          {
                            out.nativeStream.println(subform);
                            out.nativeStream.println();
                          }
;
                        }
                      }
                    }
                    else {
                      if ((!dialectEmittedP) &&
                          (!(translation.value == Logic.SYM_STELLA_IN_MODULE))) {
                        dialectEmittedP = true;
                        {
                          out.nativeStream.println(Cons.list$(Cons.cons(Logic.SYM_LOGIC_IN_DIALECT, Cons.cons(Logic.KWD_KIF, Cons.cons(Stella.NIL, Stella.NIL)))));
                          out.nativeStream.println();
                        }
;
                      }
                      {
                        out.nativeStream.println(translation);
                        out.nativeStream.println();
                      }
;
                    }
                    form = Logic.safeGetNextSExpression(iter);
                  }
                }

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

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

      } finally {
        Stella.$PRINTPRETTYp$.set(old$PrintprettyP$000);
        Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
      }
    }
  }