public static Cons clYieldDeclareTree(Cons declarations, boolean includeTypeChecksP) {
    if (declarations == Stella.NIL) {
      return (Stella.NIL);
    }
    { Cons otherdeclarations = declarations.rest;
      Cons typechecks = Stella.NIL;

      if (includeTypeChecksP &&
          (((Integer)(Stella.$SAFETY$.get())).intValue() >= 1)) {
        { Cons decl = null;
          Cons iter000 = declarations;

          for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
            decl = ((Cons)(iter000.value));
            if (((Integer)(Stella.$SAFETY$.get())).intValue() <= 2) {
              typechecks = Cons.cons(VerbatimStringWrapper.newVerbatimStringWrapper("#+MCL"), typechecks);
            }
            typechecks = Cons.cons(Cons.list$(Cons.cons(Stella.internCommonLispSymbol("CHECK-TYPE"), Cons.cons(decl.rest.rest.value, Cons.cons(Cons.cons(decl.rest.value, Stella.NIL), Stella.NIL)))), typechecks);
          }
        }
        typechecks = typechecks.reverse();
      }
      { Cons decl = null;
        Cons iter001 = declarations;

        for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
          decl = ((Cons)(iter001.value));
          if ((decl != null) &&
              (decl.value == Stella.internCommonLispSymbol("TYPE"))) {
            { Cons otherdecl = null;
              Cons iter002 = otherdeclarations;

              for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
                otherdecl = ((Cons)(iter002.value));
                if ((otherdecl != null) &&
                    ((otherdecl.value == Stella.internCommonLispSymbol("TYPE")) &&
                     Stella_Object.eqlP(otherdecl.rest.value, decl.rest.value))) {
                  decl.concatenate(otherdecl.rest.rest, Stella.NIL);
                  otherdeclarations.substitute(null, otherdecl);
                }
              }
            }
          }
          otherdeclarations = otherdeclarations.rest;
        }
      }
      return (Cons.cons(Stella_Object.clConditionalizeTypeDeclarationTree(Cons.cons(Stella.internCommonLispSymbol("DECLARE"), declarations.remove(null).concatenate(Stella.NIL, Stella.NIL))), typechecks.concatenate(Stella.NIL, Stella.NIL)));
    }
  }