public static void clOutputForwardDeclarations(PrintableStringWriter stream) {
    { List definedvariables = List.newList();
      List forwardreferencedvariables = List.newList();

      { TranslationUnit unit = null;
        Cons iter000 = ((List)(Stella.$TRANSLATIONUNITS$.get())).theConsList;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          unit = ((TranslationUnit)(iter000.value));
          if (TranslationUnit.auxiliaryVariableUnitP(unit)) {
            definedvariables.push(unit.theObject);
          }
        }
      }
      { TranslationUnit unit = null;
        Cons iter001 = ((List)(Stella.$TRANSLATIONUNITS$.get())).theConsList;

        for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
          unit = ((TranslationUnit)(iter001.value));
          if (!TranslationUnit.auxiliaryVariableUnitP(unit)) {
            if (unit.category == Stella.SYM_STELLA_GLOBAL_VARIABLE) {
              definedvariables.push(unit.theObject);
            }
            { GlobalVariable variable = null;
              Cons iter002 = unit.referencedGlobals.theConsList;

              for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
                variable = ((GlobalVariable)(iter002.value));
                if ((!definedvariables.memberP(variable)) &&
                    (!forwardreferencedvariables.memberP(variable))) {
                  forwardreferencedvariables.push(variable);
                }
              }
            }
          }
        }
      }
      { ListIterator it = ((ListIterator)(forwardreferencedvariables.allocateIterator()));

        while (it.nextP()) {
          it.valueSetter(((GlobalVariable)(it.value)).variableName);
        }
      }
      if (forwardreferencedvariables.nonEmptyP()) {
        {
          stream.println();
          stream.println(";;; Forward declarations:");
          stream.println();
        }
;
        Stella_Object.printStellaDefinition(Cons.list$(Cons.cons(Stella.internCommonLispSymbol("DECLAIM"), Cons.cons(Cons.cons(Stella.internCommonLispSymbol("SPECIAL"), Cons.clTranslateListOfTrees(forwardreferencedvariables.theConsList).concatenate(Stella.NIL, Stella.NIL)), Cons.cons(Stella.NIL, Stella.NIL)))), stream);
      }
      definedvariables.free();
      forwardreferencedvariables.free();
    }
  }