public static void cppOutputForeach(Cons loop) {
    { Cons variables = ((Cons)(loop.value));
      int nofvariables = variables.length();
      Stella_Object continuationtest = loop.rest.value;
      Cons valueassignments = ((Cons)(loop.rest.rest.value));
      Cons nextassignments = ((Cons)(loop.fourth()));
      int nofnextassignments = nextassignments.length();
      Cons body = ((Cons)(loop.fifth()));
      boolean eolseparateexpressionsP = (nofvariables > 2) ||
          (((Integer)(Stella.$CPP_INDENT_CHARS$.get())).intValue() > 35);

      Stella.cppIndent();
      if (eolseparateexpressionsP) {
        ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("for  (");
      }
      else {
        ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("for (");
      }
      Stella.cppBumpIndent();
      Stella.cppBumpIndent();
      Stella.cppBumpIndent();
      { Cons var = null;
        Cons iter000 = variables;
        int i = Stella.NULL_INTEGER;
        int iter001 = 1;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest, iter001 = iter001 + 1) {
          var = ((Cons)(iter000.value));
          i = iter001;
          Stella_Object.cppOutputStatement(var);
          if (!(i == nofvariables)) {
            ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(", ");
          }
        }
      }
      ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("; ");
      if ((!(variables == Stella.NIL)) &&
          eolseparateexpressionsP) {
        ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
        Stella.cppIndent();
      }
      Stella_Object.cppOutputStatement(continuationtest);
      ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("; ");
      if (!(nextassignments == Stella.NIL)) {
        if (eolseparateexpressionsP) {
          ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
        }
        { Stella_Object next = null;
          Cons iter002 = nextassignments;
          int i = Stella.NULL_INTEGER;
          int iter003 = 1;

          for (;!(iter002 == Stella.NIL); iter002 = iter002.rest, iter003 = iter003 + 1) {
            next = iter002.value;
            i = iter003;
            if (eolseparateexpressionsP) {
              Stella.cppIndent();
            }
            Stella_Object.cppOutputStatement(next);
            if (!(i == nofnextassignments)) {
              if (eolseparateexpressionsP) {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println(",");
              }
              else {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(", ");
              }
            }
          }
        }
      }
      ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println(") {");
      Stella.cppUnbumpIndent();
      Stella.cppUnbumpIndent();
      Cons.cppOutputStatements(Cons.cppFlattenStatements(valueassignments.concatenate(body, Stella.NIL)));
      Stella.cppUnbumpIndent();
      Stella.cppIndent();
      ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println("}");
    }
  }