public static Cons clListDirectoryFiles(String directory) {
    { Cons files = null;
      String dirsep = Stella.directorySeparatorString();
      boolean checkduplicatesP = false;
      String normfile = null;
      Cons normalizedfiles = Stella.NIL;

      if (files == null) {
        checkduplicatesP = true;
      }
      files = Stella.NIL;
      if (checkduplicatesP) {
        normalizedfiles = normalizedfiles.removeDuplicatesEqual();
      }
      { StringWrapper file = null;
        Cons iter000 = files;
        Cons collect000 = null;

        loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          file = ((StringWrapper)(iter000.value));
          normfile = file.wrapperValue;
          if (Stella.endsWithP(normfile, dirsep, Stella.NULL_INTEGER)) {
            normfile = Native.string_subsequence(normfile, 0, normfile.length() - dirsep.length());
          }
          normfile = Stella.fileNameWithoutDirectory(normfile);
          if (Stella.stringEqlP(normfile, ".") ||
              Stella.stringEqlP(normfile, "..")) {
            continue loop000;
          }
          if (collect000 == null) {
            {
              collect000 = Cons.cons(StringWrapper.wrapString(normfile), Stella.NIL);
              if (normalizedfiles == Stella.NIL) {
                normalizedfiles = collect000;
              }
              else {
                Cons.addConsToEndOfConsList(normalizedfiles, collect000);
              }
            }
          }
          else {
            {
              collect000.rest = Cons.cons(StringWrapper.wrapString(normfile), Stella.NIL);
              collect000 = collect000.rest;
            }
          }
        }
      }
      return (normalizedfiles);
    }
  }