public static Iterator allocateAllMetaObjectsIterator(int arraysize, java.lang.reflect.Method nextcode, Module module, boolean localP) {
    { AllPurposeIterator iterator = AllPurposeIterator.newAllPurposeIterator();
      Cons moduleslist = Stella.NIL;

      iterator.iteratorInteger = 0;
      iterator.iteratorSecondInteger = arraysize;
      if (module != null) {
        if (localP) {
          moduleslist = Cons.cons(module, moduleslist);
        }
        else {
          { Module mod = null;
            Cons iter000 = Module.visibleModules(module);
            Cons collect000 = null;

            for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
              mod = ((Module)(iter000.value));
              if (collect000 == null) {
                {
                  collect000 = Cons.cons(mod, Stella.NIL);
                  if (moduleslist == Stella.NIL) {
                    moduleslist = collect000;
                  }
                  else {
                    Cons.addConsToEndOfConsList(moduleslist, collect000);
                  }
                }
              }
              else {
                {
                  collect000.rest = Cons.cons(mod, Stella.NIL);
                  collect000 = collect000.rest;
                }
              }
            }
          }
        }
      }
      iterator.iteratorConsList = moduleslist;
      iterator.iteratorNextCode = nextcode;
      return (iterator);
    }
  }