function decode(bytes, options) {
    let /** !State */ s = new State();
    initState(s, new InputStream(bytes));
    if (options) {
      let customDictionary =
          /** @type {?Int8Array} */ (options["customDictionary"]);
      if (customDictionary) attachDictionaryChunk(s, customDictionary);
    }
    let /** !number */ totalOutput = 0;
    let /** !Array<!Int8Array> */ chunks = [];
    while (true) {
      let /** !Int8Array */ chunk = new Int8Array(16384);
      chunks.push(chunk);
      s.output = chunk;
      s.outputOffset = 0;
      s.outputLength = 16384;
      s.outputUsed = 0;
      decompress(s);
      totalOutput += s.outputUsed;
      if (s.outputUsed < 16384) break;
    }
    close(s);
    let /** !Int8Array */ result = new Int8Array(totalOutput);
    let /** !number */ offset = 0;
    for (let /** !number */ i = 0; i < chunks.length; ++i) {
      let /** !Int8Array */ chunk = chunks[i];
      let /** !number */ end = min(totalOutput, offset + 16384);
      let /** !number */ len = end - offset;
      if (len < 16384) {
        result.set(chunk.subarray(0, len), offset);
      } else {
        result.set(chunk, offset);
      }
      offset += len;
    }
    return result;
  }
@param {!Int8Array} bytes
@param {Options=} options
@return {!Int8Array}