public static List makePlInstances(List instances, boolean skipuninternedinstancesP) {
    { List result = List.newList();

      { LogicObject instance = null;
        Cons iter000 = instances.theConsList;
        Cons collect000 = null;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          instance = ((LogicObject)(iter000.value));
          if ((!skipuninternedinstancesP) ||
              (instance.homeModule() != null)) {
            if (collect000 == null) {
              {
                collect000 = Cons.cons(GuiServer.makePlInstance(instance), Stella.NIL);
                if (result.theConsList == Stella.NIL) {
                  result.theConsList = collect000;
                }
                else {
                  Cons.addConsToEndOfConsList(result.theConsList, collect000);
                }
              }
            }
            else {
              {
                collect000.rest = Cons.cons(GuiServer.makePlInstance(instance), Stella.NIL);
                collect000 = collect000.rest;
              }
            }
          }
        }
      }
      return (result);
    }
  }