public static void cleanupStructuredObjectsIndex(Module clearmodule) {
    { IntegerWrapper key = null;
      List bucket = null;
      DictionaryIterator iter000 = ((DictionaryIterator)(Logic.$STRUCTURED_OBJECTS_INDEX$.allocateIterator()));

      while (iter000.nextP()) {
        key = ((IntegerWrapper)(iter000.key));
        bucket = ((List)(iter000.value));
        { ContextSensitiveObject obj = null;
          Cons iter001 = bucket.theConsList;

          for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
            obj = ((ContextSensitiveObject)(iter001.value));
            { Context context = obj.homeContext;

              if ((context != null) &&
                  (context.deletedP() ||
                   ((context == clearmodule) ||
                    context.allSuperContexts.membP(clearmodule)))) {
                Logic.destroyObject(obj);
              }
            }
          }
        }
        bucket.removeDeletedMembers();
        if (bucket.emptyP()) {
          Logic.$STRUCTURED_OBJECTS_INDEX$.removeAt(key);
        }
      }
    }
  }