From be01292b590a53992c0defe77dbf7b046d2ce643 Mon Sep 17 00:00:00 2001 From: Harry-zklcdc <1269158832@qq.com> Date: Tue, 24 Oct 2023 21:39:40 +0800 Subject: [PATCH] =?UTF-8?q?[Add]=20=F0=9F=8E=89=20Cloudflare=20Worker=20De?= =?UTF-8?q?ploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudflare/bjs.js | 2181 ++++++++++++++++++++++++++++++++++++++++++ cloudflare/worker.js | 41 +- 2 files changed, 2217 insertions(+), 5 deletions(-) create mode 100644 cloudflare/bjs.js diff --git a/cloudflare/bjs.js b/cloudflare/bjs.js new file mode 100644 index 0000000000..d90be46490 --- /dev/null +++ b/cloudflare/bjs.js @@ -0,0 +1,2181 @@ +function BrotliDecodeCore(stdlib, foreign, heap) { + "use asm"; + + var H8 = new stdlib.Int8Array(heap); + var H16 = new stdlib.Int16Array(heap); + var H32 = new stdlib.Int32Array(heap); + + var imul = stdlib.Math.imul; + + var freeList = 0; + var DICTIONARY_DATA = 0; + var CODE_LENGTH_CODE_ORDER = 0; + var DICTIONARY_OFFSETS_BY_LENGTH = 0; + var DICTIONARY_SIZE_BITS_BY_LENGTH = 0; + var BLOCK_LENGTH_OFFSET = 0; + var BLOCK_LENGTH_N_BITS = 0; + var INSERT_LENGTH_OFFSET = 0; + var INSERT_LENGTH_N_BITS = 0; + var COPY_LENGTH_OFFSET = 0; + var COPY_LENGTH_N_BITS = 0; + var INSERT_RANGE_LUT = 0; + var COPY_RANGE_LUT = 0; + var LOOKUP = 0; + + var s_ringBuffer = 0; + var s_contextModes = 0; + var s_contextMap = 0; + var s_distContextMap = 0; + var s_output = 0; + var s_byteBuffer = 0; + var s_shortBuffer = 0; + var s_intBuffer = 0; + var s_rings = 0; + var s_blockTrees = 0; + var s_hGroup0 = 0; + var s_hGroup1 = 0; + var s_hGroup2 = 0; + var s_tmp0 = 0; + var s_tmp1 = 0; + var s_tmp2 = 0; + var s_tmp3 = 0; + var s_runningState = 0; + var s_nextRunningState = 0; + var s_accumulator32 = 0; + var s_bitOffset = 0; + var s_halfOffset = 0; + var s_tailBytes = 0; + var s_endOfStreamReached = 0; + var s_metaBlockLength = 0; + var s_inputEnd = 0; + var s_isUncompressed = 0; + var s_isMetadata = 0; + var s_literalBlockLength = 0; + var s_numLiteralBlockTypes = 0; + var s_commandBlockLength = 0; + var s_numCommandBlockTypes = 0; + var s_distanceBlockLength = 0; + var s_numDistanceBlockTypes = 0; + var s_pos = 0; + var s_maxDistance = 0; + var s_distRbIdx = 0; + var s_trivialLiteralContext = 0; + var s_literalTreeIndex = 0; + var s_literalTree = 0; + var s_j = 0; + var s_insertLength = 0; + var s_contextMapSlice = 0; + var s_distContextMapSlice = 0; + var s_contextLookupOffset1 = 0; + var s_contextLookupOffset2 = 0; + var s_treeCommandOffset = 0; + var s_distanceCode = 0; + var s_numDirectDistanceCodes = 0; + var s_distancePostfixMask = 0; + var s_distancePostfixBits = 0; + var s_distance = 0; + var s_copyLength = 0; + var s_copyDst = 0; + var s_maxBackwardDistance = 0; + var s_maxRingBufferSize = 0; + var s_ringBufferSize = 0; + var s_expectedTotalSize = 0; + var s_bytesToIgnore = 0; + var s_outputOffset = 0; + var s_outputLength = 0; + var s_outputUsed = 0; + var s_bytesWritten = 0; + var s_bytesToWrite = 0; + var s_error = 0; + var s_input = 0; + var TRANSFORMS = 0; + var PREFIX_SUFFIX = 0; + var PREFIX_SUFFIX_HEADS = 0; + + var prepareTransforms = foreign.prepareTransforms; + var prepareLookupTable = foreign.prepareLookupTable; + var prepareDictionaryData = foreign.prepareDictionaryData; + var readInput = foreign.readInput; + var closeInput = foreign.closeInput; + + function initHeap(len) { + len = len|0; + H32[0] = len|0; + H32[4 >> 2] = 4; + H32[8 >> 2] = (((len >> 2)|0) - 2)|0; + H32[12 >> 2] = 0; + freeList = 8; + } + + function zeroify(start, end) { + start = start|0; + end = end|0; + var cursor = 0; + cursor = start|0; + while ((cursor|0) < (end|0)) { + H32[cursor >> 2] = 0; + cursor = ((cursor|0) + 4)|0; + } + } + + function arraycopy(src, srcIdx, dst, dstIdx, size) { + src = src|0; + srcIdx = srcIdx|0; + dst = dst|0; + dstIdx = dstIdx|0; + size = size|0; + copyBytesWithin(0, ((dst|0) + (dstIdx|0))|0, ((src|0) + (srcIdx|0))|0, + ((src|0) + (srcIdx|0) + (size|0))|0); + } + + function copyBytesWithin(array, target, start, end) { + array = array|0; + target = target|0; + start = start|0; + end = end|0; + var to = 0; + var from = 0; + var limit = 0; + to = ((array|0) + (target|0))|0; + from = ((array|0) + (start|0))|0; + limit = ((array|0) + (end|0))|0; + while ((from|0) < (limit|0)) { + H8[to|0] = H8[from|0]; + to = ((to|0) + 1)|0; + from = ((from|0) + 1)|0; + } + } + + function fillBytesWithZeroes(dest, start, end) { + dest = dest|0; + start = start|0; + end = end | 0; + var cursor = 0; + var limit = 0; + cursor = ((dest|0) + (start|0))|0; + limit = ((dest|0) + (end|0))|0; + while ((cursor|0) < (limit|0)) { + H8[cursor] = 0; + cursor = ((cursor|0) + 1)|0; + } + } + + function fillIntsWithZeroes(dest, start, end) { + dest = dest|0; + start = start|0; + end = end | 0; + zeroify(((dest|0) + (start << 2))|0, (((dest|0) + (end << 2))|0)); + } + + function freeBlock(block) { + block = block|0; + var current = 0; + var len = 0; + var after = 0; + var blockLen = 0; + var prev = 0; + current = freeList|0; + blockLen = H32[block >> 2]|0; + if ((block|0) == 4) return; + while (1) { + if ((current|0) > (block|0)) { + H32[((block|0) + 4) >> 2] = current|0; + if ((prev|0) == 0) { + freeList = block|0; + } else { + H32[((prev|0) + 4) >> 2] = block|0; + } + current = block|0; + len = blockLen|0; + break; + } + len = H32[current >> 2]|0; + after = ((current|0) + (len|0))|0; + if ((after|0) == (block|0)) { + H32[current >> 2] = ((len|0) + (blockLen|0))|0; + break; + } + prev = current|0; + current = H32[((current|0) + 4) >> 2]|0; + } + len = H32[current >> 2]|0; + after = ((current|0) + (len|0))|0; + block = H32[((current|0) + 4) >> 2]|0; + if ((after|0) == (block|0)) { + H32[current >> 2] = ((len|0) + (H32[block >> 2]|0))|0; + H32[((current|0) + 4) >> 2] = H32[((block|0) + 4) >> 2]; + } + } + + function allocBlock(len32) { + len32 = len32|0; + var current = 0; + var len = 0; + var prev = 0; + var result = 0; + var next = 0; + current = freeList|0; + if ((len32|0) == 4) return 4; + while (1) { + len = H32[current >> 2]|0; + if ((len|0) >= (len32|0)) { + result = current|0; + if ((((len32|0) + 32)|0) >= (len|0)) { + current = H32[((current|0) + 4) >> 2]|0; + } else { + next = H32[((current|0) + 4) >> 2]|0; + H32[current >> 2] = len32|0; + current = ((current|0) + (len32|0))|0; + len = ((len|0) - (len32|0))|0; + H32[current >> 2] = len|0; + H32[((current|0) + 4) >> 2] = next|0; + } + if ((prev|0) == 0) { + freeList = current|0; + } else { + H32[((prev|0) + 4) >> 2] = current|0; + } + break; + } + prev = current|0; + current = H32[((current|0) + 4) >> 2]|0; + if ((current|0) == 0) break; + } + return result|0; + } + + function realloc(width, ptr, len) { + width = width|0; + ptr = ptr|0; + len = len|0; + var len32 = 0; + var n = 0; + var block = 0; + len32 = len|0; + if ((width|0) == 1) { + len32 = ((len|0) + 3) & 0xFFFFFFFC; + } else if ((width|0) == 2) { + len32 = ((len << 1) + 2) & 0xFFFFFFFC; + } else { + len32 = (len << 2) & 0xFFFFFFFC; + } + len32 = ((len32|0) + 4)|0; + if ((ptr|0) != 0) { + block = ((ptr|0) - 4)|0; + n = H32[block >> 2]|0; + if ((n|0) != 4) { + if ((n|0) >= (len32|0)) { + zeroify(ptr|0, ((block|0) + (len32|0))|0); + return ptr|0; + } + } + freeBlock(block|0); + } + return ((allocBlock(len32|0)|0) + 4)|0; + } + + function min(a, b) { + a = a|0; + b = b|0; + return (((a|0) <= (b|0)) ? (a|0) : (b|0))|0; + } + + function max(a, b) { + a = a|0; + b = b|0; + return (((a|0) >= (b|0)) ? (a|0) : (b|0))|0; + } + + function unpackLut(n, offset, bits, data, start, plus, bigStepFrom) { + n = (n | 0); + offset = (offset | 0); + bits = (bits | 0); + data = (data | 0); + start = (start | 0); + plus = (plus | 0); + bigStepFrom = (bigStepFrom | 0); + var src = 0; + var next = 0; + var value = 0; + var i = 0; + src = (data | 0); + next = (start | 0); + value = (plus | 0); + for (i = 0; (((i | 0) < (n | 0)) | 0); i = ((i | 0) + 1) | 0) { + H32[(((bits | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (next | 0); + H32[(((offset | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (value | 0); + value = ((value | 0) + ((1 << (next | 0)) | 0)) | 0; + next = ((next | 0) + (((src | 0) & 1) | 0)) | 0; + if ((((i | 0) >= (bigStepFrom | 0)) | 0)) + next = ((next | 0) + 2) | 0; + src = ((src | 0) >> 1) | 0; + } + H32[(((bits | 0) + (((((n | 0) - 1) | 0) << 2) | 0)) | 0) >> 2] = 24; + } + function unpackLuts(codeLengthCodeOrder, dictionaryOffset, dictionaryBits, blockLengthOffset, blockLengthBits, insertLengthOffset, insertLengthBits, copyLengthOffset, copyLengthBits, insertRange, copyRange) { + codeLengthCodeOrder = (codeLengthCodeOrder | 0); + dictionaryOffset = (dictionaryOffset | 0); + dictionaryBits = (dictionaryBits | 0); + blockLengthOffset = (blockLengthOffset | 0); + blockLengthBits = (blockLengthBits | 0); + insertLengthOffset = (insertLengthOffset | 0); + insertLengthBits = (insertLengthBits | 0); + copyLengthOffset = (copyLengthOffset | 0); + copyLengthBits = (copyLengthBits | 0); + insertRange = (insertRange | 0); + copyRange = (copyRange | 0); + var value = 0; + var i = 0; + var db = 0; + var delta = 0; + var irl = 0; + var crl = 0; + value = 0; + for (i = 0; (((i | 0) < 18) | 0); i = ((i | 0) + 1) | 0) { + if (((((((0x150 >> (i | 0)) | 0) & 1) | 0) != 0) | 0)) { + H32[(((codeLengthCodeOrder | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (((0x101100 >> (((((i | 0) - 4) | 0) << 2) | 0)) | 0) & 0xFF) | 0; + continue; + } + value = ((value | 0) + 1) | 0; + H32[(((codeLengthCodeOrder | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (value | 0); + } + db = 0xD136DCD; + value = 0; + for (i = 4; (((i | 0) < 25) | 0); i = ((i | 0) + 1) | 0) { + delta = ((((db | 0) >>> 30) | 0) & 3) | 0; + H32[(((dictionaryOffset | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (value | 0); + H32[(((dictionaryBits | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (((11 + (delta | 0)) | 0) - (((((i | 0) + 1) | 0) >> 2) | 0)) | 0; + value = ((value | 0) + (((i | 0) << (H32[(((dictionaryBits | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] | 0)) | 0)) | 0; + db = ((db | 0) & 0x3FFFFFFF) | 0; + db = ((((db | 0) + (db | 0)) | 0) + (db | 0)) | 0; + } + unpackLut(26, (blockLengthOffset | 0), (blockLengthBits | 0), 0xFE8888, 2, 1, 26); + unpackLut(24, (insertLengthOffset | 0), (insertLengthBits | 0), 0xFAAA0, 0, 0, 20); + unpackLut(24, (copyLengthOffset | 0), (copyLengthBits | 0), 0x3EAA80, 0, 2, 24); + irl = 0x29850; + crl = 0x26244; + for (i = 0; (((i | 0) < 9) | 0); i = ((i | 0) + 1) | 0) { + H32[(((insertRange | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = ((((irl | 0) & 3) | 0) << 3) | 0; + irl = ((irl | 0) >> 2) | 0; + H32[(((copyRange | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = ((((crl | 0) & 3) | 0) << 3) | 0; + crl = ((crl | 0) >> 2) | 0; + } + } + function decodeWindowBits() { + var n = 0; + if ((((readFewBits(1) | 0) == 0) | 0)) { + return 16; + } + n = readFewBits(3) | 0; + if ((((n | 0) != 0) | 0)) { + return ((17 + (n | 0)) | 0); + } + n = readFewBits(3) | 0; + if ((((n | 0) != 0) | 0)) { + return ((8 + (n | 0)) | 0); + } + return 17; + } + function initState(input) { + input = (input | 0); + var windowBits = 0; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_runningState | 0) != 0) | 0)) { + s_error = 102; + return; + } + s_blockTrees = realloc(4, (s_blockTrees | 0), 6480) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + s_input = (input | 0); + initBitReader(); + if ((((s_error | 0) != 0) | 0)) + return; + windowBits = decodeWindowBits() | 0; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((windowBits | 0) == 9) | 0)) { + s_error = 113; + return; + } + s_maxRingBufferSize = (1 << (windowBits | 0)) | 0; + s_maxBackwardDistance = ((s_maxRingBufferSize | 0) - 16) | 0; + s_runningState = 1; + } + function close() { + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_runningState | 0) == 0) | 0)) { + s_error = 116; + return; + } + if ((((s_runningState | 0) == 11) | 0)) { + return; + } + s_runningState = 11; + if ((((closeInput((s_input | 0)) | 0) < 0) | 0)) { + s_error = 106; + } + } + function decodeVarLenUnsignedByte() { + var n = 0; + if ((((readFewBits(1) | 0) != 0) | 0)) { + n = readFewBits(3) | 0; + if ((((n | 0) == 0) | 0)) { + return 1; + } else { + return (((readFewBits((n | 0)) | 0) + ((1 << (n | 0)) | 0)) | 0); + } + } + return 0; + } + function decodeMetaBlockLength() { + var sizeNibbles = 0; + var sizeBytes = 0; + var i = 0; + var bits = 0; + s_inputEnd = readFewBits(1) | 0; + s_metaBlockLength = 0; + s_isUncompressed = 0; + s_isMetadata = 0; + if ((((s_inputEnd | 0) != 0) | 0)) { + if ((((readFewBits(1) | 0) != 0) | 0)) { + return; + } + } + sizeNibbles = ((readFewBits(2) | 0) + 4) | 0; + if ((((sizeNibbles | 0) == 7) | 0)) { + s_isMetadata = 1; + if ((((readFewBits(1) | 0) != 0) | 0)) { + s_error = 112; + return; + } + sizeBytes = readFewBits(2) | 0; + if ((((sizeBytes | 0) == 0) | 0)) { + return; + } + for (i = 0; (((i | 0) < (sizeBytes | 0)) | 0); i = ((i | 0) + 1) | 0) { + bits = readFewBits(8) | 0; + if ((((bits | 0) == 0) | 0)) { + if ((((((i | 0) + 1) | 0) == (sizeBytes | 0)) | 0)) { + if ((((sizeBytes | 0) > 1) | 0)) { + s_error = 105; + return; + } + } + } + s_metaBlockLength = ((s_metaBlockLength | 0) | (((bits | 0) << (((i | 0) << 3) | 0)) | 0)) | 0; + } + } else { + for (i = 0; (((i | 0) < (sizeNibbles | 0)) | 0); i = ((i | 0) + 1) | 0) { + bits = readFewBits(4) | 0; + if ((((bits | 0) == 0) | 0)) { + if ((((((i | 0) + 1) | 0) == (sizeNibbles | 0)) | 0)) { + if ((((sizeNibbles | 0) > 4) | 0)) { + s_error = 105; + return; + } + } + } + s_metaBlockLength = ((s_metaBlockLength | 0) | (((bits | 0) << (((i | 0) << 2) | 0)) | 0)) | 0; + } + } + s_metaBlockLength = ((s_metaBlockLength | 0) + 1) | 0; + if ((((s_inputEnd | 0) == 0) | 0)) { + s_isUncompressed = readFewBits(1) | 0; + } + } + function readSymbol(table, offset) { + table = (table | 0); + offset = (offset | 0); + var val = 0; + var bits = 0; + var sym = 0; + var mask = 0; + val = (((s_accumulator32 | 0) >>> (s_bitOffset | 0)) | 0) | 0; + offset = ((offset | 0) + (((val | 0) & 0xFF) | 0)) | 0; + bits = ((H32[(((table | 0) + ((((offset | 0)) << 2) | 0)) | 0) >> 2] | 0) >> 16) | 0; + sym = ((H32[(((table | 0) + ((((offset | 0)) << 2) | 0)) | 0) >> 2] | 0) & 0xFFFF) | 0; + if ((((bits | 0) <= 8) | 0)) { + s_bitOffset = ((s_bitOffset | 0) + (bits | 0)) | 0; + return sym|0; + } + offset = ((offset | 0) + (sym | 0)) | 0; + mask = (((1 << (bits | 0)) | 0) - 1) | 0; + offset = ((offset | 0) + (((((val | 0) & (mask | 0)) | 0) >>> 8) | 0)) | 0; + s_bitOffset = ((s_bitOffset | 0) + (((((H32[(((table | 0) + ((((offset | 0)) << 2) | 0)) | 0) >> 2] | 0) >> 16) | 0) + 8) | 0)) | 0; + return (((H32[(((table | 0) + ((((offset | 0)) << 2) | 0)) | 0) >> 2] | 0) & 0xFFFF) | 0); + } + function readBlockLength(table, offset) { + table = (table | 0); + offset = (offset | 0); + var code = 0; + var n = 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + code = readSymbol((table | 0), (offset | 0)) | 0; + n = H32[(((BLOCK_LENGTH_N_BITS | 0) + ((((code | 0)) << 2) | 0)) | 0) >> 2] | 0; + return (((H32[(((BLOCK_LENGTH_OFFSET | 0) + ((((code | 0)) << 2) | 0)) | 0) >> 2] | 0) + (readBits((n | 0)) | 0)) | 0); + } + function translateShortCodes(code, ringBuffer, index) { + code = (code | 0); + ringBuffer = (ringBuffer | 0); + index = (index | 0); + var shift = 0; + var delta = 0; + if ((((code | 0) < 16) | 0)) { + shift = ((code | 0) << 1) | 0; + index = ((((index | 0) + ((0xAAAFFF1B >> (shift | 0)) | 0)) | 0) & 3) | 0; + delta = (((0xFA5FA500 >> (shift | 0)) | 0) & 3) | 0; + if ((((((shift | 0) & 3) | 0) == 0) | 0)) { + delta = -delta | 0; + } + return (((H32[(((ringBuffer | 0) + ((((index | 0)) << 2) | 0)) | 0) >> 2] | 0) + (delta | 0)) | 0); + } + return (((((code | 0) - 16) | 0) + 1) | 0); + } + function moveToFront(v, index) { + v = (v | 0); + index = (index | 0); + var value = 0; + value = H32[(((v | 0) + ((((index | 0)) << 2) | 0)) | 0) >> 2] | 0; + for (; (((index | 0) > 0) | 0); index = ((index | 0) - 1) | 0) { + H32[(((v | 0) + ((((index | 0)) << 2) | 0)) | 0) >> 2] = H32[(((v | 0) + (((((index | 0) - 1) | 0) << 2) | 0)) | 0) >> 2] | 0; + } + H32[(((v | 0) + (((0) << 2) | 0)) | 0) >> 2] = (value | 0); + } + function inverseMoveToFrontTransform(v, vLen) { + v = (v | 0); + vLen = (vLen | 0); + var mtf = 0; + var i = 0; + var index = 0; + mtf = (s_tmp0 | 0); + for (i = 0; (((i | 0) < 256) | 0); i = ((i | 0) + 1) | 0) { + H32[(((mtf | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (i | 0); + } + for (i = 0; (((i | 0) < (vLen | 0)) | 0); i = ((i | 0) + 1) | 0) { + index = ((H8[((v | 0) + (((i | 0)))) | 0] | 0) & 0xFF) | 0; + H8[((v | 0) + (((i | 0)))) | 0] = H32[(((mtf | 0) + ((((index | 0)) << 2) | 0)) | 0) >> 2] | 0; + if ((((index | 0) != 0) | 0)) { + moveToFront((mtf | 0), (index | 0)); + } + } + } + function readHuffmanCodeLengths(data, offset, alphabetSize) { + data = (data | 0); + offset = (offset | 0); + alphabetSize = (alphabetSize | 0); + var tableOffset = 0; + var symbol = 0; + var prevCodeLen = 0; + var repeat = 0; + var repeatCodeLen = 0; + var space = 0; + var p = 0; + var codeLen = 0; + var extraBits = 0; + var newLen = 0; + var oldRepeat = 0; + var repeatDelta = 0; + var i = 0; + tableOffset = ((offset | 0) + (alphabetSize | 0)) | 0; + symbol = 0; + prevCodeLen = 8; + repeat = 0; + repeatCodeLen = 0; + space = 32768; + buildHuffmanTable((data | 0), (tableOffset | 0), 5, 18); + while ((((symbol | 0) < (alphabetSize | 0)) | 0)) { + if ((((space | 0) <= 0) | 0)) { + break; + } + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + p = (((((s_accumulator32 | 0) >>> (s_bitOffset | 0)) | 0) | 0) & 31) | 0; + s_bitOffset = ((s_bitOffset | 0) + (((H32[(((data | 0) + (((((tableOffset | 0) + (p | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) >> 16) | 0)) | 0; + codeLen = ((H32[(((data | 0) + (((((tableOffset | 0) + (p | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) & 0xFFFF) | 0; + if ((((codeLen | 0) < 16) | 0)) { + repeat = 0; + H32[(((data | 0) + (((((offset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] = (codeLen | 0); + symbol = ((symbol | 0) + 1) | 0; + if ((((codeLen | 0) != 0) | 0)) { + prevCodeLen = (codeLen | 0); + space = ((space | 0) - ((32768 >> (codeLen | 0)) | 0)) | 0; + } + } else { + extraBits = ((codeLen | 0) - 14) | 0; + newLen = 0; + if ((((codeLen | 0) == 16) | 0)) { + newLen = (prevCodeLen | 0); + } + if ((((repeatCodeLen | 0) != (newLen | 0)) | 0)) { + repeat = 0; + repeatCodeLen = (newLen | 0); + } + oldRepeat = (repeat | 0); + if ((((repeat | 0) > 0) | 0)) { + repeat = ((repeat | 0) - 2) | 0; + repeat = ((repeat | 0) << (extraBits | 0)) | 0; + } + repeat = ((repeat | 0) + (((readFewBits((extraBits | 0)) | 0) + 3) | 0)) | 0; + repeatDelta = ((repeat | 0) - (oldRepeat | 0)) | 0; + if ((((((symbol | 0) + (repeatDelta | 0)) | 0) > (alphabetSize | 0)) | 0)) { + s_error = 108; + return; + } + for (i = 0; (((i | 0) < (repeatDelta | 0)) | 0); i = ((i | 0) + 1) | 0) { + H32[(((data | 0) + (((((offset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] = (repeatCodeLen | 0); + symbol = ((symbol | 0) + 1) | 0; + } + if ((((repeatCodeLen | 0) != 0) | 0)) { + space = ((space | 0) - (((repeatDelta | 0) << ((15 - (repeatCodeLen | 0)) | 0)) | 0)) | 0; + } + } + } + if ((((space | 0) != 0) | 0)) { + s_error = 109; + return; + } + fillIntsWithZeroes((data | 0), ((offset | 0) + (symbol | 0)) | 0, (tableOffset | 0)); + } + function checkDupes(symbols, offset, length) { + symbols = (symbols | 0); + offset = (offset | 0); + length = (length | 0); + var i = 0; + var j = 0; + for (i = 0; (((i | 0) < (((length | 0) - 1) | 0)) | 0); i = ((i | 0) + 1) | 0) { + for (j = ((i | 0) + 1) | 0; (((j | 0) < (length | 0)) | 0); j = ((j | 0) + 1) | 0) { + if ((((H32[(((symbols | 0) + (((((offset | 0) + (i | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) == (H32[(((symbols | 0) + (((((offset | 0) + (j | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0)) { + return 0; + } + } + } + return 1; + } + function readHuffmanCode(alphabetSize, table, offset) { + alphabetSize = (alphabetSize | 0); + table = (table | 0); + offset = (offset | 0); + var simpleCodeOrSkip = 0; + var maxBitsCounter = 0; + var maxBits = 0; + var symbolsOffset = 0; + var numSymbols = 0; + var i = 0; + var symbol = 0; + var space = 0; + var numCodes = 0; + var codeLenIdx = 0; + var p = 0; + var b = 0; + var v = 0; + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + simpleCodeOrSkip = readFewBits(2) | 0; + if ((((simpleCodeOrSkip | 0) == 1) | 0)) { + maxBitsCounter = ((alphabetSize | 0) - 1) | 0; + maxBits = 0; + symbolsOffset = ((offset | 0) + (alphabetSize | 0)) | 0; + numSymbols = ((readFewBits(2) | 0) + 1) | 0; + while ((((maxBitsCounter | 0) != 0) | 0)) { + maxBitsCounter = ((maxBitsCounter | 0) >> 1) | 0; + maxBits = ((maxBits | 0) + 1) | 0; + } + fillIntsWithZeroes((table | 0), (offset | 0), ((symbolsOffset | 0) + 4) | 0); + for (i = 0; (((i | 0) < (numSymbols | 0)) | 0); i = ((i | 0) + 1) | 0) { + symbol = ((readFewBits((maxBits | 0)) | 0) % (alphabetSize | 0)) | 0; + H32[(((table | 0) + (((((symbolsOffset | 0) + (i | 0)) | 0) << 2) | 0)) | 0) >> 2] = (symbol | 0); + H32[(((table | 0) + (((((offset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] = 2; + } + H32[(((table | 0) + (((((offset | 0) + (H32[(((table | 0) + (((((symbolsOffset | 0) + 0) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0) << 2) | 0)) | 0) >> 2] = 1; + switch(numSymbols|0) { + case 2: + H32[(((table | 0) + (((((offset | 0) + (H32[(((table | 0) + (((((symbolsOffset | 0) + 1) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0) << 2) | 0)) | 0) >> 2] = 1; + break; + case 4: + if ((((readFewBits(1) | 0) == 1) | 0)) { + H32[(((table | 0) + (((((offset | 0) + (H32[(((table | 0) + (((((symbolsOffset | 0) + 2) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0) << 2) | 0)) | 0) >> 2] = 3; + H32[(((table | 0) + (((((offset | 0) + (H32[(((table | 0) + (((((symbolsOffset | 0) + 3) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0) << 2) | 0)) | 0) >> 2] = 3; + } else { + H32[(((table | 0) + (((((offset | 0) + (H32[(((table | 0) + (((((symbolsOffset | 0) + 0) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0) << 2) | 0)) | 0) >> 2] = 2; + } + break; + default: + break; + } + if ((((checkDupes((table | 0), (symbolsOffset | 0), (numSymbols | 0)) | 0) == 0) | 0)) { + s_error = 107; + return; + } + } else { + space = 32; + numCodes = 0; + fillIntsWithZeroes((table | 0), ((offset | 0) + (alphabetSize | 0)) | 0, ((((offset | 0) + (alphabetSize | 0)) | 0) + 18) | 0); + for (i = (simpleCodeOrSkip | 0); (((i | 0) < 18) | 0); i = ((i | 0) + 1) | 0) { + if ((((space | 0) <= 0) | 0)) { + break; + } + codeLenIdx = H32[(((CODE_LENGTH_CODE_ORDER | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] | 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + p = (((((s_accumulator32 | 0) >>> (s_bitOffset | 0)) | 0) | 0) & 0xF) | 0; + b = ((((p | 0) << 2) | 0) & 0x1F) | 0; + s_bitOffset = ((s_bitOffset | 0) + ((2 + ((((0x20001000 >> (b | 0)) | 0) & 0xF) | 0)) | 0)) | 0; + v = (((((0x13402340 >> (b | 0)) | 0) & 0xF) | 0) + ((((p | 0) == 15) | 0) ? 4 : 0 | 0)) | 0; + H32[(((table | 0) + (((((((offset | 0) + (alphabetSize | 0)) | 0) + (codeLenIdx | 0)) | 0) << 2) | 0)) | 0) >> 2] = (v | 0); + if ((((v | 0) != 0) | 0)) { + space = ((space | 0) - ((32 >> (v | 0)) | 0)) | 0; + numCodes = ((numCodes | 0) + 1) | 0; + } + } + if ((((space | 0) != 0) | 0)) { + if ((((numCodes | 0) != 1) | 0)) { + s_error = 109; + return; + } + } + readHuffmanCodeLengths((table | 0), (offset | 0), (alphabetSize | 0)); + if ((((s_error | 0) != 0) | 0)) + return; + } + buildHuffmanTable((table | 0), (offset | 0), 8, (alphabetSize | 0)); + } + function decodeContextMap(contextMapSize, contextMap) { + contextMapSize = (contextMapSize | 0); + contextMap = (contextMap | 0); + var numTrees = 0; + var useRleForZeros = 0; + var maxRunLengthPrefix = 0; + var table = 0; + var i = 0; + var code = 0; + var reps = 0; + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return 0; + numTrees = ((decodeVarLenUnsignedByte() | 0) + 1) | 0; + if ((((numTrees | 0) == 1) | 0)) { + fillBytesWithZeroes((contextMap | 0), 0, (contextMapSize | 0)); + return numTrees|0; + } + useRleForZeros = readFewBits(1) | 0; + maxRunLengthPrefix = 0; + if ((((useRleForZeros | 0) != 0) | 0)) { + maxRunLengthPrefix = ((readFewBits(4) | 0) + 1) | 0; + } + table = (s_tmp0 | 0); + readHuffmanCode(((numTrees | 0) + (maxRunLengthPrefix | 0)) | 0, (table | 0), 0); + if ((((s_error | 0) != 0) | 0)) + return 0; + for (i = 0; (((i | 0) < (contextMapSize | 0)) | 0); ) { + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + code = readSymbol((table | 0), 0) | 0; + if ((((code | 0) == 0) | 0)) { + H8[((contextMap | 0) + (((i | 0)))) | 0] = 0; + i = ((i | 0) + 1) | 0; + } else if ((((code | 0) <= (maxRunLengthPrefix | 0)) | 0)) { + reps = (((1 << (code | 0)) | 0) + (readFewBits((code | 0)) | 0)) | 0; + while ((((reps | 0) != 0) | 0)) { + if ((((i | 0) >= (contextMapSize | 0)) | 0)) { + s_error = 103; + return 0; + } + H8[((contextMap | 0) + (((i | 0)))) | 0] = 0; + i = ((i | 0) + 1) | 0; + reps = ((reps | 0) - 1) | 0; + } + } else { + H8[((contextMap | 0) + (((i | 0)))) | 0] = (((code | 0) - (maxRunLengthPrefix | 0)) | 0); + i = ((i | 0) + 1) | 0; + } + } + if ((((readFewBits(1) | 0) == 1) | 0)) { + inverseMoveToFrontTransform((contextMap | 0), (contextMapSize | 0)); + } + return numTrees|0; + } + function decodeBlockTypeAndLength(treeType, numBlockTypes) { + treeType = (treeType | 0); + numBlockTypes = (numBlockTypes | 0); + var ringBuffers = 0; + var offset = 0; + var blockType = 0; + var result = 0; + ringBuffers = (s_rings | 0); + offset = (4 + (((treeType | 0) << 1) | 0)) | 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + blockType = readSymbol((s_blockTrees | 0), ((treeType | 0) * 1080) | 0) | 0; + result = readBlockLength((s_blockTrees | 0), ((((treeType | 0) + 3) | 0) * 1080) | 0) | 0; + if ((((blockType | 0) == 1) | 0)) { + blockType = ((H32[(((ringBuffers | 0) + (((((offset | 0) + 1) | 0) << 2) | 0)) | 0) >> 2] | 0) + 1) | 0; + } else if ((((blockType | 0) == 0) | 0)) { + blockType = H32[(((ringBuffers | 0) + ((((offset | 0)) << 2) | 0)) | 0) >> 2] | 0; + } else { + blockType = ((blockType | 0) - 2) | 0; + } + if ((((blockType | 0) >= (numBlockTypes | 0)) | 0)) { + blockType = ((blockType | 0) - (numBlockTypes | 0)) | 0; + } + H32[(((ringBuffers | 0) + ((((offset | 0)) << 2) | 0)) | 0) >> 2] = H32[(((ringBuffers | 0) + (((((offset | 0) + 1) | 0) << 2) | 0)) | 0) >> 2] | 0; + H32[(((ringBuffers | 0) + (((((offset | 0) + 1) | 0) << 2) | 0)) | 0) >> 2] = (blockType | 0); + return result|0; + } + function decodeLiteralBlockSwitch() { + var literalBlockType = 0; + var contextMode = 0; + s_literalBlockLength = decodeBlockTypeAndLength(0, (s_numLiteralBlockTypes | 0)) | 0; + literalBlockType = H32[(((s_rings | 0) + (((5) << 2) | 0)) | 0) >> 2] | 0; + s_contextMapSlice = ((literalBlockType | 0) << 6) | 0; + s_literalTreeIndex = ((H8[((s_contextMap | 0) + (((s_contextMapSlice | 0)))) | 0] | 0) & 0xFF) | 0; + s_literalTree = H32[(((s_hGroup0 | 0) + ((((s_literalTreeIndex | 0)) << 2) | 0)) | 0) >> 2] | 0; + contextMode = H8[((s_contextModes | 0) + (((literalBlockType | 0)))) | 0] | 0; + s_contextLookupOffset1 = ((contextMode | 0) << 9) | 0; + s_contextLookupOffset2 = ((s_contextLookupOffset1 | 0) + 256) | 0; + } + function decodeCommandBlockSwitch() { + s_commandBlockLength = decodeBlockTypeAndLength(1, (s_numCommandBlockTypes | 0)) | 0; + s_treeCommandOffset = H32[(((s_hGroup1 | 0) + (((H32[(((s_rings | 0) + (((7) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] | 0; + } + function decodeDistanceBlockSwitch() { + s_distanceBlockLength = decodeBlockTypeAndLength(2, (s_numDistanceBlockTypes | 0)) | 0; + s_distContextMapSlice = ((H32[(((s_rings | 0) + (((9) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0; + } + function maybeReallocateRingBuffer() { + { + if ((((s_ringBufferSize | 0) != 0) | 0)) { + return; + } + s_ringBufferSize = (s_maxRingBufferSize | 0); + s_ringBuffer = realloc(1, (s_ringBuffer | 0), ((s_ringBufferSize | 0) + 37) | 0) | 0; + } + } + function readNextMetablockHeader() { + if ((((s_inputEnd | 0) != 0) | 0)) { + s_nextRunningState = 10; + s_bytesToWrite = (s_pos | 0); + s_bytesWritten = 0; + s_runningState = 12; + return; + } + s_hGroup0 = realloc(4, (s_hGroup0 | 0), 0) | 0; + s_hGroup1 = realloc(4, (s_hGroup1 | 0), 0) | 0; + s_hGroup2 = realloc(4, (s_hGroup2 | 0), 0) | 0; + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + decodeMetaBlockLength(); + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_metaBlockLength | 0) == 0) | 0)) { + if ((((s_isMetadata | 0) == 0) | 0)) { + return; + } + } + if ((((s_isUncompressed | 0) != 0) | 0)) { + jumpToByteBoundary(); + if ((((s_error | 0) != 0) | 0)) + return; + s_runningState = 5; + } else if ((((s_isMetadata | 0) != 0) | 0)) { + jumpToByteBoundary(); + if ((((s_error | 0) != 0) | 0)) + return; + s_runningState = 4; + } else { + s_runningState = 2; + } + if ((((s_isMetadata | 0) != 0) | 0)) { + return; + } + s_expectedTotalSize = ((s_expectedTotalSize | 0) + (s_metaBlockLength | 0)) | 0; + if ((((s_expectedTotalSize | 0) > ((1 << 30) | 0)) | 0)) { + s_expectedTotalSize = (1 << 30) | 0; + } + if ((((s_ringBufferSize | 0) < (s_maxRingBufferSize | 0)) | 0)) { + maybeReallocateRingBuffer(); + if ((((s_error | 0) != 0) | 0)) + return; + } + } + function readMetablockPartition(treeType, numBlockTypes) { + treeType = (treeType | 0); + numBlockTypes = (numBlockTypes | 0); + if ((((numBlockTypes | 0) <= 1) | 0)) { + return ((1 << 28) | 0); + } + readHuffmanCode(((numBlockTypes | 0) + 2) | 0, (s_blockTrees | 0), ((treeType | 0) * 1080) | 0); + if ((((s_error | 0) != 0) | 0)) + return 0; + readHuffmanCode(26, (s_blockTrees | 0), ((((treeType | 0) + 3) | 0) * 1080) | 0); + if ((((s_error | 0) != 0) | 0)) + return 0; + return readBlockLength((s_blockTrees | 0), ((((treeType | 0) + 3) | 0) * 1080) | 0)|0; + } + function readMetablockHuffmanCodesAndContextMaps() { + var numDistanceCodes = 0; + var i = 0; + var limit = 0; + var numLiteralTrees = 0; + var j = 0; + var numDistTrees = 0; + s_numLiteralBlockTypes = ((decodeVarLenUnsignedByte() | 0) + 1) | 0; + s_literalBlockLength = readMetablockPartition(0, (s_numLiteralBlockTypes | 0)) | 0; + s_numCommandBlockTypes = ((decodeVarLenUnsignedByte() | 0) + 1) | 0; + s_commandBlockLength = readMetablockPartition(1, (s_numCommandBlockTypes | 0)) | 0; + s_numDistanceBlockTypes = ((decodeVarLenUnsignedByte() | 0) + 1) | 0; + s_distanceBlockLength = readMetablockPartition(2, (s_numDistanceBlockTypes | 0)) | 0; + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + s_distancePostfixBits = readFewBits(2) | 0; + s_numDirectDistanceCodes = (16 + (((readFewBits(4) | 0) << (s_distancePostfixBits | 0)) | 0)) | 0; + s_distancePostfixMask = (((1 << (s_distancePostfixBits | 0)) | 0) - 1) | 0; + numDistanceCodes = ((s_numDirectDistanceCodes | 0) + ((48 << (s_distancePostfixBits | 0)) | 0)) | 0; + s_contextModes = realloc(1, (s_contextModes | 0), (s_numLiteralBlockTypes | 0)) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + for (i = 0; (((i | 0) < (s_numLiteralBlockTypes | 0)) | 0); ) { + limit = min(((i | 0) + 96) | 0, (s_numLiteralBlockTypes | 0)) | 0; + for (; (((i | 0) < (limit | 0)) | 0); i = ((i | 0) + 1) | 0) { + H8[((s_contextModes | 0) + (((i | 0)))) | 0] = (readFewBits(2) | 0); + } + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + } + s_contextMap = realloc(1, (s_contextMap | 0), ((s_numLiteralBlockTypes | 0) << 6) | 0) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + numLiteralTrees = decodeContextMap(((s_numLiteralBlockTypes | 0) << 6) | 0, (s_contextMap | 0)) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + s_trivialLiteralContext = 1; + for (j = 0; (((j | 0) < (((s_numLiteralBlockTypes | 0) << 6) | 0)) | 0); j = ((j | 0) + 1) | 0) { + if ((((H8[((s_contextMap | 0) + (((j | 0)))) | 0] | 0) != (((j | 0) >> 6) | 0)) | 0)) { + s_trivialLiteralContext = 0; + break; + } + } + s_distContextMap = realloc(1, (s_distContextMap | 0), ((s_numDistanceBlockTypes | 0) << 2) | 0) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + numDistTrees = decodeContextMap(((s_numDistanceBlockTypes | 0) << 2) | 0, (s_distContextMap | 0)) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + s_hGroup0 = realloc(4, (s_hGroup0 | 0), ((numLiteralTrees | 0) * 1081) | 0) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + decodeHuffmanTreeGroup((s_hGroup0 | 0), 256, (numLiteralTrees | 0)); + if ((((s_error | 0) != 0) | 0)) + return; + s_hGroup1 = realloc(4, (s_hGroup1 | 0), ((s_numCommandBlockTypes | 0) * 1081) | 0) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + decodeHuffmanTreeGroup((s_hGroup1 | 0), 704, (s_numCommandBlockTypes | 0)); + if ((((s_error | 0) != 0) | 0)) + return; + s_hGroup2 = realloc(4, (s_hGroup2 | 0), ((numDistTrees | 0) * 1081) | 0) | 0; + if ((((s_error | 0) != 0) | 0)) + return; + decodeHuffmanTreeGroup((s_hGroup2 | 0), (numDistanceCodes | 0), (numDistTrees | 0)); + if ((((s_error | 0) != 0) | 0)) + return; + s_contextMapSlice = 0; + s_distContextMapSlice = 0; + s_contextLookupOffset1 = ((H8[((s_contextModes | 0) + ((0))) | 0] | 0) << 9) | 0; + s_contextLookupOffset2 = ((s_contextLookupOffset1 | 0) + 256) | 0; + s_literalTreeIndex = 0; + s_literalTree = H32[(((s_hGroup0 | 0) + (((0) << 2) | 0)) | 0) >> 2] | 0; + s_treeCommandOffset = H32[(((s_hGroup1 | 0) + (((0) << 2) | 0)) | 0) >> 2] | 0; + H32[(((s_rings | 0) + (((4) << 2) | 0)) | 0) >> 2] = 1; + H32[(((s_rings | 0) + (((5) << 2) | 0)) | 0) >> 2] = 0; + H32[(((s_rings | 0) + (((6) << 2) | 0)) | 0) >> 2] = 1; + H32[(((s_rings | 0) + (((7) << 2) | 0)) | 0) >> 2] = 0; + H32[(((s_rings | 0) + (((8) << 2) | 0)) | 0) >> 2] = 1; + H32[(((s_rings | 0) + (((9) << 2) | 0)) | 0) >> 2] = 0; + } + function copyUncompressedData() { + var ringBuffer = 0; + var chunkLength = 0; + ringBuffer = (s_ringBuffer | 0); + if ((((s_metaBlockLength | 0) <= 0) | 0)) { + reload(); + s_runningState = 1; + return; + } + chunkLength = min(((s_ringBufferSize | 0) - (s_pos | 0)) | 0, (s_metaBlockLength | 0)) | 0; + copyBytes((ringBuffer | 0), (s_pos | 0), (chunkLength | 0)); + if ((((s_error | 0) != 0) | 0)) + return; + s_metaBlockLength = ((s_metaBlockLength | 0) - (chunkLength | 0)) | 0; + s_pos = ((s_pos | 0) + (chunkLength | 0)) | 0; + if ((((s_pos | 0) == (s_ringBufferSize | 0)) | 0)) { + s_nextRunningState = 5; + s_bytesToWrite = (s_ringBufferSize | 0); + s_bytesWritten = 0; + s_runningState = 12; + return; + } + reload(); + s_runningState = 1; + } + function writeRingBuffer() { + var toWrite = 0; + var result = 0; + if ((((s_bytesToIgnore | 0) != 0) | 0)) { + s_bytesWritten = ((s_bytesWritten | 0) + (s_bytesToIgnore | 0)) | 0; + s_bytesToIgnore = 0; + } + toWrite = min(((s_outputLength | 0) - (s_outputUsed | 0)) | 0, ((s_bytesToWrite | 0) - (s_bytesWritten | 0)) | 0) | 0; + if ((((toWrite | 0) != 0) | 0)) { + arraycopy((s_ringBuffer | 0), (s_bytesWritten | 0), (s_output | 0), ((s_outputOffset | 0) + (s_outputUsed | 0)) | 0, (toWrite | 0)); + s_outputUsed = ((s_outputUsed | 0) + (toWrite | 0)) | 0; + s_bytesWritten = ((s_bytesWritten | 0) + (toWrite | 0)) | 0; + } + if ((((s_outputUsed | 0) < (s_outputLength | 0)) | 0)) { + result = 1; + } + return result|0; + } + function decodeHuffmanTreeGroup(group, alphabetSize, n) { + group = (group | 0); + alphabetSize = (alphabetSize | 0); + n = (n | 0); + var next = 0; + var i = 0; + next = (n | 0); + for (i = 0; (((i | 0) < (n | 0)) | 0); i = ((i | 0) + 1) | 0) { + H32[(((group | 0) + ((((i | 0)) << 2) | 0)) | 0) >> 2] = (next | 0); + readHuffmanCode((alphabetSize | 0), (group | 0), (next | 0)); + if ((((s_error | 0) != 0) | 0)) + return; + next = ((next | 0) + 1080) | 0; + } + } + function decompress() { + var ringBufferSize = 0; + var ringBufferMask = 0; + var ringBuffer = 0; + var cmdCode = 0; + var rangeIdx = 0; + var insertCode = 0; + var copyCode = 0; + var prevByte1 = 0; + var prevByte2 = 0; + var literalTreeIndex = 0; + var distContext = 0; + var postfix = 0; + var n = 0; + var offset = 0; + var src = 0; + var dst = 0; + var copyLength = 0; + var k = 0; + var wordId = 0; + var shift = 0; + var mask = 0; + var wordIdx = 0; + var transformIdx = 0; + var len = 0; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_runningState | 0) == 0) | 0)) { + s_error = 116; + return; + } + if ((((s_runningState | 0) == 11) | 0)) { + s_error = 101; + return; + } + ringBufferSize = (s_ringBufferSize | 0); + ringBufferMask = ((ringBufferSize | 0) - 1) | 0; + ringBuffer = (s_ringBuffer | 0); + while ((((s_runningState | 0) != 10) | 0)) { + switch(s_runningState|0) { + case 1: + if ((((s_metaBlockLength | 0) < 0) | 0)) { + s_error = 111; + return; + } + readNextMetablockHeader(); + if ((((s_error | 0) != 0) | 0)) + return; + ringBufferSize = (s_ringBufferSize | 0); + ringBufferMask = ((ringBufferSize | 0) - 1) | 0; + ringBuffer = (s_ringBuffer | 0); + continue; + case 2: + readMetablockHuffmanCodesAndContextMaps(); + if ((((s_error | 0) != 0) | 0)) + return; + s_runningState = 3; + case 3: + if ((((s_metaBlockLength | 0) <= 0) | 0)) { + s_runningState = 1; + continue; + } + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_commandBlockLength | 0) == 0) | 0)) { + decodeCommandBlockSwitch(); + } + s_commandBlockLength = ((s_commandBlockLength | 0) - 1) | 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + cmdCode = readSymbol((s_hGroup1 | 0), (s_treeCommandOffset | 0)) | 0; + rangeIdx = ((cmdCode | 0) >>> 6) | 0; + s_distanceCode = 0; + if ((((rangeIdx | 0) >= 2) | 0)) { + rangeIdx = ((rangeIdx | 0) - 2) | 0; + s_distanceCode = -1; + } + insertCode = ((H32[(((INSERT_RANGE_LUT | 0) + ((((rangeIdx | 0)) << 2) | 0)) | 0) >> 2] | 0) + (((((cmdCode | 0) >>> 3) | 0) & 7) | 0)) | 0; + copyCode = ((H32[(((COPY_RANGE_LUT | 0) + ((((rangeIdx | 0)) << 2) | 0)) | 0) >> 2] | 0) + (((cmdCode | 0) & 7) | 0)) | 0; + s_insertLength = ((H32[(((INSERT_LENGTH_OFFSET | 0) + ((((insertCode | 0)) << 2) | 0)) | 0) >> 2] | 0) + (readBits(H32[(((INSERT_LENGTH_N_BITS | 0) + ((((insertCode | 0)) << 2) | 0)) | 0) >> 2] | 0) | 0)) | 0; + s_copyLength = ((H32[(((COPY_LENGTH_OFFSET | 0) + ((((copyCode | 0)) << 2) | 0)) | 0) >> 2] | 0) + (readBits(H32[(((COPY_LENGTH_N_BITS | 0) + ((((copyCode | 0)) << 2) | 0)) | 0) >> 2] | 0) | 0)) | 0; + s_j = 0; + s_runningState = 6; + case 6: + if ((((s_trivialLiteralContext | 0) != 0) | 0)) { + while ((((s_j | 0) < (s_insertLength | 0)) | 0)) { + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_literalBlockLength | 0) == 0) | 0)) { + decodeLiteralBlockSwitch(); + } + s_literalBlockLength = ((s_literalBlockLength | 0) - 1) | 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + H8[((ringBuffer | 0) + (((s_pos | 0)))) | 0] = readSymbol((s_hGroup0 | 0), (s_literalTree | 0)) | 0; + s_j = ((s_j | 0) + 1) | 0; + s_pos = ((s_pos | 0) + 1) | 0; + if ((((s_pos | 0) == (ringBufferSize | 0)) | 0)) { + s_nextRunningState = 6; + s_bytesToWrite = (ringBufferSize | 0); + s_bytesWritten = 0; + s_runningState = 12; + break; + } + } + } else { + prevByte1 = ((H8[((ringBuffer | 0) + ((((((s_pos | 0) - 1) | 0) & (ringBufferMask | 0)) | 0))) | 0] | 0) & 0xFF) | 0; + prevByte2 = ((H8[((ringBuffer | 0) + ((((((s_pos | 0) - 2) | 0) & (ringBufferMask | 0)) | 0))) | 0] | 0) & 0xFF) | 0; + while ((((s_j | 0) < (s_insertLength | 0)) | 0)) { + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_literalBlockLength | 0) == 0) | 0)) { + decodeLiteralBlockSwitch(); + } + literalTreeIndex = ((H8[((s_contextMap | 0) + ((((s_contextMapSlice | 0) + (((H32[(((LOOKUP | 0) + (((((s_contextLookupOffset1 | 0) + (prevByte1 | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) | (H32[(((LOOKUP | 0) + (((((s_contextLookupOffset2 | 0) + (prevByte2 | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0)) | 0)) | 0))) | 0] | 0) & 0xFF) | 0; + s_literalBlockLength = ((s_literalBlockLength | 0) - 1) | 0; + prevByte2 = (prevByte1 | 0); + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + prevByte1 = readSymbol((s_hGroup0 | 0), H32[(((s_hGroup0 | 0) + ((((literalTreeIndex | 0)) << 2) | 0)) | 0) >> 2] | 0) | 0; + H8[((ringBuffer | 0) + (((s_pos | 0)))) | 0] = (prevByte1 | 0); + s_j = ((s_j | 0) + 1) | 0; + s_pos = ((s_pos | 0) + 1) | 0; + if ((((s_pos | 0) == (ringBufferSize | 0)) | 0)) { + s_nextRunningState = 6; + s_bytesToWrite = (ringBufferSize | 0); + s_bytesWritten = 0; + s_runningState = 12; + break; + } + } + } + if ((((s_runningState | 0) != 6) | 0)) { + continue; + } + s_metaBlockLength = ((s_metaBlockLength | 0) - (s_insertLength | 0)) | 0; + if ((((s_metaBlockLength | 0) <= 0) | 0)) { + s_runningState = 3; + continue; + } + if ((((s_distanceCode | 0) < 0) | 0)) { + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_distanceBlockLength | 0) == 0) | 0)) { + decodeDistanceBlockSwitch(); + } + s_distanceBlockLength = ((s_distanceBlockLength | 0) - 1) | 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + distContext = H8[((s_distContextMap | 0) + ((((s_distContextMapSlice | 0) + ((((s_copyLength | 0) > 4) | 0) ? 3 : (((s_copyLength | 0) - 2) | 0) | 0)) | 0))) | 0] | 0; + s_distanceCode = readSymbol((s_hGroup2 | 0), H32[(((s_hGroup2 | 0) + (((((distContext | 0) & 0xFF) | 0) << 2) | 0)) | 0) >> 2] | 0) | 0; + if ((((s_distanceCode | 0) >= (s_numDirectDistanceCodes | 0)) | 0)) { + s_distanceCode = ((s_distanceCode | 0) - (s_numDirectDistanceCodes | 0)) | 0; + postfix = ((s_distanceCode | 0) & (s_distancePostfixMask | 0)) | 0; + s_distanceCode = ((s_distanceCode | 0) >>> (s_distancePostfixBits | 0)) | 0; + n = ((((s_distanceCode | 0) >>> 1) | 0) + 1) | 0; + offset = (((((2 + (((s_distanceCode | 0) & 1) | 0)) | 0) << (n | 0)) | 0) - 4) | 0; + s_distanceCode = ((((s_numDirectDistanceCodes | 0) + (postfix | 0)) | 0) + (((((offset | 0) + (readBits((n | 0)) | 0)) | 0) << (s_distancePostfixBits | 0)) | 0)) | 0; + } + } + s_distance = translateShortCodes((s_distanceCode | 0), (s_rings | 0), (s_distRbIdx | 0)) | 0; + if ((((s_distance | 0) < 0) | 0)) { + s_error = 114; + return; + } + if ((((s_maxDistance | 0) != (s_maxBackwardDistance | 0)) | 0)) { + if ((((s_pos | 0) < (s_maxBackwardDistance | 0)) | 0)) { + s_maxDistance = (s_pos | 0); + } else { + s_maxDistance = (s_maxBackwardDistance | 0); + } + } + s_copyDst = (s_pos | 0); + if ((((s_distance | 0) > (s_maxDistance | 0)) | 0)) { + s_runningState = 9; + continue; + } + if ((((s_distanceCode | 0) > 0) | 0)) { + H32[(((s_rings | 0) + (((((s_distRbIdx | 0) & 3) | 0) << 2) | 0)) | 0) >> 2] = (s_distance | 0); + s_distRbIdx = ((s_distRbIdx | 0) + 1) | 0; + } + if ((((s_copyLength | 0) > (s_metaBlockLength | 0)) | 0)) { + s_error = 110; + return; + } + s_j = 0; + s_runningState = 7; + case 7: + src = ((((s_pos | 0) - (s_distance | 0)) | 0) & (ringBufferMask | 0)) | 0; + dst = (s_pos | 0); + copyLength = ((s_copyLength | 0) - (s_j | 0)) | 0; + if ((((((max((src | 0), (dst | 0)) | 0) + (copyLength | 0)) | 0) < (ringBufferMask | 0)) | 0)) { + for (k = 0; (((k | 0) < (copyLength | 0)) | 0); k = ((k | 0) + 1) | 0) { + H8[((ringBuffer | 0) + (((dst | 0)))) | 0] = H8[((ringBuffer | 0) + (((src | 0)))) | 0] | 0; + src = ((src | 0) + 1) | 0; + dst = ((dst | 0) + 1) | 0; + } + s_j = ((s_j | 0) + (copyLength | 0)) | 0; + s_metaBlockLength = ((s_metaBlockLength | 0) - (copyLength | 0)) | 0; + s_pos = ((s_pos | 0) + (copyLength | 0)) | 0; + } else { + for (; (((s_j | 0) < (s_copyLength | 0)) | 0); ) { + H8[((ringBuffer | 0) + (((s_pos | 0)))) | 0] = H8[((ringBuffer | 0) + ((((((s_pos | 0) - (s_distance | 0)) | 0) & (ringBufferMask | 0)) | 0))) | 0] | 0; + s_metaBlockLength = ((s_metaBlockLength | 0) - 1) | 0; + s_j = ((s_j | 0) + 1) | 0; + s_pos = ((s_pos | 0) + 1) | 0; + if ((((s_pos | 0) == (ringBufferSize | 0)) | 0)) { + s_nextRunningState = 7; + s_bytesToWrite = (ringBufferSize | 0); + s_bytesWritten = 0; + s_runningState = 12; + break; + } + } + } + if ((((s_runningState | 0) == 7) | 0)) { + s_runningState = 3; + } + continue; + case 9: + if ((((s_copyLength | 0) < 4) | 0)) { + s_error = 110; + return; + } else if ((((s_copyLength | 0) > 24) | 0)) { + s_error = 110; + return; + } + offset = H32[(((DICTIONARY_OFFSETS_BY_LENGTH | 0) + ((((s_copyLength | 0)) << 2) | 0)) | 0) >> 2] | 0; + wordId = ((((s_distance | 0) - (s_maxDistance | 0)) | 0) - 1) | 0; + shift = H32[(((DICTIONARY_SIZE_BITS_BY_LENGTH | 0) + ((((s_copyLength | 0)) << 2) | 0)) | 0) >> 2] | 0; + mask = (((1 << (shift | 0)) | 0) - 1) | 0; + wordIdx = ((wordId | 0) & (mask | 0)) | 0; + transformIdx = ((wordId | 0) >>> (shift | 0)) | 0; + offset = ( + (offset | 0) + + + (imul(wordIdx | 0, s_copyLength | 0)|0) + ) | 0; + if ((((transformIdx | 0) >= 121) | 0)) { + s_error = 110; + return; + } + len = transformDictionaryWord((ringBuffer | 0), (s_copyDst | 0), (DICTIONARY_DATA | 0), (offset | 0), (s_copyLength | 0), (transformIdx | 0)) | 0; + s_copyDst = ((s_copyDst | 0) + (len | 0)) | 0; + s_pos = ((s_pos | 0) + (len | 0)) | 0; + s_metaBlockLength = ((s_metaBlockLength | 0) - (len | 0)) | 0; + if ((((s_copyDst | 0) >= (ringBufferSize | 0)) | 0)) { + s_nextRunningState = 8; + s_bytesToWrite = (ringBufferSize | 0); + s_bytesWritten = 0; + s_runningState = 12; + continue; + } + s_runningState = 3; + continue; + case 8: + copyBytesWithin((ringBuffer | 0), 0, (ringBufferSize | 0), (s_copyDst | 0)); + s_runningState = 3; + continue; + case 4: + while ((((s_metaBlockLength | 0) > 0) | 0)) { + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + transformIdx = readFewBits(8)|0; + s_metaBlockLength = ((s_metaBlockLength | 0) - 1) | 0; + } + s_runningState = 1; + continue; + case 5: + copyUncompressedData(); + if ((((s_error | 0) != 0) | 0)) + return; + continue; + case 12: + if ((((writeRingBuffer() | 0) == 0) | 0)) { + return; + } + if ((((s_pos | 0) >= (s_maxBackwardDistance | 0)) | 0)) { + s_maxDistance = (s_maxBackwardDistance | 0); + } + s_pos = ((s_pos | 0) & (ringBufferMask | 0)) | 0; + s_runningState = (s_nextRunningState | 0); + continue; + default: + s_error = 121; + return; + } + } + if ((((s_runningState | 0) == 10) | 0)) { + if ((((s_metaBlockLength | 0) < 0) | 0)) { + s_error = 111; + return; + } + jumpToByteBoundary(); + if ((((s_error | 0) != 0) | 0)) + return; + checkHealth(1); + if ((((s_error | 0) != 0) | 0)) + return; + } + } + + function transformDictionaryWord(dst, dstOffset, data, wordOffset, len, transformIndex) { + dst = (dst | 0); + dstOffset = (dstOffset | 0); + data = (data | 0); + wordOffset = (wordOffset | 0); + len = (len | 0); + transformIndex = (transformIndex | 0); + var offset = 0; + var transformOffset = 0; + var transformPrefix = 0; + var transformType = 0; + var transformSuffix = 0; + var omitFirst = 0; + var i = 0; + var uppercaseOffset = 0; + var tmp = 0; + offset = (dstOffset | 0); + transformOffset = (3 * (transformIndex | 0)) | 0; + transformPrefix = H32[(((PREFIX_SUFFIX_HEADS | 0) + (((H32[(((TRANSFORMS | 0) + ((((transformOffset | 0)) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] | 0; + transformType = H32[(((TRANSFORMS | 0) + (((((transformOffset | 0) + 1) | 0) << 2) | 0)) | 0) >> 2] | 0; + transformSuffix = H32[(((PREFIX_SUFFIX_HEADS | 0) + (((H32[(((TRANSFORMS | 0) + (((((transformOffset | 0) + 2) | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] | 0; + while ((((H8[((PREFIX_SUFFIX | 0) + (((transformPrefix | 0)))) | 0] | 0) != 0) | 0)) { + H8[((dst | 0) + (((offset | 0)))) | 0] = H8[((PREFIX_SUFFIX | 0) + (((transformPrefix | 0)))) | 0] | 0; + transformPrefix = ((transformPrefix | 0) + 1) | 0; + offset = ((offset | 0) + 1) | 0; + } + omitFirst = (((transformType | 0) >= 12) | 0) ? (((transformType | 0) - 11) | 0) : 0 | 0; + if ((((omitFirst | 0) > (len | 0)) | 0)) { + omitFirst = (len | 0); + } + wordOffset = ((wordOffset | 0) + (omitFirst | 0)) | 0; + len = ((len | 0) - (omitFirst | 0)) | 0; + len = ((len | 0) - ((((transformType | 0) <= 9) | 0) ? (transformType | 0) : 0 | 0)) | 0; + i = (len | 0); + while ((((i | 0) > 0) | 0)) { + H8[((dst | 0) + (((offset | 0)))) | 0] = H8[((data | 0) + (((wordOffset | 0)))) | 0] | 0; + wordOffset = ((wordOffset | 0) + 1) | 0; + offset = ((offset | 0) + 1) | 0; + i = ((i | 0) - 1) | 0; + } + if ((((transformType | 0) <= 11) | 0)) { + if ((((transformType | 0) >= 10) | 0)) { + uppercaseOffset = ((offset | 0) - (len | 0)) | 0; + if ((((transformType | 0) == 10) | 0)) { + len = 1; + } + while ((((len | 0) > 0) | 0)) { + tmp = ((H8[((dst | 0) + (((uppercaseOffset | 0)))) | 0] | 0) & 0xFF) | 0; + if ((((tmp | 0) < 0xc0) | 0)) { + if ((((tmp | 0) >= 97) | 0)) { + if ((((tmp | 0) <= 122) | 0)) { + H8[((dst | 0) + (((uppercaseOffset | 0)))) | 0] = ((H8[((dst | 0) + (((uppercaseOffset | 0)))) | 0] | 0) ^ (32)) | 0; + } + } + uppercaseOffset = ((uppercaseOffset | 0) + 1) | 0; + len = ((len | 0) - 1) | 0; + } else if ((((tmp | 0) < 0xe0) | 0)) { + H8[((dst | 0) + ((((uppercaseOffset | 0) + 1) | 0))) | 0] = ((H8[((dst | 0) + ((((uppercaseOffset | 0) + 1) | 0))) | 0] | 0) ^ (32)) | 0; + uppercaseOffset = ((uppercaseOffset | 0) + 2) | 0; + len = ((len | 0) - 2) | 0; + } else { + H8[((dst | 0) + ((((uppercaseOffset | 0) + 2) | 0))) | 0] = ((H8[((dst | 0) + ((((uppercaseOffset | 0) + 2) | 0))) | 0] | 0) ^ (5)) | 0; + uppercaseOffset = ((uppercaseOffset | 0) + 3) | 0; + len = ((len | 0) - 3) | 0; + } + } + } + } + while ((((H8[((PREFIX_SUFFIX | 0) + (((transformSuffix | 0)))) | 0] | 0) != 0) | 0)) { + H8[((dst | 0) + (((offset | 0)))) | 0] = H8[((PREFIX_SUFFIX | 0) + (((transformSuffix | 0)))) | 0] | 0; + transformSuffix = ((transformSuffix | 0) + 1) | 0; + offset = ((offset | 0) + 1) | 0; + } + return (((offset | 0) - (dstOffset | 0)) | 0); + } + + function getNextKey(key, len) { + key = (key | 0); + len = (len | 0); + var step = 0; + step = (1 << (((len | 0) - 1) | 0)) | 0; + while ((((((key | 0) & (step | 0)) | 0) != 0) | 0)) { + step = ((step | 0) >> 1) | 0; + } + return (((((key | 0) & (((step | 0) - 1) | 0)) | 0) + (step | 0)) | 0); + } + function replicateValue(table, offset, step, end, item) { + table = (table | 0); + offset = (offset | 0); + step = (step | 0); + end = (end | 0); + item = (item | 0); + do { + end = ((end | 0) - (step | 0)) | 0; + H32[(((table | 0) + (((((offset | 0) + (end | 0)) | 0) << 2) | 0)) | 0) >> 2] = (item | 0); + } while ((((end | 0) > 0) | 0)); + } + function nextTableBitSize(count, len, rootBits) { + count = (count | 0); + len = (len | 0); + rootBits = (rootBits | 0); + var left = 0; + left = (1 << (((len | 0) - (rootBits | 0)) | 0)) | 0; + while ((((len | 0) < 15) | 0)) { + left = ((left | 0) - (H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0)) | 0; + if ((((left | 0) <= 0) | 0)) { + break; + } + len = ((len | 0) + 1) | 0; + left = ((left | 0) << 1) | 0; + } + return (((len | 0) - (rootBits | 0)) | 0); + } + function buildHuffmanTable(data, dataOffset, rootBits, alphabetSize) { + data = (data | 0); + dataOffset = (dataOffset | 0); + rootBits = (rootBits | 0); + alphabetSize = (alphabetSize | 0); + var key = 0; + var sorted = 0; + var count = 0; + var offset = 0; + var symbol = 0; + var len = 0; + var tableBits = 0; + var tableSize = 0; + var totalSize = 0; + var step = 0; + var mask = 0; + var low = 0; + var currentOffset = 0; + sorted = (s_tmp1 | 0); + count = (s_tmp2 | 0); + offset = (s_tmp3 | 0); + fillIntsWithZeroes((sorted | 0), 0, (alphabetSize | 0)); + fillIntsWithZeroes((count | 0), 0, 16); + fillIntsWithZeroes((offset | 0), 0, 16); + for (symbol = 0; (((symbol | 0) < (alphabetSize | 0)) | 0); symbol = ((symbol | 0) + 1) | 0) { + H32[(((count | 0) + (((H32[(((data | 0) + (((((dataOffset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] = ((H32[(((count | 0) + (((H32[(((data | 0) + (((((dataOffset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] | 0) + 1) | 0; + } + H32[(((offset | 0) + (((1) << 2) | 0)) | 0) >> 2] = 0; + for (len = 1; (((len | 0) < 15) | 0); len = ((len | 0) + 1) | 0) { + H32[(((offset | 0) + (((((len | 0) + 1) | 0) << 2) | 0)) | 0) >> 2] = ((H32[(((offset | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0) + (H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0)) | 0; + } + for (symbol = 0; (((symbol | 0) < (alphabetSize | 0)) | 0); symbol = ((symbol | 0) + 1) | 0) { + if ((((H32[(((data | 0) + (((((dataOffset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) != 0) | 0)) { + H32[(((sorted | 0) + (((H32[(((offset | 0) + (((H32[(((data | 0) + (((((dataOffset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] = (symbol | 0); + H32[(((offset | 0) + (((H32[(((data | 0) + (((((dataOffset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] = ((H32[(((offset | 0) + (((H32[(((data | 0) + (((((dataOffset | 0) + (symbol | 0)) | 0) << 2) | 0)) | 0) >> 2] | 0) << 2) | 0)) | 0) >> 2] | 0) + 1) | 0; + } + } + tableBits = (rootBits | 0); + tableSize = (1 << (tableBits | 0)) | 0; + totalSize = (tableSize | 0); + if ((((H32[(((offset | 0) + (((15) << 2) | 0)) | 0) >> 2] | 0) == 1) | 0)) { + for (key = 0; (((key | 0) < (totalSize | 0)) | 0); key = ((key | 0) + 1) | 0) { + H32[(((data | 0) + (((((dataOffset | 0) + (key | 0)) | 0) << 2) | 0)) | 0) >> 2] = H32[(((sorted | 0) + (((0) << 2) | 0)) | 0) >> 2] | 0; + } + return; + } + key = 0; + symbol = 0; + for (len = 1, step = 2; (((len | 0) <= (rootBits | 0)) | 0); len = ((len | 0) + 1) | 0, step = ((step | 0) << 1) | 0) { + for (; (((H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0) > 0) | 0); H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] = ((H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0) - 1) | 0) { + replicateValue((data | 0), ((dataOffset | 0) + (key | 0)) | 0, (step | 0), (tableSize | 0), ((((len | 0) << 16) | 0) | (H32[(((sorted | 0) + ((((symbol | 0)) << 2) | 0)) | 0) >> 2] | 0)) | 0); + symbol = ((symbol | 0) + 1) | 0; + key = getNextKey((key | 0), (len | 0)) | 0; + } + } + mask = ((totalSize | 0) - 1) | 0; + low = -1; + currentOffset = (dataOffset | 0); + for (len = ((rootBits | 0) + 1) | 0, step = 2; (((len | 0) <= 15) | 0); len = ((len | 0) + 1) | 0, step = ((step | 0) << 1) | 0) { + for (; (((H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0) > 0) | 0); H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] = ((H32[(((count | 0) + ((((len | 0)) << 2) | 0)) | 0) >> 2] | 0) - 1) | 0) { + if ((((((key | 0) & (mask | 0)) | 0) != (low | 0)) | 0)) { + currentOffset = ((currentOffset | 0) + (tableSize | 0)) | 0; + tableBits = nextTableBitSize((count | 0), (len | 0), (rootBits | 0)) | 0; + tableSize = (1 << (tableBits | 0)) | 0; + totalSize = ((totalSize | 0) + (tableSize | 0)) | 0; + low = ((key | 0) & (mask | 0)) | 0; + H32[(((data | 0) + (((((dataOffset | 0) + (low | 0)) | 0) << 2) | 0)) | 0) >> 2] = ((((((tableBits | 0) + (rootBits | 0)) | 0) << 16) | 0) | (((((currentOffset | 0) - (dataOffset | 0)) | 0) - (low | 0)) | 0)) | 0; + } + replicateValue((data | 0), ((currentOffset | 0) + (((key | 0) >> (rootBits | 0)) | 0)) | 0, (step | 0), (tableSize | 0), ((((((len | 0) - (rootBits | 0)) | 0) << 16) | 0) | (H32[(((sorted | 0) + ((((symbol | 0)) << 2) | 0)) | 0) >> 2] | 0)) | 0); + symbol = ((symbol | 0) + 1) | 0; + key = getNextKey((key | 0), (len | 0)) | 0; + } + } + } + + function readMoreInput() { + var readOffset = 0; + var bytesInBuffer = 0; + var spaceLeft = 0; + var len = 0; + if ((((s_endOfStreamReached | 0) != 0) | 0)) { + if ((((halfAvailable() | 0) >= -2) | 0)) { + return; + } + s_error = 115; + return; + } + readOffset = ((s_halfOffset | 0) << 1) | 0; + bytesInBuffer = (4096 - (readOffset | 0)) | 0; + copyBytesWithin((s_byteBuffer | 0), 0, (readOffset | 0), 4096); + s_halfOffset = 0; + while ((((bytesInBuffer | 0) < 4096) | 0)) { + spaceLeft = (4096 - (bytesInBuffer | 0)) | 0; + len = readInput((s_input | 0), (s_byteBuffer | 0), (bytesInBuffer | 0), (spaceLeft | 0)) | 0; + if ((((len | 0) < 0) | 0)) { + s_error = 118; + return; + } + if ((((len | 0) == 0) | 0)) { + s_endOfStreamReached = 1; + s_tailBytes = (bytesInBuffer | 0); + bytesInBuffer = ((bytesInBuffer | 0) + 1) | 0; + break; + } + bytesInBuffer = ((bytesInBuffer | 0) + (len | 0)) | 0; + } + bytesToNibbles((bytesInBuffer | 0)); + } + function checkHealth(endOfStream) { + endOfStream = (endOfStream | 0); + var byteOffset = 0; + if ((((s_endOfStreamReached | 0) == 0) | 0)) { + return; + } + byteOffset = ((((((s_halfOffset | 0) << 1) | 0) + (((((s_bitOffset | 0) + 7) | 0) >> 3) | 0)) | 0) - 4) | 0; + if ((((byteOffset | 0) > (s_tailBytes | 0)) | 0)) { + s_error = 117; + return; + } + if ((((endOfStream | 0) != 0) | 0)) { + if ((((byteOffset | 0) != (s_tailBytes | 0)) | 0)) { + s_error = 122; + return; + } + } + } + function readFewBits(n) { + n = (n | 0); + var val = 0; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + val = (((((s_accumulator32 | 0) >>> (s_bitOffset | 0)) | 0) | 0) & ((((1 << (n | 0)) | 0) - 1) | 0)) | 0; + s_bitOffset = ((s_bitOffset | 0) + (n | 0)) | 0; + return val|0; + } + function readBits(n) { + n = (n | 0); + var lo = 0; + var hi = 0; + var result = 0; + { + if ((((n | 0) <= 16) | 0)) { + result = readFewBits((n | 0))|0; + } else if ((((((s_bitOffset | 0) + (n | 0)) | 0) <= 32) | 0)) { + result = readFewBits((n | 0))|0; + } else { + lo = readFewBits(16) | 0; + hi = readFewBits(((n | 0) - 16) | 0) | 0; + result = (((lo | 0) | (((hi | 0) << 16) | 0)) | 0); + } + } + return result|0; + } + function initBitReader() { + s_byteBuffer = realloc(1, (s_byteBuffer | 0), 4160) | 0; + { + s_accumulator32 = 0; + s_shortBuffer = realloc(2, (s_shortBuffer | 0), 2080) | 0; + } + s_bitOffset = 32; + s_halfOffset = 2048; + s_endOfStreamReached = 0; + if ((((s_error | 0) != 0) | 0)) + return; + prepare(); + } + function prepare() { + if ((((s_halfOffset | 0) > 2030) | 0)) {readMoreInput();}; + if ((((s_error | 0) != 0) | 0)) + return; + checkHealth(0); + if ((((s_error | 0) != 0) | 0)) + return; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + return; + } + function reload() { + if ((((s_bitOffset | 0) == 32) | 0)) { + prepare(); + } + } + function jumpToByteBoundary() { + var padding = 0; + var paddingBits = 0; + padding = (((32 - (s_bitOffset | 0)) | 0) & 7) | 0; + if ((((padding | 0) != 0) | 0)) { + paddingBits = readBits((padding | 0)) | 0; + if ((((paddingBits | 0) != 0) | 0)) { + s_error = 104; + return; + } + } + } + function halfAvailable() { + var limit = 0; + limit = 2048; + if ((((s_endOfStreamReached | 0) != 0) | 0)) { + limit = ((((s_tailBytes | 0) + 1) | 0) >> 1) | 0; + } + return (((limit | 0) - (s_halfOffset | 0)) | 0); + } + function copyBytes(data, offset, length) { + data = (data | 0); + offset = (offset | 0); + length = (length | 0); + var copyNibbles = 0; + var readOffset = 0; + var delta = 0; + var len = 0; + if ((((((s_bitOffset | 0) & 7) | 0) != 0) | 0)) { + s_error = 119; + return; + } + while ((((length | 0) != 0) | 0)) { + if ((((s_bitOffset | 0) == 32) | 0)) { + break; + } + H8[((data | 0) + (((offset | 0)))) | 0] = (((s_accumulator32 | 0) >>> (s_bitOffset | 0)) | 0) | 0; + offset = ((offset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) + 8) | 0; + length = ((length | 0) - 1) | 0; + } + if ((((length | 0) == 0) | 0)) { + return; + } + copyNibbles = min(halfAvailable() | 0, ((length | 0) >> 1) | 0) | 0; + if ((((copyNibbles | 0) > 0) | 0)) { + readOffset = ((s_halfOffset | 0) << 1) | 0; + delta = ((copyNibbles | 0) << 1) | 0; + arraycopy((s_byteBuffer | 0), (readOffset | 0), (data | 0), (offset | 0), (delta | 0)); + offset = ((offset | 0) + (delta | 0)) | 0; + length = ((length | 0) - (delta | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + (copyNibbles | 0)) | 0; + } + if ((((length | 0) == 0) | 0)) { + return; + } + if ((((halfAvailable() | 0) > 0) | 0)) { + if ((((s_bitOffset | 0) >= 16) | 0)) { + s_accumulator32 = ((((H16[(((s_shortBuffer | 0) + ((((s_halfOffset | 0)) << 1) | 0)) | 0) >> 1] | 0) << 16) | 0) | (((s_accumulator32 | 0) >>> 16) | 0)) | 0; + s_halfOffset = ((s_halfOffset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) - 16) | 0; + }; + while ((((length | 0) != 0) | 0)) { + H8[((data | 0) + (((offset | 0)))) | 0] = (((s_accumulator32 | 0) >>> (s_bitOffset | 0)) | 0) | 0; + offset = ((offset | 0) + 1) | 0; + s_bitOffset = ((s_bitOffset | 0) + 8) | 0; + length = ((length | 0) - 1) | 0; + } + checkHealth(0); + return; + } + while ((((length | 0) > 0) | 0)) { + len = readInput((s_input | 0), (data | 0), (offset | 0), (length | 0)) | 0; + if ((((len | 0) < 0) | 0)) { + s_error = 118; + return; + } + if ((((len | 0) == 0) | 0)) { + s_error = 120; + return; + } + offset = ((offset | 0) + (len | 0)) | 0; + length = ((length | 0) - (len | 0)) | 0; + } + } + function bytesToNibbles(byteLen) { + byteLen = (byteLen | 0); + var byteBuffer = 0; + var halfLen = 0; + var shortBuffer = 0; + var i = 0; + byteBuffer = (s_byteBuffer | 0); + halfLen = ((byteLen | 0) >> 1) | 0; + { + shortBuffer = (s_shortBuffer | 0); + for (i = 0; (((i | 0) < (halfLen | 0)) | 0); i = ((i | 0) + 1) | 0) { + H16[(((shortBuffer | 0) + ((((i | 0)) << 1) | 0)) | 0) >> 1] = (((((H8[((byteBuffer | 0) + ((((i | 0) * 2) | 0))) | 0] | 0) & 0xFF) | 0) | (((((H8[((byteBuffer | 0) + ((((((i | 0) * 2) | 0) + 1) | 0))) | 0] | 0) & 0xFF) | 0) << 8) | 0)) | 0); + } + } + } + + function resetState() { + s_ringBuffer = realloc(1, (s_ringBuffer | 0), 0) | 0; + s_contextModes = realloc(1, (s_contextModes | 0), 0) | 0; + s_contextMap = realloc(1, (s_contextMap | 0), 0) | 0; + s_distContextMap = realloc(1, (s_distContextMap | 0), 0) | 0; + s_output = realloc(1, (s_output | 0), 0) | 0; + s_byteBuffer = realloc(1, (s_byteBuffer | 0), 0) | 0; + s_shortBuffer = realloc(2, (s_shortBuffer | 0), 0) | 0; + s_intBuffer = realloc(4, (s_intBuffer | 0), 0) | 0; + s_rings = realloc(4, (s_rings | 0), 0) | 0; + s_blockTrees = realloc(4, (s_blockTrees | 0), 0) | 0; + s_hGroup0 = realloc(4, (s_hGroup0 | 0), 0) | 0; + s_hGroup1 = realloc(4, (s_hGroup1 | 0), 0) | 0; + s_hGroup2 = realloc(4, (s_hGroup2 | 0), 0) | 0; + s_tmp0 = realloc(4, (s_tmp0 | 0), 0) | 0; + s_tmp1 = realloc(4, (s_tmp1 | 0), 0) | 0; + s_tmp2 = realloc(4, (s_tmp2 | 0), 0) | 0; + s_tmp3 = realloc(4, (s_tmp3 | 0), 0) | 0; + s_runningState = 0; + s_nextRunningState = 0; + s_accumulator32 = 0; + s_bitOffset = 0; + s_halfOffset = 0; + s_tailBytes = 0; + s_endOfStreamReached = 0; + s_metaBlockLength = 0; + s_inputEnd = 0; + s_isUncompressed = 0; + s_isMetadata = 0; + s_literalBlockLength = 0; + s_numLiteralBlockTypes = 0; + s_commandBlockLength = 0; + s_numCommandBlockTypes = 0; + s_distanceBlockLength = 0; + s_numDistanceBlockTypes = 0; + s_pos = 0; + s_maxDistance = 0; + s_distRbIdx = 0; + s_trivialLiteralContext = 0; + s_literalTreeIndex = 0; + s_literalTree = 0; + s_j = 0; + s_insertLength = 0; + s_contextMapSlice = 0; + s_distContextMapSlice = 0; + s_contextLookupOffset1 = 0; + s_contextLookupOffset2 = 0; + s_treeCommandOffset = 0; + s_distanceCode = 0; + s_numDirectDistanceCodes = 0; + s_distancePostfixMask = 0; + s_distancePostfixBits = 0; + s_distance = 0; + s_copyLength = 0; + s_copyDst = 0; + s_maxBackwardDistance = 0; + s_maxRingBufferSize = 0; + s_ringBufferSize = 0; + s_expectedTotalSize = 0; + s_bytesToIgnore = 0; + s_outputOffset = 0; + s_outputLength = 0; + s_outputUsed = 0; + s_bytesWritten = 0; + s_bytesToWrite = 0; + s_error = 0; + s_input = 0; + s_ringBuffer = realloc(1, (s_ringBuffer | 0), 0) | 0; + s_tmp0 = realloc(4, (s_tmp0 | 0), 1080) | 0; + s_tmp1 = realloc(4, (s_tmp1 | 0), 704) | 0; + s_tmp2 = realloc(4, (s_tmp2 | 0), 16) | 0; + s_tmp3 = realloc(4, (s_tmp3 | 0), 16) | 0; + s_rings = realloc(4, (s_rings | 0), 10) | 0; + H32[(((s_rings | 0) + (((0) << 2) | 0)) | 0) >> 2] = 16; + H32[(((s_rings | 0) + (((1) << 2) | 0)) | 0) >> 2] = 15; + H32[(((s_rings | 0) + (((2) << 2) | 0)) | 0) >> 2] = 11; + H32[(((s_rings | 0) + (((3) << 2) | 0)) | 0) >> 2] = 4; + } + + function initStatic() { + CODE_LENGTH_CODE_ORDER = realloc(4, CODE_LENGTH_CODE_ORDER, 18)|0; + DICTIONARY_OFFSETS_BY_LENGTH = realloc(4, DICTIONARY_OFFSETS_BY_LENGTH, 25)|0; + DICTIONARY_SIZE_BITS_BY_LENGTH = realloc(4, DICTIONARY_SIZE_BITS_BY_LENGTH, 25)|0; + BLOCK_LENGTH_OFFSET = realloc(4, BLOCK_LENGTH_OFFSET, 26)|0; + BLOCK_LENGTH_N_BITS = realloc(4, BLOCK_LENGTH_N_BITS, 26)|0; + INSERT_LENGTH_OFFSET = realloc(4, INSERT_LENGTH_OFFSET, 24)|0; + INSERT_LENGTH_N_BITS = realloc(4, INSERT_LENGTH_N_BITS, 24)|0; + COPY_LENGTH_OFFSET = realloc(4, COPY_LENGTH_OFFSET, 24)|0; + COPY_LENGTH_N_BITS = realloc(4, COPY_LENGTH_N_BITS, 24)|0; + INSERT_RANGE_LUT = realloc(4, INSERT_RANGE_LUT, 9)|0; + COPY_RANGE_LUT = realloc(4, COPY_RANGE_LUT, 9)|0; + unpackLuts((CODE_LENGTH_CODE_ORDER | 0), (DICTIONARY_OFFSETS_BY_LENGTH | 0), (DICTIONARY_SIZE_BITS_BY_LENGTH | 0), (BLOCK_LENGTH_OFFSET | 0), (BLOCK_LENGTH_N_BITS | 0), (INSERT_LENGTH_OFFSET | 0), (INSERT_LENGTH_N_BITS | 0), (COPY_LENGTH_OFFSET | 0), (COPY_LENGTH_N_BITS | 0), (INSERT_RANGE_LUT | 0), (COPY_RANGE_LUT | 0)); + TRANSFORMS = realloc(4, TRANSFORMS, 363)|0; + PREFIX_SUFFIX = realloc(1, PREFIX_SUFFIX, 217)|0; + PREFIX_SUFFIX_HEADS = realloc(4, PREFIX_SUFFIX_HEADS, 51)|0; + LOOKUP = realloc(4, LOOKUP, 2048)|0; + } + + function initialize() { + initStatic(); + if ((s_error|0) != 0) { + return; + } + DICTIONARY_DATA = realloc(1, DICTIONARY_DATA|0, 122784)|0; + if ((s_error|0) != 0) { + return; + } + prepareTransforms(PREFIX_SUFFIX|0, PREFIX_SUFFIX_HEADS|0, TRANSFORMS|0); + prepareLookupTable(LOOKUP|0); + prepareDictionaryData(DICTIONARY_DATA|0); + } + + function getError() { + return s_error|0; + } + + function allocateOutput(size) { + size = size|0; + s_output = realloc(1, s_output, size)|0; + s_outputOffset = 0; + s_outputLength = size|0; + s_outputUsed = 0; + return s_output|0; + } + + function getUsedOutput() { + return s_outputUsed|0; + } + + return { + initHeap: initHeap, + initialize: initialize, + resetState: resetState, + initState: initState, + allocateOutput: allocateOutput, + decompress: decompress, + getUsedOutput: getUsedOutput, + realloc: realloc, + getError: getError, + close: close + }; + } // BrotliDecodeCode + + /** + * @param {!Int8Array} prefixSuffix + * @param {!Int32Array} prefixSuffixHeads + * @param {!Int32Array} transforms + * @param {!string} prefixSuffixSrc + * @param {!string} transformsSrc + * @return {!void} + */ + function unpackTransforms(prefixSuffix, prefixSuffixHeads, transforms, prefixSuffixSrc, transformsSrc) { + var /** !number */ n = prefixSuffixSrc.length; + var /** !number */ index = 1; + for (var /** !number */ i = 0; i < n; ++i) { + var /** !number */ c = prefixSuffixSrc.charCodeAt(i); + prefixSuffix[i] = c; + if (c == 35) { + prefixSuffixHeads[index++] = i + 1; + prefixSuffix[i] = 0; + } + } + for (var /** !number */ i = 0; i < 363; ++i) { + transforms[i] = transformsSrc.charCodeAt(i) - 32; + } + } + + /** + * @param {!Int32Array} lookup + * @param {!string} map + * @param {!string} rle + * @return {!void} + */ + function unpackLookupTable(lookup, map, rle) { + for (var /** !number */ i = 0; i < 256; ++i) { + lookup[i] = i & 0x3F; + lookup[512 + i] = i >> 2; + lookup[1792 + i] = 2 + (i >> 6); + } + for (var /** !number */ i = 0; i < 128; ++i) { + lookup[1024 + i] = 4 * (map.charCodeAt(i) - 32); + } + for (var /** !number */ i = 0; i < 64; ++i) { + lookup[1152 + i] = i & 1; + lookup[1216 + i] = 2 + (i & 1); + } + var /** !number */ offset = 1280; + for (var /** !number */ k = 0; k < 19; ++k) { + var /** !number */ value = k & 3; + var /** !number */ rep = rle.charCodeAt(k) - 32; + for (var /** !number */ i = 0; i < rep; ++i) { + lookup[offset++] = value; + } + } + for (var /** !number */ i = 0; i < 16; ++i) { + lookup[1792 + i] = 1; + lookup[2032 + i] = 6; + } + lookup[1792] = 0; + lookup[2047] = 7; + for (var /** !number */ i = 0; i < 256; ++i) { + lookup[1536 + i] = lookup[1792 + i] << 3; + } + } + + /** + * @param {!Int8Array} dictionary + * @param {!string} data0 + * @param {!string} data1 + * @param {!string} skipFlip + * @return {!void} + */ + function unpackDictionaryData(dictionary, data0, data1, skipFlip) { + var /** !number */ n0 = data0.length; + var /** !number */ n1 = data1.length; + if (n0 + n1 != dictionary.length) { + throw "Corrupted brotli dictionary"; + } + var /** !number */ offset = 0; + for (var /** !number */ i = 0; i < n0; ++i) { + dictionary[offset++] = data0.charCodeAt(i); + } + for (var /** !number */ i = 0; i < n1; ++i) { + dictionary[offset++] = data1.charCodeAt(i); + } + offset = 0; + var /** !number */ n = skipFlip.length; + for (var /** !number */ i = 0; i < n; i += 2) { + var /** !number */ skip = skipFlip.charCodeAt(i) - 36; + var /** !number */ flip = skipFlip.charCodeAt(i + 1) - 36; + offset += skip; + for (var /** !number */ j = 0; j < flip; ++j) { + dictionary[offset] = (dictionary[offset] | 0x80); + offset++; + } + } + } + + var heapSize = 1024*1024*32; + var coreHeap = new ArrayBuffer(heapSize); + + /** + * @param {!number} prefixSuffixAddress + * @param {!number} prefixSuffixHeadsAddress + * @param {!number} transformsAddress + * @return {!void} + */ + function prepareTransforms(prefixSuffixAddress, prefixSuffixHeadsAddress, transformsAddress) { + var prefixSuffix = new Int8Array(coreHeap, prefixSuffixAddress); + var prefixSuffixHeads = new Int32Array(coreHeap, prefixSuffixHeadsAddress); + var transforms = new Int32Array(coreHeap, transformsAddress); + unpackTransforms(prefixSuffix, prefixSuffixHeads, transforms, "# #s #, #e #.# the #.com/#\u00C2\u00A0# of # and # in # to #\"#\">#\n#]# for # a # that #. # with #'# from # by #. The # on # as # is #ing #\n\t#:#ed #(# at #ly #=\"# of the #. This #,# not #er #al #='#ful #ive #less #est #ize #ous #", " !! ! , *! &! \" ! ) * * - ! # ! #!*! + ,$ ! - % . / # 0 1 . \" 2 3!* 4% ! # / 5 6 7 8 0 1 & $ 9 + : ; < ' != > ?! 4 @ 4 2 & A *# ( B C& ) % ) !*# *-% A +! *. D! %' & E *6 F G% ! *A *% H! D I!+! J!+ K +- *4! A L!*4 M N +6 O!*% +.! K *G P +%( ! G *D +D Q +# *K!*G!+D!+# +G +A +4!+% +K!+4!*D!+K!*K"); + } + + /** + * @param {!number} lookupAddress + * @return {!void} + */ + function prepareLookupTable(lookupAddress) { + var lookup = new Int32Array(coreHeap, lookupAddress); + unpackLookupTable(lookup, " !! ! \"#$##%#$&'##(#)#++++++++++((&*'##,---,---,-----,-----,-----'###.///.///./////./////./////'# ", "A/* ': & : $ \u0081 @"); + } + + /** + * @param {!number} dictionaryAddress + * @return {!void} + */ + function prepareDictionaryData(dictionaryAddress) { + var dictionary = new Int8Array(coreHeap, dictionaryAddress, 122784); + unpackDictionaryData(dictionary, "timedownlifeleftbackcodedatashowonlysitecityopenjustlikefreeworktextyearoverbodyloveformbookplaylivelinehelphomesidemorewordlongthemviewfindpagedaysfullheadtermeachareafromtruemarkableuponhighdatelandnewsevennextcasebothpostusedmadehandherewhatnameLinkblogsizebaseheldmakemainuser') +holdendswithNewsreadweresigntakehavegameseencallpathwellplusmenufilmpartjointhislistgoodneedwayswestjobsmindalsologorichuseslastteamarmyfoodkingwilleastwardbestfirePageknowaway.pngmovethanloadgiveselfnotemuchfeedmanyrockicononcelookhidediedHomerulehostajaxinfoclublawslesshalfsomesuchzone100%onescareTimeracebluefourweekfacehopegavehardlostwhenparkkeptpassshiproomHTMLplanTypedonesavekeepflaglinksoldfivetookratetownjumpthusdarkcardfilefearstaykillthatfallautoever.comtalkshopvotedeepmoderestturnbornbandfellroseurl(skinrolecomeactsagesmeetgold.jpgitemvaryfeltthensenddropViewcopy1.0\"stopelseliestourpack.gifpastcss?graymean>rideshotlatesaidroadvar feeljohnrickportfast'UA-deadpoorbilltypeU.S.woodmust2px;Inforankwidewantwalllead[0];paulwavesure$('#waitmassarmsgoesgainlangpaid!-- lockunitrootwalkfirmwifexml\"songtest20pxkindrowstoolfontmailsafestarmapscorerainflowbabyspansays4px;6px;artsfootrealwikiheatsteptriporg/lakeweaktoldFormcastfansbankveryrunsjulytask1px;goalgrewslowedgeid=\"sets5px;.js?40pxif (soonseatnonetubezerosentreedfactintogiftharm18pxcamehillboldzoomvoideasyringfillpeakinitcost3px;jacktagsbitsrolleditknewnearironfreddiskwentsoilputs/js/holyT22:ISBNT20:adamsees
P>Q\u0002P8P7P=P>P4P>Q\u0002P>P6P5P>P=P8Q\u0005P\u001DP0P5P5P1Q\u000BPP2Q\u000BP2P>P\u001DP>P>P1P\u001FP>P;P8P=P8P P$P\u001DP5P\u001CQ\u000BQ\u0002Q\u000BP\u001EP=P8Pthing.org/multiheardPowerstandtokensolid(thisbringshipsstafftriedcallsfullyfactsagentThis //-->adminegyptEvent15px;Emailtrue\"crossspentblogsbox\">notedleavechinasizesguestrobotheavytrue,sevengrandcrimesignsawaredancephase>\n \n \r\nname=diegopage swiss-->\n\n#fff;\">Log.com\"treatsheet) && 14px;sleepntentfiledja:c\u0003id=\"cName\"worseshots-box-delta\n<bears:48Z spendbakershops= \"\";php\">ction13px;brianhellosize=o=%2F joinmaybe, fjsimg\" \")[0]MTopBType\"newlyDanskczechtrailknowsfaq\">zh-cn10);\n-1\");type=bluestrulydavis.js';>\r\n\r\nform jesus100% menu.\r\n\t\r\nwalesrisksumentddingb-likteachgif\" vegasdanskeestishqipsuomisobredesdeentretodospuedeaC1osestC!tienehastaotrospartedondenuevohacerformamismomejormundoaquC-dC-assC3loayudafechatodastantomenosdatosotrassitiomuchoahoralugarmayorestoshorastenerantesfotosestaspaC-snuevasaludforosmedioquienmesespoderchileserC!vecesdecirjosC)estarventagrupohechoellostengoamigocosasnivelgentemismaairesjuliotemashaciafavorjuniolibrepuntobuenoautorabrilbuenatextomarzosaberlistaluegocC3moenerojuegoperC:haberestoynuncamujervalorfueralibrogustaigualvotoscasosguC-apuedosomosavisousteddebennochebuscafaltaeurosseriedichocursoclavecasasleC3nplazolargoobrasvistaapoyojuntotratavistocrearcampohemoscincocargopisosordenhacenC!readiscopedrocercapuedapapelmenorC:tilclarojorgecalleponertardenadiemarcasigueellassiglocochemotosmadreclaserestoniC1oquedapasarbancohijosviajepabloC)stevienereinodejarfondocanalnorteletracausatomarmanoslunesautosvillavendopesartipostengamarcollevapadreunidovamoszonasambosbandamariaabusomuchasubirriojavivirgradochicaallC-jovendichaestantalessalirsuelopesosfinesllamabuscoC)stalleganegroplazahumorpagarjuntadobleislasbolsabaC1ohablaluchaC\u0001readicenjugarnotasvalleallC!cargadolorabajoestC)gustomentemariofirmacostofichaplatahogarartesleyesaquelmuseobasespocosmitadcielochicomiedoganarsantoetapadebesplayaredessietecortecoreadudasdeseoviejodeseaaguas"domaincommonstatuseventsmastersystemactionbannerremovescrollupdateglobalmediumfilternumberchangeresultpublicscreenchoosenormaltravelissuessourcetargetspringmodulemobileswitchphotosborderregionitselfsocialactivecolumnrecordfollowtitle>eitherlengthfamilyfriendlayoutauthorcreatereviewsummerserverplayedplayerexpandpolicyformatdoublepointsseriespersonlivingdesignmonthsforcesuniqueweightpeopleenergynaturesearchfigurehavingcustomoffsetletterwindowsubmitrendergroupsuploadhealthmethodvideosschoolfutureshadowdebatevaluesObjectothersrightsleaguechromesimplenoticesharedendingseasonreportonlinesquarebuttonimagesenablemovinglatestwinterFranceperiodstrongrepeatLondondetailformeddemandsecurepassedtoggleplacesdevicestaticcitiesstreamyellowattackstreetflighthiddeninfo\">openedusefulvalleycausesleadersecretseconddamagesportsexceptratingsignedthingseffectfieldsstatesofficevisualeditorvolumeReportmuseummoviesparentaccessmostlymother\" id=\"marketgroundchancesurveybeforesymbolmomentspeechmotioninsidematterCenterobjectexistsmiddleEuropegrowthlegacymannerenoughcareeransweroriginportalclientselectrandomclosedtopicscomingfatheroptionsimplyraisedescapechosenchurchdefinereasoncorneroutputmemoryiframepolicemodelsNumberduringoffersstyleskilledlistedcalledsilvermargindeletebetterbrowselimitsGlobalsinglewidgetcenterbudgetnowrapcreditclaimsenginesafetychoicespirit-stylespreadmakingneededrussiapleaseextentScriptbrokenallowschargedividefactormember-basedtheoryconfigaroundworkedhelpedChurchimpactshouldalwayslogo\" bottomlist\">){var prefixorangeHeader.push(couplegardenbridgelaunchReviewtakingvisionlittledatingButtonbeautythemesforgotSearchanchoralmostloadedChangereturnstringreloadMobileincomesupplySourceordersviewed courseAbout island: The dialoghousesBEGIN MexicostartscentreheightaddingIslandassetsEmpireSchooleffortdirectnearlymanualSelect.\n\nOnejoinedmenu\">PhilipawardshandleimportOfficeregardskillsnationSportsdegreeweekly (e.g.behinddoctorloggedunitedbeyond-scaleacceptservedmarineFootercamera
P=P0P3P4P5PP3P>P4P2P>Q\u0002Q\u0002P0P
P2P0Q\u0001P2P0P
Q\u0002Q\u0003Q\u0002P=P0P4P4P=Q\u000FP\u0012P>Q\u0002Q\u0002Q\u0000P8P=P5P9P\u0012P0Q\u0001P=P8P Q\u0002Q\u0000Q\u0003P1P\u001EP=P8PP P9P4P2P5P>P=P>Q\u0001Q\u0003P4`$\u0015`%\u0007`$9`%\u0008`$\u0015`%\u0000`$8`%\u0007`$\u0015`$>`$\u0015`%\u000B`$\u0014`$0`$*`$0`$(`%\u0007`$\u000F`$\u0015`$\u0015`$?`$-`%\u0000`$\u0007`$8`$\u0015`$0`$$`%\u000B`$9`%\u000B`$\u0006`$*`$9`%\u0000`$/`$9`$/`$>`$$`$\u0015`$%`$>jagran`$\u0006`$\u001C`$\u001C`%\u000B`$\u0005`$,`$&`%\u000B`$\u0017`$\u0008`$\u001C`$>`$\u0017`$\u000F`$9`$.`$\u0007`$(`$5`$9`$/`%\u0007`$%`%\u0007`$%`%\u0000`$\u0018`$0`$\u001C`$,`$&`%\u0000`$\u0015`$\u0008`$\u001C`%\u0000`$5`%\u0007`$(`$\u0008`$(`$\u000F`$9`$0`$\t`$8`$.`%\u0007`$\u0015`$.`$5`%\u000B`$2`%\u0007`$8`$,`$.`$\u0008`$&`%\u0007`$\u0013`$0`$\u0006`$.`$,`$8`$-`$0`$,`$(`$\u001A`$2`$.`$(`$\u0006`$\u0017`$8`%\u0000`$2`%\u0000X9Y\u0004Y\tX%Y\u0004Y\tY\u0007X0X'X\"X.X1X9X/X/X'Y\u0004Y\tY\u0007X0Y\u0007X5Y\u0008X1X:Y\nX1Y\u0003X'Y\u0006Y\u0008Y\u0004X'X(Y\nY\u0006X9X1X6X0Y\u0004Y\u0003Y\u0007Y\u0006X'Y\nY\u0008Y\u0005Y\u0002X'Y\u0004X9Y\u0004Y\nX'Y\u0006X'Y\u0004Y\u0003Y\u0006X-X*Y\tY\u0002X(Y\u0004Y\u0008X-X)X'X.X1Y\u0001Y\u0002X7X9X(X/X1Y\u0003Y\u0006X%X0X'Y\u0003Y\u0005X'X'X-X/X%Y\u0004X'Y\u0001Y\nY\u0007X(X9X6Y\u0003Y\nY\u0001X(X-X+Y\u0008Y\u0005Y\u0006Y\u0008Y\u0007Y\u0008X#Y\u0006X'X,X/X'Y\u0004Y\u0007X'X3Y\u0004Y\u0005X9Y\u0006X/Y\u0004Y\nX3X9X(X1X5Y\u0004Y\tY\u0005Y\u0006X0X(Y\u0007X'X#Y\u0006Y\u0007Y\u0005X+Y\u0004Y\u0003Y\u0006X*X'Y\u0004X'X-Y\nX+Y\u0005X5X1X4X1X-X-Y\u0008Y\u0004Y\u0008Y\u0001Y\nX'X0X'Y\u0004Y\u0003Y\u0004Y\u0005X1X)X'Y\u0006X*X'Y\u0004Y\u0001X#X(Y\u0008X.X'X5X#Y\u0006X*X'Y\u0006Y\u0007X'Y\u0004Y\nX9X6Y\u0008Y\u0008Y\u0002X/X'X(Y\u0006X.Y\nX1X(Y\u0006X*Y\u0004Y\u0003Y\u0005X4X'X!Y\u0008Y\u0007Y\nX'X(Y\u0008Y\u0002X5X5Y\u0008Y\u0005X'X1Y\u0002Y\u0005X#X-X/Y\u0006X-Y\u0006X9X/Y\u0005X1X#Y\nX'X-X)Y\u0003X*X(X/Y\u0008Y\u0006Y\nX,X(Y\u0005Y\u0006Y\u0007X*X-X*X,Y\u0007X)X3Y\u0006X)Y\nX*Y\u0005Y\u0003X1X)X:X2X)Y\u0006Y\u0001X3X(Y\nX*Y\u0004Y\u0004Y\u0007Y\u0004Y\u0006X'X*Y\u0004Y\u0003Y\u0002Y\u0004X(Y\u0004Y\u0005X'X9Y\u0006Y\u0007X#Y\u0008Y\u0004X4Y\nX!Y\u0006Y\u0008X1X#Y\u0005X'Y\u0001Y\nY\u0003X(Y\u0003Y\u0004X0X'X*X1X*X(X(X#Y\u0006Y\u0007Y\u0005X3X'Y\u0006Y\u0003X(Y\nX9Y\u0001Y\u0002X/X-X3Y\u0006Y\u0004Y\u0007Y\u0005X4X9X1X#Y\u0007Y\u0004X4Y\u0007X1Y\u0002X7X1X7Y\u0004X(profileservicedefaulthimselfdetailscontentsupportstartedmessagesuccessfashion
countryaccountcreatedstoriesresultsrunningprocesswritingobjectsvisiblewelcomearticleunknownnetworkcompanydynamicbrowserprivacyproblemServicerespectdisplayrequestreservewebsitehistoryfriendsoptionsworkingversionmillionchannelwindow.addressvisitedweathercorrectproductedirectforwardyou canremovedsubjectcontrolarchivecurrentreadinglibrarylimitedmanagerfurthersummarymachineminutesprivatecontextprogramsocietynumberswrittenenabledtriggersourcesloadingelementpartnerfinallyperfectmeaningsystemskeepingculture",journalprojectsurfaces"expiresreviewsbalanceEnglishContentthroughPlease opinioncontactaverageprimaryvillageSpanishgallerydeclinemeetingmissionpopularqualitymeasuregeneralspeciessessionsectionwriterscounterinitialreportsfiguresmembersholdingdisputeearlierexpressdigitalpictureAnothermarriedtrafficleadingchangedcentralvictoryimages/reasonsstudiesfeaturelistingmust beschoolsVersionusuallyepisodeplayinggrowingobviousoverlaypresentactions\r\nwrapperalreadycertainrealitystorageanotherdesktopofferedpatternunusualDigitalcapitalWebsitefailureconnectreducedAndroiddecadesregular & animalsreleaseAutomatgettingmethodsnothingPopularcaptionletterscapturesciencelicensechangesEngland=1&History = new CentralupdatedSpecialNetworkrequirecommentwarningCollegetoolbarremainsbecauseelectedDeutschfinanceworkersquicklybetweenexactlysettingdiseaseSocietyweaponsexhibit<!--Controlclassescoveredoutlineattacksdevices(windowpurposetitle=\"Mobile killingshowingItaliandroppedheavilyeffects-1']);\nconfirmCurrentadvancesharingopeningdrawingbillionorderedGermanyrelatedincludewhetherdefinedSciencecatalogArticlebuttonslargestuniformjourneysidebarChicagoholidayGeneralpassage,"animatefeelingarrivedpassingnaturalroughly.\n\nThe but notdensityBritainChineselack oftributeIreland\" data-factorsreceivethat isLibraryhusbandin factaffairsCharlesradicalbroughtfindinglanding:lang=\"return leadersplannedpremiumpackageAmericaEdition]"Messageneed tovalue=\"complexlookingstationbelievesmaller-mobilerecordswant tokind ofFirefoxyou aresimilarstudiedmaximumheadingrapidlyclimatekingdomemergedamountsfoundedpioneerformuladynastyhow to SupportrevenueeconomyResultsbrothersoldierlargelycalling."AccountEdward segmentRobert effortsPacificlearnedup withheight:we haveAngelesnations_searchappliedacquiremassivegranted: falsetreatedbiggestbenefitdrivingStudiesminimumperhapsmorningsellingis usedreversevariant role=\"missingachievepromotestudentsomeoneextremerestorebottom:evolvedall thesitemapenglishway to AugustsymbolsCompanymattersmusicalagainstserving})();\r\npaymenttroubleconceptcompareparentsplayersregionsmonitor ''The winningexploreadaptedGalleryproduceabilityenhancecareers). The collectSearch ancientexistedfooter handlerprintedconsoleEasternexportswindowsChannelillegalneutralsuggest_headersigning.html\">settledwesterncausing-webkitclaimedJusticechaptervictimsThomas mozillapromisepartieseditionoutside:false,hundredOlympic_buttonauthorsreachedchronicdemandssecondsprotectadoptedprepareneithergreatlygreateroverallimprovecommandspecialsearch.worshipfundingthoughthighestinsteadutilityquarterCulturetestingclearlyexposedBrowserliberal} catchProjectexamplehide();FloridaanswersallowedEmperordefenseseriousfreedomSeveral-buttonFurtherout of != nulltrainedDenmarkvoid(0)/all.jspreventRequestStephen\n\nWhen observe
P6P5Q\u0002P5P4Q\u0000Q\u0003P3P8Q\u0005Q\u0001P;Q\u0003Q\u0007P0P5Q\u0001P5P9Q\u0007P0Q\u0001P2Q\u0001P5P3P4P0P P>Q\u0001Q\u0001P8Q\u000FP\u001CP>Q\u0001P:P2P5P4Q\u0000Q\u0003P3P8P5P3P>Q\u0000P>P4P0P2P>P?Q\u0000P>Q\u0001P4P0P=P=Q\u000BQ\u0005P4P>P;P6P=Q\u000BP8P P P2P>P3P>P?P>P Q\tP8Q\u0001P0P9Q\u0002P>P2P?P>Q\u0007P5P Q\tQ\u000CP4P>P;P6P=P>Q\u0001Q\u0001Q\u000BP;P:P8P1Q\u000BQ\u0001Q\u0002Q\u0000P>P4P0P=P=Q\u000BP5P P3P8P5P?Q\u0000P>P5P:Q\u0002P!P5P9Q\u0007P0Q\u0001P P4P5P;P8Q\u0002P0P:P>P3P>P>P=P;P0P9P=P3P>Q\u0000P>P4P5P2P5Q\u0000Q\u0001P8Q\u000FQ\u0001Q\u0002Q\u0000P0P=P5Q\u0004P8P;Q\u000CPQ\u0002Q\u0003P0P?Q\u0000P5P;Q\u000FP2P>P>P1Q\tP5P>P4P=P>P3P>Q\u0001P2P>P5P3P>Q\u0001Q\u0002P0Q\u0002Q\u000CP8P4Q\u0000Q\u0003P3P>P9Q\u0004P>Q\u0000Q\u0003P
P
P2P=Q\u000FQ\u0000P0P7P=Q\u000BQ\u0005P8Q\u0001P:P0Q\u0002Q\u000CP=P5P4P5P;Q\u000EQ\u000FP=P2P0Q\u0000Q\u000FP