public static Stella_Object clTranslateBooleanTest(Stella_Object tree, boolean invertP) {
    if (Stella_Object.safePrimaryType(tree) == Stella.SGT_STELLA_CONS) {
      { Cons tree000 = ((Cons)(tree));

        { GeneralizedSymbol testValue000 = ((GeneralizedSymbol)(tree000.value));

          if (testValue000 == Stella.SYM_STELLA_NOT) {
            { Stella_Object postree = tree000.rest.value;

              return (Stella_Object.clTranslateBooleanTest(postree, !invertP));
            }
          }
          else if ((testValue000 == Stella.SYM_STELLA_AND) ||
              (testValue000 == Stella.SYM_STELLA_OR)) {
            { Cons cursor = tree000.rest;

              while (!(cursor == Stella.NIL)) {
                cursor.value = Stella_Object.clTranslateBooleanTest(cursor.value, false);
                cursor = cursor.rest;
              }
            }
            if (tree000.value == Stella.SYM_STELLA_AND) {
              tree000.firstSetter(Stella.internCommonLispSymbol("AND"));
            }
            else {
              tree000.firstSetter(Stella.internCommonLispSymbol("OR"));
            }
            if (invertP) {
              tree000 = Cons.list$(Cons.cons(Stella.internCommonLispSymbol("NOT"), Cons.cons(tree000, Cons.cons(Stella.NIL, Stella.NIL))));
            }
            return (tree000);
          }
          else if (testValue000 == Stella.SYM_STELLA_TYPED_SYS) {
            return (Stella_Object.clTranslateBooleanTest(tree000.rest.value, invertP));
          }
          else {
          }
        }
      }
    }
    else {
    }
    return (Stella_Object.clTranslatePlainBooleanTest(tree, invertP));
  }