function initState(s, input) {
    if (s.runningState != 0) {
      throw "State MUST be uninitialized";
    }
    s.blockTrees = new Int32Array(3091);
    s.blockTrees[0] = 7;
    s.distRbIdx = 3;
    let /** @type{number} */ maxDistanceAlphabetLimit = calculateDistanceAlphabetLimit(0x7FFFFFFC, 3, 15 << 3);
    s.distExtraBits = new Int8Array(maxDistanceAlphabetLimit);
    s.distOffset = new Int32Array(maxDistanceAlphabetLimit);
    s.input = input;
    initBitReader(s);
    s.runningState = 1;
  }
@param {!State} s
@param {!InputStream} input
@return {void}