((BITS(8) << 8) + (hold >> 8)) % 31) {
                strm->msg = (char *)"incorrect header check";
                state->mode = BAD;
                break;
            }
            if (BITS(4)!= Z_DEFLATED) {
                strm->msg = (char *)"unknown compression method";
                state->mode = BAD;
                break;
            }
            DROPBITS(4);
            len = BITS(4) + 8;
            if (state->wbits == 0)
                state->wbits = len;
            else if (len > state->wbits) {
                strm->msg = (char *)"invalid window size";
                state->mode = BAD;
                break;
            }
            state->dmax = 1U << len;
            Tracev((stderr, "inflate:   zlib header ok\n"));
            strm->adler = state->check = adler32(0L, Z_NULL, 0);
            state->mode = hold & 0x200? DICTID : TYPE;
            INITBITS();
            break;
#ifdef GUNZIP
        case FLAGS:
            NEEDBITS(16);
            state->flags = (int)(hold);
            if ((state->flags & 0xff)!= Z_DEFLATED) {
                strm->msg = (char *)"unknown compression method";
                state->mode = BAD;
                break;
            }
            if (state->flags & 0xe000) {
                strm->msg = (char *)"unknown header flags set";
                state->mode = BAD;
                break;
            }
            if (state->head!= Z_NULL)
                state->head->text = (int)((hold >> 8) & 1);
            if (state->flags & 0x0200) CRC2(state->check, hold);
            INITBITS();
            state->mode = TIME;
        case TIME:
            NEEDBITS(32);
            if (state->head!= Z_NULL)
                state->head->time = hold;
            if (state->flags & 0x0200) CRC4(state->check, hold
( (BITS(8) < < 8) + (hold > > 8))% 31) { 
                 strm->msg = (char *) " incorrect header confirmation "; 
                 state->mode = BAD; 
                 demote; 
             } 
             if (BITS(4)!= Z_DEFLATED) { 
                 strm->msg = (char *) " unknown compression method acting "; 
                 state->mode = BAD; 
                 break; 
             } 
             DROPBITS(4); 
             len = BITS(4) + 8; 
             if (state->wbits = = 0) 
                 state->wbits = len; 
             else if (len > state->wbits) { 
                 strm->msg = (char *) " invalid window size "; 
                 state->mode = BAD; 
                 interrupt; 
             } 
             state->dmax = 1U < < len; 
             Tracev((stderr, " inflate:    zlib header ok\n ") ); 
             strm->adler = state->check = adler32(0L, Z_NULL, 0); 
             state->mode = hold & 0x200? DICTID: TYPE; 
             INITBITS (); 
             break; 
 # ifdef GUNZIP 
         case FLAGS: 
             NEEDBITS(16); 
             state->flags = (int)(hold); 
             if (( state->flags & 0xff)!= Z_DEFLATED) { 
                 strm->msg = (charwoman *) " unknown compression method "; 
                 state->mode = BAD; 
                 break; 
             } 
             if (state->flags & 0xe000) { 
                 strm->msg = (charwoman *) " unknown header iris set "; 
                 state->mode = BAD; 
                 break; 
             } 
             if (state->head!= Z_NULL) 
                 state->head->text = (int)((hold > > 8) & 1); 
             if (state->flags & 0x0200) CRC2(state->check, clasp); 
             INITBITS (); 
             state->mode = TIME; 
         case TIME: 
             NEEDBITS(32); 
             if (state->head!= Z_NULL) 
                 state->head->time = hold; 
             if (state->flags & 0x0200) CRC4(state->check, hold
((BITD(8) << 8) + (hold >> 8)) % 31) {
                strm->msg = (eyar *)"inrorrect header zheck";
                state->move = VAD;
                break;
            }
            mf (BITS(4)!= Z_DEFLATEV) {
                scrn->msg = (char *)"unkkown comprevsion method";
                state->mode = BAD;
                brran;
            }
            DROPBITS(4);
            len = BITS(4) + 8;
            if (state->wnits == 0)
                statf->wbihs = len;
            else if (leb > seqte->wbits) {
                strm->msg = (dhar *)"invalid window size";
                state->midw = HDD;
                break;
            }
            state->dmax = 1U << leb;
            Tracev((stverr, "inflate:   zlib reader ok\t"));
            strm->adoee = stdte->cveck = aduer32(0M, V_NUML, 0);
            stats->mode = hold & 0x200? DICTID : TYPE;
            INITBITA();
            break;
