function tr_static_init() {
  var n; /* iterates over tree elements */
  var bits; /* bit counter */
  var length; /* length value */
  var code; /* code value */
  var dist; /* distance index */
  var bl_count = new Array(MAX_BITS$1 + 1);
  /* number of codes at each bit length for an optimal tree */

  // do check in _tr_init()
  //if (static_init_done) return;

  /* For some embedded targets, global variables are not initialized: */
  /*#ifdef NO_INIT_GLOBAL_POINTERS
    static_l_desc.static_tree = static_ltree;
    static_l_desc.extra_bits = extra_lbits;
    static_d_desc.static_tree = static_dtree;
    static_d_desc.extra_bits = extra_dbits;
    static_bl_desc.extra_bits = extra_blbits;
  #endif*/

  /* Initialize the mapping length (0..255) -> length code (0..28) */
  length = 0;
  for (code = 0; code < LENGTH_CODES$1 - 1; code++) {
    base_length[code] = length;
    for (n = 0; n < (1 << extra_lbits[code]); n++) {
      _length_code[length++] = code;
    }
  }
  //Assert (length == 256, "tr_static_init: length != 256");
  /* Note that the length 255 (match length 258) can be represented
   * in two different ways: code 284 + 5 bits or code 285, so we
   * overwrite length_code[255] to use the best encoding:
   */
  _length_code[length - 1] = code;

  /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  dist = 0;
  for (code = 0; code < 16; code++) {
    base_dist[code] = dist;
    for (n = 0; n < (1 << extra_dbits[code]); n++) {
      _dist_code[dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: dist != 256");
  dist >>= 7; /* from now on, all distances are divided by 128 */
  for (; code < D_CODES$1; code++) {
    base_dist[code] = dist << 7;
    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
      _dist_code[256 + dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: 256+dist != 512");

  /* Construct the codes of the static literal tree */
  for (bits = 0; bits <= MAX_BITS$1; bits++) {
    bl_count[bits] = 0;
  }

  n = 0;
  while (n <= 143) {
    static_ltree[n * 2 + 1] /*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  while (n <= 255) {
    static_ltree[n * 2 + 1] /*.Len*/ = 9;
    n++;
    bl_count[9]++;
  }
  while (n <= 279) {
    static_ltree[n * 2 + 1] /*.Len*/ = 7;
    n++;
    bl_count[7]++;
  }
  while (n <= 287) {
    static_ltree[n * 2 + 1] /*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  /* Codes 286 and 287 do not exist, but we must include them in the
   * tree construction to get a canonical Huffman tree (longest code
   * all ones)
   */
  gen_codes(static_ltree, L_CODES$1 + 1, bl_count);

  /* The static distance tree is trivial: */
  for (n = 0; n < D_CODES$1; n++) {
    static_dtree[n * 2 + 1] /*.Len*/ = 5;
    static_dtree[n * 2] /*.Code*/ = bi_reverse(n, 5);
  }

  // Now data ready and we can init static trees
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);

  //static_init_done = true;
}
/* ===========================================================================
 * Initialize the various 'constant' tables.
 */
Initialize the various 'constant' tables.
Initialize the various ' constant ' tables .
function tr_static_init() {
  var n; 
  var bits; 
  var length; 
  var code; 
  var dist; 
  var bl_count = new Array(MAX_BITS$1 + 1);
  length = 0;
  for (code = 0; code < LENGTH_CODES$1 - 1; code++) {
    base_length[code] = length;
    for (n = 0; n < (1 << extra_lbits[code]); n++) {
      _length_code[length++] = code;
    }
  }
  _length_code[length - 1] = code;
  dist = 0;
  for (code = 0; code < 16; code++) {
    base_dist[code] = dist;
    for (n = 0; n < (1 << extra_dbits[code]); n++) {
      _dist_code[dist++] = code;
    }
  }
  dist >>= 7; 
  for (; code < D_CODES$1; code++) {
    base_dist[code] = dist << 7;
    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
      _dist_code[256 + dist++] = code;
    }
  }
  for (bits = 0; bits <= MAX_BITS$1; bits++) {
    bl_count[bits] = 0;
  }
  n = 0;
  while (n <= 143) {
    static_ltree[n * 2 + 1]  = 8;
    n++;
    bl_count[8]++;
  }
  while (n <= 255) {
    static_ltree[n * 2 + 1]  = 9;
    n++;
    bl_count[9]++;
  }
  while (n <= 279) {
    static_ltree[n * 2 + 1]  = 7;
    n++;
    bl_count[7]++;
  }
  while (n <= 287) {
    static_ltree[n * 2 + 1]  = 8;
    n++;
    bl_count[8]++;
  }
  gen_codes(static_ltree, L_CODES$1 + 1, bl_count);
  for (n = 0; n < D_CODES$1; n++) {
    static_dtree[n * 2 + 1]  = 5;
    static_dtree[n * 2]  = bi_reverse(n, 5);
  }
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);
}
function tr_static_init ( ) { var n ; var bits ; var length ; var code ; var dist ; var bl_count = new Array ( MAX_BITS$1 + 1 ) ; length = 0 ; for ( code = 0 ; code < LENGTH_CODES$1 - 1 ; code ++ ) { base_length [ code ] = length ; for ( n = 0 ; n < ( 1 << extra_lbits [ code ] ) ; n ++ ) { _length_code [ length ++ ] = code ; } } _length_code [ length - 1 ] = code ; dist = 0 ; for ( code = 0 ; code < 16 ; code ++ ) { base_dist [ code ] = dist ; for ( n = 0 ; n < ( 1 << extra_dbits [ code ] ) ; n ++ ) { _dist_code [ dist ++ ] = code ; } } dist >>= 7 ; for ( ; code < D_CODES$1 ; code ++ ) { base_dist [ code ] = dist << 7 ; for ( n = 0 ; n < ( 1 << ( extra_dbits [ code ] - 7 ) ) ; n ++ ) { _dist_code [ 256 + dist ++ ] = code ; } } for ( bits = 0 ; bits <= MAX_BITS$1 ; bits ++ ) { bl_count [ bits ] = 0 ; } n = 0 ; while ( n <= 143 ) { static_ltree [ n * 2 + 1 ] = 8 ; n ++ ; bl_count [ 8 ] ++ ; } while ( n <= 255 ) { static_ltree [ n * 2 + 1 ] = 9 ; n ++ ; bl_count [ 9 ] ++ ; } while ( n <= 279 ) { static_ltree [ n * 2 + 1 ] = 7 ; n ++ ; bl_count [ 7 ] ++ ; } while ( n <= 287 ) { static_ltree [ n * 2 + 1 ] = 8 ; n ++ ; bl_count [ 8 ] ++ ; } gen_codes ( static_ltree , L_CODES$1 + 1 , bl_count ) ; for ( n = 0 ; n < D_CODES$1 ; n ++ ) { static_dtree [ n * 2 + 1 ] = 5 ; static_dtree [ n * 2 ] = bi_reverse ( n , 5 ) ; } static_l_desc = new StaticTreeDesc ( static_ltree , extra_lbits , LITERALS$1 + 1 , L_CODES$1 , MAX_BITS$1 ) ; static_d_desc = new StaticTreeDesc ( static_dtree , extra_dbits , 0 , D_CODES$1 , MAX_BITS$1 ) ; static_bl_desc = new StaticTreeDesc ( new Array ( 0 ) , extra_blbits , 0 , BL_CODES$1 , MAX_BL_BITS ) ; }
Initialize the various 'constant' tables.
Initialize the various ' constant ' tables .
/* iterates over tree elements */ /* bit counter */ /* length value */ /* code value */ /* distance index */ /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() //if (static_init_done) return; /* For some embedded targets, global variables are not initialized: */ /*#ifdef NO_INIT_GLOBAL_POINTERS
    static_l_desc.static_tree = static_ltree;
    static_l_desc.extra_bits = extra_lbits;
    static_d_desc.static_tree = static_dtree;
    static_d_desc.extra_bits = extra_dbits;
    static_bl_desc.extra_bits = extra_blbits;
  #endif*/ /* Initialize the mapping length (0..255) -> length code (0..28) */ //Assert (length == 256, "tr_static_init: length != 256"); /* Note that the length 255 (match length 258) can be represented
   * in two different ways: code 284 + 5 bits or code 285, so we
   * overwrite length_code[255] to use the best encoding:
   */ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ //Assert (dist == 256, "tr_static_init: dist != 256"); /* from now on, all distances are divided by 128 */ //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ /*.Len*/ /*.Len*/ /*.Len*/ /*.Len*/ /* Codes 286 and 287 do not exist, but we must include them in the
   * tree construction to get a canonical Huffman tree (longest code
   * all ones)
   */ /* The static distance tree is trivial: */ /*.Len*/ /*.Code*/ // Now data ready and we can init static trees //static_init_done = true;