public static Cons cppTranslateForeachTree(Cons tree) {
    { Cons iteratorbindings = ((Cons)(tree.rest.value));
      Cons valuetrees = ((Cons)(tree.rest.rest.value));
      Cons nexttrees = ((Cons)(tree.fourth()));
      Stella_Object continuationtest = Stella_Object.cppTranslateATree(tree.fifth());
      Cons body = Cons.cppTranslateListOfTrees(tree.nthRest(5));
      Cons declaration = Stella.NIL;
      Cons declarations = Stella.NIL;
      Cons vadeclarations = Stella.NIL;
      Cons valueassignments = Stella.NIL;
      Cons nextassignments = Stella.NIL;
      Symbol varargsiterator = null;
      Cons variables = Stella.NIL;

      { Cons binding = null;
        Cons iter000 = iteratorbindings;
        Cons collect000 = null;

        loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          binding = ((Cons)(iter000.value));
          if (StandardObject.subTypeSpecOfP(((StandardObject)(binding.rest.value)), Stella.SGT_STELLA_ARGUMENT_LIST_ITERATOR)) {
            varargsiterator = ((Symbol)(binding.value));
            vadeclarations = vadeclarations.concatenate(Symbol.cppYieldVaIteratorDeclarations(varargsiterator), Stella.NIL);
            continue loop000;
          }
          else {
            declaration = Cons.cons(StandardObject.cppTranslateAndPointerizeTypeSpec(((StandardObject)(binding.rest.value))), Cons.cons(Stella_Object.cppTranslateATree(binding.value), Cons.cons(Stella_Object.cppTranslateATree(binding.rest.rest.value), Stella.NIL)));
          }
          if (collect000 == null) {
            {
              collect000 = Cons.cons(declaration, Stella.NIL);
              if (declarations == Stella.NIL) {
                declarations = collect000;
              }
              else {
                Cons.addConsToEndOfConsList(declarations, collect000);
              }
            }
          }
          else {
            {
              collect000.rest = Cons.cons(declaration, Stella.NIL);
              collect000 = collect000.rest;
            }
          }
        }
      }
      { Cons tree000 = null;
        Cons iter001 = valuetrees;
        Cons collect001 = null;

        for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
          tree000 = ((Cons)(iter001.value));
          if (collect001 == null) {
            {
              collect001 = Cons.cons(Stella_Object.cppTranslateATree(tree000), Stella.NIL);
              if (valueassignments == Stella.NIL) {
                valueassignments = collect001;
              }
              else {
                Cons.addConsToEndOfConsList(valueassignments, collect001);
              }
            }
          }
          else {
            {
              collect001.rest = Cons.cons(Stella_Object.cppTranslateATree(tree000), Stella.NIL);
              collect001 = collect001.rest;
            }
          }
        }
      }
      { Cons tree000 = null;
        Cons iter002 = nexttrees;
        Cons collect002 = null;

        for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
          tree000 = ((Cons)(iter002.value));
          if (collect002 == null) {
            {
              collect002 = Cons.cons(Stella_Object.cppTranslateATree(tree000), Stella.NIL);
              if (nextassignments == Stella.NIL) {
                nextassignments = collect002;
              }
              else {
                Cons.addConsToEndOfConsList(nextassignments, collect002);
              }
            }
          }
          else {
            {
              collect002.rest = Cons.cons(Stella_Object.cppTranslateATree(tree000), Stella.NIL);
              collect002 = collect002.rest;
            }
          }
        }
      }
      { Cons decl = null;
        Cons iter003 = vadeclarations;
        Cons collect003 = null;

        for (;!(iter003 == Stella.NIL); iter003 = iter003.rest) {
          decl = ((Cons)(iter003.value));
          if (collect003 == null) {
            {
              collect003 = Cons.cons(decl.rest.value, Stella.NIL);
              if (variables == Stella.NIL) {
                variables = collect003;
              }
              else {
                Cons.addConsToEndOfConsList(variables, collect003);
              }
            }
          }
          else {
            {
              collect003.rest = Cons.cons(decl.rest.value, Stella.NIL);
              collect003 = collect003.rest;
            }
          }
        }
      }
      { Cons decl = null;
        Cons iter004 = declarations;
        Cons collect004 = null;

        for (;!(iter004 == Stella.NIL); iter004 = iter004.rest) {
          decl = ((Cons)(iter004.value));
          if (collect004 == null) {
            {
              collect004 = Cons.cons(decl.rest.value, Stella.NIL);
              if (variables == Stella.NIL) {
                variables = collect004;
              }
              else {
                Cons.addConsToEndOfConsList(variables, collect004);
              }
            }
          }
          else {
            {
              collect004.rest = Cons.cons(decl.rest.value, Stella.NIL);
              collect004 = collect004.rest;
            }
          }
        }
      }
      if (!(vadeclarations == Stella.NIL)) {
        return (Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_BLOCK, Cons.cons(vadeclarations.concatenate(declarations, Stella.NIL), Cons.cons(Cons.cons(Cons.cons(Stella.SYM_STELLA_CPP_STATEMENTS, Symbol.cppYieldVaStartTree(varargsiterator).concatenate(Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_FOREACH, Cons.cons(variables, Cons.cons(Cons.cons(continuationtest, Cons.cons(valueassignments, Cons.cons(nextassignments, Cons.cons(body, Stella.NIL)))), Stella.NIL)))), Symbol.cppYieldVaEndTree(varargsiterator).concatenate(Stella.NIL, Stella.NIL)), Stella.NIL)), Stella.NIL), Stella.NIL)))));
      }
      else {
        return (Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_BLOCK, Cons.cons(declarations, Cons.cons(Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_FOREACH, Cons.cons(variables, Cons.cons(Cons.cons(continuationtest, Cons.cons(valueassignments, Cons.cons(nextassignments, Cons.cons(body, Stella.NIL)))), Stella.NIL)))), Stella.NIL), Stella.NIL)))));
      }
    }
  }