require '_h2ph_pre.ph';

unless(defined(&_SYS_STAT_H)) {
    eval 'sub _SYS_STAT_H () {1;}' unless defined(&_SYS_STAT_H);
    require 'features.ph';
    require 'bits/types.ph';
    if(defined (defined(&__USE_XOPEN) ? &__USE_XOPEN : 0) || defined (defined(&__USE_MISC) ? &__USE_MISC : 0)) {
	if(defined(&__USE_XOPEN)) {
	    eval 'sub __need_time_t () {1;}' unless defined(&__need_time_t);
	}
	if(defined(&__USE_MISC)) {
	    eval 'sub __need_timespec () {1;}' unless defined(&__need_timespec);
	}
	require 'time.ph';
    }
    if(defined(&__USE_XOPEN)) {
	unless(defined(&__dev_t_defined)) {
	    eval 'sub __dev_t_defined () {1;}' unless defined(&__dev_t_defined);
	}
	unless(defined(&__gid_t_defined)) {
	    eval 'sub __gid_t_defined () {1;}' unless defined(&__gid_t_defined);
	}
	unless(defined(&__ino_t_defined)) {
	    unless(defined(&__USE_FILE_OFFSET64)) {
	    } else {
	    }
	    eval 'sub __ino_t_defined () {1;}' unless defined(&__ino_t_defined);
	}
	unless(defined(&__mode_t_defined)) {
	    eval 'sub __mode_t_defined () {1;}' unless defined(&__mode_t_defined);
	}
	unless(defined(&__nlink_t_defined)) {
	    eval 'sub __nlink_t_defined () {1;}' unless defined(&__nlink_t_defined);
	}
	unless(defined(&__off_t_defined)) {
	    unless(defined(&__USE_FILE_OFFSET64)) {
	    } else {
	    }
	    eval 'sub __off_t_defined () {1;}' unless defined(&__off_t_defined);
	}
	unless(defined(&__uid_t_defined)) {
	    eval 'sub __uid_t_defined () {1;}' unless defined(&__uid_t_defined);
	}
    }
    if(defined(&__USE_UNIX98)) {
	unless(defined(&__blkcnt_t_defined)) {
	    unless(defined(&__USE_FILE_OFFSET64)) {
	    } else {
	    }
	    eval 'sub __blkcnt_t_defined () {1;}' unless defined(&__blkcnt_t_defined);
	}
	unless(defined(&__blksize_t_defined)) {
	    eval 'sub __blksize_t_defined () {1;}' unless defined(&__blksize_t_defined);
	}
    }
    require 'bits/stat.ph';
    if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_MISC) ? &__USE_MISC : 0) || defined (defined(&__USE_XOPEN) ? &__USE_XOPEN : 0)) {
	eval 'sub S_IFMT () { &__S_IFMT;}' unless defined(&S_IFMT);
	eval 'sub S_IFDIR () { &__S_IFDIR;}' unless defined(&S_IFDIR);
	eval 'sub S_IFCHR () { &__S_IFCHR;}' unless defined(&S_IFCHR);
	eval 'sub S_IFBLK () { &__S_IFBLK;}' unless defined(&S_IFBLK);
	eval 'sub S_IFREG () { &__S_IFREG;}' unless defined(&S_IFREG);
	if(defined(&__S_IFIFO)) {
	    eval 'sub S_IFIFO () { &__S_IFIFO;}' unless defined(&S_IFIFO);
	}
	if(defined(&__S_IFLNK)) {
	    eval 'sub S_IFLNK () { &__S_IFLNK;}' unless defined(&S_IFLNK);
	}
	if((defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_MISC) ? &__USE_MISC : 0) || defined (defined(&__USE_XOPEN2K) ? &__USE_XOPEN2K : 0))  && defined (defined(&__S_IFSOCK) ? &__S_IFSOCK : 0)) {
	    eval 'sub S_IFSOCK () { &__S_IFSOCK;}' unless defined(&S_IFSOCK);
	}
    }
    eval 'sub __S_ISTYPE {
        local($mode, $mask) = @_;
	    eval q(((($mode) &  &__S_IFMT) == ($mask)));
    }' unless defined(&__S_ISTYPE);
    eval 'sub S_ISDIR {
        local($mode) = @_;
	    eval q( &__S_ISTYPE(($mode),  &__S_IFDIR));
    }' unless defined(&S_ISDIR);
    eval 'sub S_ISCHR {
        local($mode) = @_;
	    eval q( &__S_ISTYPE(($mode),  &__S_IFCHR));
    }' unless defined(&S_ISCHR);
    eval 'sub S_ISBLK {
        local($mode) = @_;
	    eval q( &__S_ISTYPE(($mode),  &__S_IFBLK));
    }' unless defined(&S_ISBLK);
    eval 'sub S_ISREG {
        local($mode) = @_;
	    eval q( &__S_ISTYPE(($mode),  &__S_IFREG));
    }' unless defined(&S_ISREG);
    if(defined(&__S_IFIFO)) {
	eval 'sub S_ISFIFO {
	    local($mode) = @_;
    	    eval q( &__S_ISTYPE(($mode),  &__S_IFIFO));
	}' unless defined(&S_ISFIFO);
    }
    if(defined(&__S_IFLNK)) {
	eval 'sub S_ISLNK {
	    local($mode) = @_;
    	    eval q( &__S_ISTYPE(($mode),  &__S_IFLNK));
	}' unless defined(&S_ISLNK);
    }
    if(defined(&__USE_BSD)) {
	unless(defined(&__S_IFLNK)) {
	    eval 'sub S_ISLNK {
	        local($mode) = @_;
    		eval q(0);
	    }' unless defined(&S_ISLNK);
	}
	if(defined(&__S_IFSOCK)) {
	    eval 'sub S_ISSOCK {
	        local($mode) = @_;
    		eval q( &__S_ISTYPE(($mode),  &__S_IFSOCK));
	    }' unless defined(&S_ISSOCK);
	}
    }
    if(defined(&__USE_POSIX199309)) {
	eval 'sub S_TYPEISMQ {
	    local($buf) = @_;
    	    eval q( &__S_TYPEISMQ($buf));
	}' unless defined(&S_TYPEISMQ);
	eval 'sub S_TYPEISSEM {
	    local($buf) = @_;
    	    eval q( &__S_TYPEISSEM($buf));
	}' unless defined(&S_TYPEISSEM);
	eval 'sub S_TYPEISSHM {
	    local($buf) = @_;
    	    eval q( &__S_TYPEISSHM($buf));
	}' unless defined(&S_TYPEISSHM);
    }
    eval 'sub S_ISUID () { &__S_ISUID;}' unless defined(&S_ISUID);
    eval 'sub S_ISGID () { &__S_ISGID;}' unless defined(&S_ISGID);
    if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_MISC) ? &__USE_MISC : 0) || defined (defined(&__USE_XOPEN) ? &__USE_XOPEN : 0)) {
	eval 'sub S_ISVTX () { &__S_ISVTX;}' unless defined(&S_ISVTX);
    }
    eval 'sub S_IRUSR () { &__S_IREAD;}' unless defined(&S_IRUSR);
    eval 'sub S_IWUSR () { &__S_IWRITE;}' unless defined(&S_IWUSR);
    eval 'sub S_IXUSR () { &__S_IEXEC;}' unless defined(&S_IXUSR);
    eval 'sub S_IRWXU () {( &__S_IREAD| &__S_IWRITE| &__S_IEXEC);}' unless defined(&S_IRWXU);
    if(defined (defined(&__USE_MISC) ? &__USE_MISC : 0)  && defined (defined(&__USE_BSD) ? &__USE_BSD : 0)) {
	eval 'sub S_IREAD () { &S_IRUSR;}' unless defined(&S_IREAD);
	eval 'sub S_IWRITE () { &S_IWUSR;}' unless defined(&S_IWRITE);
	eval 'sub S_IEXEC () { &S_IXUSR;}' unless defined(&S_IEXEC);
    }
    eval 'sub S_IRGRP () {( &S_IRUSR >> 3);}' unless defined(&S_IRGRP);
    eval 'sub S_IWGRP () {( &S_IWUSR >> 3);}' unless defined(&S_IWGRP);
    eval 'sub S_IXGRP () {( &S_IXUSR >> 3);}' unless defined(&S_IXGRP);
    eval 'sub S_IRWXG () {( &S_IRWXU >> 3);}' unless defined(&S_IRWXG);
    eval 'sub S_IROTH () {( &S_IRGRP >> 3);}' unless defined(&S_IROTH);
    eval 'sub S_IWOTH () {( &S_IWGRP >> 3);}' unless defined(&S_IWOTH);
    eval 'sub S_IXOTH () {( &S_IXGRP >> 3);}' unless defined(&S_IXOTH);
    eval 'sub S_IRWXO () {( &S_IRWXG >> 3);}' unless defined(&S_IRWXO);
    if(defined(&__USE_BSD)) {
	eval 'sub ACCESSPERMS () {( &S_IRWXU| &S_IRWXG| &S_IRWXO);}' unless defined(&ACCESSPERMS);
	eval 'sub ALLPERMS () {( &S_ISUID| &S_ISGID| &S_ISVTX| &S_IRWXU| &S_IRWXG| &S_IRWXO);}' unless defined(&ALLPERMS);
	eval 'sub DEFFILEMODE () {( &S_IRUSR| &S_IWUSR| &S_IRGRP| &S_IWGRP| &S_IROTH| &S_IWOTH);}' unless defined(&DEFFILEMODE);
	eval 'sub S_BLKSIZE () {512;}' unless defined(&S_BLKSIZE);
    }
    unless(defined(&__USE_FILE_OFFSET64)) {
    } else {
	if(defined(&__REDIRECT)) {
	} else {
	    eval 'sub stat () { &stat64;}' unless defined(&stat);
	    eval 'sub fstat () { &fstat64;}' unless defined(&fstat);
	}
    }
    if(defined(&__USE_LARGEFILE64)) {
    }
    if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_XOPEN_EXTENDED) ? &__USE_XOPEN_EXTENDED : 0)) {
	unless(defined(&__USE_FILE_OFFSET64)) {
	} else {
	    if(defined(&__REDIRECT)) {
	    } else {
		eval 'sub lstat () { &lstat64;}' unless defined(&lstat);
	    }
	}
	if(defined(&__USE_LARGEFILE64)) {
	}
    }
    if(defined(&__USE_BSD)) {
    }
    if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_XOPEN_EXTENDED) ? &__USE_XOPEN_EXTENDED : 0)) {
    }
    if(defined(&__USE_GNU)) {
    }
    if(defined (defined(&__USE_MISC) ? &__USE_MISC : 0) || defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_XOPEN_EXTENDED) ? &__USE_XOPEN_EXTENDED : 0)) {
    }
    unless(defined(&_STAT_VER)) {
	eval 'sub _STAT_VER () {0;}' unless defined(&_STAT_VER);
    }
    unless(defined(&_MKNOD_VER)) {
	eval 'sub _MKNOD_VER () {0;}' unless defined(&_MKNOD_VER);
    }
    unless(defined(&__USE_FILE_OFFSET64)) {
    } else {
	if(defined(&__REDIRECT)) {
	} else {
	    eval 'sub __fxstat () { &__fxstat64;}' unless defined(&__fxstat);
	    eval 'sub __xstat () { &__xstat64;}' unless defined(&__xstat);
	    eval 'sub __lxstat () { &__lxstat64;}' unless defined(&__lxstat);
	}
    }
    if(defined(&__USE_LARGEFILE64)) {
    }
    if(defined (defined(&__GNUC__) ? &__GNUC__ : 0)  && (defined(&__GNUC__) ? &__GNUC__ : 0) >= 2) {
	if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_XOPEN_EXTENDED) ? &__USE_XOPEN_EXTENDED : 0)) {
	}
	if(defined (defined(&__USE_MISC) ? &__USE_MISC : 0) || defined (defined(&__USE_BSD) ? &__USE_BSD : 0)) {
	}
	if(defined (defined(&__USE_LARGEFILE64) ? &__USE_LARGEFILE64 : 0)  && (! defined (defined(&__USE_FILE_OFFSET64) ? &__USE_FILE_OFFSET64 : 0) || (defined (defined(&__REDIRECT) ? &__REDIRECT : 0)  && defined (defined(&__OPTIMIZE__) ? &__OPTIMIZE__ : 0)))) {
	    if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_XOPEN_EXTENDED) ? &__USE_XOPEN_EXTENDED : 0)) {
	    }
	}
    }
}
1;
