public static Cons walkLetTree(Cons tree, Object [] MV_returnarray) {
    tree.secondSetter(Cons.walkVariableDeclarations(((Cons)(tree.rest.value))));
    { boolean testValue000 = false;

      { boolean foundP000 = false;

        { Cons d = null;
          Cons iter000 = ((Cons)(tree.rest.value));

          loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
            d = ((Cons)(iter000.value));
            if (Stella_Object.proceduralExpressionP(d.rest.rest.value)) {
              foundP000 = true;
              break loop000;
            }
          }
        }
        testValue000 = foundP000;
      }
      testValue000 = !testValue000;
      if (testValue000) {
        tree.rest.rest = Cons.walkListOfStatements(tree.rest.rest);
        Cons.popLocalVariableBindings(((Cons)(tree.rest.value)));
        return (Stella_Object.sysTree(tree, Stella.SGT_STELLA_VOID, MV_returnarray));
      }
    }
    { Cons originaldeclarations = ((Cons)(tree.rest.value));
      Cons leadingdeclarations = Stella.NIL;
      Cons trailingdeclarations = Stella.NIL;
      boolean leadingP = true;

      { Cons d = null;
        Cons iter001 = ((Cons)(originaldeclarations));

        for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
          d = ((Cons)(iter001.value));
          if (Stella_Object.proceduralExpressionP(d.rest.rest.value)) {
            leadingP = false;
          }
          if (leadingP) {
            leadingdeclarations = Cons.cons(d, leadingdeclarations);
          }
          else {
            trailingdeclarations = Cons.cons(d, trailingdeclarations);
          }
        }
      }
      leadingdeclarations = leadingdeclarations.reverse();
      trailingdeclarations = trailingdeclarations.reverse();
      tree.secondSetter(trailingdeclarations);
      tree = Cons.transformLetWithProceduralExpression(tree);
      if (!(leadingdeclarations == Stella.NIL)) {
        Cons.popLocalVariableBindings(leadingdeclarations);
        tree = Cons.list$(Cons.cons(Stella.SYM_STELLA_LET, Cons.cons(leadingdeclarations, Cons.cons(Cons.cons(tree, Stella.NIL), Stella.NIL))));
      }
      return (Cons.walkAConsTree(tree, MV_returnarray));
    }
  }