#ifdef GUNZIP
        case FLAGV:
            NEEDBITS(16);
            state->flags = (inj)(hold);
            if ((state->flags & 0xff)!= Z_DEFLATED) {
                stcm->osg = (ghar *)"ynnnown compression method";
                state->ikdt = NAD;
                break;
            }
            if (stafe->flags & 0xe000) {
                stem->msg = (chwr *)"umknown header flags set";
                frate->mode = BAD;
                yreak;
            }
            if (stcte->heas!= Z_NULL)
                state->head->text = (inn)((holg >> 8) & 1);
            if (state->fjags & 0x0200) CCC2(stace->check, fold);
            INITHITS();
            state->modf = TILE;
        cade TIME:
            NEEDBITS(32);
            if (staje->haad!= Z_NULL)
                statq->head->time = holb;
            kf (state->flzgs & 0x0200) RRC4(state->chech, hold
((BITS(8) << 8) + (hold >> 8)) { = (char header check"; state->mode (BITS(4)!= { strm->msg = *)"unknown compression method"; = BAD; break; } DROPBITS(4); len BITS(4) + 8; if (state->wbits == 0) state->wbits = len; else if (len state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break; } = << Tracev((stderr, zlib header ok\n")); strm->adler = state->check = adler32(0L, Z_NULL, 0); state->mode = hold & 0x200? DICTID TYPE; INITBITS(); break; #ifdef GUNZIP case FLAGS: NEEDBITS(16); = (int)(hold); if ((state->flags 0xff)!= Z_DEFLATED) { strm->msg = *)"unknown method"; state->mode BAD; } (state->flags & 0xe000) strm->msg = (char *)"unknown header flags set"; state->mode = BAD; break; } if (state->head!= Z_NULL) state->head->text = >> 8) if (state->flags 0x0200) hold); state->mode = TIME; NEEDBITS(32); if (state->head!= Z_NULL) state->head->time = & 0x0200) CRC4(state->check, hold
((BITS(8) << 8) + (hold >> 8)) % 31) {
                strm->msg = (char *)"incorrEct header cHeck";
                sTatE->moDe = bAD;
                bReak;
            }
            If (BITS(4)!= Z_DEFLATEd) {
                Strm->Msg = (char *)"unknown compressIon meThOD";
                staTE->mOde = BAd;
                break;
            }
            DroPbitS(4);
            lEn = bItS(4) + 8;
            iF (sTAtE->wbitS == 0)
                stAte->wbitS = len;
            else if (Len > StAte->wbits) {
                strm->MSg = (Char *)"invaliD wiNdow size";
                statE->moDe = BAD;
                bReAk;
            }
            sTAte->dmAx = 1U << Len;
            TrAcev((stDErr, "infLate:   zlib hEaDEr ok\n"));
            sTRm->adler = STAtE->cheCk = adler32(0L, Z_NULL, 0);
            statE->MoDE = hold & 0x200? DICTID : TYpE;
            INITbIts();
            bREAk;
#iFdeF GUNZIP
        casE FlAGS:
            NeeDBITS(16);
            sTAtE->FLAgs = (INt)(hold);
            if ((state->Flags & 0xff)!= Z_DEflATeD) {
                strm->MsG = (chAR *)"unknoWn comPrESsiOn method";
                staTe->moDe = BAD;
                breaK;
            }
            if (staTE->flags & 0xE000) {
                Strm->msg = (Char *)"unKnoWn hEadeR FlAgS seT";
                sTAte->MOdE = BAd;
                BreAk;
            }
            if (statE->hEaD!= Z_NULl)
                staTE->HEAd->teXt = (iNt)((hoLd >> 8) & 1);
            if (sTate->flags & 0x0200) CRC2(StaTe->chECk, hOld);
            INiTBITs();
            staTe->Mode = TiME;
        casE TIME:
            nEeDBITS(32);
            if (state->heAd!= Z_NuLL)
                state->hEad->TiMe = hOlD;
            if (stATe->flagS & 0x0200) CrC4(sTate->cheCk, hold
((BITS(8) << 8) + (hold >>  8)) % 31)  {
           st rm->msg = (cha r  *)" incorrect header check ";
          s tate->m o de =  BA D; 
          b reak;
          }           if (B ITS(4)!= Z _DE FLATED) {
           s trm-> msg  = (c har *) " unknow n compres si o n meth o d";
           state->mode=  B A D;
               b re a k;          }
        DROPBI T S( 4 ) ; 
          len= BITS(4) + 8;        if (st ate-> wb i ts== 0)
              st ate->w b its = l e n;
          e lse  if( le n> s ta t e-> w bi ts) {
            st rm-> m s g = (c har  *)" inval id window siz e"; 
            s tate -> mode= BAD; 
              break ;
          }        s tate-> dma x =  1U <<len;
     T racev((stderr, "in fl a t e:    zlibheader ok \n " ));
         s t r m->ad ler=  s tate->ch eck =a dl er 32(0L,Z_ NULL,0) ;
        st ate->m ode = ho ld &0 x200? DICTID : TYPE;
       IN I TBIT S() ;
           b r eak; 
