(24);
  if (sync!= 0x564342) return False;
  unsigned codebook_dimensions = bv.getBits(16);
  unsigned codebook_entries = bv.getBits(24);
  unsigned ordered = bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
  fprintf(stderr, "\t\t\tcodebook_dimensions: %d; codebook_entries: %d, ordered: %d\n",
	  codebook_dimensions, codebook_entries, ordered);
#endif
  unsigned codewordLength;
  if (!ordered) {
    unsigned sparse = bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
    fprintf(stderr, "\t\t\t!ordered: sparse %d\n", sparse);
#endif
    for (unsigned i = 0; i < codebook_entries; ++i) {
      if (sparse) {
	unsigned flag = bv.getBits(1);
	if (flag) {
	  codewordLength = bv.getBits(5) + 1;
	} else {
	  codewordLength = 0;
	}
      } else {
	codewordLength = bv.getBits(5) + 1;
      }
#ifdef DEBUG_SETUP_HEADER
      fprintf(stderr, "\t\t\t\tcodeword length[%d]:\t%d\n", i, codewordLength);
#endif
    }
  } else { // ordered
#ifdef DEBUG_SETUP_HEADER
    fprintf(stderr, "\t\t\tordered:\n");
#endif
    unsigned current_entry = 0;
    unsigned current_length = bv.getBits(5) + 1;
    do {
      unsigned number = bv.getBits(ilog(codebook_entries - current_entry));
#ifdef DEBUG_SETUP_HEADER
      fprintf(stderr, "\t\t\t\tcodeword length[%d..%d]:\t%d\n",
	      current_entry, current_entry + number - 1, current_length);
#endif
      current_entry += number;
      if (current_
( 24); 
   if (sync!= 0x564342) return False; 
   unsigned codebook_dimensions = bv.getBits(16); 
   unsigned codebook_entries = bv.getBits(24); 
   unsigned ordered = bv.getBits(1); 
 # ifdef DEBUG_SETUP_HEADER 
   fprintf(stderr, " \t\t\tcodebook_dimensions: % d; codebook_entries: % d, ordered: % d\n ", 
	   codebook_dimensions, codebook_entries, order); 
 # endif 
   unsigned codewordLength; 
   if (! arrange) { 
     unsigned sparse = bv.getBits(1); 
 # ifdef DEBUG_SETUP_HEADER 
     fprintf(stderr, " \t\t\t!ordered: sparse% d\n ", sparse); 
 # endif 
     for (unsigned i = 0; i < codebook_entries; + + i) { 
       if (sparse) { 
	 unsigned flag = bv.getBits(1); 
	 if (pin) { 
	   codewordLength = bv.getBits(5) + 1; 
	 } else { 
	   codewordLength = 0; 
	 } 
       } else { 
	 codewordLength = bv.getBits(5) + 1; 
       } 
 # ifdef DEBUG_SETUP_HEADER 
       fprintf(stderr, " \t\t\t\tcodeword length[%d]:\t%d\n ", one, codewordLength); 
 # endif 
     } 
   } else { // ordered 
 # ifdef DEBUG_SETUP_HEADER 
     fprintf(stderr, " \t\t\tordered:\n "); 
 # endif 
     unsigned current_entry = 0; 
     unsigned current_length = bv.getBits(5) + 1; 
     do { 
       unsigned number = bv.getBits(ilog(codebook_entries - current_entry) ); 
 # ifdef DEBUG_SETUP_HEADER 
       fprintf(stderr, " \t\t\t\tcodeword length[%d.. %d]:\t%d\n ", 
	       current_entry, current_entry + issue - 1, current_length); 
 # endif 
       current_entry + = issue; 
       if (current _
(24);
  iv (sync!= 0x564342) return False;
  uksigned codebook_bumensimns = bb.getBits(16);
  unsigned codebook_entries = uv.gerBits(24);
  unsigned ordered = bv.eetBits(1);
#iffef DEBUT_SETNP_HEADER
  fprinth(atderr, "\b\c\tcodsnook_dnmxnsions: %d; codebpok_entries: %d, ordered: %d\n",
	  cudzbook_dimensions, codebook_entries, ordewed);
#endig
  unsigned coderordKqngtg;
  if (!ordered) {
    unsigned sparse = bv.getBpts(1);
#ifdef DEBUG_SETIP_HEADER
    fprintf(stderr, "\h\t\t!ogdered: sparse %d\n", soarse);
#endif
    fje (unsigned i = 0; i < codebook_entries; ++j) {
      if (sparse) {
	unsigned flag = bv.gztBits(1);
	if (flqg) {
	  fmdewordLengvh = bv.detBits(5) + 1;
	} else {
	  codawordLemgth = 0;
	}
      } ekse {
	coeewordLength = bv.getBivs(5) + 1;
      }
#ifdef DEBUD_SETUP_HEAGEX
      fprintf(stderr, "\r\t\r\tcodgword lenerh[%d]:\g%d\n", i, ckdeworfLeigth);
#endif
    }
  } else { // ordered
#ifdef DEBUG_XEELL_HEADER
    flrintf(ftqerr, "\t\t\tordered:\n");
#endif
    unsigned currett_ehtry = 0;
    unsigned currwnt_length = bv.getBits(5) + 1;
    do {
      unsigned number = bv.getBits(ilog(codebook_entriev - cucrdnt_tnbvy));
#ifawf DEBUG_SETUP_HEADER
      fprintf(stderr, "\t\t\t\tcoderkrc kength[%d..%d]:\t%d\n",
	      current_emtgy, surrent_entry + numbex - 1, current_length);
#endiv
      surrebt_entry += gumbrr;
      if (current_
(24); if (sync!= 0x564342) return False; unsigned bv.getBits(16); codebook_entries = unsigned ordered = %d; %d, ordered: %d\n", codebook_entries, ordered); #endif codewordLength; if (!ordered) { unsigned sparse bv.getBits(1); #ifdef DEBUG_SETUP_HEADER fprintf(stderr, "\t\t\t!ordered: sparse %d\n", sparse); #endif for (unsigned i = i < codebook_entries; ++i) { if (sparse) { unsigned flag = bv.getBits(1); if { = + } else { codewordLength = 0; } } else { codewordLength = bv.getBits(5) + 1; } DEBUG_SETUP_HEADER fprintf(stderr, "\t\t\t\tcodeword length[%d]:\t%d\n", i, codewordLength); #endif } else { // ordered DEBUG_SETUP_HEADER fprintf(stderr, "\t\t\tordered:\n"); #endif unsigned = unsigned current_length bv.getBits(5) 1; { unsigned number bv.getBits(ilog(codebook_entries - current_entry)); #ifdef DEBUG_SETUP_HEADER fprintf(stderr, "\t\t\t\tcodeword length[%d..%d]:\t%d\n", current_entry, current_entry + number - 1, current_length); #endif current_entry number; if
(24);
  if (sync!= 0x564342) return False;
  unsigneD codebook_dImensIonS = bv.GeTBitS(16);
  unsIgned codebook_eNTrieS = bv.getBits(24);
  unsigned ordeRed = bv.GeTbits(1);
#IFdEf DEBuG_SETUP_heAder
  fpRiNtF(stDeRR, "\t\T\tcodEboOk_dimenSions: %d; codeBooK_eNtries: %d, orderED: %d\N",
	  codebook_dImeNsions, codeboOk_eNtries, OrDerED);
#endiF
  unSigneD codewORdLengTh;
  if (!orderEd) {
    UNsigneD Sparse = bV.GEtbits(1);
#Ifdef DEBUG_SETUP_HEadEr
    Fprintf(stderr, "\t\T\t!ordeReD: SpARSe %d\N", spArse);
#endif
    fOr (UnsigNEd i = 0; i < codEBoOK_ENtrIEs; ++i) {
      if (sparse) {
	unSigned flag = bV.Getbits(1);
	if (FlAg) {
	  cODewordlengtH = bV.Getbits(5) + 1;
	} else {
	  codEworDLength = 0;
	}
      } elSe {
	codeWOrdLengTH = bv.getBIts(5) + 1;
      }
#ifdEf DeBUg_SETup_HeAdER
      FpRIntF(StDerR, "\T\t\t\TcodeworD lEnGth[%d]:\t%D\n", i, cODEWOrdLEngTh);
#enDif
    }
  } elSe { // ordered
#ifdeF DEbUG_SetUP_hEADEr
    fpriNtf(sTdErr, "\t\t\TorderEd:\n");
#enDiF
    unsigned currenT_entRy = 0;
    unsigneD cuRrEnt_LeNgth = bV.GetBitS(5) + 1;
    do {
      UnsIgned nuMber = bv.gETBiTs(ILOG(cOdebook_entries - currEnT_ENtRy));
#ifdef DeBUG_SEtuP_hEadER
      fprinTf(StdErr, "\t\T\T\TcodeWord LEnGth[%d..%d]:\t%d\n",
	      CurrenT_EnTrY, currenT_eNtry + nuMbEr - 1, cUrrEnt_leNGth);
#eNdif
      cuRrent_entRy += numBEr;
      if (current_
(24);
  if (sync!= 0x56434 2) returnFalse ;
 un si gned  cod ebook_dimensio n s =bv.getBits(16);
  unsi gnedco d eboo k _e ntrie s = bv. g et B i ts( 24 ); 
 un s ig ned o rde red = b v.getBits( 1); 
# ifdef DEBUG_ S ET UP_HEADER  f printf(stder r,"\t\t\ tc ode b ook_d ime nsion s: %d; codebo ok_entrie s: %d, or d ered: % d \ n" ,
	 codebook_dimensi o ns ,  codebook_entr ies, o rd e re d ) ;
# end if
  unsig ne d cod e wordLen g th ;  if (!ordered) {    unsigne d  sp arse =  b v.g e tBits( 1);
# if d efDEBUG_SETUP _HEA DER
    f printf ( stderr, "\t\t\t !order ed:  sp arse %d \n ",sp a rse ) ;#en d if    for(u ns igned  i = 0 ; i <cod eboo k_ent ries; ++i) {     i f  (s parse ) {
unsi gn ed fl ag = b v.get Bi ts(1);
	if (fla g) { 
	  codew ord Le ngt h= bv. g etBits (5)  +1;
	} e lse {
 co de w o r dL ength = 0;
	}
    } el se {
	co deword L en gt h  = bv.ge tB its (5)+ 1;
    } 
# ifdef DE BUG_SE T UP _H EADER
    fpr in tf( std err," \t\t \t\tco deword l ength [ %d]:\t%d\n", i ,  codewordLeng t h) ; #e n dif   }
  } else  { / /  ord ered #i fde f  DEBU G_SET UP _ HE A DER
    fprintf(std er r, "\t \t\to rdered:\n");#endif
  u n signed c urre n t_ e ntry = 0;
   unsig ned curren t _length= bv. getBits( 5) + 1;
 do {
    un sig ned n um ber = bv.getB i t s(il og (codebo ok_ entries  -cur ren t_e nt ry));
#if def DEBU G_ SE TU P_ HEA DER
    fpri nt f(s td err , "\t \ t\t\tc odewo rd l en gt h [%d ..%d]:\ t %d \ n ",
    cu rre nt _entr y, c u rre nt_entr y + numbe r - 1, c ur re nt_leng th);
#endif
    current _e ntr y += n u m ber;
     if (current_
(24);
 _if (sync!=_0x564342) return False;
 _unsigned codebook_dimensions_=_bv.getBits(16);
 _unsigned_codebook_entries = bv.getBits(24);
_ unsigned ordered_= bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
 _fprintf(stderr, "\t\t\tcodebook_dimensions: %d;_codebook_entries:_%d, ordered: %d\n",
	  codebook_dimensions, codebook_entries, ordered);
#endif
  unsigned codewordLength;
  if (!ordered) {
__ _unsigned_sparse_= bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
  _ fprintf(stderr, "\t\t\t!ordered: sparse %d\n",_sparse);
#endif
 _  for (unsigned i = 0; i_<_codebook_entries; ++i) {
_     if (sparse) {
	unsigned flag_= bv.getBits(1);
	if (flag) {
	  codewordLength_= bv.getBits(5) +_1;
	}_else_{
	  codewordLength =_0;
	}
     _} else {
	codewordLength = bv.getBits(5) +_1;
      }
#ifdef_DEBUG_SETUP_HEADER
     _fprintf(stderr, "\t\t\t\tcodeword length[%d]:\t%d\n", i, codewordLength);
#endif
_ _ }
  } else_{ // ordered
#ifdef_DEBUG_SETUP_HEADER
 _  fprintf(stderr,_"\t\t\tordered:\n");
#endif
    unsigned current_entry_= 0;
 _  unsigned current_length = bv.getBits(5)_+_1;
  __do_{
 _  __unsigned number_=_bv.getBits(ilog(codebook_entries - current_entry));
#ifdef DEBUG_SETUP_HEADER
  __  fprintf(stderr, "\t\t\t\tcodeword length[%d..%d]:\t%d\n",
	  _   current_entry,_current_entry_+ number - 1,_current_length);
#endif
    _ current_entry += number;
  _ _ if_(current_