n = wsize; p = &s->prev[n]; do { m = *--p; *p = (Pos)(m >= wsize ? m-wsize : NIL);  } while (--n);
n = wsize; #ifndef FASTEST p = &s->prev[n]; do { m = *--p; *p = (Pos)(m >= wsize ? m-wsize : NIL);  } while (--n); #endif
local void fill_window(s)    deflate_state *s;{    register unsigned n, m;    register Posf *p;    unsigned more;    /* Amount of free space at the end of the window. */    uInt wsize = s->w_size;    do {        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);        /* Deal with !@#$% 64K limit: */        if (more == 0 && s->strstart == 0 && s->lookahead == 0) {            more = wsize;        } else if (more == (unsigned)(-1)) {            /* Very unlikely, but possible on 16 bit machine if strstart == 0             * and lookahead == 1 (input done one byte at time)             */            more--;        /* If the window is almost full and there is insufficient lookahead,         * move the upper half to the lower one to make room in the upper half.         */        } else if (s->strstart >= wsize+MAX_DIST(s)) {            zmemcpy((charf *)s->window, (charf *)s->window+wsize,                   (unsigned)wsize);            s->match_start -= wsize;            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */            s->block_start -= (long) wsize;            /* Slide the hash table (could be avoided with 32 bit values               at the expense of memory usage):             */            n = s->hash_size;            p = &s->head[n];            do {                m = *--p;                *p = (Pos)(m >= wsize ? m-wsize : NIL);            } while (--n);            n = wsize;            p = &s->prev[n];            do {                m = *--p;                *p = (Pos)(m >= wsize ? m-wsize : NIL);                /* If n is not on any hash chain, prev[n] is garbage but                 * its value will never be used.                 */            } while (--n);            more += wsize;        }        if (s->strm->avail_in == 0) return;        /* If there was no sliding:         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&         *    more == window_size - lookahead - strstart         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)         * => more >= window_size - 2*WSIZE + 2         * In the BIG_MEM or MMAP case (not yet supported),         *   window_size == input_size + MIN_LOOKAHEAD  &&         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.         * Otherwise, window_size == 2*WSIZE so more >= 2.         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.         */        Assert(more >= 2, "more < 2");        n = read_buf(s->strm, (charf *)s->window + s->strstart + s->lookahead,                     more);        s->lookahead += n;        /* Initialize the hash value now that we have some input: */        if (s->lookahead >= MIN_MATCH) {            s->ins_h = s->window[s->strstart];            UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);#if MIN_MATCH != 3            Call UPDATE_HASH() MIN_MATCH-3 more times#endif        }        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,         * but this is not important since only literal bytes will be emitted.         */    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);}