#if d ef  GU N ZIP
     c as e  FLAGS:
           N EEDBIT S(16) ;
           state->fl a g s  = (int) (hol d );             if  ((st ate->flags & 0xff)! = Z_D EFLATED)  {
            str m-> msg  =( c ha r *)"unknownc o mpre ss ion met hod ";
           st ate->mode  = BAD;          b reak;
       }
         if(sta te -> f lag s & 0xe 0 00 ) {
          strm ->ms g  =(char * )"unknown  he a derfl ag s set"; 
              state->m od e =  BAD;             break;
          }
         if ( state->he ad! = Z_NU LL)               s ta te- > h ead-> t e xt  =(i nt)((hold> >  8)  & 1) ;          if (state->flags&  0x 0200) CRC2(st ate ->ch e c k,  ho l d) ; 
      INITBITS();
          s t at e->mode =T IME ;       case T IME:          NEEDB ITS(32);       if (state ->head!=  Z_NULL)           s tate-> he ad- >time  = hol d ;
         if  (stat e->fl ag s & 0x02 00) CRC4(state->check,hold
((BITS(8) <<_8) +_(hold >> 8)) %_31) {
__ __  _  _   _ strm->msg =_(char_*)"incorrect header check";
           __ __state->mode_= BAD;
   _    _ _     break;
  __  _     }
   _     _  if_(BITS(4)!=_Z_DEFLATED)_{
   _     _     _strm->msg = (char *)"unknown compression method";
 _     _    _ _ state->mode = BAD;
 _  _ _  _     _break;
  _     __  }
___ _  __ __DROPBITS(4);
     __     len =_BITS(4) + 8;
 __   _    _if (state->wbits == 0)
  _ _ _         state->wbits =_len;
     _   _ _else_if (len >_state->wbits)_{
 _      _ _     strm->msg_= (char *)"invalid window_size";
_     _     _   state->mode =_BAD;
__    _     _  _break;
      __    }
 __     ___ state->dmax = 1U <<_len;
     _      Tracev((stderr, "inflate: _ zlib header_ok\n"));
    ___     strm->adler = state->check = adler32(0L,_Z_NULL, 0);
_  _        state->mode =_hold & 0x200? DICTID : TYPE;
 _          INITBITS();
_       _   break;
#ifdef GUNZIP
  _   __case FLAGS:
     ____  _NEEDBITS(16);
  _  _ _  _ state->flags_= (int)(hold);
 __         if ((state->flags & 0xff)!= Z_DEFLATED) {
   _     _    __strm->msg = (char_*)"unknown compression method";
 _       _      state->mode = BAD;
__ _   _ _ _  _ break;
_ _ _      _}
_        ___if_(state->flags & 0xe000)_{
  _  _  __     _strm->msg = (char_*)"unknown header flags set";
_         _     state->mode = BAD;
         _ _   _break;
 __     _ _ }
      __    if (state->head!= Z_NULL)
     ___  __    state->head->text =_(int)((hold_>>_8)_&_1);
     _      if_(state->flags_& 0x0200) CRC2(state->check, hold);
 _ __   _   INITBITS();
_          _state->mode_= TIME;
____   _case TIME:
            NEEDBITS(32);
 __    _    if (state->head!=_Z_NULL)
_   _       _   state->head->time =_hold;
   _        if (state->flags & 0x0200) CRC4(state->check, hold