public static Cons cppTranslateCondTree(Cons tree) {
    { Cons otherwisecondition = null;
      Cons conditions = Stella.NIL;

      { Stella_Object condition = null;
        Cons iter000 = tree.rest;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          condition = iter000.value;
          if (Stella_Object.safePrimaryType(condition) == Stella.SGT_STELLA_CONS) {
            { Cons condition000 = ((Cons)(condition));

              if (condition000.value == Stella.SYM_STELLA_OTHERWISE) {
                otherwisecondition = Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_PROGN, Cons.cons(Cons.cons(Stella.SYM_STELLA_CPP_STATEMENTS, Cons.cppTranslateListOfTrees(condition000.rest).concatenate(Stella.NIL, Stella.NIL)), Cons.cons(Stella.NIL, Stella.NIL))));
              }
              else {
                conditions = Cons.cons(Cons.cons(Stella_Object.cppTranslateATree(condition000.value), Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_PROGN, Cons.cons(Cons.cons(Stella.SYM_STELLA_CPP_STATEMENTS, Cons.cppTranslateListOfTrees(condition000.rest).concatenate(Stella.NIL, Stella.NIL)), Cons.cons(Stella.NIL, Stella.NIL)))), Stella.NIL)), conditions);
              }
            }
          }
          else {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("`" + Stella_Object.safePrimaryType(condition) + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
        }
      }
      return (Cons.list$(Cons.cons(Stella.SYM_STELLA_CPP_COND, Cons.cons(otherwisecondition, Cons.cons(Cons.cons(conditions.reverse(), Stella.NIL), Stella.NIL)))));
    }
  }