public static void maintainRecycleLists() {
    if (Stella.$CURRENTLY_RECYCLED_ITEMS$ != null) {
      return;
    }
    { int totalsize = Stella.totalRecycleListsSize();
      int maxsize = Native.floor(Stella.$MAX_RECYCLE_LIST_BYTES$ / 4.0);
      int listsize = Stella.NULL_INTEGER;
      boolean classredefinitionP = false;

      Stella.$RECYCLE_LISTS_MAINTENANCE_TIMER$ = Stella.$RECYCLE_LISTS_MAINTENANCE_INTERVAL$;
      { RecycleList list = null;
        Cons iter000 = Stella.$ALL_RECYCLE_LISTS$.theConsList;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          list = ((RecycleList)(iter000.value));
          if ((((Stella_Class)(list.recycleListOf.surrogateValue)) != null) &&
              (!Stella_Class.decidedToRecycleP(((Stella_Class)(list.recycleListOf.surrogateValue))))) {
            classredefinitionP = true;
            RecycleList.clearRecycleList(list);
            list.deletedPSetter(true);
          }
        }
      }
      if (classredefinitionP) {
        Stella.$ALL_RECYCLE_LISTS$.removeDeletedMembers();
      }
      if (totalsize > maxsize) {
        Stella.$ALL_RECYCLE_LISTS$.sort(Native.find_java_method("edu.isi.stella.RecycleList", "recycleListSizeL", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.RecycleList"), Native.find_java_class("edu.isi.stella.RecycleList")}));
        Stella.$ALL_RECYCLE_LISTS$.reverse();
        while (totalsize > maxsize) {
          { RecycleList list = null;
            Cons iter001 = Stella.$ALL_RECYCLE_LISTS$.theConsList;

            loop002 : for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
              list = ((RecycleList)(iter001.value));
              if (totalsize <= maxsize) {
                break loop002;
              }
              listsize = list.itemSize * list.currentLength;
              if (listsize > 0) {
                totalsize = totalsize - listsize;
              }
              else {
                continue loop002;
              }
              RecycleList.reduceRecycleListSize(list, 0.5);
              totalsize = totalsize + (list.itemSize * list.currentLength);
            }
          }
        }
      }
    }
  }