| // THIS IS AUTO-GENERATED BY create.rb |
| var SimplePayload = [ |
| {name: "bigfib.cpp", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 134217728;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\nvar __ZTVN10__cxxabiv117__class_type_infoE = 13216;\nvar __ZTVN10__cxxabiv120__si_class_type_infoE = 13256;\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(14083);\n/* global initializers */ __ATINIT__.push({ func: function() { __GLOBAL__I_a() } });\n\n\n/* memory initializer */ allocate([70,105,98,32,91,0,0,0,93,32,61,32,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,97,108,108,0,0,0,0,0,116,104,0,0,0,0,0,0,115,111,109,101,0,0,0,0,114,97,110,100,0,0,0,0,56,0,0,0,0,0,0,0,184,0,0,0,1,0,0,0,2,0,0,0,200,255,255,255,200,255,255,255,184,0,0,0,3,0,0,0,4,0,0,0,78,83,116,51,95,95,49,49,57,98,97,115,105,99,95,111,115,116,114,105,110,103,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,0,0,208,51,0,0,112,0,0,0,8,13,0,0,0,0,0,0,56,0,0,0,0,0,0,0,8,13,0,0,5,0,0,0,6,0,0,0,200,255,255,255,200,255,255,255,8,13,0,0,7,0,0,0,8,0,0,0,0,0,0,0,120,1,0,0,9,0,0,0,10,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,2,0,0,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,105,110,103,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,0,0,0,0,0,0,208,51,0,0,48,1,0,0,0,12], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n/* memory initializer */ allocate([16,6,0,0,11,0,0,0,12,0,0,0,2,0,0,0,4,0,0,0,2,0,0,0,2,0,0,0,5,0,0,0,6,0,0,0,5,0,0,0,7,0,0,0,8,0,0,0,3,0,0,0,6,0,0,0,4,0,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,119,69,69,0,0,0,0,0,0,0,0,208,51,0,0,240,5,0,0,64,12,0,0,0,0,0,0,0,0,0,0,120,6,0,0,13,0,0,0,14,0,0,0,3,0,0,0,4,0,0,0,2,0,0,0,2,0,0,0,9,0,0,0,6,0,0,0,5,0,0,0,10,0,0,0,11,0,0,0,5,0,0,0,7,0,0,0,6,0,0,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,119,69,69,0,208,51,0,0,96,6,0,0,64,12,0,0,0,0,0,0,117,110,115,117,112,112,111,114,116,101,100,32,108,111,99,97,108,101,32,102,111,114,32,115,116,97,110,100,97,114,100,32,105,110,112,117,116,0,0,0,0,0,0,0,16,7,0,0,15,0,0,0,16,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,3,0,0,0,12,0,0,0,2,0,0,0,2,0,0,0,13,0,0,0,4,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,99,69,69,0,0,0,0,0,0,0,0,208,51,0,0,240,6,0,0,0,12,0,0,0,0,0,0,0,0,0,0,120,7,0,0,17,0,0,0,18,0,0,0,5,0,0,0,1,0,0,0,3,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,14,0,0,0,15,0,0,0,9,0,0,0,3,0,0,0,10,0,0,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,99,69,69,0,208,51,0,0,96,7,0,0,0,12,0,0,0,0,0,0,78,83,116,51,95,95,49,49,52,95,95,115,104,97,114,101,100,95,99,111,117,110,116,69,0,0,0,0,0,0,0,0,168,51,0,0,136,7,0,0,0,0,0,0,240,7,0,0,19,0,0,0,20,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,88,8,0,0,21,0,0,0,22,0,0,0,17,0,0,0,0,0,0,0,83,116,49,49,108,111,103,105,99,95,101,114,114,111,114,0,208,51,0,0,224,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,8,0,0,19,0,0,0,23,0,0,0,16,0,0,0,0,0,0,0,83,116,49,50,108,101,110,103,116,104,95,101,114,114,111,114,0,0,0,0,0,0,0,0,208,51,0,0,24,8,0,0,240,7,0,0,0,0,0,0,83,116,49,51,114,117,110,116,105,109,101,95,101,114,114,111,114,0,0,0,0,0,0,0,208,51,0,0,64,8,0,0,0,0,0,0,0,0,0,0,58,32,0,0,0,0,0,0,0,0,0,0,160,8,0,0,24,0,0,0,25,0,0,0,17,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,50,115,121,115,116,101,109,95,101,114,114,111,114,69,0,0,208,51,0,0,136,8,0,0,88,8,0,0,0,0,0,0,78,83,116,51,95,95,49,49,52,101,114,114,111,114,95,99,97,116,101,103,111,114,121,69,0,0,0,0,0,0,0,0,168,51,0,0,176,8,0,0,78,83,116,51,95,95,49,49,50,95,95,100,111,95,109,101,115,115,97,103,101,69,0,0,208,51,0,0,216,8,0,0,208,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,115,105,99,95,115,116,114,105,110,103,0,0,0,0,0,0,0,0,0,12,0,0,26,0,0,0,27,0,0,0,1,0,0,0,1,0,0,0,3,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,13,0,0,0,4,0,0,0,7,0,0,0,3,0,0,0,10,0,0,0,0,0,0,0,64,12,0,0,28,0,0,0,29,0,0,0,6,0,0,0,4,0,0,0,2,0,0,0,2,0,0,0,9,0,0,0,6,0,0,0,5,0,0,0,7,0,0,0,8,0,0,0,3,0,0,0,7,0,0,0,6,0,0,0,8,0,0,0,0,0,0,0,120,12,0,0,30,0,0,0,31,0,0,0,248,255,255,255,248,255,255,255,120,12,0,0,32,0,0,0,33,0,0,0,8,0,0,0,0,0,0,0,192,12,0,0,34,0,0,0,35,0,0,0,248,255,255,255,248,255,255,255,192,12,0,0,36,0,0,0,37,0,0,0,4,0,0,0,0,0,0,0,8,13,0,0,5,0,0,0,6,0,0,0,252,255,255,255,252,255,255,255,8,13,0,0,7,0,0,0,8,0,0,0,4,0,0,0,0,0,0,0,80,13,0,0,38,0,0,0,39,0,0,0,252,255,255,255,252,255,255,255,80,13,0,0,40,0,0,0,41,0,0,0,105,111,115,116,114,101,97,109,0,0,0,0,0,0,0,0,117,110,115,112,101,99,105,102,105,101,100,32,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,32,101,114,114,111,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,11,0,0,42,0,0,0,43,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,64,11,0,0,44,0,0,0,45,0,0,0,105,111,115,95,98,97,115,101,58,58,99,108,101,97,114,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,55,102,97,105,108,117,114,101,69,0,0,0,0,0,0,0,208,51,0,0,248,10,0,0,160,8,0,0,0,0,0,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,69,0,0,0,0,0,0,0,168,51,0,0,40,11,0,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,0,0,0,0,0,208,51,0,0,72,11,0,0,64,11,0,0,0,0,0,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,0,0,0,0,0,208,51,0,0,136,11,0,0,64,11,0,0,0,0,0,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,0,0,0,0,0,0,168,51,0,0,200,11,0,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,0,0,0,0,0,0,168,51,0,0,8,12,0,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,48,52,0,0,72,12,0,0,0,0,0,0,1,0,0,0,120,11,0,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,48,52,0,0,144,12,0,0,0,0,0,0,1,0,0,0,184,11,0,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,48,52,0,0,216,12,0,0,0,0,0,0,1,0,0,0,120,11,0,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,48,52,0,0,32,13,0,0,0,0,0,0,1,0,0,0,184,11,0,0,3,244,255,255,0,0,0,0,176,13,0,0,46,0,0,0,47,0,0,0,18,0,0,0,1,0,0,0,9,0,0,0,10,0,0,0,2,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,57,95,95,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,69,0,0,0,208,51,0,0,144,13,0,0,240,8,0,0,0,0,0,0,0,0,0,0,216,27,0,0,48,0,0,0,49,0,0,0,50,0,0,0,1,0,0,0,4,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,51,0,0,0,52,0,0,0,50,0,0,0,2,0,0,0,5,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,32,0,0,53,0,0,0,54,0,0,0,50,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,65,66,67,68,69,70,120,88,43,45,112,80,105,73,110,78,0,0,0,0,0,0,0,0,37,112,0,0,0,0,0,0,0,0,0,0,72,33,0,0,55,0,0,0,56,0,0,0,50,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,34,0,0,57,0,0,0,58,0,0,0,50,0,0,0,4,0,0,0,5,0,0,0,23,0,0,0,6,0,0,0,24,0,0,0,1,0,0,0,2,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,34,0,0,59,0,0,0,60,0,0,0,50,0,0,0,8,0,0,0,9,0,0,0,25,0,0,0,10,0,0,0,26,0,0,0,3,0,0,0,4,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,0,0,0,0,37,112,0,0,0,0,0,0,0,0,0,0,200,29,0,0,61,0,0,0,62,0,0,0,50,0,0,0,19,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,1,0,0,0,248,255,255,255,200,29,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,58,37,77,58,37,83,37,109,47,37,100,47,37,121,37,89,45,37,109,45,37,100,37,73,58,37,77,58,37,83,32,37,112,0,0,0,0,0,37,72,58,37,77,0,0,0,37,72,58,37,77,58,37,83,0,0,0,0,104,30,0,0,63,0,0,0,64,0,0,0,50,0,0,0,27,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,2,0,0,0,248,255,255,255,104,30,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,37,0,0,0,89,0,0,0,45,0,0,0,37,0,0,0,109,0,0,0,45,0,0,0,37,0,0,0,100,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,248,30,0,0,65,0,0,0,66,0,0,0,50,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,31,0,0,67,0,0,0,68,0,0,0,50,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,28,0,0,69,0,0,0,70,0,0,0,50,0,0,0,35,0,0,0,36,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,37,0,0,0,11,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,28,0,0,71,0,0,0,72,0,0,0,50,0,0,0,38,0,0,0,39,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,40,0,0,0,17,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,28,0,0,73,0,0,0,74,0,0,0,50,0,0,0,41,0,0,0,42,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,43,0,0,0,23,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,29,0,0,75,0,0,0,76,0,0,0,50,0,0,0,44,0,0,0,45,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,46,0,0,0,29,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,35,0,0,77,0,0,0,78,0,0,0,50,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,0,0,0,0,0,0,37,76,102,0,0,0,0,0,109,111,110,101,121,95,103,101,116,32,101,114,114,111,114,0,0,0,0,0,192,35,0,0,79,0,0,0,80,0,0,0,50,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,0,0,0,0,0,0,0,0,0,0,80,36,0,0,81,0,0,0,82,0,0,0,50,0,0,0,1,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,46,48,76,102,0,0,0,0,0,0,0,224,36,0,0,83,0,0,0,84,0,0,0,50,0,0,0,2,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,31,0,0,85,0,0,0,86,0,0,0,50,0,0,0,13,0,0,0,12,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,31,0,0,87,0,0,0,88,0,0,0,50,0,0,0,14,0,0,0,13,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,118,101,99,116,111,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,176,27,0,0,89,0,0,0,90,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,24,0,0,91,0,0,0,92,0,0,0,50,0,0,0,11,0,0,0,15,0,0,0,12,0,0,0,16,0,0,0,13,0,0,0,1,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,25,0,0,93,0,0,0,94,0,0,0,50,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,47,0,0,0,48,0,0,0,5,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,27,0,0,95,0,0,0,96,0,0,0,50,0,0,0,50,0,0,0,51,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,0,0,0,0,136,27,0,0,97,0,0,0,98,0,0,0,50,0,0,0,52,0,0,0,53,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,116,114,117,101,0,0,0,0,116,0,0,0,114,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,102,97,108,115,101,0,0,0,102,0,0,0,97,0,0,0,108,0,0,0,115,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,109,47,37,100,47,37,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,58,37,77,58,37,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,97,32,37,98,32,37,100,32,37,72,58,37,77,58,37,83,32,37,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,97,0,0,0,32,0,0,0,37,0,0,0,98,0,0,0,32,0,0,0,37,0,0,0,100,0,0,0,32,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,73,58,37,77,58,37,83,32,37,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,108,111,99,97,108,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,0,0,0,0,0,0,0,192,23,0,0,99,0,0,0,100,0,0,0,50,0,0,0,0,0,0,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,102,97,99,101,116,69,0,0,0,208,51,0,0,168,23,0,0,168,7,0,0,0,0,0,0,0,0,0,0,80,24,0,0,99,0,0,0,101,0,0,0,50,0,0,0,18,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,14,0,0,0,19,0,0,0,15,0,0,0,20,0,0,0,16,0,0,0,5,0,0,0,21,0,0,0,6,0,0,0,0,0,0,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,119,69,69,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,48,99,116,121,112,101,95,98,97,115,101,69,0,0,0,0,168,51,0,0,48,24,0,0,48,52,0,0,24,24,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,24,0,0,2,0,0,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,99,69,69,0,0,0,0,0,0,0,48,52,0,0,112,24,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,24,0,0,2,0,0,0,0,0,0,0,32,25,0,0,99,0,0,0,102,0,0,0,50,0,0,0,3,0,0,0,4,0,0,0,7,0,0,0,54,0,0,0,55,0,0,0,8,0,0,0,56,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,99,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,50,99,111,100,101,99,118,116,95,98,97,115,101,69,0,0,168,51,0,0,0,25,0,0,48,52,0,0,216,24,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,24,25,0,0,2,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,119,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,0,48,52,0,0,64,25,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,24,25,0,0,2,0,0,0,0,0,0,0,224,25,0,0,99,0,0,0,103,0,0,0,50,0,0,0,5,0,0,0,6,0,0,0,9,0,0,0,57,0,0,0,58,0,0,0,10,0,0,0,59,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,115,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,48,52,0,0,184,25,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,24,25,0,0,2,0,0,0,0,0,0,0,88,26,0,0,99,0,0,0,104,0,0,0,50,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,60,0,0,0,61,0,0,0,12,0,0,0,62,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,105,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,48,52,0,0,48,26,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,24,25,0,0,2,0,0,0,0,0,0,0,208,26,0,0,99,0,0,0,105,0,0,0,50,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,60,0,0,0,61,0,0,0,12,0,0,0,62,0,0,0,78,83,116,51,95,95,49,49,54,95,95,110,97,114,114,111,119,95,116,111,95,117,116,102,56,73,76,106,51,50,69,69,69,0,0,0,0,0,0,0,208,51,0,0,168,26,0,0,88,26,0,0,0,0,0,0,0,0,0,0,56,27,0,0,99,0,0,0,106,0,0,0,50,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,60,0,0,0,61,0,0,0,12,0,0,0,62,0,0,0,78,83,116,51,95,95,49,49,55,95,95,119,105,100,101,110,95,102,114,111,109,95,117,116,102,56,73,76,106,51,50,69,69,69,0,0,0,0,0,0,208,51,0,0,16,27,0,0,88,26,0,0,0,0,0,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,99,69,69,0,0,0,0,208,51,0,0,72,27,0,0,192,23,0,0,0,0,0,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,119,69,69,0,0,0,0,208,51,0,0,112,27,0,0,192,23,0,0,0,0,0,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,95,95,105,109,112,69,0,0,0,208,51,0,0,152,27,0,0,192,23,0,0,0,0,0,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,99,69,69,0,0,0,0,0,208,51,0,0,192,27,0,0,192,23,0,0,0,0,0,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,119,69,69,0,0,0,0,0,208,51,0,0,232,27,0,0,192,23,0,0,0,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,48,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,95,98,97,115,101,69,0,0,0,0,168,51,0,0,48,28,0,0,48,52,0,0,16,28,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,28,0,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,49,69,69,69,0,0,0,0,0,48,52,0,0,112,28,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,28,0,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,48,69,69,69,0,0,0,0,0,48,52,0,0,176,28,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,28,0,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,49,69,69,69,0,0,0,0,0,48,52,0,0,240,28,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,28,0,0,2,0,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,57,116,105,109,101,95,98,97,115,101,69,0,0,0,0,0,0,168,51,0,0,120,29,0,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,99,69,69,0,0,0,0,0,0,0,168,51,0,0,152,29,0,0,48,52,0,0,48,29,0,0,0,0,0,0,3,0,0,0,192,23,0,0,2,0,0,0,144,29,0,0,2,0,0,0,192,29,0,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,119,69,69,0,0,0,0,0,0,0,168,51,0,0,56,30,0,0,48,52,0,0,240,29,0,0,0,0,0,0,3,0,0,0,192,23,0,0,2,0,0,0,144,29,0,0,2,0,0,0,96,30,0,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,49,48,95,95,116,105,109,101,95,112,117,116,69,0,0,0,0,168,51,0,0,216,30,0,0,48,52,0,0,144,30,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,240,30,0,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,48,52,0,0,24,31,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,240,30,0,0,0,8,0,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,99,69,69,0,0,0,0,78,83,116,51,95,95,49,49,51,109,101,115,115,97,103,101,115,95,98,97,115,101,69,0,168,51,0,0,152,31,0,0,48,52,0,0,128,31,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,176,31,0,0,2,0,0,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,119,69,69,0,0,0,0,48,52,0,0,216,31,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,176,31,0,0,2,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,99,69,69,0,0,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,103,101,116,95,98,97,115,101,69,0,0,0,0,0,0,0,0,168,51,0,0,112,32,0,0,48,52,0,0,88,32,0,0,0,0,0,0,1,0,0,0,144,32,0,0,0,0,0,0,48,52,0,0,16,32,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,152,32,0,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,119,69,69,0,0,0,48,52,0,0,24,33,0,0,0,0,0,0,1,0,0,0,144,32,0,0,0,0,0,0,48,52,0,0,208,32,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,48,33,0,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,99,69,69,0,0,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,112,117,116,95,98,97,115,101,69,0,0,0,0,0,0,0,0,168,51,0,0,200,33,0,0,48,52,0,0,176,33,0,0,0,0,0,0,1,0,0,0,232,33,0,0,0,0,0,0,48,52,0,0,104,33,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,240,33,0,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,119,69,69,0,0,0,48,52,0,0,112,34,0,0,0,0,0,0,1,0,0,0,232,33,0,0,0,0,0,0,48,52,0,0,40,34,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,136,34,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,99,69,69,0,0,0,0,0,0,0,0,168,51,0,0,8,35,0,0,48,52,0,0,192,34,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,40,35,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,119,69,69,0,0,0,0,0,0,0,0,168,51,0,0,152,35,0,0,48,52,0,0,80,35,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,184,35,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,99,69,69,0,0,0,0,0,0,0,0,168,51,0,0,40,36,0,0,48,52,0,0,224,35,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,72,36,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,119,69,69,0,0,0,0,0,0,0,0,168,51,0,0,184,36,0,0,48,52,0,0,112,36,0,0,0,0,0,0,2,0,0,0,192,23,0,0,2,0,0,0,216,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,77,0,0,0,0,0,0,80,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,114,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,99,0,0,0,104,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,105,0,0,0,108,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,117,0,0,0,115,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,116,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,111,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+1452);\n/* memory initializer */ allocate([74,97,110,117,97,114,121,0,70,101,98,114,117,97,114,121,0,0,0,0,0,0,0,0,77,97,114,99,104,0,0,0,65,112,114,105,108,0,0,0,77,97,121,0,0,0,0,0,74,117,110,101,0,0,0,0,74,117,108,121,0,0,0,0,65,117,103,117,115,116,0,0,83,101,112,116,101,109,98,101,114,0,0,0,0,0,0,0,79,99,116,111,98,101,114,0,78,111,118,101,109,98,101,114,0,0,0,0,0,0,0,0,68,101,99,101,109,98,101,114,0,0,0,0,0,0,0,0,74,97,110,0,0,0,0,0,70,101,98,0,0,0,0,0,77,97,114,0,0,0,0,0,65,112,114,0,0,0,0,0,74,117,110,0,0,0,0,0,74,117,108,0,0,0,0,0,65,117,103,0,0,0,0,0,83,101,112,0,0,0,0,0,79,99,116,0,0,0,0,0,78,111,118,0,0,0,0,0,68,101,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,110,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,114,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,117,0,0,0,114,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,117,110,100,97,121,0,0,77,111,110,100,97,121,0,0,84,117,101,115,100,97,121,0,87,101,100,110,101,115,100,97,121,0,0,0,0,0,0,0,84,104,117,114,115,100,97,121,0,0,0,0,0,0,0,0,70,114,105,100,97,121,0,0,83,97,116,117,114,100,97,121,0,0,0,0,0,0,0,0,83,117,110,0,0,0,0,0,77,111,110,0,0,0,0,0,84,117,101,0,0,0,0,0,87,101,100,0,0,0,0,0,84,104,117,0,0,0,0,0,70,114,105,0,0,0,0,0,83,97,116,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,51,0,0,107,0,0,0,108,0,0,0,63,0,0,0,0,0,0,0,115,116,100,58,58,98,97,100,95,99,97,115,116,0,0,0,83,116,57,116,121,112,101,95,105,110,102,111,0,0,0,0,168,51,0,0,248,50,0,0,83,116,56,98,97,100,95,99,97,115,116,0,0,0,0,0,208,51,0,0,16,51,0,0,0,0,0,0,0,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,0,0,0,0,208,51,0,0,48,51,0,0,8,51,0,0,0,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,0,0,0,208,51,0,0,104,51,0,0,88,51,0,0,0,0,0,0,0,0,0,0,144,51,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,22,0,0,0,14,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,24,52,0,0,109,0,0,0,113,0,0,0,111,0,0,0,112,0,0,0,22,0,0,0,15,0,0,0,2,0,0,0,7,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,208,51,0,0,240,51,0,0,144,51,0,0,0,0,0,0,0,0,0,0,120,52,0,0,109,0,0,0,114,0,0,0,111,0,0,0,112,0,0,0,22,0,0,0,16,0,0,0,3,0,0,0,8,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,49,95,95,118,109,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,208,51,0,0,80,52,0,0,144,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,54,0,0,115,0,0,0,116,0,0,0,64,0,0,0,0,0,0,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,0,83,116,57,98,97,100,95,97,108,108,111,99,0,0,0,0,208,51,0,0,168,54,0,0,0,0,0,0,0,0,0,0,105,110,102,105,110,105,116,121,0,0,0,0,0,0,0,0,110,97,110,0,0,0,0,0,95,112,137,0,255,9,47,15,10,0,0,0,100,0,0,0,232,3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+11712);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n function _llvm_lifetime_end() {}\n\n \n \n Module[\"_rand_r\"] = _rand_r;\n \n var ___rand_seed=allocate([0x0273459b, 0, 0, 0], \"i32\", ALLOC_STATIC); \n Module[\"_rand\"] = _rand;\n\n \n \n Module[\"_memset\"] = _memset;var _llvm_memset_p0i8_i32=_memset;\n\n \n Module[\"_i64Subtract\"] = _i64Subtract;\n\n \n Module[\"_i64Add\"] = _i64Add;\n\n \n function __ZSt18uncaught_exceptionv() { // std::uncaught_exception()\n return !!__ZSt18uncaught_exceptionv.uncaught_exception;\n }\n \n \n \n function ___cxa_is_number_type(type) {\n var isNumber = false;\n try { if (type == __ZTIi) isNumber = true } catch(e){}\n try { if (type == __ZTIj) isNumber = true } catch(e){}\n try { if (type == __ZTIl) isNumber = true } catch(e){}\n try { if (type == __ZTIm) isNumber = true } catch(e){}\n try { if (type == __ZTIx) isNumber = true } catch(e){}\n try { if (type == __ZTIy) isNumber = true } catch(e){}\n try { if (type == __ZTIf) isNumber = true } catch(e){}\n try { if (type == __ZTId) isNumber = true } catch(e){}\n try { if (type == __ZTIe) isNumber = true } catch(e){}\n try { if (type == __ZTIc) isNumber = true } catch(e){}\n try { if (type == __ZTIa) isNumber = true } catch(e){}\n try { if (type == __ZTIh) isNumber = true } catch(e){}\n try { if (type == __ZTIs) isNumber = true } catch(e){}\n try { if (type == __ZTIt) isNumber = true } catch(e){}\n return isNumber;\n }function ___cxa_does_inherit(definiteType, possibilityType, possibility) {\n if (possibility == 0) return false;\n if (possibilityType == 0 || possibilityType == definiteType)\n return true;\n var possibility_type_info;\n if (___cxa_is_number_type(possibilityType)) {\n possibility_type_info = possibilityType;\n } else {\n var possibility_type_infoAddr = HEAP32[((possibilityType)>>2)] - 8;\n possibility_type_info = HEAP32[((possibility_type_infoAddr)>>2)];\n }\n switch (possibility_type_info) {\n case 0: // possibility is a pointer\n // See if definite type is a pointer\n var definite_type_infoAddr = HEAP32[((definiteType)>>2)] - 8;\n var definite_type_info = HEAP32[((definite_type_infoAddr)>>2)];\n if (definite_type_info == 0) {\n // Also a pointer; compare base types of pointers\n var defPointerBaseAddr = definiteType+8;\n var defPointerBaseType = HEAP32[((defPointerBaseAddr)>>2)];\n var possPointerBaseAddr = possibilityType+8;\n var possPointerBaseType = HEAP32[((possPointerBaseAddr)>>2)];\n return ___cxa_does_inherit(defPointerBaseType, possPointerBaseType, possibility);\n } else\n return false; // one pointer and one non-pointer\n case 1: // class with no base class\n return false;\n case 2: // class with base class\n var parentTypeAddr = possibilityType + 8;\n var parentType = HEAP32[((parentTypeAddr)>>2)];\n return ___cxa_does_inherit(definiteType, parentType, possibility);\n default:\n return false; // some unencountered type\n }\n }\n \n \n \n var ___cxa_last_thrown_exception=0;function ___resumeException(ptr) {\n if (!___cxa_last_thrown_exception) { ___cxa_last_thrown_exception = ptr; }\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n \n var ___cxa_exception_header_size=8;function ___cxa_find_matching_catch(thrown, throwntype) {\n if (thrown == -1) thrown = ___cxa_last_thrown_exception;\n header = thrown - ___cxa_exception_header_size;\n if (throwntype == -1) throwntype = HEAP32[((header)>>2)];\n var typeArray = Array.prototype.slice.call(arguments, 2);\n \n // If throwntype is a pointer, this means a pointer has been\n // thrown. When a pointer is thrown, actually what's thrown\n // is a pointer to the pointer. We'll dereference it.\n if (throwntype != 0 && !___cxa_is_number_type(throwntype)) {\n var throwntypeInfoAddr= HEAP32[((throwntype)>>2)] - 8;\n var throwntypeInfo= HEAP32[((throwntypeInfoAddr)>>2)];\n if (throwntypeInfo == 0)\n thrown = HEAP32[((thrown)>>2)];\n }\n // The different catch blocks are denoted by different types.\n // Due to inheritance, those types may not precisely match the\n // type of the thrown object. Find one which matches, and\n // return the type of the catch block which should be called.\n for (var i = 0; i < typeArray.length; i++) {\n if (___cxa_does_inherit(typeArray[i], throwntype, thrown))\n return ((asm[\"setTempRet0\"](typeArray[i]),thrown)|0);\n }\n // Shouldn't happen unless we have bogus data in typeArray\n // or encounter a type for which emscripten doesn't have suitable\n // typeinfo defined. Best-efforts match just in case.\n return ((asm[\"setTempRet0\"](throwntype),thrown)|0);\n }function ___cxa_throw(ptr, type, destructor) {\n if (!___cxa_throw.initialized) {\n try {\n HEAP32[((__ZTVN10__cxxabiv119__pointer_type_infoE)>>2)]=0; // Workaround for libcxxabi integration bug\n } catch(e){}\n try {\n HEAP32[((__ZTVN10__cxxabiv117__class_type_infoE)>>2)]=1; // Workaround for libcxxabi integration bug\n } catch(e){}\n try {\n HEAP32[((__ZTVN10__cxxabiv120__si_class_type_infoE)>>2)]=2; // Workaround for libcxxabi integration bug\n } catch(e){}\n ___cxa_throw.initialized = true;\n }\n var header = ptr - ___cxa_exception_header_size;\n HEAP32[((header)>>2)]=type;\n HEAP32[(((header)+(4))>>2)]=destructor;\n ___cxa_last_thrown_exception = ptr;\n if (!(\"uncaught_exception\" in __ZSt18uncaught_exceptionv)) {\n __ZSt18uncaught_exceptionv.uncaught_exception = 1;\n } else {\n __ZSt18uncaught_exceptionv.uncaught_exception++;\n }\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n\n function _pthread_mutex_lock() {}\n\n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }\n\n \n \n \n function _isspace(chr) {\n return (chr == 32) || (chr >= 9 && chr <= 13);\n }\n function __parseInt64(str, endptr, base, min, max, unsign) {\n var isNegative = false;\n // Skip space.\n while (_isspace(HEAP8[(str)])) str++;\n \n // Check for a plus/minus sign.\n if (HEAP8[(str)] == 45) {\n str++;\n isNegative = true;\n } else if (HEAP8[(str)] == 43) {\n str++;\n }\n \n // Find base.\n var ok = false;\n var finalBase = base;\n if (!finalBase) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n finalBase = 16;\n str += 2;\n } else {\n finalBase = 8;\n ok = true; // we saw an initial zero, perhaps the entire thing is just \"0\"\n }\n }\n } else if (finalBase==16) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n str += 2;\n }\n }\n }\n if (!finalBase) finalBase = 10;\n var start = str;\n \n // Get digits.\n var chr;\n while ((chr = HEAP8[(str)]) != 0) {\n var digit = parseInt(String.fromCharCode(chr), finalBase);\n if (isNaN(digit)) {\n break;\n } else {\n str++;\n ok = true;\n }\n }\n \n if (!ok) {\n ___setErrNo(ERRNO_CODES.EINVAL);\n return ((asm[\"setTempRet0\"](0),0)|0);\n }\n \n // Set end pointer.\n if (endptr) {\n HEAP32[((endptr)>>2)]=str;\n }\n \n try {\n var numberString = isNegative ? '-'+Pointer_stringify(start, str - start) : Pointer_stringify(start, str - start);\n i64Math.fromString(numberString, finalBase, min, max, unsign);\n } catch(e) {\n ___setErrNo(ERRNO_CODES.ERANGE); // not quite correct\n }\n \n return ((asm[\"setTempRet0\"](((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)),((HEAP32[((tempDoublePtr)>>2)])|0))|0);\n }function _strtoull(str, endptr, base) {\n return __parseInt64(str, endptr, base, 0, '18446744073709551615', true); // ULONG_MAX.\n }function _strtoull_l(str, endptr, base) {\n return _strtoull(str, endptr, base); // no locale support yet\n }\n\n function _sysconf(name) {\n // long sysconf(int name);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html\n switch(name) {\n case 30: return PAGE_SIZE;\n case 132:\n case 133:\n case 12:\n case 137:\n case 138:\n case 15:\n case 235:\n case 16:\n case 17:\n case 18:\n case 19:\n case 20:\n case 149:\n case 13:\n case 10:\n case 236:\n case 153:\n case 9:\n case 21:\n case 22:\n case 159:\n case 154:\n case 14:\n case 77:\n case 78:\n case 139:\n case 80:\n case 81:\n case 79:\n case 82:\n case 68:\n case 67:\n case 164:\n case 11:\n case 29:\n case 47:\n case 48:\n case 95:\n case 52:\n case 51:\n case 46:\n return 200809;\n case 27:\n case 246:\n case 127:\n case 128:\n case 23:\n case 24:\n case 160:\n case 161:\n case 181:\n case 182:\n case 242:\n case 183:\n case 184:\n case 243:\n case 244:\n case 245:\n case 165:\n case 178:\n case 179:\n case 49:\n case 50:\n case 168:\n case 169:\n case 175:\n case 170:\n case 171:\n case 172:\n case 97:\n case 76:\n case 32:\n case 173:\n case 35:\n return -1;\n case 176:\n case 177:\n case 7:\n case 155:\n case 8:\n case 157:\n case 125:\n case 126:\n case 92:\n case 93:\n case 129:\n case 130:\n case 131:\n case 94:\n case 91:\n return 1;\n case 74:\n case 60:\n case 69:\n case 70:\n case 4:\n return 1024;\n case 31:\n case 42:\n case 72:\n return 32;\n case 87:\n case 26:\n case 33:\n return 2147483647;\n case 34:\n case 1:\n return 47839;\n case 38:\n case 36:\n return 99;\n case 43:\n case 37:\n return 2048;\n case 0: return 2097152;\n case 3: return 65536;\n case 28: return 32768;\n case 44: return 32767;\n case 75: return 16384;\n case 39: return 1000;\n case 89: return 700;\n case 71: return 256;\n case 40: return 255;\n case 2: return 100;\n case 180: return 64;\n case 25: return 20;\n case 5: return 16;\n case 6: return 6;\n case 73: return 4;\n case 84: return 1;\n }\n ___setErrNo(ERRNO_CODES.EINVAL);\n return -1;\n }\n\n \n \n \n \n function _mkport() { throw 'TODO' }var SOCKFS={mount:function (mount) {\n return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createSocket:function (family, type, protocol) {\n var streaming = type == 1;\n if (protocol) {\n assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp\n }\n \n // create our internal socket structure\n var sock = {\n family: family,\n type: type,\n protocol: protocol,\n server: null,\n peers: {},\n pending: [],\n recv_queue: [],\n sock_ops: SOCKFS.websocket_sock_ops\n };\n \n // create the filesystem node to store the socket structure\n var name = SOCKFS.nextname();\n var node = FS.createNode(SOCKFS.root, name, 49152, 0);\n node.sock = sock;\n \n // and the wrapping stream that enables library functions such\n // as read and write to indirectly interact with the socket\n var stream = FS.createStream({\n path: name,\n node: node,\n flags: FS.modeStringToFlags('r+'),\n seekable: false,\n stream_ops: SOCKFS.stream_ops\n });\n \n // map the new stream to the socket structure (sockets have a 1:1\n // relationship with a stream)\n sock.stream = stream;\n \n return sock;\n },getSocket:function (fd) {\n var stream = FS.getStream(fd);\n if (!stream || !FS.isSocket(stream.node.mode)) {\n return null;\n }\n return stream.node.sock;\n },stream_ops:{poll:function (stream) {\n var sock = stream.node.sock;\n return sock.sock_ops.poll(sock);\n },ioctl:function (stream, request, varargs) {\n var sock = stream.node.sock;\n return sock.sock_ops.ioctl(sock, request, varargs);\n },read:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n var msg = sock.sock_ops.recvmsg(sock, length);\n if (!msg) {\n // socket is closed\n return 0;\n }\n buffer.set(msg.buffer, offset);\n return msg.buffer.length;\n },write:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n return sock.sock_ops.sendmsg(sock, buffer, offset, length);\n },close:function (stream) {\n var sock = stream.node.sock;\n sock.sock_ops.close(sock);\n }},nextname:function () {\n if (!SOCKFS.nextname.current) {\n SOCKFS.nextname.current = 0;\n }\n return 'socket[' + (SOCKFS.nextname.current++) + ']';\n },websocket_sock_ops:{createPeer:function (sock, addr, port) {\n var ws;\n \n if (typeof addr === 'object') {\n ws = addr;\n addr = null;\n port = null;\n }\n \n if (ws) {\n // for sockets that've already connected (e.g. we're the server)\n // we can inspect the _socket property for the address\n if (ws._socket) {\n addr = ws._socket.remoteAddress;\n port = ws._socket.remotePort;\n }\n // if we're just now initializing a connection to the remote,\n // inspect the url property\n else {\n var result = /ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);\n if (!result) {\n throw new Error('WebSocket URL must be in the format ws(s)://address:port');\n }\n addr = result[1];\n port = parseInt(result[2], 10);\n }\n } else {\n // create the actual websocket object and connect\n try {\n var url = 'ws://' + addr + ':' + port;\n // the node ws library API is slightly different than the browser's\n var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];\n // If node we use the ws library.\n var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];\n ws = new WebSocket(url, opts);\n ws.binaryType = 'arraybuffer';\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);\n }\n }\n \n \n var peer = {\n addr: addr,\n port: port,\n socket: ws,\n dgram_send_queue: []\n };\n \n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);\n \n // if this is a bound dgram socket, send the port number first to allow\n // us to override the ephemeral port reported to us by remotePort on the\n // remote end.\n if (sock.type === 2 && typeof sock.sport !== 'undefined') {\n peer.dgram_send_queue.push(new Uint8Array([\n 255, 255, 255, 255,\n 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),\n ((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)\n ]));\n }\n \n return peer;\n },getPeer:function (sock, addr, port) {\n return sock.peers[addr + ':' + port];\n },addPeer:function (sock, peer) {\n sock.peers[peer.addr + ':' + peer.port] = peer;\n },removePeer:function (sock, peer) {\n delete sock.peers[peer.addr + ':' + peer.port];\n },handlePeerEvents:function (sock, peer) {\n var first = true;\n \n var handleOpen = function () {\n try {\n var queued = peer.dgram_send_queue.shift();\n while (queued) {\n peer.socket.send(queued);\n queued = peer.dgram_send_queue.shift();\n }\n } catch (e) {\n // not much we can do here in the way of proper error handling as we've already\n // lied and said this data was sent. shut it down.\n peer.socket.close();\n }\n };\n \n function handleMessage(data) {\n assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer\n data = new Uint8Array(data); // make a typed array view on the array buffer\n \n \n // if this is the port message, override the peer's port with it\n var wasfirst = first;\n first = false;\n if (wasfirst &&\n data.length === 10 &&\n data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&\n data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {\n // update the peer's port and it's key in the peer map\n var newport = ((data[8] << 8) | data[9]);\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n peer.port = newport;\n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n return;\n }\n \n sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });\n };\n \n if (ENVIRONMENT_IS_NODE) {\n peer.socket.on('open', handleOpen);\n peer.socket.on('message', function(data, flags) {\n if (!flags.binary) {\n return;\n }\n handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer\n });\n peer.socket.on('error', function() {\n // don't throw\n });\n } else {\n peer.socket.onopen = handleOpen;\n peer.socket.onmessage = function peer_socket_onmessage(event) {\n handleMessage(event.data);\n };\n }\n },poll:function (sock) {\n if (sock.type === 1 && sock.server) {\n // listen sockets should only say they're available for reading\n // if there are pending clients.\n return sock.pending.length ? (64 | 1) : 0;\n }\n \n var mask = 0;\n var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets\n SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :\n null;\n \n if (sock.recv_queue.length ||\n !dest || // connection-less sockets are always ready to read\n (dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed\n mask |= (64 | 1);\n }\n \n if (!dest || // connection-less sockets are always ready to write\n (dest && dest.socket.readyState === dest.socket.OPEN)) {\n mask |= 4;\n }\n \n if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) {\n mask |= 16;\n }\n \n return mask;\n },ioctl:function (sock, request, arg) {\n switch (request) {\n case 21531:\n var bytes = 0;\n if (sock.recv_queue.length) {\n bytes = sock.recv_queue[0].data.length;\n }\n HEAP32[((arg)>>2)]=bytes;\n return 0;\n default:\n return ERRNO_CODES.EINVAL;\n }\n },close:function (sock) {\n // if we've spawned a listen server, close it\n if (sock.server) {\n try {\n sock.server.close();\n } catch (e) {\n }\n sock.server = null;\n }\n // close any peer connections\n var peers = Object.keys(sock.peers);\n for (var i = 0; i < peers.length; i++) {\n var peer = sock.peers[peers[i]];\n try {\n peer.socket.close();\n } catch (e) {\n }\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n }\n return 0;\n },bind:function (sock, addr, port) {\n if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound\n }\n sock.saddr = addr;\n sock.sport = port || _mkport();\n // in order to emulate dgram sockets, we need to launch a listen server when\n // binding on a connection-less socket\n // note: this is only required on the server side\n if (sock.type === 2) {\n // close the existing server if it exists\n if (sock.server) {\n sock.server.close();\n sock.server = null;\n }\n // swallow error operation not supported error that occurs when binding in the\n // browser where this isn't supported\n try {\n sock.sock_ops.listen(sock, 0);\n } catch (e) {\n if (!(e instanceof FS.ErrnoError)) throw e;\n if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;\n }\n }\n },connect:function (sock, addr, port) {\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);\n }\n \n // TODO autobind\n // if (!sock.addr && sock.type == 2) {\n // }\n \n // early out if we're already connected / in the middle of connecting\n if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n if (dest) {\n if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EALREADY);\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EISCONN);\n }\n }\n }\n \n // add the socket to our peer list and set our\n // destination address / port to match\n var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n sock.daddr = peer.addr;\n sock.dport = peer.port;\n \n // always \"fail\" in non-blocking mode\n throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);\n },listen:function (sock, backlog) {\n if (!ENVIRONMENT_IS_NODE) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening\n }\n var WebSocketServer = require('ws').Server;\n var host = sock.saddr;\n sock.server = new WebSocketServer({\n host: host,\n port: sock.sport\n // TODO support backlog\n });\n \n sock.server.on('connection', function(ws) {\n if (sock.type === 1) {\n var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);\n \n // create a peer on the new socket\n var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);\n newsock.daddr = peer.addr;\n newsock.dport = peer.port;\n \n // push to queue for accept to pick up\n sock.pending.push(newsock);\n } else {\n // create a peer on the listen socket so calling sendto\n // with the listen socket and an address will resolve\n // to the correct client\n SOCKFS.websocket_sock_ops.createPeer(sock, ws);\n }\n });\n sock.server.on('closed', function() {\n sock.server = null;\n });\n sock.server.on('error', function() {\n // don't throw\n });\n },accept:function (listensock) {\n if (!listensock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var newsock = listensock.pending.shift();\n newsock.stream.flags = listensock.stream.flags;\n return newsock;\n },getname:function (sock, peer) {\n var addr, port;\n if (peer) {\n if (sock.daddr === undefined || sock.dport === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n addr = sock.daddr;\n port = sock.dport;\n } else {\n // TODO saddr and sport will be set for bind()'d UDP sockets, but what\n // should we be returning for TCP sockets that've been connect()'d?\n addr = sock.saddr || 0;\n port = sock.sport || 0;\n }\n return { addr: addr, port: port };\n },sendmsg:function (sock, buffer, offset, length, addr, port) {\n if (sock.type === 2) {\n // connection-less sockets will honor the message address,\n // and otherwise fall back to the bound destination address\n if (addr === undefined || port === undefined) {\n addr = sock.daddr;\n port = sock.dport;\n }\n // if there was no address to fall back to, error out\n if (addr === undefined || port === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);\n }\n } else {\n // connection-based sockets will only use the bound\n addr = sock.daddr;\n port = sock.dport;\n }\n \n // find the peer for the destination address\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);\n \n // early out if not connected with a connection-based socket\n if (sock.type === 1) {\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n } else if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // create a copy of the incoming data to send, as the WebSocket API\n // doesn't work entirely with an ArrayBufferView, it'll just send\n // the entire underlying buffer\n var data;\n if (buffer instanceof Array || buffer instanceof ArrayBuffer) {\n data = buffer.slice(offset, offset + length);\n } else { // ArrayBufferView\n data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);\n }\n \n // if we're emulating a connection-less dgram socket and don't have\n // a cached connection, queue the buffer to send upon connect and\n // lie, saying the data was sent now.\n if (sock.type === 2) {\n if (!dest || dest.socket.readyState !== dest.socket.OPEN) {\n // if we're not connected, open a new connection\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n }\n dest.dgram_send_queue.push(data);\n return length;\n }\n }\n \n try {\n // send the actual data\n dest.socket.send(data);\n return length;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n },recvmsg:function (sock, length) {\n // http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html\n if (sock.type === 1 && sock.server) {\n // tcp servers should not be recv()'ing on the listen socket\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n \n var queued = sock.recv_queue.shift();\n if (!queued) {\n if (sock.type === 1) {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n \n if (!dest) {\n // if we have a destination address but are not connected, error out\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n // return null if the socket has closed\n return null;\n }\n else {\n // else, our socket is in a valid state but truly has nothing available\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // queued.data will be an ArrayBuffer if it's unadulterated, but if it's\n // requeued TCP data it'll be an ArrayBufferView\n var queuedLength = queued.data.byteLength || queued.data.length;\n var queuedOffset = queued.data.byteOffset || 0;\n var queuedBuffer = queued.data.buffer || queued.data;\n var bytesRead = Math.min(length, queuedLength);\n var res = {\n buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),\n addr: queued.addr,\n port: queued.port\n };\n \n \n // push back any unread data for TCP connections\n if (sock.type === 1 && bytesRead < queuedLength) {\n var bytesRemaining = queuedLength - bytesRead;\n queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);\n sock.recv_queue.unshift(queued);\n }\n \n return res;\n }}};function _send(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _write(fd, buf, len);\n }\n \n function _pwrite(fildes, buf, nbyte, offset) {\n // ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _write(fildes, buf, nbyte) {\n // ssize_t write(int fildes, const void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }\n \n function _fileno(stream) {\n // int fileno(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) return -1;\n return stream.fd;\n }function _fwrite(ptr, size, nitems, stream) {\n // size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html\n var bytesToWrite = nitems * size;\n if (bytesToWrite == 0) return 0;\n var fd = _fileno(stream);\n var bytesWritten = _write(fd, ptr, bytesToWrite);\n if (bytesWritten == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return 0;\n } else {\n return Math.floor(bytesWritten / size);\n }\n }\n\n \n function _strtoll(str, endptr, base) {\n return __parseInt64(str, endptr, base, '-9223372036854775808', '9223372036854775807'); // LLONG_MIN, LLONG_MAX.\n }function _strtoll_l(str, endptr, base) {\n return _strtoll(str, endptr, base); // no locale support yet\n }\n\n\n\n function _pthread_cond_broadcast() {\n return 0;\n }\n\n \n \n function __exit(status) {\n // void _exit(int status);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html\n Module['exit'](status);\n }function _exit(status) {\n __exit(status);\n }function __ZSt9terminatev() {\n _exit(-1234);\n }\n\n \n \n function __parseInt(str, endptr, base, min, max, bits, unsign) {\n // Skip space.\n while (_isspace(HEAP8[(str)])) str++;\n \n // Check for a plus/minus sign.\n var multiplier = 1;\n if (HEAP8[(str)] == 45) {\n multiplier = -1;\n str++;\n } else if (HEAP8[(str)] == 43) {\n str++;\n }\n \n // Find base.\n var finalBase = base;\n if (!finalBase) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n finalBase = 16;\n str += 2;\n } else {\n finalBase = 8;\n str++;\n }\n }\n } else if (finalBase==16) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n str += 2;\n }\n }\n }\n if (!finalBase) finalBase = 10;\n \n // Get digits.\n var chr;\n var ret = 0;\n while ((chr = HEAP8[(str)]) != 0) {\n var digit = parseInt(String.fromCharCode(chr), finalBase);\n if (isNaN(digit)) {\n break;\n } else {\n ret = ret * finalBase + digit;\n str++;\n }\n }\n \n // Apply sign.\n ret *= multiplier;\n \n // Set end pointer.\n if (endptr) {\n HEAP32[((endptr)>>2)]=str;\n }\n \n // Unsign if needed.\n if (unsign) {\n if (Math.abs(ret) > max) {\n ret = max;\n ___setErrNo(ERRNO_CODES.ERANGE);\n } else {\n ret = unSign(ret, bits);\n }\n }\n \n // Validate range.\n if (ret > max || ret < min) {\n ret = ret > max ? max : min;\n ___setErrNo(ERRNO_CODES.ERANGE);\n }\n \n if (bits == 64) {\n return ((asm[\"setTempRet0\"]((tempDouble=ret,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)),ret>>>0)|0);\n }\n \n return ret;\n }function _strtol(str, endptr, base) {\n return __parseInt(str, endptr, base, -2147483648, 2147483647, 32); // LONG_MIN, LONG_MAX.\n }function _atoi(ptr) {\n return _strtol(ptr, null, 10);\n }\n\n function _pthread_mutex_unlock() {}\n\n \n function _isxdigit(chr) {\n return (chr >= 48 && chr <= 57) ||\n (chr >= 97 && chr <= 102) ||\n (chr >= 65 && chr <= 70);\n }function _isxdigit_l(chr) {\n return _isxdigit(chr); // no locale support yet\n }\n\n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;\n\n function _sbrk(bytes) {\n // Implement a Linux-like 'memory area' for our 'process'.\n // Changes the size of the memory area by |bytes|; returns the\n // address of the previous top ('break') of the memory area\n // We control the \"dynamic\" memory - DYNAMIC_BASE to DYNAMICTOP\n var self = _sbrk;\n if (!self.called) {\n DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned\n self.called = true;\n assert(Runtime.dynamicAlloc);\n self.alloc = Runtime.dynamicAlloc;\n Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };\n }\n var ret = DYNAMICTOP;\n if (bytes != 0) self.alloc(bytes);\n return ret; // Previous break location.\n }\n\n function _atexit(func, arg) {\n __ATEXIT__.unshift({ func: func, arg: arg });\n }\n\n \n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;function _newlocale(mask, locale, base) {\n return _malloc(4);\n }\n\n \n Module[\"_memmove\"] = _memmove;\n\n function ___errno_location() {\n return ___errno_state;\n }\n\n var _BItoD=true;\n\n function _catclose(catd) {\n // int catclose (nl_catd catd)\n return 0;\n }\n\n \n \n \n function _free() {\n }\n Module[\"_free\"] = _free;function ___cxa_free_exception(ptr) {\n try {\n return _free(ptr - ___cxa_exception_header_size);\n } catch(e) { // XXX FIXME\n }\n }\n \n var ___cxa_caught_exceptions=[];function ___cxa_end_catch() {\n if (___cxa_end_catch.rethrown) {\n ___cxa_end_catch.rethrown = false;\n return;\n }\n // Clear state flag.\n asm['setThrew'](0);\n // Call destructor if one is registered then clear it.\n var ptr = ___cxa_caught_exceptions.pop();\n if (ptr) {\n header = ptr - ___cxa_exception_header_size;\n var destructor = HEAP32[(((header)+(4))>>2)];\n if (destructor) {\n Runtime.dynCall('vi', destructor, [ptr]);\n HEAP32[(((header)+(4))>>2)]=0;\n }\n ___cxa_free_exception(ptr);\n ___cxa_last_thrown_exception = 0;\n }\n }function ___cxa_rethrow() {\n ___cxa_end_catch.rethrown = true;\n var ptr = ___cxa_caught_exceptions.pop();\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n\n function _abort() {\n Module['abort']();\n }\n\n function _fmod(x, y) {\n return x % y;\n }\n\n function ___cxa_guard_release() {}\n\n function _ungetc(c, stream) {\n // int ungetc(int c, FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/ungetc.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) {\n return -1;\n }\n if (c === -1) {\n // do nothing for EOF character\n return c;\n }\n c = unSign(c & 0xFF);\n stream.ungotten.push(c);\n stream.eof = false;\n return c;\n }\n\n function _uselocale(locale) {\n return 0;\n }\n\n \n \n \n \n Module[\"_strlen\"] = _strlen;\n \n function __reallyNegative(x) {\n return x < 0 || (x === 0 && (1/x) === -Infinity);\n }function __formatString(format, varargs) {\n var textIndex = format;\n var argIndex = 0;\n function getNextArg(type) {\n // NOTE: Explicitly ignoring type safety. Otherwise this fails:\n // int x = 4; printf(\"%c\\n\", (char)x);\n var ret;\n if (type === 'double') {\n ret = (HEAP32[((tempDoublePtr)>>2)]=HEAP32[(((varargs)+(argIndex))>>2)],HEAP32[(((tempDoublePtr)+(4))>>2)]=HEAP32[(((varargs)+((argIndex)+(4)))>>2)],(+(HEAPF64[(tempDoublePtr)>>3])));\n } else if (type == 'i64') {\n ret = [HEAP32[(((varargs)+(argIndex))>>2)],\n HEAP32[(((varargs)+(argIndex+4))>>2)]];\n \n } else {\n type = 'i32'; // varargs are always i32, i64, or double\n ret = HEAP32[(((varargs)+(argIndex))>>2)];\n }\n argIndex += Runtime.getNativeFieldSize(type);\n return ret;\n }\n \n var ret = [];\n var curr, next, currArg;\n while(1) {\n var startTextIndex = textIndex;\n curr = HEAP8[(textIndex)];\n if (curr === 0) break;\n next = HEAP8[((textIndex+1)|0)];\n if (curr == 37) {\n // Handle flags.\n var flagAlwaysSigned = false;\n var flagLeftAlign = false;\n var flagAlternative = false;\n var flagZeroPad = false;\n var flagPadSign = false;\n flagsLoop: while (1) {\n switch (next) {\n case 43:\n flagAlwaysSigned = true;\n break;\n case 45:\n flagLeftAlign = true;\n break;\n case 35:\n flagAlternative = true;\n break;\n case 48:\n if (flagZeroPad) {\n break flagsLoop;\n } else {\n flagZeroPad = true;\n break;\n }\n case 32:\n flagPadSign = true;\n break;\n default:\n break flagsLoop;\n }\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n \n // Handle width.\n var width = 0;\n if (next == 42) {\n width = getNextArg('i32');\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n } else {\n while (next >= 48 && next <= 57) {\n width = width * 10 + (next - 48);\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n }\n \n // Handle precision.\n var precisionSet = false, precision = -1;\n if (next == 46) {\n precision = 0;\n precisionSet = true;\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n if (next == 42) {\n precision = getNextArg('i32');\n textIndex++;\n } else {\n while(1) {\n var precisionChr = HEAP8[((textIndex+1)|0)];\n if (precisionChr < 48 ||\n precisionChr > 57) break;\n precision = precision * 10 + (precisionChr - 48);\n textIndex++;\n }\n }\n next = HEAP8[((textIndex+1)|0)];\n }\n if (precision < 0) {\n precision = 6; // Standard default.\n precisionSet = false;\n }\n \n // Handle integer sizes. WARNING: These assume a 32-bit architecture!\n var argSize;\n switch (String.fromCharCode(next)) {\n case 'h':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 104) {\n textIndex++;\n argSize = 1; // char (actually i32 in varargs)\n } else {\n argSize = 2; // short (actually i32 in varargs)\n }\n break;\n case 'l':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 108) {\n textIndex++;\n argSize = 8; // long long\n } else {\n argSize = 4; // long\n }\n break;\n case 'L': // long long\n case 'q': // int64_t\n case 'j': // intmax_t\n argSize = 8;\n break;\n case 'z': // size_t\n case 't': // ptrdiff_t\n case 'I': // signed ptrdiff_t or unsigned size_t\n argSize = 4;\n break;\n default:\n argSize = null;\n }\n if (argSize) textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n \n // Handle type specifier.\n switch (String.fromCharCode(next)) {\n case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {\n // Integer.\n var signed = next == 100 || next == 105;\n argSize = argSize || 4;\n var currArg = getNextArg('i' + (argSize * 8));\n var origArg = currArg;\n var argText;\n // Flatten i64-1 [low, high] into a (slightly rounded) double\n if (argSize == 8) {\n currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);\n }\n // Truncate to requested size.\n if (argSize <= 4) {\n var limit = Math.pow(256, argSize) - 1;\n currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);\n }\n // Format the number.\n var currAbsArg = Math.abs(currArg);\n var prefix = '';\n if (next == 100 || next == 105) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else\n argText = reSign(currArg, 8 * argSize, 1).toString(10);\n } else if (next == 117) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else\n argText = unSign(currArg, 8 * argSize, 1).toString(10);\n currArg = Math.abs(currArg);\n } else if (next == 111) {\n argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);\n } else if (next == 120 || next == 88) {\n prefix = (flagAlternative && currArg != 0) ? '0x' : '';\n if (argSize == 8 && i64Math) {\n if (origArg[1]) {\n argText = (origArg[1]>>>0).toString(16);\n var lower = (origArg[0]>>>0).toString(16);\n while (lower.length < 8) lower = '0' + lower;\n argText += lower;\n } else {\n argText = (origArg[0]>>>0).toString(16);\n }\n } else\n if (currArg < 0) {\n // Represent negative numbers in hex as 2's complement.\n currArg = -currArg;\n argText = (currAbsArg - 1).toString(16);\n var buffer = [];\n for (var i = 0; i < argText.length; i++) {\n buffer.push((0xF - parseInt(argText[i], 16)).toString(16));\n }\n argText = buffer.join('');\n while (argText.length < argSize * 2) argText = 'f' + argText;\n } else {\n argText = currAbsArg.toString(16);\n }\n if (next == 88) {\n prefix = prefix.toUpperCase();\n argText = argText.toUpperCase();\n }\n } else if (next == 112) {\n if (currAbsArg === 0) {\n argText = '(nil)';\n } else {\n prefix = '0x';\n argText = currAbsArg.toString(16);\n }\n }\n if (precisionSet) {\n while (argText.length < precision) {\n argText = '0' + argText;\n }\n }\n \n // Add sign if needed\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n prefix = '+' + prefix;\n } else if (flagPadSign) {\n prefix = ' ' + prefix;\n }\n }\n \n // Move sign to prefix so we zero-pad after the sign\n if (argText.charAt(0) == '-') {\n prefix = '-' + prefix;\n argText = argText.substr(1);\n }\n \n // Add padding.\n while (prefix.length + argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad) {\n argText = '0' + argText;\n } else {\n prefix = ' ' + prefix;\n }\n }\n }\n \n // Insert the result into the buffer.\n argText = prefix + argText;\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {\n // Float.\n var currArg = getNextArg('double');\n var argText;\n if (isNaN(currArg)) {\n argText = 'nan';\n flagZeroPad = false;\n } else if (!isFinite(currArg)) {\n argText = (currArg < 0 ? '-' : '') + 'inf';\n flagZeroPad = false;\n } else {\n var isGeneral = false;\n var effectivePrecision = Math.min(precision, 20);\n \n // Convert g/G to f/F or e/E, as per:\n // http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html\n if (next == 103 || next == 71) {\n isGeneral = true;\n precision = precision || 1;\n var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);\n if (precision > exponent && exponent >= -4) {\n next = ((next == 103) ? 'f' : 'F').charCodeAt(0);\n precision -= exponent + 1;\n } else {\n next = ((next == 103) ? 'e' : 'E').charCodeAt(0);\n precision--;\n }\n effectivePrecision = Math.min(precision, 20);\n }\n \n if (next == 101 || next == 69) {\n argText = currArg.toExponential(effectivePrecision);\n // Make sure the exponent has at least 2 digits.\n if (/[eE][-+]\\d$/.test(argText)) {\n argText = argText.slice(0, -1) + '0' + argText.slice(-1);\n }\n } else if (next == 102 || next == 70) {\n argText = currArg.toFixed(effectivePrecision);\n if (currArg === 0 && __reallyNegative(currArg)) {\n argText = '-' + argText;\n }\n }\n \n var parts = argText.split('e');\n if (isGeneral && !flagAlternative) {\n // Discard trailing zeros and periods.\n while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&\n (parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {\n parts[0] = parts[0].slice(0, -1);\n }\n } else {\n // Make sure we have a period in alternative mode.\n if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';\n // Zero pad until required precision.\n while (precision > effectivePrecision++) parts[0] += '0';\n }\n argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');\n \n // Capitalize 'E' if needed.\n if (next == 69) argText = argText.toUpperCase();\n \n // Add sign.\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n argText = '+' + argText;\n } else if (flagPadSign) {\n argText = ' ' + argText;\n }\n }\n }\n \n // Add padding.\n while (argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {\n argText = argText[0] + '0' + argText.slice(1);\n } else {\n argText = (flagZeroPad ? '0' : ' ') + argText;\n }\n }\n }\n \n // Adjust case.\n if (next < 97) argText = argText.toUpperCase();\n \n // Insert the result into the buffer.\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 's': {\n // String.\n var arg = getNextArg('i8*');\n var argLength = arg ? _strlen(arg) : '(null)'.length;\n if (precisionSet) argLength = Math.min(argLength, precision);\n if (!flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n if (arg) {\n for (var i = 0; i < argLength; i++) {\n ret.push(HEAPU8[((arg++)|0)]);\n }\n } else {\n ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));\n }\n if (flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n break;\n }\n case 'c': {\n // Character.\n if (flagLeftAlign) ret.push(getNextArg('i8'));\n while (--width > 0) {\n ret.push(32);\n }\n if (!flagLeftAlign) ret.push(getNextArg('i8'));\n break;\n }\n case 'n': {\n // Write the length written so far to the next parameter.\n var ptr = getNextArg('i32*');\n HEAP32[((ptr)>>2)]=ret.length;\n break;\n }\n case '%': {\n // Literal percent sign.\n ret.push(curr);\n break;\n }\n default: {\n // Unknown specifiers remain untouched.\n for (var i = startTextIndex; i < textIndex + 2; i++) {\n ret.push(HEAP8[(i)]);\n }\n }\n }\n textIndex += 2;\n // TODO: Support a/A (hex float) and m (last error) specifiers.\n // TODO: Support %1${specifier} for arg selection.\n } else {\n ret.push(curr);\n textIndex += 1;\n }\n }\n return ret;\n }function _snprintf(s, n, format, varargs) {\n // int snprintf(char *restrict s, size_t n, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var result = __formatString(format, varargs);\n var limit = (n === undefined) ? result.length\n : Math.min(result.length, Math.max(n - 1, 0));\n if (s < 0) {\n s = -s;\n var buf = _malloc(limit+1);\n HEAP32[((s)>>2)]=buf;\n s = buf;\n }\n for (var i = 0; i < limit; i++) {\n HEAP8[(((s)+(i))|0)]=result[i];\n }\n if (limit < n || (n === undefined)) HEAP8[(((s)+(i))|0)]=0;\n return result.length;\n }function _vsnprintf(s, n, format, va_arg) {\n return _snprintf(s, n, format, HEAP32[((va_arg)>>2)]);\n }\n\n \n \n \n function __getFloat(text) {\n return /^[+-]?[0-9]*\\.?[0-9]+([eE][+-]?[0-9]+)?/.exec(text);\n }function __scanString(format, get, unget, varargs) {\n if (!__scanString.whiteSpace) {\n __scanString.whiteSpace = {};\n __scanString.whiteSpace[32] = 1;\n __scanString.whiteSpace[9] = 1;\n __scanString.whiteSpace[10] = 1;\n __scanString.whiteSpace[11] = 1;\n __scanString.whiteSpace[12] = 1;\n __scanString.whiteSpace[13] = 1;\n }\n // Supports %x, %4x, %d.%d, %lld, %s, %f, %lf.\n // TODO: Support all format specifiers.\n format = Pointer_stringify(format);\n var soFar = 0;\n if (format.indexOf('%n') >= 0) {\n // need to track soFar\n var _get = get;\n get = function get() {\n soFar++;\n return _get();\n }\n var _unget = unget;\n unget = function unget() {\n soFar--;\n return _unget();\n }\n }\n var formatIndex = 0;\n var argsi = 0;\n var fields = 0;\n var argIndex = 0;\n var next;\n \n mainLoop:\n for (var formatIndex = 0; formatIndex < format.length;) {\n if (format[formatIndex] === '%' && format[formatIndex+1] == 'n') {\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n HEAP32[((argPtr)>>2)]=soFar;\n formatIndex += 2;\n continue;\n }\n \n if (format[formatIndex] === '%') {\n var nextC = format.indexOf('c', formatIndex+1);\n if (nextC > 0) {\n var maxx = 1;\n if (nextC > formatIndex+1) {\n var sub = format.substring(formatIndex+1, nextC);\n maxx = parseInt(sub);\n if (maxx != sub) maxx = 0;\n }\n if (maxx) {\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n fields++;\n for (var i = 0; i < maxx; i++) {\n next = get();\n HEAP8[((argPtr++)|0)]=next;\n if (next === 0) return i > 0 ? fields : fields-1; // we failed to read the full length of this field\n }\n formatIndex += nextC - formatIndex + 1;\n continue;\n }\n }\n }\n \n // handle %[...]\n if (format[formatIndex] === '%' && format.indexOf('[', formatIndex+1) > 0) {\n var match = /\\%([0-9]*)\\[(\\^)?(\\]?[^\\]]*)\\]/.exec(format.substring(formatIndex));\n if (match) {\n var maxNumCharacters = parseInt(match[1]) || Infinity;\n var negateScanList = (match[2] === '^');\n var scanList = match[3];\n \n // expand \"middle\" dashs into character sets\n var middleDashMatch;\n while ((middleDashMatch = /([^\\-])\\-([^\\-])/.exec(scanList))) {\n var rangeStartCharCode = middleDashMatch[1].charCodeAt(0);\n var rangeEndCharCode = middleDashMatch[2].charCodeAt(0);\n for (var expanded = ''; rangeStartCharCode <= rangeEndCharCode; expanded += String.fromCharCode(rangeStartCharCode++));\n scanList = scanList.replace(middleDashMatch[1] + '-' + middleDashMatch[2], expanded);\n }\n \n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n fields++;\n \n for (var i = 0; i < maxNumCharacters; i++) {\n next = get();\n if (negateScanList) {\n if (scanList.indexOf(String.fromCharCode(next)) < 0) {\n HEAP8[((argPtr++)|0)]=next;\n } else {\n unget();\n break;\n }\n } else {\n if (scanList.indexOf(String.fromCharCode(next)) >= 0) {\n HEAP8[((argPtr++)|0)]=next;\n } else {\n unget();\n break;\n }\n }\n }\n \n // write out null-terminating character\n HEAP8[((argPtr++)|0)]=0;\n formatIndex += match[0].length;\n \n continue;\n }\n } \n // remove whitespace\n while (1) {\n next = get();\n if (next == 0) return fields;\n if (!(next in __scanString.whiteSpace)) break;\n }\n unget();\n \n if (format[formatIndex] === '%') {\n formatIndex++;\n var suppressAssignment = false;\n if (format[formatIndex] == '*') {\n suppressAssignment = true;\n formatIndex++;\n }\n var maxSpecifierStart = formatIndex;\n while (format[formatIndex].charCodeAt(0) >= 48 &&\n format[formatIndex].charCodeAt(0) <= 57) {\n formatIndex++;\n }\n var max_;\n if (formatIndex != maxSpecifierStart) {\n max_ = parseInt(format.slice(maxSpecifierStart, formatIndex), 10);\n }\n var long_ = false;\n var half = false;\n var longLong = false;\n if (format[formatIndex] == 'l') {\n long_ = true;\n formatIndex++;\n if (format[formatIndex] == 'l') {\n longLong = true;\n formatIndex++;\n }\n } else if (format[formatIndex] == 'h') {\n half = true;\n formatIndex++;\n }\n var type = format[formatIndex];\n formatIndex++;\n var curr = 0;\n var buffer = [];\n // Read characters according to the format. floats are trickier, they may be in an unfloat state in the middle, then be a valid float later\n if (type == 'f' || type == 'e' || type == 'g' ||\n type == 'F' || type == 'E' || type == 'G') {\n next = get();\n while (next > 0 && (!(next in __scanString.whiteSpace))) {\n buffer.push(String.fromCharCode(next));\n next = get();\n }\n var m = __getFloat(buffer.join(''));\n var last = m ? m[0].length : 0;\n for (var i = 0; i < buffer.length - last + 1; i++) {\n unget();\n }\n buffer.length = last;\n } else {\n next = get();\n var first = true;\n \n // Strip the optional 0x prefix for %x.\n if ((type == 'x' || type == 'X') && (next == 48)) {\n var peek = get();\n if (peek == 120 || peek == 88) {\n next = get();\n } else {\n unget();\n }\n }\n \n while ((curr < max_ || isNaN(max_)) && next > 0) {\n if (!(next in __scanString.whiteSpace) && // stop on whitespace\n (type == 's' ||\n ((type === 'd' || type == 'u' || type == 'i') && ((next >= 48 && next <= 57) ||\n (first && next == 45))) ||\n ((type === 'x' || type === 'X') && (next >= 48 && next <= 57 ||\n next >= 97 && next <= 102 ||\n next >= 65 && next <= 70))) &&\n (formatIndex >= format.length || next !== format[formatIndex].charCodeAt(0))) { // Stop when we read something that is coming up\n buffer.push(String.fromCharCode(next));\n next = get();\n curr++;\n first = false;\n } else {\n break;\n }\n }\n unget();\n }\n if (buffer.length === 0) return 0; // Failure.\n if (suppressAssignment) continue;\n \n var text = buffer.join('');\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n switch (type) {\n case 'd': case 'u': case 'i':\n if (half) {\n HEAP16[((argPtr)>>1)]=parseInt(text, 10);\n } else if (longLong) {\n (tempI64 = [parseInt(text, 10)>>>0,(tempDouble=parseInt(text, 10),(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((argPtr)>>2)]=tempI64[0],HEAP32[(((argPtr)+(4))>>2)]=tempI64[1]);\n } else {\n HEAP32[((argPtr)>>2)]=parseInt(text, 10);\n }\n break;\n case 'X':\n case 'x':\n HEAP32[((argPtr)>>2)]=parseInt(text, 16);\n break;\n case 'F':\n case 'f':\n case 'E':\n case 'e':\n case 'G':\n case 'g':\n case 'E':\n // fallthrough intended\n if (long_) {\n HEAPF64[((argPtr)>>3)]=parseFloat(text);\n } else {\n HEAPF32[((argPtr)>>2)]=parseFloat(text);\n }\n break;\n case 's':\n var array = intArrayFromString(text);\n for (var j = 0; j < array.length; j++) {\n HEAP8[(((argPtr)+(j))|0)]=array[j];\n }\n break;\n }\n fields++;\n } else if (format[formatIndex].charCodeAt(0) in __scanString.whiteSpace) {\n next = get();\n while (next in __scanString.whiteSpace) {\n if (next <= 0) break mainLoop; // End of input.\n next = get();\n }\n unget(next);\n formatIndex++;\n } else {\n // Not a specifier.\n next = get();\n if (format[formatIndex].charCodeAt(0) !== next) {\n unget(next);\n break mainLoop;\n }\n formatIndex++;\n }\n }\n return fields;\n }function _sscanf(s, format, varargs) {\n // int sscanf(const char *restrict s, const char *restrict format, ... );\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/scanf.html\n var index = 0;\n function get() { return HEAP8[(((s)+(index++))|0)]; };\n function unget() { index--; };\n return __scanString(format, get, unget, varargs);\n }function _vsscanf(s, format, va_arg) {\n return _sscanf(s, format, HEAP32[((va_arg)>>2)]);\n }\n\n\n\n \n \n \n function _recv(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _read(fd, buf, len);\n }\n \n function _pread(fildes, buf, nbyte, offset) {\n // ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.read(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _read(fildes, buf, nbyte) {\n // ssize_t read(int fildes, void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.read(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _fread(ptr, size, nitems, stream) {\n // size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fread.html\n var bytesToRead = nitems * size;\n if (bytesToRead == 0) {\n return 0;\n }\n var bytesRead = 0;\n var streamObj = FS.getStreamFromPtr(stream);\n if (!streamObj) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return 0;\n }\n while (streamObj.ungotten.length && bytesToRead > 0) {\n HEAP8[((ptr++)|0)]=streamObj.ungotten.pop();\n bytesToRead--;\n bytesRead++;\n }\n var err = _read(streamObj.fd, ptr, bytesToRead);\n if (err == -1) {\n if (streamObj) streamObj.error = true;\n return 0;\n }\n bytesRead += err;\n if (bytesRead < bytesToRead) streamObj.eof = true;\n return Math.floor(bytesRead / size);\n }function _fgetc(stream) {\n // int fgetc(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fgetc.html\n var streamObj = FS.getStreamFromPtr(stream);\n if (!streamObj) return -1;\n if (streamObj.eof || streamObj.error) return -1;\n var ret = _fread(_fgetc.ret, 1, 1, stream);\n if (ret == 0) {\n return -1;\n } else if (ret == -1) {\n streamObj.error = true;\n return -1;\n } else {\n return HEAPU8[((_fgetc.ret)|0)];\n }\n }\n\n var _llvm_memmove_p0i8_p0i8_i32=_memmove;\n\n var ___cxa_atexit=_atexit;\n\n \n function _strerror_r(errnum, strerrbuf, buflen) {\n if (errnum in ERRNO_MESSAGES) {\n if (ERRNO_MESSAGES[errnum].length > buflen - 1) {\n return ___setErrNo(ERRNO_CODES.ERANGE);\n } else {\n var msg = ERRNO_MESSAGES[errnum];\n writeAsciiToMemory(msg, strerrbuf);\n return 0;\n }\n } else {\n return ___setErrNo(ERRNO_CODES.EINVAL);\n }\n }function _strerror(errnum) {\n if (!_strerror.buffer) _strerror.buffer = _malloc(256);\n _strerror_r(errnum, _strerror.buffer, 256);\n return _strerror.buffer;\n }\n\n \n \n function __isLeapYear(year) {\n return year%4 === 0 && (year%100 !== 0 || year%400 === 0);\n }\n \n function __arraySum(array, index) {\n var sum = 0;\n for (var i = 0; i <= index; sum += array[i++]);\n return sum;\n }\n \n \n var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];\n \n var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date, days) {\n var newDate = new Date(date.getTime());\n while(days > 0) {\n var leap = __isLeapYear(newDate.getFullYear());\n var currentMonth = newDate.getMonth();\n var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth];\n \n if (days > daysInCurrentMonth-newDate.getDate()) {\n // we spill over to next month\n days -= (daysInCurrentMonth-newDate.getDate()+1);\n newDate.setDate(1);\n if (currentMonth < 11) {\n newDate.setMonth(currentMonth+1)\n } else {\n newDate.setMonth(0);\n newDate.setFullYear(newDate.getFullYear()+1);\n }\n } else {\n // we stay in current month \n newDate.setDate(newDate.getDate()+days);\n return newDate;\n }\n }\n \n return newDate;\n }function _strftime(s, maxsize, format, tm) {\n // size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html\n \n var date = {\n tm_sec: HEAP32[((tm)>>2)],\n tm_min: HEAP32[(((tm)+(4))>>2)],\n tm_hour: HEAP32[(((tm)+(8))>>2)],\n tm_mday: HEAP32[(((tm)+(12))>>2)],\n tm_mon: HEAP32[(((tm)+(16))>>2)],\n tm_year: HEAP32[(((tm)+(20))>>2)],\n tm_wday: HEAP32[(((tm)+(24))>>2)],\n tm_yday: HEAP32[(((tm)+(28))>>2)],\n tm_isdst: HEAP32[(((tm)+(32))>>2)]\n };\n \n var pattern = Pointer_stringify(format);\n \n // expand format\n var EXPANSION_RULES_1 = {\n '%c': '%a %b %d %H:%M:%S %Y', // Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013\n '%D': '%m/%d/%y', // Equivalent to %m / %d / %y\n '%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d\n '%h': '%b', // Equivalent to %b\n '%r': '%I:%M:%S %p', // Replaced by the time in a.m. and p.m. notation\n '%R': '%H:%M', // Replaced by the time in 24-hour notation\n '%T': '%H:%M:%S', // Replaced by the time\n '%x': '%m/%d/%y', // Replaced by the locale's appropriate date representation\n '%X': '%H:%M:%S', // Replaced by the locale's appropriate date representation\n };\n for (var rule in EXPANSION_RULES_1) {\n pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_1[rule]);\n }\n \n var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n var MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n \n function leadingSomething(value, digits, character) {\n var str = typeof value === 'number' ? value.toString() : (value || '');\n while (str.length < digits) {\n str = character[0]+str;\n }\n return str;\n };\n \n function leadingNulls(value, digits) {\n return leadingSomething(value, digits, '0');\n };\n \n function compareByDay(date1, date2) {\n function sgn(value) {\n return value < 0 ? -1 : (value > 0 ? 1 : 0);\n };\n \n var compare;\n if ((compare = sgn(date1.getFullYear()-date2.getFullYear())) === 0) {\n if ((compare = sgn(date1.getMonth()-date2.getMonth())) === 0) {\n compare = sgn(date1.getDate()-date2.getDate());\n }\n }\n return compare;\n };\n \n function getFirstWeekStartDate(janFourth) {\n switch (janFourth.getDay()) {\n case 0: // Sunday\n return new Date(janFourth.getFullYear()-1, 11, 29);\n case 1: // Monday\n return janFourth;\n case 2: // Tuesday\n return new Date(janFourth.getFullYear(), 0, 3);\n case 3: // Wednesday\n return new Date(janFourth.getFullYear(), 0, 2);\n case 4: // Thursday\n return new Date(janFourth.getFullYear(), 0, 1);\n case 5: // Friday\n return new Date(janFourth.getFullYear()-1, 11, 31);\n case 6: // Saturday\n return new Date(janFourth.getFullYear()-1, 11, 30);\n }\n };\n \n function getWeekBasedYear(date) {\n var thisDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);\n \n var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);\n var janFourthNextYear = new Date(thisDate.getFullYear()+1, 0, 4);\n \n var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);\n var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);\n \n if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) {\n // this date is after the start of the first week of this year\n if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) {\n return thisDate.getFullYear()+1;\n } else {\n return thisDate.getFullYear();\n }\n } else { \n return thisDate.getFullYear()-1;\n }\n };\n \n var EXPANSION_RULES_2 = {\n '%a': function(date) {\n return WEEKDAYS[date.tm_wday].substring(0,3);\n },\n '%A': function(date) {\n return WEEKDAYS[date.tm_wday];\n },\n '%b': function(date) {\n return MONTHS[date.tm_mon].substring(0,3);\n },\n '%B': function(date) {\n return MONTHS[date.tm_mon];\n },\n '%C': function(date) {\n var year = date.tm_year+1900;\n return leadingNulls(Math.floor(year/100),2);\n },\n '%d': function(date) {\n return leadingNulls(date.tm_mday, 2);\n },\n '%e': function(date) {\n return leadingSomething(date.tm_mday, 2, ' ');\n },\n '%g': function(date) {\n // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. \n // In this system, weeks begin on a Monday and week 1 of the year is the week that includes \n // January 4th, which is also the week that includes the first Thursday of the year, and \n // is also the first week that contains at least four days in the year. \n // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of \n // the last week of the preceding year; thus, for Saturday 2nd January 1999, \n // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th, \n // or 31st is a Monday, it and any following days are part of week 1 of the following year. \n // Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.\n \n return getWeekBasedYear(date).toString().substring(2);\n },\n '%G': function(date) {\n return getWeekBasedYear(date);\n },\n '%H': function(date) {\n return leadingNulls(date.tm_hour, 2);\n },\n '%I': function(date) {\n return leadingNulls(date.tm_hour < 13 ? date.tm_hour : date.tm_hour-12, 2);\n },\n '%j': function(date) {\n // Day of the year (001-366)\n return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date.tm_mon-1), 3);\n },\n '%m': function(date) {\n return leadingNulls(date.tm_mon+1, 2);\n },\n '%M': function(date) {\n return leadingNulls(date.tm_min, 2);\n },\n '%n': function() {\n return '\\n';\n },\n '%p': function(date) {\n if (date.tm_hour > 0 && date.tm_hour < 13) {\n return 'AM';\n } else {\n return 'PM';\n }\n },\n '%S': function(date) {\n return leadingNulls(date.tm_sec, 2);\n },\n '%t': function() {\n return '\\t';\n },\n '%u': function(date) {\n var day = new Date(date.tm_year+1900, date.tm_mon+1, date.tm_mday, 0, 0, 0, 0);\n return day.getDay() || 7;\n },\n '%U': function(date) {\n // Replaced by the week number of the year as a decimal number [00,53]. \n // The first Sunday of January is the first day of week 1; \n // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]\n var janFirst = new Date(date.tm_year+1900, 0, 1);\n var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7-janFirst.getDay());\n var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);\n \n // is target date after the first Sunday?\n if (compareByDay(firstSunday, endDate) < 0) {\n // calculate difference in days between first Sunday and endDate\n var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;\n var firstSundayUntilEndJanuary = 31-firstSunday.getDate();\n var days = firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();\n return leadingNulls(Math.ceil(days/7), 2);\n }\n \n return compareByDay(firstSunday, janFirst) === 0 ? '01': '00';\n },\n '%V': function(date) {\n // Replaced by the week number of the year (Monday as the first day of the week) \n // as a decimal number [01,53]. If the week containing 1 January has four \n // or more days in the new year, then it is considered week 1. \n // Otherwise, it is the last week of the previous year, and the next week is week 1. \n // Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]\n var janFourthThisYear = new Date(date.tm_year+1900, 0, 4);\n var janFourthNextYear = new Date(date.tm_year+1901, 0, 4);\n \n var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);\n var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);\n \n var endDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);\n \n if (compareByDay(endDate, firstWeekStartThisYear) < 0) {\n // if given date is before this years first week, then it belongs to the 53rd week of last year\n return '53';\n } \n \n if (compareByDay(firstWeekStartNextYear, endDate) <= 0) {\n // if given date is after next years first week, then it belongs to the 01th week of next year\n return '01';\n }\n \n // given date is in between CW 01..53 of this calendar year\n var daysDifference;\n if (firstWeekStartThisYear.getFullYear() < date.tm_year+1900) {\n // first CW of this year starts last year\n daysDifference = date.tm_yday+32-firstWeekStartThisYear.getDate()\n } else {\n // first CW of this year starts this year\n daysDifference = date.tm_yday+1-firstWeekStartThisYear.getDate();\n }\n return leadingNulls(Math.ceil(daysDifference/7), 2);\n },\n '%w': function(date) {\n var day = new Date(date.tm_year+1900, date.tm_mon+1, date.tm_mday, 0, 0, 0, 0);\n return day.getDay();\n },\n '%W': function(date) {\n // Replaced by the week number of the year as a decimal number [00,53]. \n // The first Monday of January is the first day of week 1; \n // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]\n var janFirst = new Date(date.tm_year, 0, 1);\n var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7-janFirst.getDay()+1);\n var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);\n \n // is target date after the first Monday?\n if (compareByDay(firstMonday, endDate) < 0) {\n var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;\n var firstMondayUntilEndJanuary = 31-firstMonday.getDate();\n var days = firstMondayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();\n return leadingNulls(Math.ceil(days/7), 2);\n }\n return compareByDay(firstMonday, janFirst) === 0 ? '01': '00';\n },\n '%y': function(date) {\n // Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]\n return (date.tm_year+1900).toString().substring(2);\n },\n '%Y': function(date) {\n // Replaced by the year as a decimal number (for example, 1997). [ tm_year]\n return date.tm_year+1900;\n },\n '%z': function(date) {\n // Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ),\n // or by no characters if no timezone is determinable. \n // For example, \"-0430\" means 4 hours 30 minutes behind UTC (west of Greenwich). \n // If tm_isdst is zero, the standard time offset is used. \n // If tm_isdst is greater than zero, the daylight savings time offset is used. \n // If tm_isdst is negative, no characters are returned. \n // FIXME: we cannot determine time zone (or can we?)\n return '';\n },\n '%Z': function(date) {\n // Replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. [ tm_isdst]\n // FIXME: we cannot determine time zone (or can we?)\n return '';\n },\n '%%': function() {\n return '%';\n }\n };\n for (var rule in EXPANSION_RULES_2) {\n if (pattern.indexOf(rule) >= 0) {\n pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_2[rule](date));\n }\n }\n \n var bytes = intArrayFromString(pattern, false);\n if (bytes.length > maxsize) {\n return 0;\n } \n \n writeArrayToMemory(bytes, s);\n return bytes.length-1;\n }function _strftime_l(s, maxsize, format, tm) {\n return _strftime(s, maxsize, format, tm); // no locale support yet\n }\n\n var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;\n\n\n function _pthread_cond_wait() {\n return 0;\n }\n\n \n function _isdigit(chr) {\n return chr >= 48 && chr <= 57;\n }function _isdigit_l(chr) {\n return _isdigit(chr); // no locale support yet\n }\n\n var _fabs=Math_abs;\n\n function _llvm_lifetime_start() {}\n\n var _getc=_fgetc;\n\n var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n function ___ctype_b_loc() {\n // http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/baselib---ctype-b-loc.html\n var me = ___ctype_b_loc;\n if (!me.ret) {\n var values = [\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,8195,8194,8194,8194,8194,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,24577,49156,49156,49156,\n 49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,55304,55304,55304,55304,55304,55304,55304,55304,\n 55304,55304,49156,49156,49156,49156,49156,49156,49156,54536,54536,54536,54536,54536,54536,50440,50440,50440,50440,50440,\n 50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,49156,49156,49156,49156,49156,\n 49156,54792,54792,54792,54792,54792,54792,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,\n 50696,50696,50696,50696,50696,50696,50696,49156,49156,49156,49156,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n ];\n var i16size = 2;\n var arr = _malloc(values.length * i16size);\n for (var i = 0; i < values.length; i++) {\n HEAP16[(((arr)+(i * i16size))>>1)]=values[i];\n }\n me.ret = allocate([arr + 128 * i16size], 'i16*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function _freelocale(locale) {\n _free(locale);\n }\n\n function ___cxa_allocate_exception(size) {\n var ptr = _malloc(size + ___cxa_exception_header_size);\n return ptr + ___cxa_exception_header_size;\n }\n\n var _fmodl=_fmod;\n\n function _catopen(name, oflag) {\n // nl_catd catopen (const char *name, int oflag)\n return -1;\n }\n\n function _catgets(catd, set_id, msg_id, s) {\n // char *catgets (nl_catd catd, int set_id, int msg_id, const char *s)\n return s;\n }\n\n \n \n function _sprintf(s, format, varargs) {\n // int sprintf(char *restrict s, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n return _snprintf(s, undefined, format, varargs);\n }function _asprintf(s, format, varargs) {\n return _sprintf(-s, format, varargs);\n }function _vasprintf(s, format, va_arg) {\n return _asprintf(s, format, HEAP32[((va_arg)>>2)]);\n }\n\n function _time(ptr) {\n var ret = Math.floor(Date.now()/1000);\n if (ptr) {\n HEAP32[((ptr)>>2)]=ret;\n }\n return ret;\n }\n\n function _copysign(a, b) {\n return __reallyNegative(a) === __reallyNegative(b) ? a : -a;\n }\n\n function ___ctype_toupper_loc() {\n // http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-toupper-loc.html\n var me = ___ctype_toupper_loc;\n if (!me.ret) {\n var values = [\n 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,\n 158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,\n 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,\n 218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,\n 248,249,250,251,252,253,254,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,\n 73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,\n 81,82,83,84,85,86,87,88,89,90,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,\n 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,\n 175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,\n 205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,\n 235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255\n ];\n var i32size = 4;\n var arr = _malloc(values.length * i32size);\n for (var i = 0; i < values.length; i++) {\n HEAP32[(((arr)+(i * i32size))>>2)]=values[i];\n }\n me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function ___cxa_guard_acquire(variable) {\n if (!HEAP8[(variable)]) { // ignore SAFE_HEAP stuff because llvm mixes i64 and i8 here\n HEAP8[(variable)]=1;\n return 1;\n }\n return 0;\n }\n\n function ___ctype_tolower_loc() {\n // http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-tolower-loc.html\n var me = ___ctype_tolower_loc;\n if (!me.ret) {\n var values = [\n 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,\n 158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,\n 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,\n 218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,\n 248,249,250,251,252,253,254,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,97,98,99,100,101,102,103,\n 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,96,97,98,99,100,101,102,103,\n 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,\n 134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,\n 164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,\n 194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,\n 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,\n 254,255\n ];\n var i32size = 4;\n var arr = _malloc(values.length * i32size);\n for (var i = 0; i < values.length; i++) {\n HEAP32[(((arr)+(i * i32size))>>2)]=values[i];\n }\n me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function ___cxa_begin_catch(ptr) {\n __ZSt18uncaught_exceptionv.uncaught_exception--;\n ___cxa_caught_exceptions.push(___cxa_last_thrown_exception);\n return ptr;\n }\n\n \n Module[\"_bitshift64Shl\"] = _bitshift64Shl;\n\n\n function __ZNSt9exceptionD2Ev() {}\n\n var _copysignl=_copysign;\n\n var __ZTISt9exception=allocate([allocate([1,0,0,0,0,0,0], \"i8\", ALLOC_STATIC)+8, 0], \"i32\", ALLOC_STATIC);\n\n var ___dso_handle=allocate(1, \"i32*\", ALLOC_STATIC);\n\n\n\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\n__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });\n_fgetc.ret = allocate([0], \"i8\", ALLOC_STATIC);\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n var ctlz_i8 = allocate([8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], \"i8\", ALLOC_DYNAMIC);\n var cttz_i8 = allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0], \"i8\", ALLOC_DYNAMIC);\n\nvar Math_min = Math.min;\nfunction invoke_iiii(index,a1,a2,a3) {\n try {\n return Module[\"dynCall_iiii\"](index,a1,a2,a3);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {\n try {\n Module[\"dynCall_viiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiii(index,a1,a2,a3,a4,a5) {\n try {\n Module[\"dynCall_viiiii\"](index,a1,a2,a3,a4,a5);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_vi(index,a1) {\n try {\n Module[\"dynCall_vi\"](index,a1);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_vii(index,a1,a2) {\n try {\n Module[\"dynCall_vii\"](index,a1,a2);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {\n try {\n Module[\"dynCall_viiiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_ii(index,a1) {\n try {\n return Module[\"dynCall_ii\"](index,a1);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiid(index,a1,a2,a3,a4,a5,a6,a7) {\n try {\n Module[\"dynCall_viiiiiid\"](index,a1,a2,a3,a4,a5,a6,a7);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viii(index,a1,a2,a3) {\n try {\n Module[\"dynCall_viii\"](index,a1,a2,a3);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiid(index,a1,a2,a3,a4,a5,a6) {\n try {\n Module[\"dynCall_viiiiid\"](index,a1,a2,a3,a4,a5,a6);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_v(index) {\n try {\n Module[\"dynCall_v\"](index);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {\n try {\n return Module[\"dynCall_iiiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiii(index,a1,a2,a3,a4) {\n try {\n return Module[\"dynCall_iiiii\"](index,a1,a2,a3,a4);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {\n try {\n Module[\"dynCall_viiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {\n try {\n Module[\"dynCall_viiiiii\"](index,a1,a2,a3,a4,a5,a6);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iii(index,a1,a2) {\n try {\n return Module[\"dynCall_iii\"](index,a1,a2);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiiii(index,a1,a2,a3,a4,a5) {\n try {\n return Module[\"dynCall_iiiiii\"](index,a1,a2,a3,a4,a5);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiii(index,a1,a2,a3,a4) {\n try {\n Module[\"dynCall_viiii\"](index,a1,a2,a3,a4);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=env.ctlz_i8|0;var o=env.___rand_seed|0;var p=env.__ZTISt9exception|0;var q=env.___dso_handle|0;var r=env._stderr|0;var s=env._stdin|0;var t=env._stdout|0;var u=0;var v=0;var w=0;var x=0;var y=+env.NaN,z=+env.Infinity;var A=0,B=0,C=0,D=0,E=0.0,F=0,G=0,H=0,I=0.0;var J=0;var K=0;var L=0;var M=0;var N=0;var O=0;var P=0;var Q=0;var R=0;var S=0;var T=global.Math.floor;var U=global.Math.abs;var V=global.Math.sqrt;var W=global.Math.pow;var X=global.Math.cos;var Y=global.Math.sin;var Z=global.Math.tan;var _=global.Math.acos;var $=global.Math.asin;var aa=global.Math.atan;var ba=global.Math.atan2;var ca=global.Math.exp;var da=global.Math.log;var ea=global.Math.ceil;var fa=global.Math.imul;var ga=env.abort;var ha=env.assert;var ia=env.asmPrintInt;var ja=env.asmPrintFloat;var ka=env.min;var la=env.invoke_iiii;var ma=env.invoke_viiiiiii;var na=env.invoke_viiiii;var oa=env.invoke_vi;var pa=env.invoke_vii;var qa=env.invoke_viiiiiiiii;var ra=env.invoke_ii;var sa=env.invoke_viiiiiid;var ta=env.invoke_viii;var ua=env.invoke_viiiiid;var va=env.invoke_v;var wa=env.invoke_iiiiiiiii;var xa=env.invoke_iiiii;var ya=env.invoke_viiiiiiii;var za=env.invoke_viiiiii;var Aa=env.invoke_iii;var Ba=env.invoke_iiiiii;var Ca=env.invoke_viiii;var Da=env._fabs;var Ea=env._vsscanf;var Fa=env.__ZSt9terminatev;var Ga=env.___cxa_guard_acquire;var Ha=env.__reallyNegative;var Ia=env.__ZSt18uncaught_exceptionv;var Ja=env.___ctype_toupper_loc;var Ka=env.__addDays;var La=env._sbrk;var Ma=env.___cxa_begin_catch;var Na=env._emscripten_memcpy_big;var Oa=env._sysconf;var Pa=env._fileno;var Qa=env._fread;var Ra=env._write;var Sa=env.__isLeapYear;var Ta=env.__ZNSt9exceptionD2Ev;var Ua=env.___cxa_does_inherit;var Va=env.__exit;var Wa=env.___cxa_rethrow;var Xa=env._catclose;var Ya=env._llvm_lifetime_end;var Za=env._send;var _a=env.___cxa_is_number_type;var $a=env.___cxa_free_exception;var ab=env.___cxa_find_matching_catch;var bb=env._isxdigit_l;var cb=env.___cxa_guard_release;var db=env._strtol;var eb=env.___setErrNo;var fb=env._newlocale;var gb=env._isdigit_l;var hb=env.___resumeException;var ib=env._freelocale;var jb=env._sprintf;var kb=env._vasprintf;var lb=env._vsnprintf;var mb=env._strtoull_l;var nb=env._read;var ob=env._fwrite;var pb=env._time;var qb=env._pthread_mutex_lock;var rb=env._catopen;var sb=env._exit;var tb=env.___ctype_b_loc;var ub=env._fmod;var vb=env.___cxa_allocate_exception;var wb=env._atoi;var xb=env._strtoll;var yb=env._pwrite;var zb=env._uselocale;var Ab=env._snprintf;var Bb=env.__scanString;var Cb=env.___cxa_end_catch;var Db=env._strtoull;var Eb=env._strftime;var Fb=env._isxdigit;var Gb=env.__parseInt;var Hb=env._pthread_cond_broadcast;var Ib=env._recv;var Jb=env._fgetc;var Kb=env.__parseInt64;var Lb=env.__getFloat;var Mb=env._abort;var Nb=env._isspace;var Ob=env._pthread_cond_wait;var Pb=env._llvm_lifetime_start;var Qb=env._ungetc;var Rb=env._fflush;var Sb=env._strftime_l;var Tb=env._sscanf;var Ub=env._catgets;var Vb=env._asprintf;var Wb=env._strtoll_l;var Xb=env.__arraySum;var Yb=env.___ctype_tolower_loc;var Zb=env._pthread_mutex_unlock;var _b=env._pread;var $b=env._mkport;var ac=env.___errno_location;var bc=env._copysign;var cc=env.___cxa_throw;var dc=env._isdigit;var ec=env._strerror;var fc=env.__formatString;var gc=env._atexit;var hc=env._strerror_r;var ic=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction Yg(b,d,e,f,g,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;fh(n,g,v,l,m);g=o;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(o,10,0);if((a[g]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=pc[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=pc[c[(c[z>>2]|0)+36>>2]&127](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[g]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}ye(o,P<<1,0);if((a[g]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}ye(o,Q,0);if((a[g]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=pc[c[(c[E>>2]|0)+36>>2]&127](E)|0}else{U=c[I>>2]|0}if((gh(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){pc[c[(c[E>>2]|0)+40>>2]&127](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);h[k>>3]=+Ol(M,c[p>>2]|0,j);mj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=pc[c[(c[E>>2]|0)+36>>2]&127](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=pc[c[(c[L>>2]|0)+36>>2]&127](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}function Zg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];_g(a,0,k,j,f,g,h);i=b;return}function _g(b,d,e,f,g,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;fh(n,g,v,l,m);g=o;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(o,10,0);if((a[g]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=pc[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=pc[c[(c[z>>2]|0)+36>>2]&127](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[g]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}ye(o,P<<1,0);if((a[g]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}ye(o,Q,0);if((a[g]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=pc[c[(c[E>>2]|0)+36>>2]&127](E)|0}else{U=c[I>>2]|0}if((gh(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){pc[c[(c[E>>2]|0)+40>>2]&127](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);h[k>>3]=+Nl(M,c[p>>2]|0,j);mj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=pc[c[(c[E>>2]|0)+36>>2]&127](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=pc[c[(c[L>>2]|0)+36>>2]&127](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}function $g(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0;d=i;i=i+8|0;k=d;l=i;i=i+16|0;m=i;i=i+104|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+160|0;r=n;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;Qe(o,g);g=o;o=c[g>>2]|0;if(!((c[1280]|0)==-1)){c[l>>2]=5120;c[l+4>>2]=118;c[l+8>>2]=0;qe(5120,l,119)}l=(c[5124>>2]|0)+ -1|0;s=c[o+8>>2]|0;if(!((c[o+12>>2]|0)-s>>2>>>0>l>>>0)){t=vb(4)|0;u=t;pm(u);cc(t|0,13088,107)}o=c[s+(l<<2)>>2]|0;if((o|0)==0){t=vb(4)|0;u=t;pm(u);cc(t|0,13088,107)}t=m;vc[c[(c[o>>2]|0)+48>>2]&7](o,3672,3698|0,t)|0;Yd(c[g>>2]|0)|0;g=p;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(p,10,0);if((a[g]&1)==0){o=p+1|0;v=o;w=p+8|0;x=o}else{o=p+8|0;v=p+1|0;w=o;x=c[o>>2]|0}o=e;e=f;f=p;u=p+4|0;l=m+96|0;s=m+100|0;y=q;z=m+104|0;A=m;m=n+4|0;B=c[o>>2]|0;C=x;D=q;q=0;E=x;a:while(1){do{if((B|0)==0){F=0;G=1}else{x=c[B+12>>2]|0;if((x|0)==(c[B+16>>2]|0)){H=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{H=c[x>>2]|0}if(!((H|0)==-1)){F=B;G=0;break}c[o>>2]=0;F=0;G=1}}while(0);x=c[e>>2]|0;do{if((x|0)==0){I=22}else{J=c[x+12>>2]|0;if((J|0)==(c[x+16>>2]|0)){K=pc[c[(c[x>>2]|0)+36>>2]&127](x)|0}else{K=c[J>>2]|0}if((K|0)==-1){c[e>>2]=0;I=22;break}else{if(G){break}else{L=E;break a}}}}while(0);if((I|0)==22){I=0;if(G){L=E;break}}x=a[g]|0;J=(x&1)==0;if(J){M=(x&255)>>>1}else{M=c[u>>2]|0}if((C-E|0)==(M|0)){if(J){N=(x&255)>>>1;O=(x&255)>>>1}else{x=c[u>>2]|0;N=x;O=x}ye(p,O<<1,0);if((a[g]&1)==0){P=10}else{P=(c[f>>2]&-2)+ -1|0}ye(p,P,0);if((a[g]&1)==0){Q=v}else{Q=c[w>>2]|0}R=Q+N|0;S=Q}else{R=C;S=E}x=c[F+12>>2]|0;if((x|0)==(c[F+16>>2]|0)){T=pc[c[(c[F>>2]|0)+36>>2]&127](F)|0}else{T=c[x>>2]|0}x=(R|0)==(S|0);do{if(x){J=(c[l>>2]|0)==(T|0);if(!J){if((c[s>>2]|0)!=(T|0)){I=43;break}}a[R]=J?43:45;U=R+1|0;V=D;W=0}else{I=43}}while(0);do{if((I|0)==43){I=0;J=a[r]|0;if((J&1)==0){X=(J&255)>>>1}else{X=c[m>>2]|0}if((X|0)!=0&(T|0)==0){if((D-y|0)>=160){U=R;V=D;W=q;break}c[D>>2]=q;U=R;V=D+4|0;W=0;break}else{Y=t}while(1){J=Y+4|0;if((c[Y>>2]|0)==(T|0)){Z=Y;break}if((J|0)==(z|0)){Z=z;break}else{Y=J}}J=Z-A|0;_=J>>2;if((J|0)>92){L=S;break a}if((J|0)<88){a[R]=a[3672+_|0]|0;U=R+1|0;V=D;W=q+1|0;break}if(x){L=R;break a}if((R-S|0)>=3){L=S;break a}if((a[R+ -1|0]|0)!=48){L=S;break a}a[R]=a[3672+_|0]|0;U=R+1|0;V=D;W=0}}while(0);x=c[o>>2]|0;_=x+12|0;J=c[_>>2]|0;if((J|0)==(c[x+16>>2]|0)){pc[c[(c[x>>2]|0)+40>>2]&127](x)|0;B=x;C=U;D=V;q=W;E=S;continue}else{c[_>>2]=J+4;B=x;C=U;D=V;q=W;E=S;continue}}a[L+3|0]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);S=c[1254]|0;c[k>>2]=j;if((Eg(L,S,3712,k)|0)!=1){c[h>>2]=4}k=c[o>>2]|0;do{if((k|0)==0){$=0;aa=1}else{S=c[k+12>>2]|0;if((S|0)==(c[k+16>>2]|0)){ba=pc[c[(c[k>>2]|0)+36>>2]&127](k)|0}else{ba=c[S>>2]|0}if(!((ba|0)==-1)){$=k;aa=0;break}c[o>>2]=0;$=0;aa=1}}while(0);o=c[e>>2]|0;do{if((o|0)==0){I=78}else{k=c[o+12>>2]|0;if((k|0)==(c[o+16>>2]|0)){ca=pc[c[(c[o>>2]|0)+36>>2]&127](o)|0}else{ca=c[k>>2]|0}if((ca|0)==-1){c[e>>2]=0;I=78;break}if(!aa){break}da=b;c[da>>2]=$;ve(p);ve(n);i=d;return}}while(0);do{if((I|0)==78){if(aa){break}da=b;c[da>>2]=$;ve(p);ve(n);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;da=b;c[da>>2]=$;ve(p);ve(n);i=d;return}function ah(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;o=c[f>>2]|0;p=(o|0)==(e|0);do{if(p){q=(c[m+96>>2]|0)==(b|0);if(!q){if((c[m+100>>2]|0)!=(b|0)){break}}c[f>>2]=e+1;a[e]=q?43:45;c[g>>2]=0;r=0;i=n;return r|0}}while(0);q=a[j]|0;if((q&1)==0){s=(q&255)>>>1}else{s=c[j+4>>2]|0}if((s|0)!=0&(b|0)==(h|0)){h=c[l>>2]|0;if((h-k|0)>=160){r=0;i=n;return r|0}k=c[g>>2]|0;c[l>>2]=h+4;c[h>>2]=k;c[g>>2]=0;r=0;i=n;return r|0}k=m+104|0;h=m;while(1){l=h+4|0;if((c[h>>2]|0)==(b|0)){t=h;break}if((l|0)==(k|0)){t=k;break}else{h=l}}h=t-m|0;m=h>>2;if((h|0)>92){r=-1;i=n;return r|0}do{if((d|0)==10|(d|0)==8){if((m|0)<(d|0)){break}else{r=-1}i=n;return r|0}else if((d|0)==16){if((h|0)<88){break}if(p){r=-1;i=n;return r|0}if((o-e|0)>=3){r=-1;i=n;return r|0}if((a[o+ -1|0]|0)!=48){r=-1;i=n;return r|0}c[g>>2]=0;t=a[3672+m|0]|0;c[f>>2]=o+1;a[o]=t;r=0;i=n;return r|0}}while(0);e=a[3672+m|0]|0;c[f>>2]=o+1;a[o]=e;c[g>>2]=(c[g>>2]|0)+1;r=0;i=n;return r|0}function bh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+40|0;h=g;j=g+16|0;k=g+32|0;Qe(k,d);d=k;k=c[d>>2]|0;if(!((c[1282]|0)==-1)){c[j>>2]=5128;c[j+4>>2]=118;c[j+8>>2]=0;qe(5128,j,119)}j=(c[5132>>2]|0)+ -1|0;l=c[k+8>>2]|0;if(!((c[k+12>>2]|0)-l>>2>>>0>j>>>0)){m=vb(4)|0;n=m;pm(n);cc(m|0,13088,107)}k=c[l+(j<<2)>>2]|0;if((k|0)==0){m=vb(4)|0;n=m;pm(n);cc(m|0,13088,107)}vc[c[(c[k>>2]|0)+32>>2]&7](k,3672,3698|0,e)|0;e=c[d>>2]|0;if(!((c[1318]|0)==-1)){c[h>>2]=5272;c[h+4>>2]=118;c[h+8>>2]=0;qe(5272,h,119)}h=(c[5276>>2]|0)+ -1|0;k=c[e+8>>2]|0;if(!((c[e+12>>2]|0)-k>>2>>>0>h>>>0)){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}e=c[k+(h<<2)>>2]|0;if((e|0)==0){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}else{o=e;a[f]=pc[c[(c[e>>2]|0)+16>>2]&127](o)|0;nc[c[(c[e>>2]|0)+20>>2]&63](b,o);Yd(c[d>>2]|0)|0;i=g;return}}function ch(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+40|0;j=h;k=h+16|0;l=h+32|0;Qe(l,d);d=l;l=c[d>>2]|0;if(!((c[1282]|0)==-1)){c[k>>2]=5128;c[k+4>>2]=118;c[k+8>>2]=0;qe(5128,k,119)}k=(c[5132>>2]|0)+ -1|0;m=c[l+8>>2]|0;if(!((c[l+12>>2]|0)-m>>2>>>0>k>>>0)){n=vb(4)|0;o=n;pm(o);cc(n|0,13088,107)}l=c[m+(k<<2)>>2]|0;if((l|0)==0){n=vb(4)|0;o=n;pm(o);cc(n|0,13088,107)}vc[c[(c[l>>2]|0)+32>>2]&7](l,3672,3704|0,e)|0;e=c[d>>2]|0;if(!((c[1318]|0)==-1)){c[j>>2]=5272;c[j+4>>2]=118;c[j+8>>2]=0;qe(5272,j,119)}j=(c[5276>>2]|0)+ -1|0;l=c[e+8>>2]|0;if(!((c[e+12>>2]|0)-l>>2>>>0>j>>>0)){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}e=c[l+(j<<2)>>2]|0;if((e|0)==0){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}else{p=e;q=e;a[f]=pc[c[(c[q>>2]|0)+12>>2]&127](p)|0;a[g]=pc[c[(c[q>>2]|0)+16>>2]&127](p)|0;nc[c[(c[e>>2]|0)+20>>2]&63](b,p);Yd(c[d>>2]|0)|0;i=h;return}}function dh(b,d,e,f,g,h,j,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0;p=i;if(b<<24>>24==h<<24>>24){if((a[d]|0)==0){q=-1;i=p;return q|0}a[d]=0;h=c[g>>2]|0;c[g>>2]=h+1;a[h]=46;h=a[k]|0;if((h&1)==0){r=(h&255)>>>1}else{r=c[k+4>>2]|0}if((r|0)==0){q=0;i=p;return q|0}r=c[m>>2]|0;if((r-l|0)>=160){q=0;i=p;return q|0}h=c[n>>2]|0;c[m>>2]=r+4;c[r>>2]=h;q=0;i=p;return q|0}do{if(b<<24>>24==j<<24>>24){h=a[k]|0;if((h&1)==0){s=(h&255)>>>1}else{s=c[k+4>>2]|0}if((s|0)==0){break}if((a[d]|0)==0){q=-1;i=p;return q|0}h=c[m>>2]|0;if((h-l|0)>=160){q=0;i=p;return q|0}r=c[n>>2]|0;c[m>>2]=h+4;c[h>>2]=r;c[n>>2]=0;q=0;i=p;return q|0}}while(0);s=o+32|0;j=o;while(1){r=j+1|0;if((a[j]|0)==b<<24>>24){t=j;break}if((r|0)==(s|0)){t=s;break}else{j=r}}j=t-o|0;if((j|0)>31){q=-1;i=p;return q|0}o=a[3672+j|0]|0;if((j|0)==24|(j|0)==25){t=c[g>>2]|0;do{if((t|0)!=(f|0)){if((a[t+ -1|0]&95|0)==(a[e]&127|0)){break}else{q=-1}i=p;return q|0}}while(0);c[g>>2]=t+1;a[t]=o;q=0;i=p;return q|0}else if((j|0)==23|(j|0)==22){a[e]=80;t=c[g>>2]|0;c[g>>2]=t+1;a[t]=o;q=0;i=p;return q|0}else{t=o&95;do{if((t|0)==(a[e]|0)){a[e]=t|128;if((a[d]|0)==0){break}a[d]=0;f=a[k]|0;if((f&1)==0){u=(f&255)>>>1}else{u=c[k+4>>2]|0}if((u|0)==0){break}f=c[m>>2]|0;if((f-l|0)>=160){break}s=c[n>>2]|0;c[m>>2]=f+4;c[f>>2]=s}}while(0);m=c[g>>2]|0;c[g>>2]=m+1;a[m]=o;if((j|0)>21){q=0;i=p;return q|0}c[n>>2]=(c[n>>2]|0)+1;q=0;i=p;return q|0}return 0}function eh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+40|0;g=f;h=f+16|0;j=f+32|0;Qe(j,b);b=j;j=c[b>>2]|0;if(!((c[1280]|0)==-1)){c[h>>2]=5120;c[h+4>>2]=118;c[h+8>>2]=0;qe(5120,h,119)}h=(c[5124>>2]|0)+ -1|0;k=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-k>>2>>>0>h>>>0)){l=vb(4)|0;m=l;pm(m);cc(l|0,13088,107)}j=c[k+(h<<2)>>2]|0;if((j|0)==0){l=vb(4)|0;m=l;pm(m);cc(l|0,13088,107)}vc[c[(c[j>>2]|0)+48>>2]&7](j,3672,3698|0,d)|0;d=c[b>>2]|0;if(!((c[1320]|0)==-1)){c[g>>2]=5280;c[g+4>>2]=118;c[g+8>>2]=0;qe(5280,g,119)}g=(c[5284>>2]|0)+ -1|0;j=c[d+8>>2]|0;if(!((c[d+12>>2]|0)-j>>2>>>0>g>>>0)){n=vb(4)|0;o=n;pm(o);cc(n|0,13088,107)}d=c[j+(g<<2)>>2]|0;if((d|0)==0){n=vb(4)|0;o=n;pm(o);cc(n|0,13088,107)}else{n=d;c[e>>2]=pc[c[(c[d>>2]|0)+16>>2]&127](n)|0;nc[c[(c[d>>2]|0)+20>>2]&63](a,n);Yd(c[b>>2]|0)|0;i=f;return}}function fh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+40|0;h=g;j=g+16|0;k=g+32|0;Qe(k,b);b=k;k=c[b>>2]|0;if(!((c[1280]|0)==-1)){c[j>>2]=5120;c[j+4>>2]=118;c[j+8>>2]=0;qe(5120,j,119)}j=(c[5124>>2]|0)+ -1|0;l=c[k+8>>2]|0;if(!((c[k+12>>2]|0)-l>>2>>>0>j>>>0)){m=vb(4)|0;n=m;pm(n);cc(m|0,13088,107)}k=c[l+(j<<2)>>2]|0;if((k|0)==0){m=vb(4)|0;n=m;pm(n);cc(m|0,13088,107)}vc[c[(c[k>>2]|0)+48>>2]&7](k,3672,3704|0,d)|0;d=c[b>>2]|0;if(!((c[1320]|0)==-1)){c[h>>2]=5280;c[h+4>>2]=118;c[h+8>>2]=0;qe(5280,h,119)}h=(c[5284>>2]|0)+ -1|0;k=c[d+8>>2]|0;if(!((c[d+12>>2]|0)-k>>2>>>0>h>>>0)){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}d=c[k+(h<<2)>>2]|0;if((d|0)==0){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}else{o=d;p=d;c[e>>2]=pc[c[(c[p>>2]|0)+12>>2]&127](o)|0;c[f>>2]=pc[c[(c[p>>2]|0)+16>>2]&127](o)|0;nc[c[(c[d>>2]|0)+20>>2]&63](a,o);Yd(c[b>>2]|0)|0;i=g;return}}function gh(b,d,e,f,g,h,j,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0;p=i;if((b|0)==(h|0)){if((a[d]|0)==0){q=-1;i=p;return q|0}a[d]=0;h=c[g>>2]|0;c[g>>2]=h+1;a[h]=46;h=a[k]|0;if((h&1)==0){r=(h&255)>>>1}else{r=c[k+4>>2]|0}if((r|0)==0){q=0;i=p;return q|0}r=c[m>>2]|0;if((r-l|0)>=160){q=0;i=p;return q|0}h=c[n>>2]|0;c[m>>2]=r+4;c[r>>2]=h;q=0;i=p;return q|0}do{if((b|0)==(j|0)){h=a[k]|0;if((h&1)==0){s=(h&255)>>>1}else{s=c[k+4>>2]|0}if((s|0)==0){break}if((a[d]|0)==0){q=-1;i=p;return q|0}h=c[m>>2]|0;if((h-l|0)>=160){q=0;i=p;return q|0}r=c[n>>2]|0;c[m>>2]=h+4;c[h>>2]=r;c[n>>2]=0;q=0;i=p;return q|0}}while(0);s=o+128|0;j=o;while(1){r=j+4|0;if((c[j>>2]|0)==(b|0)){t=j;break}if((r|0)==(s|0)){t=s;break}else{j=r}}j=t-o|0;o=j>>2;if((j|0)>124){q=-1;i=p;return q|0}t=a[3672+o|0]|0;do{if((o|0)==24|(o|0)==25){s=c[g>>2]|0;do{if((s|0)!=(f|0)){if((a[s+ -1|0]&95|0)==(a[e]&127|0)){break}else{q=-1}i=p;return q|0}}while(0);c[g>>2]=s+1;a[s]=t;q=0;i=p;return q|0}else if((o|0)==23|(o|0)==22){a[e]=80}else{b=t&95;if((b|0)!=(a[e]|0)){break}a[e]=b|128;if((a[d]|0)==0){break}a[d]=0;b=a[k]|0;if((b&1)==0){u=(b&255)>>>1}else{u=c[k+4>>2]|0}if((u|0)==0){break}b=c[m>>2]|0;if((b-l|0)>=160){break}r=c[n>>2]|0;c[m>>2]=b+4;c[b>>2]=r}}while(0);m=c[g>>2]|0;c[g>>2]=m+1;a[m]=t;if((j|0)>84){q=0;i=p;return q|0}c[n>>2]=(c[n>>2]|0)+1;q=0;i=p;return q|0}function hh(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function ih(a){a=a|0;i=i;return}function jh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;j=i;i=i+56|0;k=j;l=j+8|0;m=j+24|0;n=j+32|0;o=j+40|0;if((c[f+4>>2]&1|0)==0){p=c[(c[d>>2]|0)+24>>2]|0;c[m>>2]=c[e>>2];q=h&1;r=k;s=m;c[r+0>>2]=c[s+0>>2];xc[p&31](b,d,k,f,g,q);i=j;return}Qe(n,f);f=n;n=c[f>>2]|0;if(!((c[1318]|0)==-1)){c[l>>2]=5272;c[l+4>>2]=118;c[l+8>>2]=0;qe(5272,l,119)}l=(c[5276>>2]|0)+ -1|0;q=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-q>>2>>>0>l>>>0)){t=vb(4)|0;u=t;pm(u);cc(t|0,13088,107)}n=c[q+(l<<2)>>2]|0;if((n|0)==0){t=vb(4)|0;u=t;pm(u);cc(t|0,13088,107)}t=n;Yd(c[f>>2]|0)|0;f=c[n>>2]|0;if(h){nc[c[f+24>>2]&63](o,t)}else{nc[c[f+28>>2]&63](o,t)}t=o;f=a[t]|0;if((f&1)==0){h=o+1|0;v=h;w=h;x=o+8|0}else{h=o+8|0;v=c[h>>2]|0;w=o+1|0;x=h}h=e;e=o+4|0;n=f;f=v;while(1){if((n&1)==0){y=w;z=(n&255)>>>1}else{y=c[x>>2]|0;z=c[e>>2]|0}if((f|0)==(y+z|0)){break}v=a[f]|0;u=c[h>>2]|0;do{if((u|0)!=0){l=u+24|0;q=c[l>>2]|0;if((q|0)!=(c[u+28>>2]|0)){c[l>>2]=q+1;a[q]=v;break}if(!((yc[c[(c[u>>2]|0)+52>>2]&31](u,v&255)|0)==-1)){break}c[h>>2]=0}}while(0);n=a[t]|0;f=f+1|0}c[b>>2]=c[h>>2];ve(o);i=j;return}function kh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+24|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[3920|0]|0;a[s+1|0]=a[3921|0]|0;a[s+2|0]=a[3922|0]|0;a[s+3|0]=a[3923|0]|0;a[s+4|0]=a[3924|0]|0;a[s+5|0]=a[3925|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=m;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);v=c[1254]|0;c[k>>2]=h;h=lh(w,12,v,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else if((s|0)==32){y=k}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Qe(q,f);mh(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];ad(b,j,z,e,o,f,g);i=d;return}function lh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+16|0;h=g;c[h>>2]=f;f=zb(d|0)|0;d=lb(a|0,b|0,e|0,h|0)|0;if((f|0)==0){i=g;return d|0}zb(f|0)|0;i=g;return d|0}function mh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1282]|0)==-1)){c[m>>2]=5128;c[m+4>>2]=118;c[m+8>>2]=0;qe(5128,m,119)}m=(c[5132>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}q=j;r=c[o>>2]|0;if(!((c[1318]|0)==-1)){c[l>>2]=5272;c[l+4>>2]=118;c[l+8>>2]=0;qe(5272,l,119)}l=(c[5276>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}s=r;nc[c[(c[r>>2]|0)+20>>2]&63](n,s);t=n;l=a[t]|0;if((l&1)==0){u=(l&255)>>>1}else{u=c[n+4>>2]|0}do{if((u|0)==0){vc[c[(c[j>>2]|0)+32>>2]&7](q,b,e,f)|0;c[h>>2]=f+(e-b)}else{c[h>>2]=f;l=a[b]|0;if(l<<24>>24==43|l<<24>>24==45){o=yc[c[(c[j>>2]|0)+28>>2]&31](q,l)|0;l=c[h>>2]|0;c[h>>2]=l+1;a[l]=o;v=b+1|0}else{v=b}do{if((e-v|0)>1){if((a[v]|0)!=48){w=v;break}o=v+1|0;l=a[o]|0;if(!(l<<24>>24==88|l<<24>>24==120)){w=v;break}l=j;m=yc[c[(c[l>>2]|0)+28>>2]&31](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=m;m=yc[c[(c[l>>2]|0)+28>>2]&31](q,a[o]|0)|0;o=c[h>>2]|0;c[h>>2]=o+1;a[o]=m;w=v+2|0}else{w=v}}while(0);do{if((w|0)!=(e|0)){m=e+ -1|0;if(m>>>0>w>>>0){x=w;y=m}else{break}do{m=a[x]|0;a[x]=a[y]|0;a[y]=m;x=x+1|0;y=y+ -1|0;}while(x>>>0<y>>>0)}}while(0);m=pc[c[(c[r>>2]|0)+16>>2]&127](s)|0;if(w>>>0<e>>>0){o=n+1|0;l=j;p=n+4|0;z=n+8|0;A=0;B=0;C=w;while(1){D=(a[t]&1)==0;do{if((a[(D?o:c[z>>2]|0)+B|0]|0)==0){E=A;F=B}else{if((A|0)!=(a[(D?o:c[z>>2]|0)+B|0]|0)){E=A;F=B;break}G=c[h>>2]|0;c[h>>2]=G+1;a[G]=m;G=a[t]|0;if((G&1)==0){H=(G&255)>>>1}else{H=c[p>>2]|0}E=0;F=(B>>>0<(H+ -1|0)>>>0)+B|0}}while(0);D=yc[c[(c[l>>2]|0)+28>>2]&31](q,a[C]|0)|0;G=c[h>>2]|0;c[h>>2]=G+1;a[G]=D;D=C+1|0;if(D>>>0<e>>>0){A=E+1|0;B=F;C=D}else{break}}}C=f+(w-b)|0;B=c[h>>2]|0;if((C|0)==(B|0)){break}A=B+ -1|0;if(A>>>0>C>>>0){I=C;J=A}else{break}do{A=a[I]|0;a[I]=a[J]|0;a[J]=A;I=I+1|0;J=J+ -1|0;}while(I>>>0<J>>>0)}}while(0);if((d|0)==(e|0)){K=c[h>>2]|0;c[g>>2]=K;ve(n);i=k;return}else{K=f+(d-b)|0;c[g>>2]=K;ve(n);i=k;return}}function nh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+48|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=100}}while(0);w=n;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);x=c[1254]|0;v=l;c[v>>2]=h;c[v+4>>2]=j;j=lh(w,22,x,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Qe(r,f);mh(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];ad(b,k,z,e,p,f,g);i=d;return}function oh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+24|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[3920|0]|0;a[s+1|0]=a[3921|0]|0;a[s+2|0]=a[3922|0]|0;a[s+3|0]=a[3923|0]|0;a[s+4|0]=a[3924|0]|0;a[s+5|0]=a[3925|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=117}}while(0);w=m;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);v=c[1254]|0;c[k>>2]=h;h=lh(w,12,v,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else if((s|0)==32){y=k}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Qe(q,f);mh(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];ad(b,j,z,e,o,f,g);i=d;return}function ph(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+48|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=n;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);x=c[1254]|0;v=l;c[v>>2]=h;c[v+4>>2]=j;j=lh(w,23,x,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Qe(r,f);mh(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];ad(b,k,z,e,p,f,g);i=d;return}function qh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+24|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+64|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){if((q&1|0)==0){a[D]=97;E=0;break}else{a[D]=65;E=0;break}}else{a[D]=46;B=D+2|0;a[D+1|0]=42;if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=lh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=lh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[5024]|0)==0;if(E){do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=rh(s,r,z,n)|0}else{do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);o=c[1254]|0;c[m>>2]=c[f+8>>2];r=m+4|0;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=rh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Wm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Km(J<<1)|0;if((L|0)!=0){M=H;N=L;O=L;break}Wm()}}while(0);Qe(w,f);sh(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];ad(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Lm(N)}if((I|0)==0){i=d;return}Lm(I);i=d;return}function rh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;e=zb(b|0)|0;b=kb(a|0,d|0,g|0)|0;if((e|0)==0){i=f;return b|0}zb(e|0)|0;i=f;return b|0}function sh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1282]|0)==-1)){c[m>>2]=5128;c[m+4>>2]=118;c[m+8>>2]=0;qe(5128,m,119)}m=(c[5132>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}q=j;r=c[o>>2]|0;if(!((c[1318]|0)==-1)){c[l>>2]=5272;c[l+4>>2]=118;c[l+8>>2]=0;qe(5272,l,119)}l=(c[5276>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}s=r;nc[c[(c[r>>2]|0)+20>>2]&63](n,s);c[h>>2]=f;t=a[b]|0;if(t<<24>>24==43|t<<24>>24==45){l=yc[c[(c[j>>2]|0)+28>>2]&31](q,t)|0;t=c[h>>2]|0;c[h>>2]=t+1;a[t]=l;u=b+1|0}else{u=b}l=e;a:do{if((l-u|0)>1){if((a[u]|0)!=48){v=14;break}t=u+1|0;o=a[t]|0;if(!(o<<24>>24==88|o<<24>>24==120)){v=14;break}o=j;m=yc[c[(c[o>>2]|0)+28>>2]&31](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=m;m=u+2|0;p=yc[c[(c[o>>2]|0)+28>>2]&31](q,a[t]|0)|0;t=c[h>>2]|0;c[h>>2]=t+1;a[t]=p;if(m>>>0<e>>>0){w=m}else{x=m;y=m;break}while(1){p=a[w]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);t=w+1|0;if((bb(p<<24>>24|0,c[1254]|0)|0)==0){x=m;y=w;break a}if(t>>>0<e>>>0){w=t}else{x=m;y=t;break}}}else{v=14}}while(0);b:do{if((v|0)==14){if(u>>>0<e>>>0){z=u}else{x=u;y=u;break}while(1){w=a[z]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);p=z+1|0;if((gb(w<<24>>24|0,c[1254]|0)|0)==0){x=u;y=z;break b}if(p>>>0<e>>>0){z=p}else{x=u;y=p;break}}}}while(0);u=n;z=a[u]|0;if((z&1)==0){A=(z&255)>>>1}else{A=c[n+4>>2]|0}do{if((A|0)==0){vc[c[(c[j>>2]|0)+32>>2]&7](q,x,y,c[h>>2]|0)|0;c[h>>2]=(c[h>>2]|0)+(y-x)}else{do{if((x|0)!=(y|0)){z=y+ -1|0;if(z>>>0>x>>>0){B=x;C=z}else{break}do{z=a[B]|0;a[B]=a[C]|0;a[C]=z;B=B+1|0;C=C+ -1|0;}while(B>>>0<C>>>0)}}while(0);w=pc[c[(c[r>>2]|0)+16>>2]&127](s)|0;if(x>>>0<y>>>0){z=n+1|0;v=n+4|0;p=n+8|0;m=j;t=0;o=0;D=x;while(1){E=(a[u]&1)==0;do{if((a[(E?z:c[p>>2]|0)+o|0]|0)>0){if((t|0)!=(a[(E?z:c[p>>2]|0)+o|0]|0)){F=t;G=o;break}H=c[h>>2]|0;c[h>>2]=H+1;a[H]=w;H=a[u]|0;if((H&1)==0){I=(H&255)>>>1}else{I=c[v>>2]|0}F=0;G=(o>>>0<(I+ -1|0)>>>0)+o|0}else{F=t;G=o}}while(0);E=yc[c[(c[m>>2]|0)+28>>2]&31](q,a[D]|0)|0;H=c[h>>2]|0;c[h>>2]=H+1;a[H]=E;E=D+1|0;if(E>>>0<y>>>0){t=F+1|0;o=G;D=E}else{break}}}D=f+(x-b)|0;o=c[h>>2]|0;if((D|0)==(o|0)){break}t=o+ -1|0;if(t>>>0>D>>>0){J=D;K=t}else{break}do{t=a[J]|0;a[J]=a[K]|0;a[K]=t;J=J+1|0;K=K+ -1|0;}while(J>>>0<K>>>0)}}while(0);c:do{if(y>>>0<e>>>0){K=j;J=y;while(1){x=a[J]|0;if(x<<24>>24==46){break}G=yc[c[(c[K>>2]|0)+28>>2]&31](q,x)|0;x=c[h>>2]|0;c[h>>2]=x+1;a[x]=G;G=J+1|0;if(G>>>0<e>>>0){J=G}else{L=G;break c}}K=pc[c[(c[r>>2]|0)+12>>2]&127](s)|0;G=c[h>>2]|0;c[h>>2]=G+1;a[G]=K;L=J+1|0}else{L=y}}while(0);vc[c[(c[j>>2]|0)+32>>2]&7](q,L,e,c[h>>2]|0)|0;q=(c[h>>2]|0)+(l-L)|0;c[h>>2]=q;if((d|0)==(e|0)){M=q;c[g>>2]=M;ve(n);i=k;return}M=f+(d-b)|0;c[g>>2]=M;ve(n);i=k;return}function th(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+64|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){a[D]=76;B=D+1|0;if((q&1|0)==0){a[B]=97;E=0;break}else{a[B]=65;E=0;break}}else{a[D]=46;a[D+1|0]=42;a[D+2|0]=76;B=D+3|0;if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=lh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=lh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[5024]|0)==0;if(E){do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=rh(s,r,z,n)|0}else{do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);o=c[1254]|0;r=m;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=rh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Wm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else if((s|0)==32){K=F}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Km(J<<1)|0;if((L|0)!=0){M=H;N=L;O=L;break}Wm()}}while(0);Qe(w,f);sh(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];ad(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Lm(N)}if((I|0)==0){i=d;return}Lm(I);i=d;return}function uh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+16|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+40|0;p=i;i=i+8|0;q=i;i=i+8|0;r=m;a[r+0|0]=a[3928|0]|0;a[r+1|0]=a[3929|0]|0;a[r+2|0]=a[3930|0]|0;a[r+3|0]=a[3931|0]|0;a[r+4|0]=a[3932|0]|0;a[r+5|0]=a[3933|0]|0;m=n;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);s=c[1254]|0;c[k>>2]=h;h=lh(m,20,s,r,k)|0;k=n+h|0;r=c[f+4>>2]&176;do{if((r|0)==32){t=k}else if((r|0)==16){s=a[m]|0;if(s<<24>>24==43|s<<24>>24==45){t=n+1|0;break}if(!((h|0)>1&s<<24>>24==48)){u=10;break}s=a[n+1|0]|0;if(!(s<<24>>24==88|s<<24>>24==120)){u=10;break}t=n+2|0}else{u=10}}while(0);if((u|0)==10){t=m}u=o;Qe(p,f);r=p;p=c[r>>2]|0;if(!((c[1282]|0)==-1)){c[l>>2]=5128;c[l+4>>2]=118;c[l+8>>2]=0;qe(5128,l,119)}l=(c[5132>>2]|0)+ -1|0;s=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-s>>2>>>0>l>>>0)){v=vb(4)|0;w=v;pm(w);cc(v|0,13088,107)}p=c[s+(l<<2)>>2]|0;if((p|0)==0){v=vb(4)|0;w=v;pm(w);cc(v|0,13088,107)}Yd(c[r>>2]|0)|0;vc[c[(c[p>>2]|0)+32>>2]&7](p,m,k,u)|0;m=o+h|0;if((t|0)==(k|0)){x=m;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];ad(b,j,u,x,m,f,g);E=j;i=d;return}x=o+(t-n)|0;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];ad(b,j,u,x,m,f,g);E=j;i=d;return}function vh(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function wh(a){a=a|0;i=i;return}function xh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;j=i;i=i+56|0;k=j;l=j+8|0;m=j+24|0;n=j+32|0;o=j+40|0;if((c[f+4>>2]&1|0)==0){p=c[(c[d>>2]|0)+24>>2]|0;c[m>>2]=c[e>>2];q=h&1;r=k;s=m;c[r+0>>2]=c[s+0>>2];xc[p&31](b,d,k,f,g,q);i=j;return}Qe(n,f);f=n;n=c[f>>2]|0;if(!((c[1320]|0)==-1)){c[l>>2]=5280;c[l+4>>2]=118;c[l+8>>2]=0;qe(5280,l,119)}l=(c[5284>>2]|0)+ -1|0;q=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-q>>2>>>0>l>>>0)){t=vb(4)|0;u=t;pm(u);cc(t|0,13088,107)}n=c[q+(l<<2)>>2]|0;if((n|0)==0){t=vb(4)|0;u=t;pm(u);cc(t|0,13088,107)}t=n;Yd(c[f>>2]|0)|0;f=c[n>>2]|0;if(h){nc[c[f+24>>2]&63](o,t)}else{nc[c[f+28>>2]&63](o,t)}t=o;f=a[t]|0;if((f&1)==0){h=o+4|0;v=h;w=o+8|0;x=h}else{h=o+8|0;v=c[h>>2]|0;w=h;x=o+4|0}h=e;e=f;f=v;while(1){if((e&1)==0){y=x;z=(e&255)>>>1}else{y=c[w>>2]|0;z=c[x>>2]|0}if((f|0)==(y+(z<<2)|0)){break}v=c[f>>2]|0;n=c[h>>2]|0;do{if((n|0)!=0){u=n+24|0;l=c[u>>2]|0;if((l|0)==(c[n+28>>2]|0)){A=yc[c[(c[n>>2]|0)+52>>2]&31](n,v)|0}else{c[u>>2]=l+4;c[l>>2]=v;A=v}if(!((A|0)==-1)){break}c[h>>2]=0}}while(0);e=a[t]|0;f=f+4|0}c[b>>2]=c[h>>2];He(o);i=j;return}function yh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+88|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[3920|0]|0;a[s+1|0]=a[3921|0]|0;a[s+2|0]=a[3922|0]|0;a[s+3|0]=a[3923|0]|0;a[s+4|0]=a[3924|0]|0;a[s+5|0]=a[3925|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=100}}while(0);w=m;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);x=c[1254]|0;c[k>>2]=h;h=lh(w,12,x,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==32){y=k}else if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Qe(q,f);zh(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];Ah(b,j,z,e,o,f,g);i=d;return}function zh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1280]|0)==-1)){c[m>>2]=5120;c[m+4>>2]=118;c[m+8>>2]=0;qe(5120,m,119)}m=(c[5124>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}q=j;r=c[o>>2]|0;if(!((c[1320]|0)==-1)){c[l>>2]=5280;c[l+4>>2]=118;c[l+8>>2]=0;qe(5280,l,119)}l=(c[5284>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}s=r;nc[c[(c[r>>2]|0)+20>>2]&63](n,s);t=n;l=a[t]|0;if((l&1)==0){u=(l&255)>>>1}else{u=c[n+4>>2]|0}do{if((u|0)==0){vc[c[(c[j>>2]|0)+48>>2]&7](q,b,e,f)|0;l=f+(e-b<<2)|0;c[h>>2]=l;v=l}else{c[h>>2]=f;l=a[b]|0;if(l<<24>>24==43|l<<24>>24==45){o=yc[c[(c[j>>2]|0)+44>>2]&31](q,l)|0;l=c[h>>2]|0;c[h>>2]=l+4;c[l>>2]=o;w=b+1|0}else{w=b}do{if((e-w|0)>1){if((a[w]|0)!=48){x=w;break}o=w+1|0;l=a[o]|0;if(!(l<<24>>24==88|l<<24>>24==120)){x=w;break}l=j;m=yc[c[(c[l>>2]|0)+44>>2]&31](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=m;m=yc[c[(c[l>>2]|0)+44>>2]&31](q,a[o]|0)|0;o=c[h>>2]|0;c[h>>2]=o+4;c[o>>2]=m;x=w+2|0}else{x=w}}while(0);do{if((x|0)!=(e|0)){m=e+ -1|0;if(m>>>0>x>>>0){y=x;z=m}else{break}do{m=a[y]|0;a[y]=a[z]|0;a[z]=m;y=y+1|0;z=z+ -1|0;}while(y>>>0<z>>>0)}}while(0);m=pc[c[(c[r>>2]|0)+16>>2]&127](s)|0;if(x>>>0<e>>>0){o=n+1|0;l=j;p=n+4|0;A=n+8|0;B=0;C=0;D=x;while(1){E=(a[t]&1)==0;do{if((a[(E?o:c[A>>2]|0)+C|0]|0)==0){F=B;G=C}else{if((B|0)!=(a[(E?o:c[A>>2]|0)+C|0]|0)){F=B;G=C;break}H=c[h>>2]|0;c[h>>2]=H+4;c[H>>2]=m;H=a[t]|0;if((H&1)==0){I=(H&255)>>>1}else{I=c[p>>2]|0}F=0;G=(C>>>0<(I+ -1|0)>>>0)+C|0}}while(0);E=yc[c[(c[l>>2]|0)+44>>2]&31](q,a[D]|0)|0;H=c[h>>2]|0;J=H+4|0;c[h>>2]=J;c[H>>2]=E;E=D+1|0;if(E>>>0<e>>>0){B=F+1|0;C=G;D=E}else{K=J;break}}}else{K=c[h>>2]|0}D=f+(x-b<<2)|0;if((D|0)==(K|0)){v=K;break}C=K+ -4|0;if(C>>>0>D>>>0){L=D;M=C}else{v=K;break}while(1){C=c[L>>2]|0;c[L>>2]=c[M>>2];c[M>>2]=C;C=L+4|0;D=M+ -4|0;if(C>>>0<D>>>0){M=D;L=C}else{v=K;break}}}}while(0);if((d|0)==(e|0)){N=v;c[g>>2]=N;ve(n);i=k;return}N=f+(d-b<<2)|0;c[g>>2]=N;ve(n);i=k;return}function Ah(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;k=i;i=i+16|0;l=k;m=d;d=c[m>>2]|0;if((d|0)==0){c[b>>2]=0;i=k;return}n=g;g=e;o=n-g>>2;p=h+12|0;h=c[p>>2]|0;q=(h|0)>(o|0)?h-o|0:0;o=f;h=o-g|0;g=h>>2;do{if((h|0)>0){if((jc[c[(c[d>>2]|0)+48>>2]&31](d,e,g)|0)==(g|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);do{if((q|0)>0){Ge(l,q,j);if((a[l]&1)==0){r=l+4|0}else{r=c[l+8>>2]|0}if((jc[c[(c[d>>2]|0)+48>>2]&31](d,r,q)|0)==(q|0)){He(l);break}c[m>>2]=0;c[b>>2]=0;He(l);i=k;return}}while(0);l=n-o|0;o=l>>2;do{if((l|0)>0){if((jc[c[(c[d>>2]|0)+48>>2]&31](d,f,o)|0)==(o|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);c[p>>2]=0;c[b>>2]=d;i=k;return}function Bh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+168|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=n;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);v=c[1254]|0;x=l;c[x>>2]=h;c[x+4>>2]=j;j=lh(w,22,v,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Qe(r,f);zh(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];Ah(b,k,z,e,p,f,g);i=d;return}function Ch(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+88|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[3920|0]|0;a[s+1|0]=a[3921|0]|0;a[s+2|0]=a[3922|0]|0;a[s+3|0]=a[3923|0]|0;a[s+4|0]=a[3924|0]|0;a[s+5|0]=a[3925|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=m;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);x=c[1254]|0;c[k>>2]=h;h=lh(w,12,x,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==32){y=k}else if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Qe(q,f);zh(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];Ah(b,j,z,e,o,f,g);i=d;return}function Dh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+176|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=117}}while(0);w=n;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);v=c[1254]|0;x=l;c[x>>2]=h;c[x+4>>2]=j;j=lh(w,23,v,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Qe(r,f);zh(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];Ah(b,k,z,e,p,f,g);i=d;return}function Eh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+24|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+232|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){if((q&1|0)==0){a[D]=97;E=0;break}else{a[D]=65;E=0;break}}else{a[D]=46;B=D+2|0;a[D+1|0]=42;if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=lh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=lh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[5024]|0)==0;if(E){do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=rh(s,r,z,n)|0}else{do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);o=c[1254]|0;c[m>>2]=c[f+8>>2];r=m+4|0;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=rh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Wm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Km(J<<3)|0;s=L;if((L|0)!=0){M=H;N=s;O=s;break}Wm()}}while(0);Qe(w,f);Fh(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];Ah(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Lm(N)}if((I|0)==0){i=d;return}Lm(I);i=d;return}function Fh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1280]|0)==-1)){c[m>>2]=5120;c[m+4>>2]=118;c[m+8>>2]=0;qe(5120,m,119)}m=(c[5124>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=vb(4)|0;r=q;pm(r);cc(q|0,13088,107)}q=j;r=c[o>>2]|0;if(!((c[1320]|0)==-1)){c[l>>2]=5280;c[l+4>>2]=118;c[l+8>>2]=0;qe(5280,l,119)}l=(c[5284>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=vb(4)|0;t=s;pm(t);cc(s|0,13088,107)}s=r;nc[c[(c[r>>2]|0)+20>>2]&63](n,s);c[h>>2]=f;t=a[b]|0;if(t<<24>>24==43|t<<24>>24==45){l=yc[c[(c[j>>2]|0)+44>>2]&31](q,t)|0;t=c[h>>2]|0;c[h>>2]=t+4;c[t>>2]=l;u=b+1|0}else{u=b}l=e;a:do{if((l-u|0)>1){if((a[u]|0)!=48){v=14;break}t=u+1|0;o=a[t]|0;if(!(o<<24>>24==88|o<<24>>24==120)){v=14;break}o=j;m=yc[c[(c[o>>2]|0)+44>>2]&31](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=m;m=u+2|0;p=yc[c[(c[o>>2]|0)+44>>2]&31](q,a[t]|0)|0;t=c[h>>2]|0;c[h>>2]=t+4;c[t>>2]=p;if(m>>>0<e>>>0){w=m}else{x=m;y=m;break}while(1){p=a[w]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);t=w+1|0;if((bb(p<<24>>24|0,c[1254]|0)|0)==0){x=m;y=w;break a}if(t>>>0<e>>>0){w=t}else{x=m;y=t;break}}}else{v=14}}while(0);b:do{if((v|0)==14){if(u>>>0<e>>>0){z=u}else{x=u;y=u;break}while(1){w=a[z]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);p=z+1|0;if((gb(w<<24>>24|0,c[1254]|0)|0)==0){x=u;y=z;break b}if(p>>>0<e>>>0){z=p}else{x=u;y=p;break}}}}while(0);u=n;z=a[u]|0;if((z&1)==0){A=(z&255)>>>1}else{A=c[n+4>>2]|0}do{if((A|0)==0){vc[c[(c[j>>2]|0)+48>>2]&7](q,x,y,c[h>>2]|0)|0;z=(c[h>>2]|0)+(y-x<<2)|0;c[h>>2]=z;B=z}else{do{if((x|0)!=(y|0)){z=y+ -1|0;if(z>>>0>x>>>0){C=x;D=z}else{break}do{z=a[C]|0;a[C]=a[D]|0;a[D]=z;C=C+1|0;D=D+ -1|0;}while(C>>>0<D>>>0)}}while(0);w=pc[c[(c[r>>2]|0)+16>>2]&127](s)|0;if(x>>>0<y>>>0){z=n+1|0;v=n+4|0;p=n+8|0;m=j;t=0;o=0;E=x;while(1){F=(a[u]&1)==0;do{if((a[(F?z:c[p>>2]|0)+o|0]|0)>0){if((t|0)!=(a[(F?z:c[p>>2]|0)+o|0]|0)){G=t;H=o;break}I=c[h>>2]|0;c[h>>2]=I+4;c[I>>2]=w;I=a[u]|0;if((I&1)==0){J=(I&255)>>>1}else{J=c[v>>2]|0}G=0;H=(o>>>0<(J+ -1|0)>>>0)+o|0}else{G=t;H=o}}while(0);F=yc[c[(c[m>>2]|0)+44>>2]&31](q,a[E]|0)|0;I=c[h>>2]|0;K=I+4|0;c[h>>2]=K;c[I>>2]=F;F=E+1|0;if(F>>>0<y>>>0){t=G+1|0;o=H;E=F}else{L=K;break}}}else{L=c[h>>2]|0}E=f+(x-b<<2)|0;if((E|0)==(L|0)){B=L;break}o=L+ -4|0;if(o>>>0>E>>>0){M=E;N=o}else{B=L;break}while(1){o=c[M>>2]|0;c[M>>2]=c[N>>2];c[N>>2]=o;o=M+4|0;E=N+ -4|0;if(o>>>0<E>>>0){N=E;M=o}else{B=L;break}}}}while(0);c:do{if(y>>>0<e>>>0){L=j;M=y;while(1){N=a[M]|0;if(N<<24>>24==46){break}x=yc[c[(c[L>>2]|0)+44>>2]&31](q,N)|0;N=c[h>>2]|0;H=N+4|0;c[h>>2]=H;c[N>>2]=x;x=M+1|0;if(x>>>0<e>>>0){M=x}else{O=H;P=x;break c}}L=pc[c[(c[r>>2]|0)+12>>2]&127](s)|0;x=c[h>>2]|0;H=x+4|0;c[h>>2]=H;c[x>>2]=L;O=H;P=M+1|0}else{O=B;P=y}}while(0);vc[c[(c[j>>2]|0)+48>>2]&7](q,P,e,O)|0;O=(c[h>>2]|0)+(l-P<<2)|0;c[h>>2]=O;if((d|0)==(e|0)){Q=O;c[g>>2]=Q;ve(n);i=k;return}Q=f+(d-b<<2)|0;c[g>>2]=Q;ve(n);i=k;return}function Gh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+232|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){a[D]=76;B=D+1|0;if((q&1|0)==0){a[B]=97;E=0;break}else{a[B]=65;E=0;break}}else{a[D]=46;a[D+1|0]=42;a[D+2|0]=76;B=D+3|0;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=lh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=lh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[5024]|0)==0;if(E){do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);r=c[1254]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=rh(s,r,z,n)|0}else{do{if(o){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);o=c[1254]|0;r=m;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=rh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Wm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else if((s|0)==32){K=F}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Km(J<<3)|0;s=L;if((L|0)!=0){M=H;N=s;O=s;break}Wm()}}while(0);Qe(w,f);Fh(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];Ah(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Lm(N)}if((I|0)==0){i=d;return}Lm(I);i=d;return}function Hh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+16|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+152|0;p=i;i=i+8|0;q=i;i=i+8|0;r=m;a[r+0|0]=a[3928|0]|0;a[r+1|0]=a[3929|0]|0;a[r+2|0]=a[3930|0]|0;a[r+3|0]=a[3931|0]|0;a[r+4|0]=a[3932|0]|0;a[r+5|0]=a[3933|0]|0;m=n;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);s=c[1254]|0;c[k>>2]=h;h=lh(m,20,s,r,k)|0;k=n+h|0;r=c[f+4>>2]&176;do{if((r|0)==16){s=a[m]|0;if(s<<24>>24==43|s<<24>>24==45){t=n+1|0;break}if(!((h|0)>1&s<<24>>24==48)){u=10;break}s=a[n+1|0]|0;if(!(s<<24>>24==88|s<<24>>24==120)){u=10;break}t=n+2|0}else if((r|0)==32){t=k}else{u=10}}while(0);if((u|0)==10){t=m}Qe(p,f);u=p;p=c[u>>2]|0;if(!((c[1280]|0)==-1)){c[l>>2]=5120;c[l+4>>2]=118;c[l+8>>2]=0;qe(5120,l,119)}l=(c[5124>>2]|0)+ -1|0;r=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-r>>2>>>0>l>>>0)){v=vb(4)|0;w=v;pm(w);cc(v|0,13088,107)}p=c[r+(l<<2)>>2]|0;if((p|0)==0){v=vb(4)|0;w=v;pm(w);cc(v|0,13088,107)}Yd(c[u>>2]|0)|0;u=o;vc[c[(c[p>>2]|0)+48>>2]&7](p,m,k,u)|0;m=o+(h<<2)|0;if((t|0)==(k|0)){x=m;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];Ah(b,j,u,x,m,f,g);E=j;i=d;return}x=o+(t-n<<2)|0;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];Ah(b,j,u,x,m,f,g);E=j;i=d;return}function Ih(e,f,g,h,j,k,l,m,n){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0;o=i;i=i+64|0;p=o;q=o+8|0;r=o+16|0;s=o+32|0;t=o+40|0;u=o+48|0;v=o+56|0;Qe(s,j);w=s;s=c[w>>2]|0;if(!((c[1282]|0)==-1)){c[r>>2]=5128;c[r+4>>2]=118;c[r+8>>2]=0;qe(5128,r,119)}r=(c[5132>>2]|0)+ -1|0;x=c[s+8>>2]|0;if(!((c[s+12>>2]|0)-x>>2>>>0>r>>>0)){y=vb(4)|0;z=y;pm(z);cc(y|0,13088,107)}s=c[x+(r<<2)>>2]|0;if((s|0)==0){y=vb(4)|0;z=y;pm(z);cc(y|0,13088,107)}y=s;Yd(c[w>>2]|0)|0;c[k>>2]=0;w=g;a:do{if((m|0)==(n|0)){A=65}else{z=h;r=s;x=s+8|0;B=s;C=f;D=u;E=v;F=t;G=m;H=0;b:while(1){I=H;while(1){if((I|0)!=0){A=65;break a}J=c[w>>2]|0;do{if((J|0)==0){K=0}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){K=J;break}if(!((pc[c[(c[J>>2]|0)+36>>2]&127](J)|0)==-1)){K=J;break}c[w>>2]=0;K=0}}while(0);J=(K|0)==0;L=c[z>>2]|0;c:do{if((L|0)==0){A=19}else{do{if((c[L+12>>2]|0)==(c[L+16>>2]|0)){if(!((pc[c[(c[L>>2]|0)+36>>2]&127](L)|0)==-1)){break}c[z>>2]=0;A=19;break c}}while(0);if(J){M=L}else{A=20;break b}}}while(0);if((A|0)==19){A=0;if(J){A=20;break b}else{M=0}}if((jc[c[(c[r>>2]|0)+36>>2]&31](y,a[G]|0,0)|0)<<24>>24==37){A=22;break}L=a[G]|0;if(L<<24>>24>-1){N=c[x>>2]|0;if(!((b[N+(L<<24>>24<<1)>>1]&8192)==0)){O=G;A=33;break}}P=K+12|0;L=c[P>>2]|0;Q=K+16|0;if((L|0)==(c[Q>>2]|0)){R=pc[c[(c[K>>2]|0)+36>>2]&127](K)|0}else{R=d[L]|0}L=yc[c[(c[B>>2]|0)+12>>2]&31](y,R&255)|0;if(L<<24>>24==(yc[c[(c[B>>2]|0)+12>>2]&31](y,a[G]|0)|0)<<24>>24){A=60;break}c[k>>2]=4;I=4}d:do{if((A|0)==22){A=0;I=G+1|0;if((I|0)==(n|0)){A=23;break b}L=jc[c[(c[r>>2]|0)+36>>2]&31](y,a[I]|0,0)|0;if(L<<24>>24==48|L<<24>>24==69){S=G+2|0;if((S|0)==(n|0)){A=26;break b}T=S;U=jc[c[(c[r>>2]|0)+36>>2]&31](y,a[S]|0,0)|0;V=L}else{T=I;U=L;V=0}L=c[(c[C>>2]|0)+36>>2]|0;c[D>>2]=K;c[E>>2]=M;I=q;S=u;c[I+0>>2]=c[S+0>>2];S=p;I=v;c[S+0>>2]=c[I+0>>2];oc[L&3](t,f,q,p,j,k,l,U,V);c[w>>2]=c[F>>2];W=T+1|0}else if((A|0)==33){while(1){A=0;L=O+1|0;if((L|0)==(n|0)){X=n;break}I=a[L]|0;if(!(I<<24>>24>-1)){X=L;break}if((b[N+(I<<24>>24<<1)>>1]&8192)==0){X=L;break}else{O=L;A=33}}J=K;L=M;I=M;while(1){do{if((J|0)==0){Y=0}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){Y=J;break}if(!((pc[c[(c[J>>2]|0)+36>>2]&127](J)|0)==-1)){Y=J;break}c[w>>2]=0;Y=0}}while(0);S=(Y|0)==0;do{if((I|0)==0){Z=L;A=46}else{if((c[I+12>>2]|0)!=(c[I+16>>2]|0)){if(S){_=L;$=I;break}else{W=X;break d}}if((pc[c[(c[I>>2]|0)+36>>2]&127](I)|0)==-1){c[z>>2]=0;Z=0;A=46;break}else{if(S^(L|0)==0){_=L;$=L;break}else{W=X;break d}}}}while(0);if((A|0)==46){A=0;if(S){W=X;break d}else{_=Z;$=0}}aa=Y+12|0;ba=c[aa>>2]|0;ca=Y+16|0;if((ba|0)==(c[ca>>2]|0)){da=pc[c[(c[Y>>2]|0)+36>>2]&127](Y)|0}else{da=d[ba]|0}if(!((da&255)<<24>>24>-1)){W=X;break d}if((b[(c[x>>2]|0)+(da<<24>>24<<1)>>1]&8192)==0){W=X;break d}ba=c[aa>>2]|0;if((ba|0)==(c[ca>>2]|0)){pc[c[(c[Y>>2]|0)+40>>2]&127](Y)|0;J=Y;L=_;I=$;continue}else{c[aa>>2]=ba+1;J=Y;L=_;I=$;continue}}}else if((A|0)==60){A=0;I=c[P>>2]|0;if((I|0)==(c[Q>>2]|0)){pc[c[(c[K>>2]|0)+40>>2]&127](K)|0}else{c[P>>2]=I+1}W=G+1|0}}while(0);if((W|0)==(n|0)){A=65;break a}G=W;H=c[k>>2]|0}if((A|0)==20){c[k>>2]=4;ea=K;break}else if((A|0)==23){c[k>>2]=4;ea=K;break}else if((A|0)==26){c[k>>2]=4;ea=K;break}}}while(0);if((A|0)==65){ea=c[w>>2]|0}w=g;do{if((ea|0)==0){fa=0}else{if((c[ea+12>>2]|0)!=(c[ea+16>>2]|0)){fa=ea;break}if(!((pc[c[(c[ea>>2]|0)+36>>2]&127](ea)|0)==-1)){fa=ea;break}c[w>>2]=0;fa=0}}while(0);w=(fa|0)==0;ea=h;h=c[ea>>2]|0;e:do{if((h|0)==0){A=75}else{do{if((c[h+12>>2]|0)==(c[h+16>>2]|0)){if(!((pc[c[(c[h>>2]|0)+36>>2]&127](h)|0)==-1)){break}c[ea>>2]=0;A=75;break e}}while(0);if(!w){break}ga=e;c[ga>>2]=fa;i=o;return}}while(0);do{if((A|0)==75){if(w){break}ga=e;c[ga>>2]=fa;i=o;return}}while(0);c[k>>2]=c[k>>2]|2;ga=e;c[ga>>2]=fa;i=o;return}function Jh(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Kh(a){a=a|0;i=i;return}function Lh(a){a=a|0;i=i;return 2}function Mh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;k=j;l=j+8|0;m=j+16|0;n=j+24|0;c[m>>2]=c[d>>2];c[n>>2]=c[e>>2];e=l;d=m;c[e+0>>2]=c[d+0>>2];d=k;e=n;c[d+0>>2]=c[e+0>>2];Ih(a,b,l,k,f,g,h,4032,4040|0);i=j;return}function Nh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=d+8|0;q=pc[c[(c[p>>2]|0)+20>>2]&127](p)|0;c[n>>2]=c[e>>2];c[o>>2]=c[f>>2];f=a[q]|0;if((f&1)==0){r=q+1|0;s=q+1|0;t=(f&255)>>>1}else{f=c[q+8>>2]|0;r=f;s=f;t=c[q+4>>2]|0}q=r+t|0;t=m;r=n;c[t+0>>2]=c[r+0>>2];r=l;t=o;c[r+0>>2]=c[t+0>>2];Ih(b,d,m,l,g,h,j,s,q);i=k;return}function Oh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Qe(n,f);f=n;n=c[f>>2]|0;if(!((c[1282]|0)==-1)){c[m>>2]=5128;c[m+4>>2]=118;c[m+8>>2]=0;qe(5128,m,119)}m=(c[5132>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=pc[c[c[e>>2]>>2]&127](e)|0;c[l>>2]=f;f=b+168|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=jg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=168){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+24>>2]=((g|0)/12|0|0)%7|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Ph(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Qe(n,f);f=n;n=c[f>>2]|0;if(!((c[1282]|0)==-1)){c[m>>2]=5128;c[m+4>>2]=118;c[m+8>>2]=0;qe(5128,m,119)}m=(c[5132>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=pc[c[(c[e>>2]|0)+4>>2]&127](e)|0;c[l>>2]=f;f=b+288|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=jg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=288){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+16>>2]=((g|0)/12|0|0)%12|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Qh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;b=i;i=i+40|0;j=b;k=b+8|0;l=b+16|0;m=b+32|0;Qe(m,f);f=m;m=c[f>>2]|0;if(!((c[1282]|0)==-1)){c[l>>2]=5128;c[l+4>>2]=118;c[l+8>>2]=0;qe(5128,l,119)}l=(c[5132>>2]|0)+ -1|0;n=c[m+8>>2]|0;if(!((c[m+12>>2]|0)-n>>2>>>0>l>>>0)){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}m=c[n+(l<<2)>>2]|0;if((m|0)==0){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}o=m;Yd(c[f>>2]|0)|0;f=h+20|0;c[k>>2]=c[e>>2];e=j;h=k;c[e+0>>2]=c[h+0>>2];h=Uh(d,j,g,o,4)|0;if((c[g>>2]&4|0)!=0){q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}if((h|0)<69){t=h+2e3|0}else{t=(h+ -69|0)>>>0<31?h+1900|0:h}c[f>>2]=t+ -1900;q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}function Rh(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;l=i;i=i+576|0;m=l;n=l+8|0;o=l+16|0;p=l+24|0;q=l+32|0;r=l+40|0;s=l+48|0;t=l+56|0;u=l+64|0;v=l+72|0;w=l+80|0;x=l+88|0;y=l+96|0;z=l+104|0;A=l+112|0;B=l+120|0;C=l+128|0;D=l+136|0;E=l+144|0;F=l+152|0;G=l+160|0;H=l+168|0;I=l+176|0;J=l+184|0;K=l+192|0;L=l+200|0;M=l+208|0;N=l+216|0;O=l+224|0;P=l+232|0;Q=l+240|0;R=l+248|0;S=l+256|0;T=l+264|0;U=l+272|0;V=l+280|0;W=l+288|0;X=l+296|0;Y=l+304|0;Z=l+312|0;_=l+320|0;$=l+328|0;aa=l+336|0;ba=l+344|0;ca=l+352|0;da=l+368|0;ea=l+376|0;fa=l+384|0;ga=l+392|0;ha=l+400|0;ia=l+408|0;ja=l+416|0;ka=l+424|0;la=l+432|0;ma=l+440|0;na=l+448|0;oa=l+456|0;pa=l+464|0;qa=l+472|0;ra=l+480|0;sa=l+488|0;ta=l+496|0;ua=l+504|0;va=l+512|0;wa=l+520|0;xa=l+528|0;ya=l+536|0;za=l+544|0;Aa=l+552|0;Ba=l+560|0;Ca=l+568|0;c[h>>2]=0;Qe(da,g);Da=da;da=c[Da>>2]|0;if(!((c[1282]|0)==-1)){c[ca>>2]=5128;c[ca+4>>2]=118;c[ca+8>>2]=0;qe(5128,ca,119)}ca=(c[5132>>2]|0)+ -1|0;Ea=c[da+8>>2]|0;if(!((c[da+12>>2]|0)-Ea>>2>>>0>ca>>>0)){Fa=vb(4)|0;Ga=Fa;pm(Ga);cc(Fa|0,13088,107)}da=c[Ea+(ca<<2)>>2]|0;if((da|0)==0){Fa=vb(4)|0;Ga=Fa;pm(Ga);cc(Fa|0,13088,107)}Fa=da;Yd(c[Da>>2]|0)|0;a:do{switch(k<<24>>24|0){case 106:{c[Y>>2]=c[f>>2];c[F+0>>2]=c[Y+0>>2];Da=Uh(e,F,h,Fa,3)|0;da=c[h>>2]|0;if((da&4|0)==0&(Da|0)<366){c[j+28>>2]=Da;break a}else{c[h>>2]=da|4;break a}break};case 104:case 66:case 98:{da=c[f>>2]|0;Da=d+8|0;Ga=pc[c[(c[Da>>2]|0)+4>>2]&127](Da)|0;c[aa>>2]=da;c[P+0>>2]=c[aa+0>>2];da=(jg(e,P,Ga,Ga+288|0,Fa,h,0)|0)-Ga|0;if((da|0)>=288){break a}c[j+16>>2]=((da|0)/12|0|0)%12|0;break};case 65:case 97:{da=c[f>>2]|0;Ga=d+8|0;Da=pc[c[c[Ga>>2]>>2]&127](Ga)|0;c[ba>>2]=da;c[Q+0>>2]=c[ba+0>>2];da=(jg(e,Q,Da,Da+168|0,Fa,h,0)|0)-Da|0;if((da|0)>=168){break a}c[j+24>>2]=((da|0)/12|0|0)%7|0;break};case 73:{da=j+8|0;c[Z>>2]=c[f>>2];c[G+0>>2]=c[Z+0>>2];Da=Uh(e,G,h,Fa,2)|0;Ga=c[h>>2]|0;do{if((Ga&4|0)==0){if(!((Da+ -1|0)>>>0<12)){break}c[da>>2]=Da;break a}}while(0);c[h>>2]=Ga|4;break};case 99:{Da=d+8|0;da=pc[c[(c[Da>>2]|0)+12>>2]&127](Da)|0;Da=e;c[fa>>2]=c[Da>>2];c[ga>>2]=c[f>>2];ca=a[da]|0;if((ca&1)==0){Ha=da+1|0;Ia=da+1|0;Ja=(ca&255)>>>1}else{ca=c[da+8>>2]|0;Ha=ca;Ia=ca;Ja=c[da+4>>2]|0}c[O+0>>2]=c[fa+0>>2];c[N+0>>2]=c[ga+0>>2];Ih(ea,d,O,N,g,h,j,Ia,Ha+Ja|0);c[Da>>2]=c[ea>>2];break};case 70:{Da=e;c[la>>2]=c[Da>>2];c[ma>>2]=c[f>>2];c[J+0>>2]=c[la+0>>2];c[I+0>>2]=c[ma+0>>2];Ih(ka,d,J,I,g,h,j,4048,4056|0);c[Da>>2]=c[ka>>2];break};case 68:{Da=e;c[ia>>2]=c[Da>>2];c[ja>>2]=c[f>>2];c[L+0>>2]=c[ia+0>>2];c[K+0>>2]=c[ja+0>>2];Ih(ha,d,L,K,g,h,j,4040,4048|0);c[Da>>2]=c[ha>>2];break};case 101:case 100:{Da=j+12|0;c[$>>2]=c[f>>2];c[M+0>>2]=c[$+0>>2];da=Uh(e,M,h,Fa,2)|0;ca=c[h>>2]|0;do{if((ca&4|0)==0){if(!((da+ -1|0)>>>0<31)){break}c[Da>>2]=da;break a}}while(0);c[h>>2]=ca|4;break};case 72:{c[_>>2]=c[f>>2];c[H+0>>2]=c[_+0>>2];da=Uh(e,H,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<24){c[j+8>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 109:{c[X>>2]=c[f>>2];c[E+0>>2]=c[X+0>>2];Da=Uh(e,E,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(Da|0)<13){c[j+16>>2]=Da+ -1;break a}else{c[h>>2]=da|4;break a}break};case 77:{c[W>>2]=c[f>>2];c[D+0>>2]=c[W+0>>2];da=Uh(e,D,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<60){c[j+4>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 116:case 110:{c[na>>2]=c[f>>2];c[C+0>>2]=c[na+0>>2];Sh(0,e,C,h,Fa);break};case 112:{Da=j+8|0;da=c[f>>2]|0;Ga=d+8|0;Ea=pc[c[(c[Ga>>2]|0)+8>>2]&127](Ga)|0;Ga=a[Ea]|0;if((Ga&1)==0){Ka=(Ga&255)>>>1}else{Ka=c[Ea+4>>2]|0}Ga=a[Ea+12|0]|0;if((Ga&1)==0){La=(Ga&255)>>>1}else{La=c[Ea+16>>2]|0}if((Ka|0)==(0-La|0)){c[h>>2]=c[h>>2]|4;break a}c[V>>2]=da;c[B+0>>2]=c[V+0>>2];da=jg(e,B,Ea,Ea+24|0,Fa,h,0)|0;Ga=da-Ea|0;do{if((da|0)==(Ea|0)){if((c[Da>>2]|0)!=12){break}c[Da>>2]=0;break a}}while(0);if((Ga|0)!=12){break a}Ea=c[Da>>2]|0;if((Ea|0)>=12){break a}c[Da>>2]=Ea+12;break};case 114:{Ea=e;c[pa>>2]=c[Ea>>2];c[qa>>2]=c[f>>2];c[A+0>>2]=c[pa+0>>2];c[z+0>>2]=c[qa+0>>2];Ih(oa,d,A,z,g,h,j,4056,4067|0);c[Ea>>2]=c[oa>>2];break};case 82:{Ea=e;c[sa>>2]=c[Ea>>2];c[ta>>2]=c[f>>2];c[y+0>>2]=c[sa+0>>2];c[x+0>>2]=c[ta+0>>2];Ih(ra,d,y,x,g,h,j,4072,4077|0);c[Ea>>2]=c[ra>>2];break};case 83:{c[U>>2]=c[f>>2];c[w+0>>2]=c[U+0>>2];Ea=Uh(e,w,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(Ea|0)<61){c[j>>2]=Ea;break a}else{c[h>>2]=da|4;break a}break};case 84:{da=e;c[va>>2]=c[da>>2];c[wa>>2]=c[f>>2];c[v+0>>2]=c[va+0>>2];c[u+0>>2]=c[wa+0>>2];Ih(ua,d,v,u,g,h,j,4080,4088|0);c[da>>2]=c[ua>>2];break};case 119:{c[T>>2]=c[f>>2];c[t+0>>2]=c[T+0>>2];da=Uh(e,t,h,Fa,1)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(da|0)<7){c[j+24>>2]=da;break a}else{c[h>>2]=Ea|4;break a}break};case 120:{Ea=c[(c[d>>2]|0)+20>>2]|0;c[xa>>2]=c[e>>2];c[ya>>2]=c[f>>2];c[s+0>>2]=c[xa+0>>2];c[r+0>>2]=c[ya+0>>2];kc[Ea&63](b,d,s,r,g,h,j);i=l;return};case 88:{Ea=d+8|0;da=pc[c[(c[Ea>>2]|0)+24>>2]&127](Ea)|0;Ea=e;c[Aa>>2]=c[Ea>>2];c[Ba>>2]=c[f>>2];ca=a[da]|0;if((ca&1)==0){Ma=da+1|0;Na=da+1|0;Oa=(ca&255)>>>1}else{ca=c[da+8>>2]|0;Ma=ca;Na=ca;Oa=c[da+4>>2]|0}c[q+0>>2]=c[Aa+0>>2];c[p+0>>2]=c[Ba+0>>2];Ih(za,d,q,p,g,h,j,Na,Ma+Oa|0);c[Ea>>2]=c[za>>2];break};case 121:{c[S>>2]=c[f>>2];c[o+0>>2]=c[S+0>>2];Ea=Uh(e,o,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}if((Ea|0)<69){Pa=Ea+2e3|0}else{Pa=(Ea+ -69|0)>>>0<31?Ea+1900|0:Ea}c[j+20>>2]=Pa+ -1900;break};case 89:{c[R>>2]=c[f>>2];c[n+0>>2]=c[R+0>>2];Ea=Uh(e,n,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}c[j+20>>2]=Ea+ -1900;break};case 37:{c[Ca>>2]=c[f>>2];c[m+0>>2]=c[Ca+0>>2];Th(0,e,m,h,Fa);break};default:{c[h>>2]=c[h>>2]|4}}}while(0);c[b>>2]=c[e>>2];i=l;return}function Sh(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;a=i;j=e;e=f;f=h+8|0;a:while(1){h=c[j>>2]|0;do{if((h|0)==0){k=0}else{if((c[h+12>>2]|0)!=(c[h+16>>2]|0)){k=h;break}if((pc[c[(c[h>>2]|0)+36>>2]&127](h)|0)==-1){c[j>>2]=0;k=0;break}else{k=c[j>>2]|0;break}}}while(0);h=(k|0)==0;l=c[e>>2]|0;do{if((l|0)==0){m=12}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){if(h){n=l;break}else{o=l;break a}}if((pc[c[(c[l>>2]|0)+36>>2]&127](l)|0)==-1){c[e>>2]=0;m=12;break}else{if(h){n=l;break}else{o=l;break a}}}}while(0);if((m|0)==12){m=0;if(h){o=0;break}else{n=0}}l=c[j>>2]|0;p=c[l+12>>2]|0;if((p|0)==(c[l+16>>2]|0)){q=pc[c[(c[l>>2]|0)+36>>2]&127](l)|0}else{q=d[p]|0}if(!((q&255)<<24>>24>-1)){o=n;break}if((b[(c[f>>2]|0)+(q<<24>>24<<1)>>1]&8192)==0){o=n;break}p=c[j>>2]|0;l=p+12|0;r=c[l>>2]|0;if((r|0)==(c[p+16>>2]|0)){pc[c[(c[p>>2]|0)+40>>2]&127](p)|0;continue}else{c[l>>2]=r+1;continue}}n=c[j>>2]|0;do{if((n|0)==0){s=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){s=n;break}if((pc[c[(c[n>>2]|0)+36>>2]&127](n)|0)==-1){c[j>>2]=0;s=0;break}else{s=c[j>>2]|0;break}}}while(0);j=(s|0)==0;b:do{if((o|0)==0){m=32}else{do{if((c[o+12>>2]|0)==(c[o+16>>2]|0)){if(!((pc[c[(c[o>>2]|0)+36>>2]&127](o)|0)==-1)){break}c[e>>2]=0;m=32;break b}}while(0);if(!j){break}i=a;return}}while(0);do{if((m|0)==32){if(j){break}i=a;return}}while(0);c[g>>2]=c[g>>2]|2;i=a;return}function Th(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;a=i;h=b;b=c[h>>2]|0;do{if((b|0)==0){j=0}else{if((c[b+12>>2]|0)!=(c[b+16>>2]|0)){j=b;break}if((pc[c[(c[b>>2]|0)+36>>2]&127](b)|0)==-1){c[h>>2]=0;j=0;break}else{j=c[h>>2]|0;break}}}while(0);b=(j|0)==0;j=e;e=c[j>>2]|0;a:do{if((e|0)==0){k=11}else{do{if((c[e+12>>2]|0)==(c[e+16>>2]|0)){if(!((pc[c[(c[e>>2]|0)+36>>2]&127](e)|0)==-1)){break}c[j>>2]=0;k=11;break a}}while(0);if(b){l=e}else{k=12}}}while(0);if((k|0)==11){if(b){k=12}else{l=0}}if((k|0)==12){c[f>>2]=c[f>>2]|6;i=a;return}b=c[h>>2]|0;e=c[b+12>>2]|0;if((e|0)==(c[b+16>>2]|0)){m=pc[c[(c[b>>2]|0)+36>>2]&127](b)|0}else{m=d[e]|0}if(!((jc[c[(c[g>>2]|0)+36>>2]&31](g,m&255,0)|0)<<24>>24==37)){c[f>>2]=c[f>>2]|4;i=a;return}m=c[h>>2]|0;g=m+12|0;e=c[g>>2]|0;if((e|0)==(c[m+16>>2]|0)){pc[c[(c[m>>2]|0)+40>>2]&127](m)|0}else{c[g>>2]=e+1}e=c[h>>2]|0;do{if((e|0)==0){n=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){n=e;break}if((pc[c[(c[e>>2]|0)+36>>2]&127](e)|0)==-1){c[h>>2]=0;n=0;break}else{n=c[h>>2]|0;break}}}while(0);h=(n|0)==0;b:do{if((l|0)==0){k=31}else{do{if((c[l+12>>2]|0)==(c[l+16>>2]|0)){if(!((pc[c[(c[l>>2]|0)+36>>2]&127](l)|0)==-1)){break}c[j>>2]=0;k=31;break b}}while(0);if(!h){break}i=a;return}}while(0);do{if((k|0)==31){if(h){break}i=a;return}}while(0);c[f>>2]=c[f>>2]|2;i=a;return}function Uh(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;j=i;k=a;a=c[k>>2]|0;do{if((a|0)==0){l=0}else{if((c[a+12>>2]|0)!=(c[a+16>>2]|0)){l=a;break}if((pc[c[(c[a>>2]|0)+36>>2]&127](a)|0)==-1){c[k>>2]=0;l=0;break}else{l=c[k>>2]|0;break}}}while(0);a=(l|0)==0;l=e;e=c[l>>2]|0;a:do{if((e|0)==0){m=11}else{do{if((c[e+12>>2]|0)==(c[e+16>>2]|0)){if(!((pc[c[(c[e>>2]|0)+36>>2]&127](e)|0)==-1)){break}c[l>>2]=0;m=11;break a}}while(0);if(a){n=e}else{m=12}}}while(0);if((m|0)==11){if(a){m=12}else{n=0}}if((m|0)==12){c[f>>2]=c[f>>2]|6;o=0;i=j;return o|0}a=c[k>>2]|0;e=c[a+12>>2]|0;if((e|0)==(c[a+16>>2]|0)){p=pc[c[(c[a>>2]|0)+36>>2]&127](a)|0}else{p=d[e]|0}e=p&255;do{if(e<<24>>24>-1){a=g+8|0;if((b[(c[a>>2]|0)+(p<<24>>24<<1)>>1]&2048)==0){break}q=g;r=(jc[c[(c[q>>2]|0)+36>>2]&31](g,e,0)|0)<<24>>24;s=c[k>>2]|0;t=s+12|0;u=c[t>>2]|0;if((u|0)==(c[s+16>>2]|0)){pc[c[(c[s>>2]|0)+40>>2]&127](s)|0;v=h;w=n;x=n;y=r}else{c[t>>2]=u+1;v=h;w=n;x=n;y=r}while(1){z=y+ -48|0;r=v+ -1|0;u=c[k>>2]|0;do{if((u|0)==0){A=0}else{if((c[u+12>>2]|0)!=(c[u+16>>2]|0)){A=u;break}if((pc[c[(c[u>>2]|0)+36>>2]&127](u)|0)==-1){c[k>>2]=0;A=0;break}else{A=c[k>>2]|0;break}}}while(0);u=(A|0)==0;do{if((x|0)==0){B=w;C=0}else{if((c[x+12>>2]|0)!=(c[x+16>>2]|0)){B=w;C=x;break}if(!((pc[c[(c[x>>2]|0)+36>>2]&127](x)|0)==-1)){B=w;C=w;break}c[l>>2]=0;B=0;C=0}}while(0);D=c[k>>2]|0;if(!((u^(C|0)==0)&(r|0)>0)){m=40;break}t=c[D+12>>2]|0;if((t|0)==(c[D+16>>2]|0)){E=pc[c[(c[D>>2]|0)+36>>2]&127](D)|0}else{E=d[t]|0}t=E&255;if(!(t<<24>>24>-1)){o=z;m=52;break}if((b[(c[a>>2]|0)+(E<<24>>24<<1)>>1]&2048)==0){o=z;m=52;break}s=((jc[c[(c[q>>2]|0)+36>>2]&31](g,t,0)|0)<<24>>24)+(z*10|0)|0;t=c[k>>2]|0;F=t+12|0;G=c[F>>2]|0;if((G|0)==(c[t+16>>2]|0)){pc[c[(c[t>>2]|0)+40>>2]&127](t)|0;H=r;w=B;x=C;y=s;v=H;continue}else{c[F>>2]=G+1;H=r;w=B;x=C;y=s;v=H;continue}}if((m|0)==40){do{if((D|0)==0){I=0}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){I=D;break}if((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1){c[k>>2]=0;I=0;break}else{I=c[k>>2]|0;break}}}while(0);q=(I|0)==0;b:do{if((B|0)==0){m=50}else{do{if((c[B+12>>2]|0)==(c[B+16>>2]|0)){if(!((pc[c[(c[B>>2]|0)+36>>2]&127](B)|0)==-1)){break}c[l>>2]=0;m=50;break b}}while(0);if(q){o=z}else{break}i=j;return o|0}}while(0);do{if((m|0)==50){if(q){break}else{o=z}i=j;return o|0}}while(0);c[f>>2]=c[f>>2]|2;o=z;i=j;return o|0}else if((m|0)==52){i=j;return o|0}}}while(0);c[f>>2]=c[f>>2]|4;o=0;i=j;return o|0}function Vh(a,b,d,e,f,g,h,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0;l=i;i=i+64|0;m=l;n=l+8|0;o=l+16|0;p=l+32|0;q=l+40|0;r=l+48|0;s=l+56|0;Qe(p,f);t=p;p=c[t>>2]|0;if(!((c[1280]|0)==-1)){c[o>>2]=5120;c[o+4>>2]=118;c[o+8>>2]=0;qe(5120,o,119)}o=(c[5124>>2]|0)+ -1|0;u=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-u>>2>>>0>o>>>0)){v=vb(4)|0;w=v;pm(w);cc(v|0,13088,107)}p=c[u+(o<<2)>>2]|0;if((p|0)==0){v=vb(4)|0;w=v;pm(w);cc(v|0,13088,107)}v=p;Yd(c[t>>2]|0)|0;c[g>>2]=0;t=d;a:do{if((j|0)==(k|0)){x=69}else{w=e;o=p;u=p;y=p;z=b;A=r;B=s;C=q;D=j;E=0;b:while(1){F=E;while(1){if((F|0)!=0){x=69;break a}G=c[t>>2]|0;do{if((G|0)==0){H=0;I=1}else{J=c[G+12>>2]|0;if((J|0)==(c[G+16>>2]|0)){K=pc[c[(c[G>>2]|0)+36>>2]&127](G)|0}else{K=c[J>>2]|0}if(!((K|0)==-1)){H=G;I=0;break}c[t>>2]=0;H=0;I=1}}while(0);G=c[w>>2]|0;do{if((G|0)==0){x=22}else{J=c[G+12>>2]|0;if((J|0)==(c[G+16>>2]|0)){L=pc[c[(c[G>>2]|0)+36>>2]&127](G)|0}else{L=c[J>>2]|0}if((L|0)==-1){c[w>>2]=0;x=22;break}else{if(I){M=G;break}else{x=24;break b}}}}while(0);if((x|0)==22){x=0;if(I){x=24;break b}else{M=0}}if((jc[c[(c[o>>2]|0)+52>>2]&31](v,c[D>>2]|0,0)|0)<<24>>24==37){x=26;break}if(jc[c[(c[u>>2]|0)+12>>2]&31](v,8192,c[D>>2]|0)|0){N=D;x=36;break}O=H+12|0;G=c[O>>2]|0;P=H+16|0;if((G|0)==(c[P>>2]|0)){Q=pc[c[(c[H>>2]|0)+36>>2]&127](H)|0}else{Q=c[G>>2]|0}G=yc[c[(c[y>>2]|0)+28>>2]&31](v,Q)|0;if((G|0)==(yc[c[(c[y>>2]|0)+28>>2]&31](v,c[D>>2]|0)|0)){x=64;break}c[g>>2]=4;F=4}c:do{if((x|0)==26){x=0;F=D+4|0;if((F|0)==(k|0)){x=27;break b}G=jc[c[(c[o>>2]|0)+52>>2]&31](v,c[F>>2]|0,0)|0;if(G<<24>>24==48|G<<24>>24==69){J=D+8|0;if((J|0)==(k|0)){x=30;break b}R=J;S=jc[c[(c[o>>2]|0)+52>>2]&31](v,c[J>>2]|0,0)|0;T=G}else{R=F;S=G;T=0}G=c[(c[z>>2]|0)+36>>2]|0;c[A>>2]=H;c[B>>2]=M;F=n;J=r;c[F+0>>2]=c[J+0>>2];J=m;F=s;c[J+0>>2]=c[F+0>>2];oc[G&3](q,b,n,m,f,g,h,S,T);c[t>>2]=c[C>>2];U=R+4|0}else if((x|0)==36){while(1){x=0;G=N+4|0;if((G|0)==(k|0)){V=k;break}if(jc[c[(c[u>>2]|0)+12>>2]&31](v,8192,c[G>>2]|0)|0){N=G;x=36}else{V=G;break}}G=H;F=M;J=M;while(1){do{if((G|0)==0){W=0;X=1}else{Y=c[G+12>>2]|0;if((Y|0)==(c[G+16>>2]|0)){Z=pc[c[(c[G>>2]|0)+36>>2]&127](G)|0}else{Z=c[Y>>2]|0}if(!((Z|0)==-1)){W=G;X=0;break}c[t>>2]=0;W=0;X=1}}while(0);do{if((J|0)==0){_=F;x=51}else{Y=c[J+12>>2]|0;if((Y|0)==(c[J+16>>2]|0)){$=pc[c[(c[J>>2]|0)+36>>2]&127](J)|0}else{$=c[Y>>2]|0}if(($|0)==-1){c[w>>2]=0;_=0;x=51;break}else{if(X^(F|0)==0){aa=F;ba=F;break}else{U=V;break c}}}}while(0);if((x|0)==51){x=0;if(X){U=V;break c}else{aa=_;ba=0}}Y=W+12|0;ca=c[Y>>2]|0;da=W+16|0;if((ca|0)==(c[da>>2]|0)){ea=pc[c[(c[W>>2]|0)+36>>2]&127](W)|0}else{ea=c[ca>>2]|0}if(!(jc[c[(c[u>>2]|0)+12>>2]&31](v,8192,ea)|0)){U=V;break c}ca=c[Y>>2]|0;if((ca|0)==(c[da>>2]|0)){pc[c[(c[W>>2]|0)+40>>2]&127](W)|0;G=W;F=aa;J=ba;continue}else{c[Y>>2]=ca+4;G=W;F=aa;J=ba;continue}}}else if((x|0)==64){x=0;J=c[O>>2]|0;if((J|0)==(c[P>>2]|0)){pc[c[(c[H>>2]|0)+40>>2]&127](H)|0}else{c[O>>2]=J+4}U=D+4|0}}while(0);if((U|0)==(k|0)){x=69;break a}D=U;E=c[g>>2]|0}if((x|0)==24){c[g>>2]=4;fa=H;break}else if((x|0)==27){c[g>>2]=4;fa=H;break}else if((x|0)==30){c[g>>2]=4;fa=H;break}}}while(0);if((x|0)==69){fa=c[t>>2]|0}t=d;do{if((fa|0)==0){ga=0;ha=1}else{d=c[fa+12>>2]|0;if((d|0)==(c[fa+16>>2]|0)){ia=pc[c[(c[fa>>2]|0)+36>>2]&127](fa)|0}else{ia=c[d>>2]|0}if(!((ia|0)==-1)){ga=fa;ha=0;break}c[t>>2]=0;ga=0;ha=1}}while(0);t=e;e=c[t>>2]|0;do{if((e|0)==0){x=82}else{fa=c[e+12>>2]|0;if((fa|0)==(c[e+16>>2]|0)){ja=pc[c[(c[e>>2]|0)+36>>2]&127](e)|0}else{ja=c[fa>>2]|0}if((ja|0)==-1){c[t>>2]=0;x=82;break}if(!ha){break}ka=a;c[ka>>2]=ga;i=l;return}}while(0);do{if((x|0)==82){if(ha){break}ka=a;c[ka>>2]=ga;i=l;return}}while(0);c[g>>2]=c[g>>2]|2;ka=a;c[ka>>2]=ga;i=l;return}function Wh(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Xh(a){a=a|0;i=i;return}function Yh(a){a=a|0;i=i;return 2}function Zh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;k=j;l=j+8|0;m=j+16|0;n=j+24|0;c[m>>2]=c[d>>2];c[n>>2]=c[e>>2];e=l;d=m;c[e+0>>2]=c[d+0>>2];d=k;e=n;c[d+0>>2]=c[e+0>>2];Vh(a,b,l,k,f,g,h,4184,4216|0);i=j;return}function _h(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=d+8|0;q=pc[c[(c[p>>2]|0)+20>>2]&127](p)|0;c[n>>2]=c[e>>2];c[o>>2]=c[f>>2];f=a[q]|0;if((f&1)==0){r=q+4|0;s=q+4|0;t=(f&255)>>>1}else{f=c[q+8>>2]|0;r=f;s=f;t=c[q+4>>2]|0}q=r+(t<<2)|0;t=m;r=n;c[t+0>>2]=c[r+0>>2];r=l;t=o;c[r+0>>2]=c[t+0>>2];Vh(b,d,m,l,g,h,j,s,q);i=k;return}function $h(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Qe(n,f);f=n;n=c[f>>2]|0;if(!((c[1280]|0)==-1)){c[m>>2]=5120;c[m+4>>2]=118;c[m+8>>2]=0;qe(5120,m,119)}m=(c[5124>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=pc[c[c[e>>2]>>2]&127](e)|0;c[l>>2]=f;f=b+168|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=Ig(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=168){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+24>>2]=((g|0)/12|0|0)%7|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function ai(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Qe(n,f);f=n;n=c[f>>2]|0;if(!((c[1280]|0)==-1)){c[m>>2]=5120;c[m+4>>2]=118;c[m+8>>2]=0;qe(5120,m,119)}m=(c[5124>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=vb(4)|0;q=p;pm(q);cc(p|0,13088,107)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=pc[c[(c[e>>2]|0)+4>>2]&127](e)|0;c[l>>2]=f;f=b+288|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=Ig(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=288){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+16>>2]=((g|0)/12|0|0)%12|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function bi(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;b=i;i=i+40|0;j=b;k=b+8|0;l=b+16|0;m=b+32|0;Qe(m,f);f=m;m=c[f>>2]|0;if(!((c[1280]|0)==-1)){c[l>>2]=5120;c[l+4>>2]=118;c[l+8>>2]=0;qe(5120,l,119)}l=(c[5124>>2]|0)+ -1|0;n=c[m+8>>2]|0;if(!((c[m+12>>2]|0)-n>>2>>>0>l>>>0)){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}m=c[n+(l<<2)>>2]|0;if((m|0)==0){o=vb(4)|0;p=o;pm(p);cc(o|0,13088,107)}o=m;Yd(c[f>>2]|0)|0;f=h+20|0;c[k>>2]=c[e>>2];e=j;h=k;c[e+0>>2]=c[h+0>>2];h=fi(d,j,g,o,4)|0;if((c[g>>2]&4|0)!=0){q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}if((h|0)<69){t=h+2e3|0}else{t=(h+ -69|0)>>>0<31?h+1900|0:h}c[f>>2]=t+ -1900;q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}function ci(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;l=i;i=i+576|0;m=l;n=l+8|0;o=l+16|0;p=l+24|0;q=l+32|0;r=l+40|0;s=l+48|0;t=l+56|0;u=l+64|0;v=l+72|0;w=l+80|0;x=l+88|0;y=l+96|0;z=l+104|0;A=l+112|0;B=l+120|0;C=l+128|0;D=l+136|0;E=l+144|0;F=l+152|0;G=l+160|0;H=l+168|0;I=l+176|0;J=l+184|0;K=l+192|0;L=l+200|0;M=l+208|0;N=l+216|0;O=l+224|0;P=l+232|0;Q=l+240|0;R=l+248|0;S=l+256|0;T=l+264|0;U=l+272|0;V=l+280|0;W=l+288|0;X=l+296|0;Y=l+304|0;Z=l+312|0;_=l+320|0;$=l+328|0;aa=l+336|0;ba=l+344|0;ca=l+352|0;da=l+368|0;ea=l+376|0;fa=l+384|0;ga=l+392|0;ha=l+400|0;ia=l+408|0;ja=l+416|0;ka=l+424|0;la=l+432|0;ma=l+440|0;na=l+448|0;oa=l+456|0;pa=l+464|0;qa=l+472|0;ra=l+480|0;sa=l+488|0;ta=l+496|0;ua=l+504|0;va=l+512|0;wa=l+520|0;xa=l+528|0;ya=l+536|0;za=l+544|0;Aa=l+552|0;Ba=l+560|0;Ca=l+568|0;c[h>>2]=0;Qe(da,g);Da=da;da=c[Da>>2]|0;if(!((c[1280]|0)==-1)){c[ca>>2]=5120;c[ca+4>>2]=118;c[ca+8>>2]=0;qe(5120,ca,119)}ca=(c[5124>>2]|0)+ -1|0;Ea=c[da+8>>2]|0;if(!((c[da+12>>2]|0)-Ea>>2>>>0>ca>>>0)){Fa=vb(4)|0;Ga=Fa;pm(Ga);cc(Fa|0,13088,107)}da=c[Ea+(ca<<2)>>2]|0;if((da|0)==0){Fa=vb(4)|0;Ga=Fa;pm(Ga);cc(Fa|0,13088,107)}Fa=da;Yd(c[Da>>2]|0)|0;a:do{switch(k<<24>>24|0){case 89:{c[R>>2]=c[f>>2];c[n+0>>2]=c[R+0>>2];Da=fi(e,n,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}c[j+20>>2]=Da+ -1900;break};case 121:{c[S>>2]=c[f>>2];c[o+0>>2]=c[S+0>>2];Da=fi(e,o,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}if((Da|0)<69){Ha=Da+2e3|0}else{Ha=(Da+ -69|0)>>>0<31?Da+1900|0:Da}c[j+20>>2]=Ha+ -1900;break};case 88:{Da=d+8|0;da=pc[c[(c[Da>>2]|0)+24>>2]&127](Da)|0;Da=e;c[Aa>>2]=c[Da>>2];c[Ba>>2]=c[f>>2];Ga=a[da]|0;if((Ga&1)==0){Ia=da+4|0;Ja=da+4|0;Ka=(Ga&255)>>>1}else{Ga=c[da+8>>2]|0;Ia=Ga;Ja=Ga;Ka=c[da+4>>2]|0}c[q+0>>2]=c[Aa+0>>2];c[p+0>>2]=c[Ba+0>>2];Vh(za,d,q,p,g,h,j,Ja,Ia+(Ka<<2)|0);c[Da>>2]=c[za>>2];break};case 37:{c[Ca>>2]=c[f>>2];c[m+0>>2]=c[Ca+0>>2];ei(0,e,m,h,Fa);break};case 84:{Da=e;c[va>>2]=c[Da>>2];c[wa>>2]=c[f>>2];c[v+0>>2]=c[va+0>>2];c[u+0>>2]=c[wa+0>>2];Vh(ua,d,v,u,g,h,j,4352,4384|0);c[Da>>2]=c[ua>>2];break};case 120:{Da=c[(c[d>>2]|0)+20>>2]|0;c[xa>>2]=c[e>>2];c[ya>>2]=c[f>>2];c[s+0>>2]=c[xa+0>>2];c[r+0>>2]=c[ya+0>>2];kc[Da&63](b,d,s,r,g,h,j);i=l;return};case 116:case 110:{c[na>>2]=c[f>>2];c[C+0>>2]=c[na+0>>2];di(0,e,C,h,Fa);break};case 112:{Da=j+8|0;da=c[f>>2]|0;Ga=d+8|0;ca=pc[c[(c[Ga>>2]|0)+8>>2]&127](Ga)|0;Ga=a[ca]|0;if((Ga&1)==0){La=(Ga&255)>>>1}else{La=c[ca+4>>2]|0}Ga=a[ca+12|0]|0;if((Ga&1)==0){Ma=(Ga&255)>>>1}else{Ma=c[ca+16>>2]|0}if((La|0)==(0-Ma|0)){c[h>>2]=c[h>>2]|4;break a}c[V>>2]=da;c[B+0>>2]=c[V+0>>2];da=Ig(e,B,ca,ca+24|0,Fa,h,0)|0;Ga=da-ca|0;do{if((da|0)==(ca|0)){if((c[Da>>2]|0)!=12){break}c[Da>>2]=0;break a}}while(0);if((Ga|0)!=12){break a}ca=c[Da>>2]|0;if((ca|0)>=12){break a}c[Da>>2]=ca+12;break};case 77:{c[W>>2]=c[f>>2];c[D+0>>2]=c[W+0>>2];ca=fi(e,D,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(ca|0)<60){c[j+4>>2]=ca;break a}else{c[h>>2]=da|4;break a}break};case 101:case 100:{da=j+12|0;c[$>>2]=c[f>>2];c[M+0>>2]=c[$+0>>2];ca=fi(e,M,h,Fa,2)|0;Ea=c[h>>2]|0;do{if((Ea&4|0)==0){if(!((ca+ -1|0)>>>0<31)){break}c[da>>2]=ca;break a}}while(0);c[h>>2]=Ea|4;break};case 68:{ca=e;c[ia>>2]=c[ca>>2];c[ja>>2]=c[f>>2];c[L+0>>2]=c[ia+0>>2];c[K+0>>2]=c[ja+0>>2];Vh(ha,d,L,K,g,h,j,4216,4248|0);c[ca>>2]=c[ha>>2];break};case 70:{ca=e;c[la>>2]=c[ca>>2];c[ma>>2]=c[f>>2];c[J+0>>2]=c[la+0>>2];c[I+0>>2]=c[ma+0>>2];Vh(ka,d,J,I,g,h,j,4248,4280|0);c[ca>>2]=c[ka>>2];break};case 72:{c[_>>2]=c[f>>2];c[H+0>>2]=c[_+0>>2];ca=fi(e,H,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(ca|0)<24){c[j+8>>2]=ca;break a}else{c[h>>2]=da|4;break a}break};case 73:{da=j+8|0;c[Z>>2]=c[f>>2];c[G+0>>2]=c[Z+0>>2];ca=fi(e,G,h,Fa,2)|0;Da=c[h>>2]|0;do{if((Da&4|0)==0){if(!((ca+ -1|0)>>>0<12)){break}c[da>>2]=ca;break a}}while(0);c[h>>2]=Da|4;break};case 106:{c[Y>>2]=c[f>>2];c[F+0>>2]=c[Y+0>>2];ca=fi(e,F,h,Fa,3)|0;da=c[h>>2]|0;if((da&4|0)==0&(ca|0)<366){c[j+28>>2]=ca;break a}else{c[h>>2]=da|4;break a}break};case 109:{c[X>>2]=c[f>>2];c[E+0>>2]=c[X+0>>2];da=fi(e,E,h,Fa,2)|0;ca=c[h>>2]|0;if((ca&4|0)==0&(da|0)<13){c[j+16>>2]=da+ -1;break a}else{c[h>>2]=ca|4;break a}break};case 65:case 97:{ca=c[f>>2]|0;da=d+8|0;Ea=pc[c[c[da>>2]>>2]&127](da)|0;c[ba>>2]=ca;c[Q+0>>2]=c[ba+0>>2];ca=(Ig(e,Q,Ea,Ea+168|0,Fa,h,0)|0)-Ea|0;if((ca|0)>=168){break a}c[j+24>>2]=((ca|0)/12|0|0)%7|0;break};case 104:case 66:case 98:{ca=c[f>>2]|0;Ea=d+8|0;da=pc[c[(c[Ea>>2]|0)+4>>2]&127](Ea)|0;c[aa>>2]=ca;c[P+0>>2]=c[aa+0>>2];ca=(Ig(e,P,da,da+288|0,Fa,h,0)|0)-da|0;if((ca|0)>=288){break a}c[j+16>>2]=((ca|0)/12|0|0)%12|0;break};case 99:{ca=d+8|0;da=pc[c[(c[ca>>2]|0)+12>>2]&127](ca)|0;ca=e;c[fa>>2]=c[ca>>2];c[ga>>2]=c[f>>2];Ea=a[da]|0;if((Ea&1)==0){Na=da+4|0;Oa=da+4|0;Pa=(Ea&255)>>>1}else{Ea=c[da+8>>2]|0;Na=Ea;Oa=Ea;Pa=c[da+4>>2]|0}c[O+0>>2]=c[fa+0>>2];c[N+0>>2]=c[ga+0>>2];Vh(ea,d,O,N,g,h,j,Oa,Na+(Pa<<2)|0);c[ca>>2]=c[ea>>2];break};case 114:{ca=e;c[pa>>2]=c[ca>>2];c[qa>>2]=c[f>>2];c[A+0>>2]=c[pa+0>>2];c[z+0>>2]=c[qa+0>>2];Vh(oa,d,A,z,g,h,j,4280,4324|0);c[ca>>2]=c[oa>>2];break};case 82:{ca=e;c[sa>>2]=c[ca>>2];c[ta>>2]=c[f>>2];c[y+0>>2]=c[sa+0>>2];c[x+0>>2]=c[ta+0>>2];Vh(ra,d,y,x,g,h,j,4328,4348|0);c[ca>>2]=c[ra>>2];break};case 83:{c[U>>2]=c[f>>2];c[w+0>>2]=c[U+0>>2];ca=fi(e,w,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(ca|0)<61){c[j>>2]=ca;break a}else{c[h>>2]=da|4;break a}break};case 119:{c[T>>2]=c[f>>2];c[t+0>>2]=c[T+0>>2];da=fi(e,t,h,Fa,1)|0;ca=c[h>>2]|0;if((ca&4|0)==0&(da|0)<7){c[j+24>>2]=da;break a}else{c[h>>2]=ca|4;break a}break};default:{c[h>>2]=c[h>>2]|4}}}while(0);c[b>>2]=c[e>>2];i=l;return}function di(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;a=i;g=b;b=d;d=f;a:while(1){h=c[g>>2]|0;do{if((h|0)==0){j=1}else{k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){l=pc[c[(c[h>>2]|0)+36>>2]&127](h)|0}else{l=c[k>>2]|0}if((l|0)==-1){c[g>>2]=0;j=1;break}else{j=(c[g>>2]|0)==0;break}}}while(0);h=c[b>>2]|0;do{if((h|0)==0){m=15}else{k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){n=pc[c[(c[h>>2]|0)+36>>2]&127](h)|0}else{n=c[k>>2]|0}if((n|0)==-1){c[b>>2]=0;m=15;break}else{if(j){o=h;break}else{p=h;break a}}}}while(0);if((m|0)==15){m=0;if(j){p=0;break}else{o=0}}h=c[g>>2]|0;k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){q=pc[c[(c[h>>2]|0)+36>>2]&127](h)|0}else{q=c[k>>2]|0}if(!(jc[c[(c[d>>2]|0)+12>>2]&31](f,8192,q)|0)){p=o;break}k=c[g>>2]|0;h=k+12|0;r=c[h>>2]|0;if((r|0)==(c[k+16>>2]|0)){pc[c[(c[k>>2]|0)+40>>2]&127](k)|0;continue}else{c[h>>2]=r+4;continue}}o=c[g>>2]|0;do{if((o|0)==0){s=1}else{q=c[o+12>>2]|0;if((q|0)==(c[o+16>>2]|0)){t=pc[c[(c[o>>2]|0)+36>>2]&127](o)|0}else{t=c[q>>2]|0}if((t|0)==-1){c[g>>2]=0;s=1;break}else{s=(c[g>>2]|0)==0;break}}}while(0);do{if((p|0)==0){m=37}else{g=c[p+12>>2]|0;if((g|0)==(c[p+16>>2]|0)){u=pc[c[(c[p>>2]|0)+36>>2]&127](p)|0}else{u=c[g>>2]|0}if((u|0)==-1){c[b>>2]=0;m=37;break}if(!s){break}i=a;return}}while(0);do{if((m|0)==37){if(s){break}i=a;return}}while(0);c[e>>2]=c[e>>2]|2;i=a;return}function ei(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=i;g=b;b=c[g>>2]|0;do{if((b|0)==0){h=1}else{j=c[b+12>>2]|0;if((j|0)==(c[b+16>>2]|0)){k=pc[c[(c[b>>2]|0)+36>>2]&127](b)|0}else{k=c[j>>2]|0}if((k|0)==-1){c[g>>2]=0;h=1;break}else{h=(c[g>>2]|0)==0;break}}}while(0);k=d;d=c[k>>2]|0;do{if((d|0)==0){l=14}else{b=c[d+12>>2]|0;if((b|0)==(c[d+16>>2]|0)){m=pc[c[(c[d>>2]|0)+36>>2]&127](d)|0}else{m=c[b>>2]|0}if((m|0)==-1){c[k>>2]=0;l=14;break}else{if(h){n=d;break}else{l=16;break}}}}while(0);if((l|0)==14){if(h){l=16}else{n=0}}if((l|0)==16){c[e>>2]=c[e>>2]|6;i=a;return}h=c[g>>2]|0;d=c[h+12>>2]|0;if((d|0)==(c[h+16>>2]|0)){o=pc[c[(c[h>>2]|0)+36>>2]&127](h)|0}else{o=c[d>>2]|0}if(!((jc[c[(c[f>>2]|0)+52>>2]&31](f,o,0)|0)<<24>>24==37)){c[e>>2]=c[e>>2]|4;i=a;return}o=c[g>>2]|0;f=o+12|0;d=c[f>>2]|0;if((d|0)==(c[o+16>>2]|0)){pc[c[(c[o>>2]|0)+40>>2]&127](o)|0}else{c[f>>2]=d+4}d=c[g>>2]|0;do{if((d|0)==0){p=1}else{f=c[d+12>>2]|0;if((f|0)==(c[d+16>>2]|0)){q=pc[c[(c[d>>2]|0)+36>>2]&127](d)|0}else{q=c[f>>2]|0}if((q|0)==-1){c[g>>2]=0;p=1;break}else{p=(c[g>>2]|0)==0;break}}}while(0);do{if((n|0)==0){l=38}else{g=c[n+12>>2]|0;if((g|0)==(c[n+16>>2]|0)){r=pc[c[(c[n>>2]|0)+36>>2]&127](n)|0}else{r=c[g>>2]|0}if((r|0)==-1){c[k>>2]=0;l=38;break}if(!p){break}i=a;return}}while(0);do{if((l|0)==38){if(p){break}i=a;return}}while(0);c[e>>2]=c[e>>2]|2;i=a;return}function fi(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;g=i;h=a;a=c[h>>2]|0;do{if((a|0)==0){j=1}else{k=c[a+12>>2]|0;if((k|0)==(c[a+16>>2]|0)){l=pc[c[(c[a>>2]|0)+36>>2]&127](a)|0}else{l=c[k>>2]|0}if((l|0)==-1){c[h>>2]=0;j=1;break}else{j=(c[h>>2]|0)==0;break}}}while(0);l=b;b=c[l>>2]|0;do{if((b|0)==0){m=14}else{a=c[b+12>>2]|0;if((a|0)==(c[b+16>>2]|0)){n=pc[c[(c[b>>2]|0)+36>>2]&127](b)|0}else{n=c[a>>2]|0}if((n|0)==-1){c[l>>2]=0;m=14;break}else{if(j){o=b;break}else{m=16;break}}}}while(0);if((m|0)==14){if(j){m=16}else{o=0}}if((m|0)==16){c[d>>2]=c[d>>2]|6;p=0;i=g;return p|0}j=c[h>>2]|0;b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0)){q=pc[c[(c[j>>2]|0)+36>>2]&127](j)|0}else{q=c[b>>2]|0}b=e;if(!(jc[c[(c[b>>2]|0)+12>>2]&31](e,2048,q)|0)){c[d>>2]=c[d>>2]|4;p=0;i=g;return p|0}j=e;n=(jc[c[(c[j>>2]|0)+52>>2]&31](e,q,0)|0)<<24>>24;q=c[h>>2]|0;a=q+12|0;k=c[a>>2]|0;if((k|0)==(c[q+16>>2]|0)){pc[c[(c[q>>2]|0)+40>>2]&127](q)|0;r=f;s=o;t=o;u=n}else{c[a>>2]=k+4;r=f;s=o;t=o;u=n}while(1){v=u+ -48|0;n=r+ -1|0;o=c[h>>2]|0;do{if((o|0)==0){w=1}else{f=c[o+12>>2]|0;if((f|0)==(c[o+16>>2]|0)){x=pc[c[(c[o>>2]|0)+36>>2]&127](o)|0}else{x=c[f>>2]|0}if((x|0)==-1){c[h>>2]=0;w=1;break}else{w=(c[h>>2]|0)==0;break}}}while(0);do{if((t|0)==0){y=s;z=0;A=1}else{o=c[t+12>>2]|0;if((o|0)==(c[t+16>>2]|0)){B=pc[c[(c[t>>2]|0)+36>>2]&127](t)|0}else{B=c[o>>2]|0}if((B|0)==-1){c[l>>2]=0;y=0;z=0;A=1;break}else{y=s;z=s;A=(s|0)==0;break}}}while(0);C=c[h>>2]|0;if(!((w^A)&(n|0)>0)){break}o=c[C+12>>2]|0;if((o|0)==(c[C+16>>2]|0)){D=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{D=c[o>>2]|0}if(!(jc[c[(c[b>>2]|0)+12>>2]&31](e,2048,D)|0)){p=v;m=63;break}o=((jc[c[(c[j>>2]|0)+52>>2]&31](e,D,0)|0)<<24>>24)+(v*10|0)|0;f=c[h>>2]|0;k=f+12|0;a=c[k>>2]|0;if((a|0)==(c[f+16>>2]|0)){pc[c[(c[f>>2]|0)+40>>2]&127](f)|0;E=n;s=y;t=z;u=o;r=E;continue}else{c[k>>2]=a+4;E=n;s=y;t=z;u=o;r=E;continue}}if((m|0)==63){i=g;return p|0}do{if((C|0)==0){F=1}else{E=c[C+12>>2]|0;if((E|0)==(c[C+16>>2]|0)){G=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{G=c[E>>2]|0}if((G|0)==-1){c[h>>2]=0;F=1;break}else{F=(c[h>>2]|0)==0;break}}}while(0);do{if((y|0)==0){m=60}else{h=c[y+12>>2]|0;if((h|0)==(c[y+16>>2]|0)){H=pc[c[(c[y>>2]|0)+36>>2]&127](y)|0}else{H=c[h>>2]|0}if((H|0)==-1){c[l>>2]=0;m=60;break}if(F){p=v}else{break}i=g;return p|0}}while(0);do{if((m|0)==60){if(F){break}else{p=v}i=g;return p|0}}while(0);c[d>>2]=c[d>>2]|2;p=v;i=g;return p|0}function gi(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b+8|0;f=c[e>>2]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);if((f|0)==(c[1254]|0)){g=b;Rm(g);i=d;return}ib(c[e>>2]|0);g=b;Rm(g);i=d;return}function hi(b){b=b|0;var d=0,e=0;d=i;e=b+8|0;b=c[e>>2]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);if((b|0)==(c[1254]|0)){i=d;return}ib(c[e>>2]|0);i=d;return}function ii(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;g=i;i=i+112|0;f=g;l=g+8|0;m=l;n=f;a[n]=37;o=f+1|0;a[o]=j;p=f+2|0;a[p]=k;a[f+3|0]=0;if(!(k<<24>>24==0)){a[o]=k;a[p]=j}j=Sb(m|0,100,n|0,h|0,c[d+8>>2]|0)|0;d=l+j|0;l=c[e>>2]|0;if((j|0)==0){q=l;r=b;c[r>>2]=q;i=g;return}else{s=m;t=l;u=l}while(1){l=a[s]|0;do{if((u|0)==0){v=t;w=0}else{m=u+24|0;j=c[m>>2]|0;if((j|0)==(c[u+28>>2]|0)){e=(yc[c[(c[u>>2]|0)+52>>2]&31](u,l&255)|0)==-1;v=e?0:t;w=e?0:u;break}else{c[m>>2]=j+1;a[j]=l;v=t;w=u;break}}}while(0);l=s+1|0;if((l|0)==(d|0)){q=v;break}else{s=l;t=v;u=w}}r=b;c[r>>2]=q;i=g;return}function ji(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b+8|0;f=c[e>>2]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);if((f|0)==(c[1254]|0)){g=b;Rm(g);i=d;return}ib(c[e>>2]|0);g=b;Rm(g);i=d;return}function ki(b){b=b|0;var d=0,e=0;d=i;e=b+8|0;b=c[e>>2]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);if((b|0)==(c[1254]|0)){i=d;return}ib(c[e>>2]|0);i=d;return}function li(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=i;i=i+408|0;e=f;k=f+400|0;l=e;c[k>>2]=e+400;mi(b+8|0,l,k,g,h,j);j=c[k>>2]|0;k=c[d>>2]|0;if((l|0)==(j|0)){m=k;n=a;c[n>>2]=m;i=f;return}else{o=l;p=k;q=k}while(1){k=c[o>>2]|0;if((p|0)==0){r=q;s=0}else{l=p+24|0;d=c[l>>2]|0;if((d|0)==(c[p+28>>2]|0)){t=yc[c[(c[p>>2]|0)+52>>2]&31](p,k)|0}else{c[l>>2]=d+4;c[d>>2]=k;t=k}k=(t|0)==-1;r=k?0:q;s=k?0:p}k=o+4|0;if((k|0)==(j|0)){m=r;break}else{o=k;p=s;q=r}}n=a;c[n>>2]=m;i=f;return}function mi(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+120|0;k=j;l=j+112|0;m=i;i=i+8|0;n=j+8|0;o=k;a[o]=37;p=k+1|0;a[p]=g;q=k+2|0;a[q]=h;a[k+3|0]=0;if(!(h<<24>>24==0)){a[p]=h;a[q]=g}g=b;Sb(n|0,100,o|0,f|0,c[g>>2]|0)|0;f=l;c[f>>2]=0;c[f+4>>2]=0;c[m>>2]=n;n=(c[e>>2]|0)-d>>2;f=zb(c[g>>2]|0)|0;g=fm(d,m,n,l)|0;if((f|0)!=0){zb(f|0)|0}if((g|0)==-1){ij(6008)}else{c[e>>2]=d+(g<<2);i=j;return}}function ni(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function oi(a){a=a|0;i=i;return}function pi(a){a=a|0;i=i;return 127}function qi(a){a=a|0;i=i;return 127}function ri(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function si(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function ti(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function ui(a,b){a=a|0;b=b|0;b=i;ue(a,1,45);i=b;return}function vi(a){a=a|0;i=i;return 0}function wi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function xi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function yi(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function zi(a){a=a|0;i=i;return}function Ai(a){a=a|0;i=i;return 127}function Bi(a){a=a|0;i=i;return 127}function Ci(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Di(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Ei(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Fi(a,b){a=a|0;b=b|0;b=i;ue(a,1,45);i=b;return}function Gi(a){a=a|0;i=i;return 0}function Hi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ii(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ji(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Ki(a){a=a|0;i=i;return}function Li(a){a=a|0;i=i;return 2147483647}function Mi(a){a=a|0;i=i;return 2147483647}function Ni(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Oi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Pi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Qi(a,b){a=a|0;b=b|0;b=i;Ge(a,1,45);i=b;return}function Ri(a){a=a|0;i=i;return 0}function Si(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ti(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ui(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Vi(a){a=a|0;i=i;return}function Wi(a){a=a|0;i=i;return 2147483647}function Xi(a){a=a|0;i=i;return 2147483647}function Yi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Zi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function _i(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function $i(a,b){a=a|0;b=b|0;b=i;Ge(a,1,45);i=b;return}function aj(a){a=a|0;i=i;return 0}function bj(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function cj(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function dj(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function ej(a){a=a|0;i=i;return}function fj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+104|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=i;i=i+8|0;u=i;i=i+16|0;v=i;i=i+104|0;w=p;c[w>>2]=o;x=p+4|0;c[x>>2]=120;y=o+100|0;Qe(r,h);o=r;z=c[o>>2]|0;if(!((c[1282]|0)==-1)){c[n>>2]=5128;c[n+4>>2]=118;c[n+8>>2]=0;qe(5128,n,119)}n=(c[5132>>2]|0)+ -1|0;A=c[z+8>>2]|0;if(!((c[z+12>>2]|0)-A>>2>>>0>n>>>0)){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}z=c[A+(n<<2)>>2]|0;if((z|0)==0){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}B=z;a[s]=0;C=f;c[t>>2]=c[C>>2];f=c[h+4>>2]|0;h=l;n=t;c[h+0>>2]=c[n+0>>2];n=hj(e,l,g,r,f,j,s,B,p,q,y)|0;do{if(n){y=u;vc[c[(c[z>>2]|0)+32>>2]&7](B,4744,4754|0,y)|0;p=v;f=c[q>>2]|0;r=c[w>>2]|0;g=f-r|0;do{if((g|0)>98){l=Km(g+2|0)|0;if((l|0)!=0){D=l;E=l;break}Wm()}else{D=0;E=p}}while(0);if((a[s]|0)==0){F=E}else{a[E]=45;F=E+1|0}if(r>>>0<f>>>0){g=u+10|0;l=u;h=F;t=r;while(1){A=a[t]|0;G=y;while(1){H=G+1|0;if((a[G]|0)==A<<24>>24){I=G;break}if((H|0)==(g|0)){I=g;break}else{G=H}}a[h]=a[4744+(I-l)|0]|0;G=t+1|0;A=h+1|0;if(G>>>0<(c[q>>2]|0)>>>0){h=A;t=G}else{J=A;break}}}else{J=F}a[J]=0;c[m>>2]=k;if((Tb(p|0,4760,m|0)|0)!=1){t=vb(8)|0;ce(t,4768);cc(t|0,2136,21)}if((D|0)==0){break}Lm(D)}}while(0);D=e;e=c[D>>2]|0;do{if((e|0)==0){K=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){K=e;break}if(!((pc[c[(c[e>>2]|0)+36>>2]&127](e)|0)==-1)){K=e;break}c[D>>2]=0;K=0}}while(0);D=(K|0)==0;e=c[C>>2]|0;do{if((e|0)==0){L=31}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){if(D){break}else{L=33;break}}if((pc[c[(c[e>>2]|0)+36>>2]&127](e)|0)==-1){c[C>>2]=0;L=31;break}else{if(D){break}else{L=33;break}}}}while(0);if((L|0)==31){if(D){L=33}}if((L|0)==33){c[j>>2]=c[j>>2]|2}c[b>>2]=K;Yd(c[o>>2]|0)|0;o=c[w>>2]|0;c[w>>2]=0;if((o|0)==0){i=d;return}mc[c[x>>2]&255](o);i=d;return}function gj(a){a=a|0;i=i;return}function hj(e,f,g,h,j,k,l,m,n,o,p){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;var q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,nc=0,oc=0,qc=0,rc=0,sc=0,tc=0,uc=0;q=i;i=i+408|0;r=q;s=q+400|0;t=s;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+8|0;D=r;c[s>>2]=0;E=w;c[E+0>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;F=x;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;G=y;c[G+0>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;H=z;c[H+0>>2]=0;c[H+4>>2]=0;c[H+8>>2]=0;I=A;c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;lj(g,h,t,u,v,w,x,y,z,B);t=n;c[o>>2]=c[t>>2];h=e;e=f;f=s;s=m+8|0;m=z+1|0;g=z+4|0;J=z+8|0;K=y+1|0;L=y+4|0;M=y+8|0;N=(j&512|0)!=0;j=x+1|0;O=x+8|0;P=x+4|0;Q=A;R=Q+1|0;S=A+8|0;T=A+4|0;U=f+3|0;V=n+4|0;n=w+4|0;W=r+400|0;r=D;X=D;D=p;p=0;Y=0;Z=120;a:while(1){_=c[h>>2]|0;do{if((_|0)==0){$=0}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){$=_;break}if((pc[c[(c[_>>2]|0)+36>>2]&127](_)|0)==-1){c[h>>2]=0;$=0;break}else{$=c[h>>2]|0;break}}}while(0);_=($|0)==0;aa=c[e>>2]|0;do{if((aa|0)==0){ba=12}else{if((c[aa+12>>2]|0)!=(c[aa+16>>2]|0)){if(_){ca=aa;break}else{da=X;ea=r;fa=Y;ga=Z;ba=269;break a}}if((pc[c[(c[aa>>2]|0)+36>>2]&127](aa)|0)==-1){c[e>>2]=0;ba=12;break}else{if(_){ca=aa;break}else{da=X;ea=r;fa=Y;ga=Z;ba=269;break a}}}}while(0);if((ba|0)==12){ba=0;if(_){da=X;ea=r;fa=Y;ga=Z;ba=269;break}else{ca=0}}b:do{switch(a[f+p|0]|0){case 1:{if((p|0)==3){da=X;ea=r;fa=Y;ga=Z;ba=269;break a}aa=c[h>>2]|0;ha=c[aa+12>>2]|0;if((ha|0)==(c[aa+16>>2]|0)){ia=pc[c[(c[aa>>2]|0)+36>>2]&127](aa)|0}else{ia=d[ha]|0}if(!((ia&255)<<24>>24>-1)){ba=25;break a}if((b[(c[s>>2]|0)+(ia<<24>>24<<1)>>1]&8192)==0){ba=25;break a}ha=c[h>>2]|0;aa=ha+12|0;ja=c[aa>>2]|0;if((ja|0)==(c[ha+16>>2]|0)){ka=pc[c[(c[ha>>2]|0)+40>>2]&127](ha)|0}else{c[aa>>2]=ja+1;ka=d[ja]|0}Be(A,ka&255);ba=26;break};case 0:{ba=26;break};case 3:{ja=a[G]|0;aa=(ja&1)==0;if(aa){la=(ja&255)>>>1}else{la=c[L>>2]|0}ha=a[H]|0;ma=(ha&1)==0;if(ma){na=(ha&255)>>>1}else{na=c[g>>2]|0}if((la|0)==(0-na|0)){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break b}if(aa){ua=(ja&255)>>>1}else{ua=c[L>>2]|0}do{if((ua|0)!=0){if(ma){va=(ha&255)>>>1}else{va=c[g>>2]|0}if((va|0)==0){break}wa=c[h>>2]|0;xa=c[wa+12>>2]|0;ya=c[wa+16>>2]|0;if((xa|0)==(ya|0)){za=pc[c[(c[wa>>2]|0)+36>>2]&127](wa)|0;Aa=c[h>>2]|0;Ba=za;Ca=c[Aa+16>>2]|0;Da=c[Aa+12>>2]|0;Ea=Aa;Fa=a[G]|0}else{Ba=d[xa]|0;Ca=ya;Da=xa;Ea=wa;Fa=ja}wa=Ea+12|0;xa=(Da|0)==(Ca|0);if((Ba&255)<<24>>24==(a[(Fa&1)==0?K:c[M>>2]|0]|0)){if(xa){pc[c[(c[Ea>>2]|0)+40>>2]&127](Ea)|0}else{c[wa>>2]=Da+1}wa=a[G]|0;if((wa&1)==0){Ga=(wa&255)>>>1}else{Ga=c[L>>2]|0}oa=D;pa=X;qa=r;ra=W;sa=Ga>>>0>1?y:Y;ta=Z;break b}if(xa){Ha=pc[c[(c[Ea>>2]|0)+36>>2]&127](Ea)|0}else{Ha=d[Da]|0}if(!((Ha&255)<<24>>24==(a[(a[H]&1)==0?m:c[J>>2]|0]|0))){ba=112;break a}xa=c[h>>2]|0;wa=xa+12|0;ya=c[wa>>2]|0;if((ya|0)==(c[xa+16>>2]|0)){pc[c[(c[xa>>2]|0)+40>>2]&127](xa)|0}else{c[wa>>2]=ya+1}a[l]=1;ya=a[H]|0;if((ya&1)==0){Ia=(ya&255)>>>1}else{Ia=c[g>>2]|0}oa=D;pa=X;qa=r;ra=W;sa=Ia>>>0>1?z:Y;ta=Z;break b}}while(0);if(aa){Ja=(ja&255)>>>1}else{Ja=c[L>>2]|0}ma=c[h>>2]|0;ya=c[ma+12>>2]|0;wa=(ya|0)==(c[ma+16>>2]|0);if((Ja|0)==0){if(wa){xa=pc[c[(c[ma>>2]|0)+36>>2]&127](ma)|0;Ka=xa;La=a[H]|0}else{Ka=d[ya]|0;La=ha}if(!((Ka&255)<<24>>24==(a[(La&1)==0?m:c[J>>2]|0]|0))){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break b}xa=c[h>>2]|0;Aa=xa+12|0;za=c[Aa>>2]|0;if((za|0)==(c[xa+16>>2]|0)){pc[c[(c[xa>>2]|0)+40>>2]&127](xa)|0}else{c[Aa>>2]=za+1}a[l]=1;za=a[H]|0;if((za&1)==0){Ma=(za&255)>>>1}else{Ma=c[g>>2]|0}oa=D;pa=X;qa=r;ra=W;sa=Ma>>>0>1?z:Y;ta=Z;break b}if(wa){wa=pc[c[(c[ma>>2]|0)+36>>2]&127](ma)|0;Na=wa;Oa=a[G]|0}else{Na=d[ya]|0;Oa=ja}if(!((Na&255)<<24>>24==(a[(Oa&1)==0?K:c[M>>2]|0]|0))){a[l]=1;oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break b}ya=c[h>>2]|0;wa=ya+12|0;ma=c[wa>>2]|0;if((ma|0)==(c[ya+16>>2]|0)){pc[c[(c[ya>>2]|0)+40>>2]&127](ya)|0}else{c[wa>>2]=ma+1}ma=a[G]|0;if((ma&1)==0){Pa=(ma&255)>>>1}else{Pa=c[L>>2]|0}oa=D;pa=X;qa=r;ra=W;sa=Pa>>>0>1?y:Y;ta=Z;break};case 2:{if(!((Y|0)!=0|p>>>0<2)){if((p|0)==2){Qa=(a[U]|0)!=0}else{Qa=0}if(!(N|Qa)){oa=D;pa=X;qa=r;ra=W;sa=0;ta=Z;break b}}ma=a[F]|0;wa=(ma&1)==0;ya=wa?j:c[O>>2]|0;c:do{if((p|0)==0){Ra=ca;Sa=ca;Ta=ma;Ua=ya}else{if((d[f+(p+ -1)|0]|0)>=2){Ra=ca;Sa=ca;Ta=ma;Ua=ya;break}za=ya+(wa?(ma&255)>>>1:c[P>>2]|0)|0;Aa=ya;while(1){if((Aa|0)==(za|0)){Va=za;break}xa=a[Aa]|0;if(!(xa<<24>>24>-1)){Va=Aa;break}if((b[(c[s>>2]|0)+(xa<<24>>24<<1)>>1]&8192)==0){Va=Aa;break}else{Aa=Aa+1|0}}Aa=Va-ya|0;za=a[I]|0;xa=(za&1)==0;if(xa){Wa=(za&255)>>>1}else{Wa=c[T>>2]|0}if(Aa>>>0>Wa>>>0){Ra=ca;Sa=ca;Ta=ma;Ua=ya;break}if(xa){xa=(za&255)>>>1;Xa=Q+(xa-Aa)+1|0;Ya=R;Za=xa}else{xa=c[S>>2]|0;za=c[T>>2]|0;Xa=xa+(za-Aa)|0;Ya=xa;Za=za}za=Ya+Za|0;if((Xa|0)==(za|0)){Ra=ca;Sa=ca;Ta=ma;Ua=Va;break}else{_a=ya;$a=Xa}while(1){if((a[$a]|0)!=(a[_a]|0)){Ra=ca;Sa=ca;Ta=ma;Ua=ya;break c}xa=$a+1|0;if((xa|0)==(za|0)){Ra=ca;Sa=ca;Ta=ma;Ua=Va;break}else{_a=_a+1|0;$a=xa}}}}while(0);d:while(1){if((Ta&1)==0){ab=j;bb=(Ta&255)>>>1}else{ab=c[O>>2]|0;bb=c[P>>2]|0}if((Ua|0)==(ab+bb|0)){break}ma=c[h>>2]|0;do{if((ma|0)==0){cb=0}else{if((c[ma+12>>2]|0)!=(c[ma+16>>2]|0)){cb=ma;break}if((pc[c[(c[ma>>2]|0)+36>>2]&127](ma)|0)==-1){c[h>>2]=0;cb=0;break}else{cb=c[h>>2]|0;break}}}while(0);ma=(cb|0)==0;do{if((Sa|0)==0){db=Ra;ba=147}else{if((c[Sa+12>>2]|0)!=(c[Sa+16>>2]|0)){if(ma){eb=Ra;fb=Sa;break}else{break d}}if((pc[c[(c[Sa>>2]|0)+36>>2]&127](Sa)|0)==-1){c[e>>2]=0;db=0;ba=147;break}else{if(ma^(Ra|0)==0){eb=Ra;fb=Ra;break}else{break d}}}}while(0);if((ba|0)==147){ba=0;if(ma){break}else{eb=db;fb=0}}ya=c[h>>2]|0;wa=c[ya+12>>2]|0;if((wa|0)==(c[ya+16>>2]|0)){gb=pc[c[(c[ya>>2]|0)+36>>2]&127](ya)|0}else{gb=d[wa]|0}if(!((gb&255)<<24>>24==(a[Ua]|0))){break}wa=c[h>>2]|0;ya=wa+12|0;ja=c[ya>>2]|0;if((ja|0)==(c[wa+16>>2]|0)){pc[c[(c[wa>>2]|0)+40>>2]&127](wa)|0}else{c[ya>>2]=ja+1}Ra=eb;Sa=fb;Ta=a[F]|0;Ua=Ua+1|0}if(!N){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break b}ja=a[F]|0;if((ja&1)==0){hb=j;ib=(ja&255)>>>1}else{hb=c[O>>2]|0;ib=c[P>>2]|0}if((Ua|0)==(hb+ib|0)){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z}else{ba=162;break a}break};case 4:{ja=D;ya=X;wa=r;ha=W;aa=0;za=Z;e:while(1){xa=c[h>>2]|0;do{if((xa|0)==0){jb=0}else{if((c[xa+12>>2]|0)!=(c[xa+16>>2]|0)){jb=xa;break}if((pc[c[(c[xa>>2]|0)+36>>2]&127](xa)|0)==-1){c[h>>2]=0;jb=0;break}else{jb=c[h>>2]|0;break}}}while(0);xa=(jb|0)==0;ma=c[e>>2]|0;do{if((ma|0)==0){ba=173}else{if((c[ma+12>>2]|0)!=(c[ma+16>>2]|0)){if(xa){break}else{break e}}if((pc[c[(c[ma>>2]|0)+36>>2]&127](ma)|0)==-1){c[e>>2]=0;ba=173;break}else{if(xa){break}else{break e}}}}while(0);if((ba|0)==173){ba=0;if(xa){break}}ma=c[h>>2]|0;Aa=c[ma+12>>2]|0;if((Aa|0)==(c[ma+16>>2]|0)){kb=pc[c[(c[ma>>2]|0)+36>>2]&127](ma)|0}else{kb=d[Aa]|0}Aa=kb&255;do{if(Aa<<24>>24>-1){if((b[(c[s>>2]|0)+(kb<<24>>24<<1)>>1]&2048)==0){ba=189;break}ma=c[o>>2]|0;if((ma|0)==(ja|0)){lb=(c[V>>2]|0)!=120;mb=c[t>>2]|0;nb=ja-mb|0;ob=nb>>>0<2147483647?nb<<1:-1;pb=Mm(lb?mb:0,ob)|0;if((pb|0)==0){ba=182;break a}do{if(lb){c[t>>2]=pb;qb=pb}else{mb=c[t>>2]|0;c[t>>2]=pb;if((mb|0)==0){qb=pb;break}mc[c[V>>2]&255](mb);qb=c[t>>2]|0}}while(0);c[V>>2]=121;pb=qb+nb|0;c[o>>2]=pb;rb=pb;sb=(c[t>>2]|0)+ob|0}else{rb=ma;sb=ja}c[o>>2]=rb+1;a[rb]=Aa;tb=sb;ub=ya;vb=wa;wb=ha;xb=aa+1|0;yb=za}else{ba=189}}while(0);if((ba|0)==189){ba=0;xa=a[E]|0;if((xa&1)==0){zb=(xa&255)>>>1}else{zb=c[n>>2]|0}if((zb|0)==0|(aa|0)==0){break}if(!(Aa<<24>>24==(a[v]|0))){break}if((wa|0)==(ha|0)){xa=wa-ya|0;pb=xa>>>0<2147483647?xa<<1:-1;if((za|0)==120){Ab=0}else{Ab=ya}lb=Mm(Ab,pb)|0;mb=lb;if((lb|0)==0){ba=198;break a}Bb=mb;Cb=mb+(xa>>2<<2)|0;Db=mb+(pb>>>2<<2)|0;Eb=121}else{Bb=ya;Cb=wa;Db=ha;Eb=za}c[Cb>>2]=aa;tb=ja;ub=Bb;vb=Cb+4|0;wb=Db;xb=0;yb=Eb}pb=c[h>>2]|0;mb=pb+12|0;xa=c[mb>>2]|0;if((xa|0)==(c[pb+16>>2]|0)){pc[c[(c[pb>>2]|0)+40>>2]&127](pb)|0;ja=tb;ya=ub;wa=vb;ha=wb;aa=xb;za=yb;continue}else{c[mb>>2]=xa+1;ja=tb;ya=ub;wa=vb;ha=wb;aa=xb;za=yb;continue}}if((ya|0)==(wa|0)|(aa|0)==0){Fb=ya;Gb=wa;Hb=ha;Ib=za}else{if((wa|0)==(ha|0)){xa=wa-ya|0;mb=xa>>>0<2147483647?xa<<1:-1;if((za|0)==120){Jb=0}else{Jb=ya}pb=Mm(Jb,mb)|0;lb=pb;if((pb|0)==0){ba=209;break a}Kb=lb;Lb=lb+(xa>>2<<2)|0;Mb=lb+(mb>>>2<<2)|0;Nb=121}else{Kb=ya;Lb=wa;Mb=ha;Nb=za}c[Lb>>2]=aa;Fb=Kb;Gb=Lb+4|0;Hb=Mb;Ib=Nb}mb=c[B>>2]|0;if((mb|0)>0){lb=c[h>>2]|0;do{if((lb|0)==0){Ob=0}else{if((c[lb+12>>2]|0)!=(c[lb+16>>2]|0)){Ob=lb;break}if((pc[c[(c[lb>>2]|0)+36>>2]&127](lb)|0)==-1){c[h>>2]=0;Ob=0;break}else{Ob=c[h>>2]|0;break}}}while(0);lb=(Ob|0)==0;aa=c[e>>2]|0;do{if((aa|0)==0){ba=223}else{if((c[aa+12>>2]|0)!=(c[aa+16>>2]|0)){if(lb){Pb=aa;break}else{ba=229;break a}}if((pc[c[(c[aa>>2]|0)+36>>2]&127](aa)|0)==-1){c[e>>2]=0;ba=223;break}else{if(lb){Pb=aa;break}else{ba=229;break a}}}}while(0);if((ba|0)==223){ba=0;if(lb){ba=229;break a}else{Pb=0}}aa=c[h>>2]|0;za=c[aa+12>>2]|0;if((za|0)==(c[aa+16>>2]|0)){Qb=pc[c[(c[aa>>2]|0)+36>>2]&127](aa)|0}else{Qb=d[za]|0}if(!((Qb&255)<<24>>24==(a[u]|0))){ba=229;break a}za=c[h>>2]|0;aa=za+12|0;ha=c[aa>>2]|0;if((ha|0)==(c[za+16>>2]|0)){pc[c[(c[za>>2]|0)+40>>2]&127](za)|0;Rb=Pb;Sb=mb;Tb=Pb;Ub=ja}else{c[aa>>2]=ha+1;Rb=Pb;Sb=mb;Tb=Pb;Ub=ja}while(1){ha=c[h>>2]|0;do{if((ha|0)==0){Vb=0}else{if((c[ha+12>>2]|0)!=(c[ha+16>>2]|0)){Vb=ha;break}if((pc[c[(c[ha>>2]|0)+36>>2]&127](ha)|0)==-1){c[h>>2]=0;Vb=0;break}else{Vb=c[h>>2]|0;break}}}while(0);ha=(Vb|0)==0;do{if((Tb|0)==0){Wb=Rb;ba=243}else{if((c[Tb+12>>2]|0)!=(c[Tb+16>>2]|0)){if(ha){Xb=Rb;Yb=Tb;break}else{ba=250;break a}}if((pc[c[(c[Tb>>2]|0)+36>>2]&127](Tb)|0)==-1){c[e>>2]=0;Wb=0;ba=243;break}else{if(ha^(Rb|0)==0){Xb=Rb;Yb=Rb;break}else{ba=250;break a}}}}while(0);if((ba|0)==243){ba=0;if(ha){ba=250;break a}else{Xb=Wb;Yb=0}}Aa=c[h>>2]|0;aa=c[Aa+12>>2]|0;if((aa|0)==(c[Aa+16>>2]|0)){Zb=pc[c[(c[Aa>>2]|0)+36>>2]&127](Aa)|0}else{Zb=d[aa]|0}if(!((Zb&255)<<24>>24>-1)){ba=250;break a}if((b[(c[s>>2]|0)+(Zb<<24>>24<<1)>>1]&2048)==0){ba=250;break a}aa=c[o>>2]|0;if((aa|0)==(Ub|0)){Aa=(c[V>>2]|0)!=120;za=c[t>>2]|0;wa=Ub-za|0;ya=wa>>>0<2147483647?wa<<1:-1;xa=Mm(Aa?za:0,ya)|0;if((xa|0)==0){ba=253;break a}do{if(Aa){c[t>>2]=xa;_b=xa}else{za=c[t>>2]|0;c[t>>2]=xa;if((za|0)==0){_b=xa;break}mc[c[V>>2]&255](za);_b=c[t>>2]|0}}while(0);c[V>>2]=121;xa=_b+wa|0;c[o>>2]=xa;$b=xa;ac=(c[t>>2]|0)+ya|0}else{$b=aa;ac=Ub}xa=c[h>>2]|0;Aa=c[xa+12>>2]|0;if((Aa|0)==(c[xa+16>>2]|0)){ha=pc[c[(c[xa>>2]|0)+36>>2]&127](xa)|0;bc=ha;cc=c[o>>2]|0}else{bc=d[Aa]|0;cc=$b}c[o>>2]=cc+1;a[cc]=bc;Aa=Sb+ -1|0;c[B>>2]=Aa;ha=c[h>>2]|0;xa=ha+12|0;za=c[xa>>2]|0;if((za|0)==(c[ha+16>>2]|0)){pc[c[(c[ha>>2]|0)+40>>2]&127](ha)|0}else{c[xa>>2]=za+1}if((Aa|0)>0){Rb=Xb;Sb=Aa;Tb=Yb;Ub=ac}else{dc=ac;break}}}else{dc=ja}if((c[o>>2]|0)==(c[t>>2]|0)){ba=267;break a}else{oa=dc;pa=Fb;qa=Gb;ra=Hb;sa=Y;ta=Ib}break};default:{oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z}}}while(0);f:do{if((ba|0)==26){ba=0;if((p|0)==3){da=X;ea=r;fa=Y;ga=Z;ba=269;break a}else{ec=ca;fc=ca}while(1){_=c[h>>2]|0;do{if((_|0)==0){gc=0}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){gc=_;break}if((pc[c[(c[_>>2]|0)+36>>2]&127](_)|0)==-1){c[h>>2]=0;gc=0;break}else{gc=c[h>>2]|0;break}}}while(0);_=(gc|0)==0;do{if((fc|0)==0){hc=ec;ba=37}else{if((c[fc+12>>2]|0)!=(c[fc+16>>2]|0)){if(_){ic=ec;jc=fc;break}else{oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break f}}if((pc[c[(c[fc>>2]|0)+36>>2]&127](fc)|0)==-1){c[e>>2]=0;hc=0;ba=37;break}else{if(_^(ec|0)==0){ic=ec;jc=ec;break}else{oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break f}}}}while(0);if((ba|0)==37){ba=0;if(_){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break f}else{ic=hc;jc=0}}aa=c[h>>2]|0;ya=c[aa+12>>2]|0;if((ya|0)==(c[aa+16>>2]|0)){kc=pc[c[(c[aa>>2]|0)+36>>2]&127](aa)|0}else{kc=d[ya]|0}if(!((kc&255)<<24>>24>-1)){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break f}if((b[(c[s>>2]|0)+(kc<<24>>24<<1)>>1]&8192)==0){oa=D;pa=X;qa=r;ra=W;sa=Y;ta=Z;break f}ya=c[h>>2]|0;aa=ya+12|0;wa=c[aa>>2]|0;if((wa|0)==(c[ya+16>>2]|0)){lc=pc[c[(c[ya>>2]|0)+40>>2]&127](ya)|0}else{c[aa>>2]=wa+1;lc=d[wa]|0}Be(A,lc&255);ec=ic;fc=jc}}}while(0);ja=p+1|0;if(ja>>>0<4){W=ra;r=qa;X=pa;D=oa;p=ja;Y=sa;Z=ta}else{da=pa;ea=qa;fa=sa;ga=ta;ba=269;break}}g:do{if((ba|0)==25){c[k>>2]=c[k>>2]|4;nc=0;oc=X;qc=Z}else if((ba|0)==112){c[k>>2]=c[k>>2]|4;nc=0;oc=X;qc=Z}else if((ba|0)==162){c[k>>2]=c[k>>2]|4;nc=0;oc=X;qc=Z}else if((ba|0)==182){Wm()}else if((ba|0)==198){Wm()}else if((ba|0)==209){Wm()}else if((ba|0)==229){c[k>>2]=c[k>>2]|4;nc=0;oc=Fb;qc=Ib}else if((ba|0)==250){c[k>>2]=c[k>>2]|4;nc=0;oc=Fb;qc=Ib}else if((ba|0)==253){Wm()}else if((ba|0)==267){c[k>>2]=c[k>>2]|4;nc=0;oc=Fb;qc=Ib}else if((ba|0)==269){h:do{if((fa|0)!=0){ta=fa;sa=fa+1|0;qa=fa+8|0;pa=fa+4|0;Y=1;i:while(1){p=a[ta]|0;if((p&1)==0){rc=(p&255)>>>1}else{rc=c[pa>>2]|0}if(!(Y>>>0<rc>>>0)){break h}p=c[h>>2]|0;do{if((p|0)==0){sc=0}else{if((c[p+12>>2]|0)!=(c[p+16>>2]|0)){sc=p;break}if((pc[c[(c[p>>2]|0)+36>>2]&127](p)|0)==-1){c[h>>2]=0;sc=0;break}else{sc=c[h>>2]|0;break}}}while(0);p=(sc|0)==0;_=c[e>>2]|0;do{if((_|0)==0){ba=285}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){if(p){break}else{break i}}if((pc[c[(c[_>>2]|0)+36>>2]&127](_)|0)==-1){c[e>>2]=0;ba=285;break}else{if(p){break}else{break i}}}}while(0);if((ba|0)==285){ba=0;if(p){break}}_=c[h>>2]|0;oa=c[_+12>>2]|0;if((oa|0)==(c[_+16>>2]|0)){tc=pc[c[(c[_>>2]|0)+36>>2]&127](_)|0}else{tc=d[oa]|0}if((a[ta]&1)==0){uc=sa}else{uc=c[qa>>2]|0}if(!((tc&255)<<24>>24==(a[uc+Y|0]|0))){break}oa=Y+1|0;_=c[h>>2]|0;D=_+12|0;r=c[D>>2]|0;if((r|0)==(c[_+16>>2]|0)){pc[c[(c[_>>2]|0)+40>>2]&127](_)|0;Y=oa;continue}else{c[D>>2]=r+1;Y=oa;continue}}c[k>>2]=c[k>>2]|4;nc=0;oc=da;qc=ga;break g}}while(0);if((da|0)==(ea|0)){nc=1;oc=ea;qc=ga;break}c[C>>2]=0;mj(w,da,ea,C);if((c[C>>2]|0)==0){nc=1;oc=da;qc=ga;break}c[k>>2]=c[k>>2]|4;nc=0;oc=da;qc=ga}}while(0);ve(A);ve(z);ve(y);ve(x);ve(w);if((oc|0)==0){i=q;return nc|0}mc[qc&255](oc);i=q;return nc|0}function ij(a){a=a|0;var b=0;b=vb(8)|0;ce(b,a);cc(b|0,2136,21)}function jj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;d=i;i=i+168|0;l=d;m=d+8|0;n=d+24|0;o=d+128|0;p=d+136|0;q=d+144|0;r=d+152|0;s=d+160|0;t=o;c[t>>2]=n;u=o+4|0;c[u>>2]=120;v=n+100|0;Qe(q,h);n=q;w=c[n>>2]|0;if(!((c[1282]|0)==-1)){c[m>>2]=5128;c[m+4>>2]=118;c[m+8>>2]=0;qe(5128,m,119)}m=(c[5132>>2]|0)+ -1|0;x=c[w+8>>2]|0;if(!((c[w+12>>2]|0)-x>>2>>>0>m>>>0)){y=vb(4)|0;z=y;pm(z);cc(y|0,13088,107)}w=c[x+(m<<2)>>2]|0;if((w|0)==0){y=vb(4)|0;z=y;pm(z);cc(y|0,13088,107)}y=w;a[r]=0;z=f;f=c[z>>2]|0;c[s>>2]=f;m=c[h+4>>2]|0;h=l;x=s;c[h+0>>2]=c[x+0>>2];x=hj(e,l,g,q,m,j,r,y,o,p,v)|0;if(x){x=k;if((a[x]&1)==0){a[k+1|0]=0;a[x]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}x=w;if((a[r]|0)!=0){Be(k,yc[c[(c[x>>2]|0)+28>>2]&31](y,45)|0)}r=yc[c[(c[x>>2]|0)+28>>2]&31](y,48)|0;y=c[t>>2]|0;x=c[p>>2]|0;p=x+ -1|0;a:do{if(y>>>0<p>>>0){w=y;while(1){v=w+1|0;if(!((a[w]|0)==r<<24>>24)){A=w;break a}if(v>>>0<p>>>0){w=v}else{A=v;break}}}else{A=y}}while(0);kj(k,A,x)|0}x=e;e=c[x>>2]|0;do{if((e|0)==0){B=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){B=e;break}if(!((pc[c[(c[e>>2]|0)+36>>2]&127](e)|0)==-1)){B=e;break}c[x>>2]=0;B=0}}while(0);x=(B|0)==0;do{if((f|0)==0){C=25}else{if((c[f+12>>2]|0)!=(c[f+16>>2]|0)){if(x){break}else{C=27;break}}if((pc[c[(c[f>>2]|0)+36>>2]&127](f)|0)==-1){c[z>>2]=0;C=25;break}else{if(x^(f|0)==0){break}else{C=27;break}}}}while(0);if((C|0)==25){if(x){C=27}}if((C|0)==27){c[j>>2]=c[j>>2]|2}c[b>>2]=B;Yd(c[n>>2]|0)|0;n=c[t>>2]|0;c[t>>2]=0;if((n|0)==0){i=d;return}mc[c[u>>2]&255](n);i=d;return}function kj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;g=b;h=d;j=a[g]|0;if((j&1)==0){k=(j&255)>>>1;l=j;m=10}else{j=c[b>>2]|0;k=c[b+4>>2]|0;l=j&255;m=(j&-2)+ -1|0}j=e-h|0;if((e|0)==(d|0)){i=f;return b|0}if((m-k|0)>>>0<j>>>0){Ee(b,m,k+j-m|0,k,k,0,0);n=a[g]|0}else{n=l}if((n&1)==0){o=b+1|0}else{o=c[b+8>>2]|0}n=e+(k-h)|0;h=d;d=o+k|0;while(1){a[d]=a[h]|0;l=h+1|0;if((l|0)==(e|0)){break}else{d=d+1|0;h=l}}a[o+n|0]=0;n=k+j|0;if((a[g]&1)==0){a[g]=n<<1;i=f;return b|0}else{c[b+4>>2]=n;i=f;return b|0}return 0}function lj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;n=i;i=i+176|0;o=n;p=n+16|0;q=n+32|0;r=n+40|0;s=n+56|0;t=n+72|0;u=n+88|0;v=n+104|0;w=n+112|0;x=n+128|0;y=n+144|0;z=n+160|0;if(b){b=c[d>>2]|0;if(!((c[1142]|0)==-1)){c[p>>2]=4568;c[p+4>>2]=118;c[p+8>>2]=0;qe(4568,p,119)}p=(c[4572>>2]|0)+ -1|0;A=c[b+8>>2]|0;if(!((c[b+12>>2]|0)-A>>2>>>0>p>>>0)){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}b=c[A+(p<<2)>>2]|0;if((b|0)==0){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}B=b;nc[c[(c[b>>2]|0)+44>>2]&63](q,B);C=e;p=c[q>>2]|0;a[C]=p;a[C+1|0]=p>>8;a[C+2|0]=p>>16;a[C+3|0]=p>>24;p=b;nc[c[(c[p>>2]|0)+32>>2]&63](r,B);C=l;if((a[C]&1)==0){a[l+1|0]=0;a[C]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}Ae(l,0);q=r;c[C+0>>2]=c[q+0>>2];c[C+4>>2]=c[q+4>>2];c[C+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(r);nc[c[(c[p>>2]|0)+28>>2]&63](s,B);r=k;if((a[r]&1)==0){a[k+1|0]=0;a[r]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}Ae(k,0);q=s;c[r+0>>2]=c[q+0>>2];c[r+4>>2]=c[q+4>>2];c[r+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(s);s=b;a[f]=pc[c[(c[s>>2]|0)+12>>2]&127](B)|0;a[g]=pc[c[(c[s>>2]|0)+16>>2]&127](B)|0;nc[c[(c[p>>2]|0)+20>>2]&63](t,B);s=h;if((a[s]&1)==0){a[h+1|0]=0;a[s]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}Ae(h,0);q=t;c[s+0>>2]=c[q+0>>2];c[s+4>>2]=c[q+4>>2];c[s+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(t);nc[c[(c[p>>2]|0)+24>>2]&63](u,B);p=j;if((a[p]&1)==0){a[j+1|0]=0;a[p]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}Ae(j,0);t=u;c[p+0>>2]=c[t+0>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;ve(u);D=pc[c[(c[b>>2]|0)+36>>2]&127](B)|0;c[m>>2]=D;i=n;return}else{B=c[d>>2]|0;if(!((c[1126]|0)==-1)){c[o>>2]=4504;c[o+4>>2]=118;c[o+8>>2]=0;qe(4504,o,119)}o=(c[4508>>2]|0)+ -1|0;d=c[B+8>>2]|0;if(!((c[B+12>>2]|0)-d>>2>>>0>o>>>0)){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}B=c[d+(o<<2)>>2]|0;if((B|0)==0){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}E=B;nc[c[(c[B>>2]|0)+44>>2]&63](v,E);F=e;e=c[v>>2]|0;a[F]=e;a[F+1|0]=e>>8;a[F+2|0]=e>>16;a[F+3|0]=e>>24;e=B;nc[c[(c[e>>2]|0)+32>>2]&63](w,E);F=l;if((a[F]&1)==0){a[l+1|0]=0;a[F]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}Ae(l,0);l=w;c[F+0>>2]=c[l+0>>2];c[F+4>>2]=c[l+4>>2];c[F+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;ve(w);nc[c[(c[e>>2]|0)+28>>2]&63](x,E);w=k;if((a[w]&1)==0){a[k+1|0]=0;a[w]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}Ae(k,0);k=x;c[w+0>>2]=c[k+0>>2];c[w+4>>2]=c[k+4>>2];c[w+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;ve(x);x=B;a[f]=pc[c[(c[x>>2]|0)+12>>2]&127](E)|0;a[g]=pc[c[(c[x>>2]|0)+16>>2]&127](E)|0;nc[c[(c[e>>2]|0)+20>>2]&63](y,E);x=h;if((a[x]&1)==0){a[h+1|0]=0;a[x]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}Ae(h,0);h=y;c[x+0>>2]=c[h+0>>2];c[x+4>>2]=c[h+4>>2];c[x+8>>2]=c[h+8>>2];c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ve(y);nc[c[(c[e>>2]|0)+24>>2]&63](z,E);e=j;if((a[e]&1)==0){a[j+1|0]=0;a[e]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}Ae(j,0);j=z;c[e+0>>2]=c[j+0>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ve(z);D=pc[c[(c[B>>2]|0)+36>>2]&127](E)|0;c[m>>2]=D;i=n;return}}function mj(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;h=b;j=a[h]|0;if((j&1)==0){k=(j&255)>>>1}else{k=c[b+4>>2]|0}if((k|0)==0){i=g;return}do{if((d|0)==(e|0)){l=j}else{k=e+ -4|0;if(k>>>0>d>>>0){m=d;n=k}else{l=j;break}do{k=c[m>>2]|0;c[m>>2]=c[n>>2];c[n>>2]=k;m=m+4|0;n=n+ -4|0;}while(m>>>0<n>>>0);l=a[h]|0}}while(0);if((l&1)==0){o=b+1|0;p=(l&255)>>>1}else{o=c[b+8>>2]|0;p=c[b+4>>2]|0}b=e+ -4|0;e=a[o]|0;l=e<<24>>24<1|e<<24>>24==127;a:do{if(b>>>0>d>>>0){h=o+p|0;n=e;m=o;j=d;k=l;while(1){if(!k){if((n<<24>>24|0)!=(c[j>>2]|0)){break}}q=(h-m|0)>1?m+1|0:m;r=j+4|0;s=a[q]|0;t=s<<24>>24<1|s<<24>>24==127;if(r>>>0<b>>>0){n=s;m=q;j=r;k=t}else{u=s;v=t;break a}}c[f>>2]=4;i=g;return}else{u=e;v=l}}while(0);if(v){i=g;return}v=c[b>>2]|0;if(!(u<<24>>24>>>0<v>>>0|(v|0)==0)){i=g;return}c[f>>2]=4;i=g;return}function nj(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function oj(a){a=a|0;i=i;return}function pj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+400|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=i;i=i+8|0;u=i;i=i+40|0;v=i;i=i+104|0;w=p;c[w>>2]=o;x=p+4|0;c[x>>2]=120;y=o+400|0;Qe(r,h);o=r;z=c[o>>2]|0;if(!((c[1280]|0)==-1)){c[n>>2]=5120;c[n+4>>2]=118;c[n+8>>2]=0;qe(5120,n,119)}n=(c[5124>>2]|0)+ -1|0;A=c[z+8>>2]|0;if(!((c[z+12>>2]|0)-A>>2>>>0>n>>>0)){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}z=c[A+(n<<2)>>2]|0;if((z|0)==0){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}B=z;a[s]=0;C=f;c[t>>2]=c[C>>2];f=c[h+4>>2]|0;h=l;n=t;c[h+0>>2]=c[n+0>>2];n=qj(e,l,g,r,f,j,s,B,p,q,y)|0;do{if(n){y=u;vc[c[(c[z>>2]|0)+48>>2]&7](B,4824,4834|0,y)|0;p=v;f=c[q>>2]|0;r=c[w>>2]|0;g=f-r|0;do{if((g|0)>392){l=Km((g>>2)+2|0)|0;if((l|0)!=0){D=l;E=l;break}Wm()}else{D=0;E=p}}while(0);if((a[s]|0)==0){F=E}else{a[E]=45;F=E+1|0}if(r>>>0<f>>>0){g=u+40|0;l=u;h=F;t=r;while(1){A=c[t>>2]|0;G=y;while(1){H=G+4|0;if((c[G>>2]|0)==(A|0)){I=G;break}if((H|0)==(g|0)){I=g;break}else{G=H}}a[h]=a[4824+(I-l>>2)|0]|0;G=t+4|0;A=h+1|0;if(G>>>0<(c[q>>2]|0)>>>0){h=A;t=G}else{J=A;break}}}else{J=F}a[J]=0;c[m>>2]=k;if((Tb(p|0,4760,m|0)|0)!=1){t=vb(8)|0;ce(t,4768);cc(t|0,2136,21)}if((D|0)==0){break}Lm(D)}}while(0);D=e;e=c[D>>2]|0;do{if((e|0)==0){K=1}else{m=c[e+12>>2]|0;if((m|0)==(c[e+16>>2]|0)){L=pc[c[(c[e>>2]|0)+36>>2]&127](e)|0}else{L=c[m>>2]|0}if((L|0)==-1){c[D>>2]=0;K=1;break}else{K=(c[D>>2]|0)==0;break}}}while(0);L=c[C>>2]|0;do{if((L|0)==0){M=35}else{e=c[L+12>>2]|0;if((e|0)==(c[L+16>>2]|0)){N=pc[c[(c[L>>2]|0)+36>>2]&127](L)|0}else{N=c[e>>2]|0}if((N|0)==-1){c[C>>2]=0;M=35;break}else{if(K){break}else{M=37;break}}}}while(0);if((M|0)==35){if(K){M=37}}if((M|0)==37){c[j>>2]=c[j>>2]|2}c[b>>2]=c[D>>2];Yd(c[o>>2]|0)|0;o=c[w>>2]|0;c[w>>2]=0;if((o|0)==0){i=d;return}mc[c[x>>2]&255](o);i=d;return}\n\n\n\nfunction Bc(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function Cc(){return i|0}function Dc(a){a=a|0;i=a}function Ec(a,b){a=a|0;b=b|0;if((u|0)==0){u=a;v=b}}function Fc(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function Gc(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function Hc(a){a=a|0;J=a}function Ic(a){a=a|0;K=a}function Jc(a){a=a|0;L=a}function Kc(a){a=a|0;M=a}function Lc(a){a=a|0;N=a}function Mc(a){a=a|0;O=a}function Nc(a){a=a|0;P=a}function Oc(a){a=a|0;Q=a}function Pc(a){a=a|0;R=a}function Qc(a){a=a|0;S=a}function Rc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0;e=i;i=i+96|0;f=e;g=e+16|0;h=e+32|0;j=e+48|0;k=e+64|0;l=e+80|0;m=b;Sc(m,d+1|0);n=b+4|0;o=b;p=c[o>>2]|0;q=((c[n>>2]|0)-p|0)/12|0;if(q>>>0>d>>>0){r=p;s=a;t=r+(d*12|0)|0;od(s,t);i=e;return}p=b+8|0;u=j;v=l;w=k;x=k+4|0;y=l+4|0;z=j+4|0;A=f;B=f+4|0;C=f+8|0;D=g;E=g+4|0;F=g+8|0;G=h;H=h+4|0;I=h+8|0;J=q;a:do{do{if((J|0)==0){c[A>>2]=0;c[B>>2]=0;c[C>>2]=0;q=Pm(4)|0;K=q;L=q+4|0;if((q|0)!=0){c[K>>2]=0}c[A>>2]=K;c[B>>2]=L;c[C>>2]=L;M=c[n>>2]|0;if((M|0)==(c[p>>2]|0)){nd(m,f);N=c[A>>2]|0}else{if((M|0)==0){O=0}else{P=M;c[P>>2]=0;Q=M+4|0;c[Q>>2]=0;R=M+8|0;c[R>>2]=0;M=Pm(4)|0;S=M;c[Q>>2]=S;c[P>>2]=S;c[R>>2]=M+4;M=q+(0-q)|0;q=K;R=S;while(1){if((R|0)!=0){c[R>>2]=c[q>>2]}P=q+4|0;if((P|0)==(L|0)){break}else{q=P;R=R+4|0}}c[Q>>2]=S+((M>>>2)+1<<2);O=c[n>>2]|0}c[n>>2]=O+12;N=K}if((N|0)==0){break}R=c[B>>2]|0;if((R|0)!=(N|0)){c[B>>2]=R+(~((R+ -4+(0-N)|0)>>>2)<<2)}Rm(N)}else if((J|0)==1){R=c[o>>2]|0;do{if((R|0)==(c[n>>2]|0)){c[D>>2]=0;c[E>>2]=0;c[F>>2]=0;q=Pm(4)|0;L=q;P=q+4|0;if((q|0)!=0){c[L>>2]=0}c[D>>2]=L;c[E>>2]=P;c[F>>2]=P;if((R|0)==(c[p>>2]|0)){nd(m,g);T=c[D>>2]|0}else{if((R|0)==0){U=0}else{V=R;c[V>>2]=0;W=R+4|0;c[W>>2]=0;X=R+8|0;c[X>>2]=0;Y=Pm(4)|0;Z=Y;c[W>>2]=Z;c[V>>2]=Z;c[X>>2]=Y+4;Y=q+(0-q)|0;q=L;X=Z;while(1){if((X|0)!=0){c[X>>2]=c[q>>2]}V=q+4|0;if((V|0)==(P|0)){break}else{q=V;X=X+4|0}}c[W>>2]=Z+((Y>>>2)+1<<2);U=c[n>>2]|0}c[n>>2]=U+12;T=L}if((T|0)==0){break}X=c[E>>2]|0;if((X|0)!=(T|0)){c[E>>2]=X+(~((X+ -4+(0-T)|0)>>>2)<<2)}Rm(T)}}while(0);c[G>>2]=0;c[H>>2]=0;c[I>>2]=0;R=Pm(4)|0;K=R;M=R+4|0;if((R|0)!=0){c[K>>2]=1}c[G>>2]=K;c[H>>2]=M;c[I>>2]=M;S=c[n>>2]|0;if((S|0)==(c[p>>2]|0)){nd(m,h);_=c[G>>2]|0}else{if((S|0)==0){$=0}else{Q=S;c[Q>>2]=0;X=S+4|0;c[X>>2]=0;q=S+8|0;c[q>>2]=0;S=Pm(4)|0;P=S;c[X>>2]=P;c[Q>>2]=P;c[q>>2]=S+4;S=R+(0-R)|0;R=K;q=P;while(1){if((q|0)!=0){c[q>>2]=c[R>>2]}Q=R+4|0;if((Q|0)==(M|0)){break}else{R=Q;q=q+4|0}}c[X>>2]=P+((S>>>2)+1<<2);$=c[n>>2]|0}c[n>>2]=$+12;_=K}if((_|0)==0){break}q=c[H>>2]|0;if((q|0)!=(_|0)){c[H>>2]=q+(~((q+ -4+(0-_)|0)>>>2)<<2)}Rm(_)}else{Rc(k,b,J+ -2|0);Rc(l,b,J+ -1|0);pd(j,k,l);q=c[n>>2]|0;if((q|0)==(c[p>>2]|0)){nd(m,j)}else{if((q|0)==0){aa=0}else{R=q;c[R>>2]=0;M=q+4|0;c[M>>2]=0;Q=q+8|0;c[Q>>2]=0;q=(c[z>>2]|0)-(c[u>>2]|0)|0;V=q>>2;do{if((V|0)!=0){if(V>>>0>1073741823){ba=54;break a}ca=Pm(q)|0;c[M>>2]=ca;c[R>>2]=ca;c[Q>>2]=ca+(V<<2);da=c[u>>2]|0;ea=c[z>>2]|0;if((da|0)==(ea|0)){break}fa=ea+ -4+(0-da)|0;ga=da;da=ca;while(1){if((da|0)!=0){c[da>>2]=c[ga>>2]}ha=ga+4|0;if((ha|0)==(ea|0)){break}else{ga=ha;da=da+4|0}}c[M>>2]=ca+((fa>>>2)+1<<2)}}while(0);aa=c[n>>2]|0}c[n>>2]=aa+12}M=c[u>>2]|0;if((M|0)!=0){V=c[z>>2]|0;if((V|0)!=(M|0)){c[z>>2]=V+(~((V+ -4+(0-M)|0)>>>2)<<2)}Rm(M)}M=c[v>>2]|0;if((M|0)!=0){V=c[y>>2]|0;if((V|0)!=(M|0)){c[y>>2]=V+(~((V+ -4+(0-M)|0)>>>2)<<2)}Rm(M)}M=c[w>>2]|0;if((M|0)==0){break}V=c[x>>2]|0;if((V|0)!=(M|0)){c[x>>2]=V+(~((V+ -4+(0-M)|0)>>>2)<<2)}Rm(M)}}while(0);J=J+1|0;}while(!(J>>>0>d>>>0));if((ba|0)==54){Rj(0)}r=c[o>>2]|0;s=a;t=r+(d*12|0)|0;od(s,t);i=e;return}function Sc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=i;e=a+8|0;f=a;g=c[f>>2]|0;h=g;if(!((((c[e>>2]|0)-h|0)/12|0)>>>0<b>>>0)){i=d;return}j=a+4|0;a=c[j>>2]|0;if((b|0)==0){k=0}else{k=Pm(b*12|0)|0}l=k+(((a-h|0)/12|0)*12|0)|0;h=k+(b*12|0)|0;do{if((a|0)==(g|0)){c[f>>2]=l;c[j>>2]=l;c[e>>2]=h;m=g}else{b=a;k=l;do{b=b+ -12|0;od(k+ -12|0,b);k=k+ -12|0;}while((b|0)!=(g|0));b=c[f>>2]|0;n=c[j>>2]|0;c[f>>2]=k;c[j>>2]=l;c[e>>2]=h;if((n|0)==(b|0)){m=b;break}else{o=n}while(1){n=o+ -12|0;p=c[n>>2]|0;if((p|0)!=0){q=o+ -8|0;r=c[q>>2]|0;if((r|0)!=(p|0)){c[q>>2]=r+(~((r+ -4+(0-p)|0)>>>2)<<2)}Rm(p)}if((n|0)==(b|0)){m=b;break}else{o=n}}}}while(0);if((m|0)==0){i=d;return}Rm(m);i=d;return}function Tc(a){a=a|0;Ma(a|0)|0;Fa()}function Uc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;d=i;i=i+168|0;e=d;f=d+16|0;g=d+152|0;h=f;j=f+4|0;c[h>>2]=212;k=f+56|0;c[k>>2]=232;l=f+56|0;Re(l,j);c[f+128>>2]=0;c[f+132>>2]=-1;c[h>>2]=84;c[f+56>>2]=104;m=e;n=j;c[n>>2]=2400;o=f+8|0;Xj(o);p=f+12|0;c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;c[p+16>>2]=0;c[p+20>>2]=0;c[n>>2]=248;n=f+36|0;p=f+52|0;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;c[p>>2]=16;c[m+0>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;md(j,e);if(!((a[m]&1)==0)){Rm(c[e+8>>2]|0)}e=b+4|0;m=b;if((c[e>>2]|0)!=(c[m>>2]|0)){b=f;p=0;do{q=Vc(Jf(Vc(b,8)|0,p)|0,16)|0;r=c[m>>2]|0;s=r+(p*12|0)|0;t=c[s>>2]|0;u=((c[r+(p*12|0)+4>>2]|0)-t>>2)+ -1|0;if((u|0)==0){v=t}else{r=t;t=u;while(1){u=Kf(q,c[r+(t<<2)>>2]|0)|0;w=u;x=u;c[x+((c[(c[w>>2]|0)+ -12>>2]|0)+12)>>2]=9;c[x+((c[(c[w>>2]|0)+ -12>>2]|0)+76)>>2]=48;w=t+ -1|0;x=c[s>>2]|0;if((w|0)==0){v=x;break}else{t=w;r=x}}}Vc(Kf(q,c[v>>2]|0)|0,24)|0;p=p+1|0;}while(p>>>0<(((c[e>>2]|0)-(c[m>>2]|0)|0)/12|0)>>>0)}bd(g,j);Wc(480,g)|0;if(!((a[g]&1)==0)){Rm(c[g+8>>2]|0)}c[h>>2]=84;c[k>>2]=104;k=f+4|0;c[k>>2]=248;if((a[n]&1)==0){c[k>>2]=2400;Zj(o);Pe(l);i=d;return}Rm(c[f+44>>2]|0);c[k>>2]=2400;Zj(o);Pe(l);i=d;return}function Vc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+40|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=h;a[l]=0;c[h+4>>2]=b;m=b;n=c[(c[m>>2]|0)+ -12>>2]|0;o=b;if((c[o+(n+16)>>2]|0)!=0){If(h);i=e;return b|0}p=c[o+(n+72)>>2]|0;if((p|0)==0){q=n}else{xf(p)|0;q=c[(c[m>>2]|0)+ -12>>2]|0}a[l]=1;l=on(d|0)|0;c[j>>2]=c[o+(q+24)>>2];if((c[o+(q+4)>>2]&176|0)==32){r=d+l|0}else{r=d}p=o+q|0;n=o+(q+76)|0;q=c[n>>2]|0;if((q|0)==-1){s=p;Qe(g,s);t=_j(g,5128)|0;u=yc[c[(c[t>>2]|0)+28>>2]&31](t,32)|0;Zj(g);g=u<<24>>24;c[n>>2]=g;v=s;w=g}else{v=p;w=q}q=w&255;w=d+l|0;l=f;p=j;c[l+0>>2]=c[p+0>>2];ad(k,f,d,r,w,v,q);if((c[k>>2]|0)!=0){If(h);i=e;return b|0}k=c[(c[m>>2]|0)+ -12>>2]|0;Oe(o+k|0,c[o+(k+16)>>2]|5);If(h);i=e;return b|0}function Wc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;e=i;i=i+40|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=h;a[l]=0;c[h+4>>2]=b;m=b;n=c[(c[m>>2]|0)+ -12>>2]|0;o=b;if((c[o+(n+16)>>2]|0)!=0){If(h);i=e;return b|0}p=c[o+(n+72)>>2]|0;if((p|0)!=0){xf(p)|0}a[l]=1;l=a[d]|0;p=(l&1)==0;if(p){q=(l&255)>>>1}else{q=c[d+4>>2]|0}l=c[(c[m>>2]|0)+ -12>>2]|0;c[j>>2]=c[o+(l+24)>>2];if(p){p=d;if((c[o+(l+4)>>2]&176|0)==32){r=p+q+1|0}else{r=p+1|0}s=r;t=d+1|0;u=d+1|0}else{r=c[d+8>>2]|0;if((c[o+(l+4)>>2]&176|0)==32){v=r+q|0}else{v=r}s=v;t=c[d+8>>2]|0;u=c[d+8>>2]|0}d=o+l|0;v=o+(l+76)|0;l=c[v>>2]|0;if((l|0)==-1){r=d;Qe(g,r);p=_j(g,5128)|0;n=yc[c[(c[p>>2]|0)+28>>2]&31](p,32)|0;Zj(g);g=n<<24>>24;c[v>>2]=g;w=r;x=g}else{w=d;x=l}l=x&255;x=u+q|0;q=f;u=j;c[q+0>>2]=c[u+0>>2];ad(k,f,t,s,x,w,l);if((c[k>>2]|0)!=0){If(h);i=e;return b|0}k=c[(c[m>>2]|0)+ -12>>2]|0;Oe(o+k|0,c[o+(k+16)>>2]|5);If(h);i=e;return b|0}function Xc(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=84;c[b+56>>2]=104;e=b+4|0;c[e>>2]=248;if(!((a[b+36|0]&1)==0)){Rm(c[b+44>>2]|0)}c[e>>2]=2400;Zj(b+8|0);Pe(b+56|0);i=d;return}function Yc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;i=i+184|0;f=e;g=e+16|0;h=e+152|0;j=e+168|0;k=g;l=g+4|0;c[k>>2]=212;m=g+56|0;c[m>>2]=232;n=g+56|0;Re(n,l);c[g+128>>2]=0;c[g+132>>2]=-1;c[k>>2]=84;c[g+56>>2]=104;o=f;p=l;c[p>>2]=2400;q=g+8|0;Xj(q);r=g+12|0;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0;c[r+16>>2]=0;c[r+20>>2]=0;c[p>>2]=248;p=g+36|0;r=g+52|0;c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;c[r>>2]=16;c[o+0>>2]=0;c[o+4>>2]=0;c[o+8>>2]=0;md(l,f);if(!((a[o]&1)==0)){Rm(c[f+8>>2]|0)}f=b;do{if(!((((c[b+4>>2]|0)-(c[f>>2]|0)|0)/12|0)>>>0>d>>>0)){Rc(h,b,d);o=c[h>>2]|0;if((o|0)==0){break}r=h+4|0;s=c[r>>2]|0;if((s|0)!=(o|0)){c[r>>2]=s+(~((s+ -4+(0-o)|0)>>>2)<<2)}Rm(o)}}while(0);h=Vc(Kf(Vc(g,8)|0,d)|0,16)|0;b=c[f>>2]|0;f=b+(d*12|0)|0;o=c[f>>2]|0;s=((c[b+(d*12|0)+4>>2]|0)-o>>2)+ -1|0;if((s|0)==0){t=o}else{d=o;o=s;while(1){s=Kf(h,c[d+(o<<2)>>2]|0)|0;b=s;r=s;c[r+((c[(c[b>>2]|0)+ -12>>2]|0)+12)>>2]=9;c[r+((c[(c[b>>2]|0)+ -12>>2]|0)+76)>>2]=48;b=o+ -1|0;r=c[f>>2]|0;if((b|0)==0){t=r;break}else{o=b;d=r}}}Vc(Kf(h,c[t>>2]|0)|0,24)|0;bd(j,l);Wc(480,j)|0;if(!((a[j]&1)==0)){Rm(c[j+8>>2]|0)}c[k>>2]=84;c[m>>2]=104;m=g+4|0;c[m>>2]=248;if((a[p]&1)==0){c[m>>2]=2400;Zj(q);Pe(n);i=e;return}Rm(c[g+44>>2]|0);c[m>>2]=2400;Zj(q);Pe(n);i=e;return}function Zc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;f=i;i=i+16|0;g=f;if((d|0)<3){d=b;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=f;return}d=c[e+4>>2]|0;e=on(d|0)|0;if(e>>>0>4294967279){re(0)}if(e>>>0<11){h=e<<1&255;j=g;a[j]=h;k=j;l=h;m=g+1|0}else{h=e+16&-16;j=Pm(h)|0;c[g+8>>2]=j;n=h|1;c[g>>2]=n;c[g+4>>2]=e;k=g;l=n&255;m=j}mn(m|0,d|0,e|0)|0;a[m+e|0]=0;if((l&1)==0){o=(l&255)>>>1;p=g+1|0}else{o=c[g+4>>2]|0;p=c[g+8>>2]|0}e=o>>>0>3;if((en(p,40,e?3:o)|0)==0){if(o>>>0>2&(e^1)){q=28}else{q=13}}else{q=13}do{if((q|0)==13){if((l&1)==0){r=(l&255)>>>1;s=g+1|0}else{r=c[g+4>>2]|0;s=c[g+8>>2]|0}e=r>>>0>2;if((en(s,48,e?2:r)|0)==0){if(r>>>0>1&(e^1)){q=28;break}}if((l&1)==0){t=(l&255)>>>1;u=g+1|0}else{t=c[g+4>>2]|0;u=c[g+8>>2]|0}e=t>>>0>4;if((en(u,56,e?4:t)|0)==0){if(t>>>0>3&(e^1)){q=28;break}}if((l&1)==0){v=(l&255)>>>1;w=g+1|0}else{v=c[g+4>>2]|0;w=c[g+8>>2]|0}e=v>>>0>4;if((en(w,64,e?4:v)|0)==0){if(v>>>0>3&(e^1)){q=28;break}}e=b;c[e+0>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0}}while(0);do{if((q|0)==28){if((l&1)==0){v=b;c[v+0>>2]=c[k+0>>2];c[v+4>>2]=c[k+4>>2];c[v+8>>2]=c[k+8>>2];break}v=c[g+8>>2]|0;w=c[g+4>>2]|0;if(w>>>0>4294967279){re(0)}if(w>>>0<11){a[b]=w<<1;x=b+1|0}else{t=w+16&-16;u=Pm(t)|0;c[b+8>>2]=u;c[b>>2]=t|1;c[b+4>>2]=w;x=u}mn(x|0,v|0,w|0)|0;a[x+w|0]=0}}while(0);if((l&1)==0){i=f;return}Rm(c[g+8>>2]|0);i=f;return}function _c(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;e=i;i=i+80|0;f=e;g=e+16|0;h=e+32|0;j=e+48|0;k=e+64|0;Zc(f,b,d);l=f;m=a[l]|0;if((m&1)==0){n=(m&255)>>>1}else{n=c[f+4>>2]|0}if((n|0)==0){xe(f,48)|0;o=a[l]|0;p=5e4}else{o=m;p=wb(c[d+8>>2]|0)|0}if((o&1)==0){q=(o&255)>>>1;r=f+1|0}else{q=c[f+4>>2]|0;r=c[f+8>>2]|0}o=q>>>0>3;do{if((en(r,40,o?3:q)|0)==0){if(!(q>>>0>2&(o^1))){break}$c(g,p);Uc(g);m=g;n=c[m>>2]|0;if((n|0)==0){break}s=g+4|0;t=c[s>>2]|0;if((t|0)==(n|0)){u=n}else{v=t;while(1){t=v+ -12|0;c[s>>2]=t;w=c[t>>2]|0;if((w|0)==0){x=t}else{t=v+ -8|0;y=c[t>>2]|0;if((y|0)!=(w|0)){c[t>>2]=y+(~((y+ -4+(0-w)|0)>>>2)<<2)}Rm(w);x=c[s>>2]|0}if((x|0)==(n|0)){break}else{v=x}}u=c[m>>2]|0}Rm(u)}}while(0);u=a[l]|0;if((u&1)==0){z=(u&255)>>>1;A=f+1|0}else{z=c[f+4>>2]|0;A=c[f+8>>2]|0}u=z>>>0>2;do{if((en(A,48,u?2:z)|0)==0){if(!(z>>>0>1&(u^1))){break}$c(h,p);x=h;g=c[x>>2]|0;if((g|0)==0){break}o=h+4|0;q=c[o>>2]|0;if((q|0)==(g|0)){B=g}else{r=q;while(1){q=r+ -12|0;c[o>>2]=q;v=c[q>>2]|0;if((v|0)==0){C=q}else{q=r+ -8|0;n=c[q>>2]|0;if((n|0)!=(v|0)){c[q>>2]=n+(~((n+ -4+(0-v)|0)>>>2)<<2)}Rm(v);C=c[o>>2]|0}if((C|0)==(g|0)){break}else{r=C}}B=c[x>>2]|0}Rm(B)}}while(0);B=a[l]|0;if((B&1)==0){D=(B&255)>>>1;E=f+1|0}else{D=c[f+4>>2]|0;E=c[f+8>>2]|0}B=D>>>0>4;do{if((en(E,56,B?4:D)|0)==0){if(!(D>>>0>3&(B^1))){break}$c(j,0);if((b|0)>2){C=2;do{Yc(j,wb(c[d+(C<<2)>>2]|0)|0);C=C+1|0;}while((C|0)<(b|0))}C=j;x=c[C>>2]|0;if((x|0)==0){break}h=j+4|0;u=c[h>>2]|0;if((u|0)==(x|0)){F=x}else{z=u;while(1){u=z+ -12|0;c[h>>2]=u;A=c[u>>2]|0;if((A|0)==0){G=u}else{u=z+ -8|0;r=c[u>>2]|0;if((r|0)!=(A|0)){c[u>>2]=r+(~((r+ -4+(0-A)|0)>>>2)<<2)}Rm(A);G=c[h>>2]|0}if((G|0)==(x|0)){break}else{z=G}}F=c[C>>2]|0}Rm(F)}}while(0);F=a[l]|0;if((F&1)==0){H=(F&255)>>>1;I=f+1|0}else{H=c[f+4>>2]|0;I=c[f+8>>2]|0}F=H>>>0>4;do{if((en(I,64,F?4:H)|0)==0){if(!(H>>>0>3&(F^1))){break}if((b|0)==3){J=25e3}else{J=wb(c[d+12>>2]|0)|0}$c(k,0);if((p|0)!=0){G=0;do{Yc(k,(hn()|0)%(J|0)|0);G=G+1|0;}while(G>>>0<p>>>0)}G=k;C=c[G>>2]|0;if((C|0)==0){break}j=k+4|0;B=c[j>>2]|0;if((B|0)==(C|0)){K=C}else{D=B;while(1){B=D+ -12|0;c[j>>2]=B;E=c[B>>2]|0;if((E|0)==0){L=B}else{B=D+ -8|0;z=c[B>>2]|0;if((z|0)!=(E|0)){c[B>>2]=z+(~((z+ -4+(0-E)|0)>>>2)<<2)}Rm(E);L=c[j>>2]|0}if((L|0)==(C|0)){break}else{D=L}}K=c[G>>2]|0}Rm(K)}}while(0);if((a[l]&1)==0){i=e;return 0}Rm(c[f+8>>2]|0);i=e;return 0}function $c(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;Rc(e,a,b);b=c[e>>2]|0;if((b|0)==0){i=d;return}a=e+4|0;e=c[a>>2]|0;if((e|0)!=(b|0)){c[a>>2]=e+(~((e+ -4+(0-b)|0)>>>2)<<2)}Rm(b);i=d;return}function ad(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;k=i;i=i+16|0;l=k;m=d;d=c[m>>2]|0;if((d|0)==0){c[b>>2]=0;i=k;return}n=g;g=e;o=n-g|0;p=h+12|0;h=c[p>>2]|0;q=(h|0)>(o|0)?h-o|0:0;o=f;h=o-g|0;do{if((h|0)>0){if((jc[c[(c[d>>2]|0)+48>>2]&31](d,e,h)|0)==(h|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);do{if((q|0)>0){if(q>>>0<11){h=q<<1&255;e=l;a[e]=h;r=e;s=h;t=l+1|0}else{h=q+16&-16;e=Pm(h)|0;c[l+8>>2]=e;g=h|1;c[l>>2]=g;c[l+4>>2]=q;r=l;s=g&255;t=e}jn(t|0,j|0,q|0)|0;a[t+q|0]=0;if((s&1)==0){u=l+1|0}else{u=c[l+8>>2]|0}if((jc[c[(c[d>>2]|0)+48>>2]&31](d,u,q)|0)==(q|0)){if((a[r]&1)==0){break}Rm(c[l+8>>2]|0);break}c[m>>2]=0;c[b>>2]=0;if((a[r]&1)==0){i=k;return}Rm(c[l+8>>2]|0);i=k;return}}while(0);l=n-o|0;do{if((l|0)>0){if((jc[c[(c[d>>2]|0)+48>>2]&31](d,f,l)|0)==(l|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);c[p>>2]=0;c[b>>2]=d;i=k;return}function bd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;f=c[d+48>>2]|0;if((f&16|0)!=0){g=d+44|0;h=c[g>>2]|0;j=c[d+24>>2]|0;if(h>>>0<j>>>0){c[g>>2]=j;k=j}else{k=h}h=c[d+20>>2]|0;j=h;g=k-j|0;if(g>>>0>4294967279){re(0)}if(g>>>0<11){a[b]=g<<1;l=b+1|0}else{m=g+16&-16;n=Pm(m)|0;c[b+8>>2]=n;c[b>>2]=m|1;c[b+4>>2]=g;l=n}if((h|0)==(k|0)){o=l}else{n=h;h=l;while(1){a[h]=a[n]|0;g=n+1|0;if((g|0)==(k|0)){break}else{h=h+1|0;n=g}}o=l+(k+(0-j))|0}a[o]=0;i=e;return}if((f&8|0)==0){f=b;c[f+0>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;i=e;return}f=c[d+8>>2]|0;o=c[d+16>>2]|0;d=f;j=o-d|0;if(j>>>0>4294967279){re(0)}if(j>>>0<11){a[b]=j<<1;p=b+1|0}else{k=j+16&-16;l=Pm(k)|0;c[b+8>>2]=l;c[b>>2]=k|1;c[b+4>>2]=j;p=l}if((f|0)==(o|0)){q=p}else{l=f;f=p;while(1){a[f]=a[l]|0;j=l+1|0;if((j|0)==(o|0)){break}else{f=f+1|0;l=j}}q=p+(o+(0-d))|0}a[q]=0;i=e;return}function cd(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=84;c[b+56>>2]=104;e=b+4|0;c[e>>2]=248;if(!((a[b+36|0]&1)==0)){Rm(c[b+44>>2]|0)}c[e>>2]=2400;Zj(b+8|0);Pe(b+56|0);Rm(b);i=d;return}function dd(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b;f=c[(c[b>>2]|0)+ -12>>2]|0;c[e+f>>2]=84;b=e+(f+56)|0;c[b>>2]=104;g=e+(f+4)|0;c[g>>2]=248;if(!((a[e+(f+36)|0]&1)==0)){Rm(c[e+(f+44)>>2]|0)}c[g>>2]=2400;Zj(e+(f+8)|0);Pe(b);i=d;return}function ed(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=b;f=c[(c[b>>2]|0)+ -12>>2]|0;b=e+f|0;c[b>>2]=84;g=e+(f+56)|0;c[g>>2]=104;h=e+(f+4)|0;c[h>>2]=248;if(!((a[e+(f+36)|0]&1)==0)){Rm(c[e+(f+44)>>2]|0)}c[h>>2]=2400;Zj(e+(f+8)|0);Pe(g);Rm(b);i=d;return}function fd(b){b=b|0;var d=0,e=0;d=i;e=b;c[e>>2]=248;if(!((a[b+32|0]&1)==0)){Rm(c[b+40>>2]|0)}c[e>>2]=2400;Zj(b+4|0);i=d;return}function gd(b){b=b|0;var d=0,e=0;d=i;e=b;c[e>>2]=248;if(!((a[b+32|0]&1)==0)){Rm(c[b+40>>2]|0)}c[e>>2]=2400;Zj(b+4|0);Rm(b);i=d;return}function hd(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;k=d+44|0;l=c[k>>2]|0;m=d+24|0;n=c[m>>2]|0;if(l>>>0<n>>>0){c[k>>2]=n;o=n}else{o=l}l=h&24;do{if((l|0)==24){if((g|0)==2){p=11;break}else if((g|0)==0){q=0;r=0;break}else if((g|0)!=1){p=15;break}k=b;c[k>>2]=0;c[k+4>>2]=0;k=b+8|0;c[k>>2]=-1;c[k+4>>2]=-1;i=j;return}else if((l|0)==0){k=b;c[k>>2]=0;c[k+4>>2]=0;k=b+8|0;c[k>>2]=-1;c[k+4>>2]=-1;i=j;return}else{if((g|0)==2){p=11;break}else if((g|0)==0){q=0;r=0;break}else if((g|0)!=1){p=15;break}if((h&8|0)==0){k=n-(c[d+20>>2]|0)|0;q=k;r=((k|0)<0)<<31>>31;break}else{k=(c[d+12>>2]|0)-(c[d+8>>2]|0)|0;q=k;r=((k|0)<0)<<31>>31;break}}}while(0);if((p|0)==15){g=b;c[g>>2]=0;c[g+4>>2]=0;g=b+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=j;return}if((p|0)==11){p=d+32|0;if((a[p]&1)==0){s=p+1|0}else{s=c[d+40>>2]|0}p=o-s|0;q=p;r=((p|0)<0)<<31>>31}p=ln(q|0,r|0,e|0,f|0)|0;f=J;do{if(!((f|0)<0|(f|0)==0&p>>>0<0)){e=d+32|0;if((a[e]&1)==0){t=e+1|0}else{t=c[d+40>>2]|0}e=o-t|0;r=((e|0)<0)<<31>>31;if((r|0)<(f|0)|(r|0)==(f|0)&e>>>0<p>>>0){break}e=h&8;do{if(!((p|0)==0&(f|0)==0)){do{if((e|0)!=0){if((c[d+12>>2]|0)!=0){break}r=b;c[r>>2]=0;c[r+4>>2]=0;r=b+8|0;c[r>>2]=-1;c[r+4>>2]=-1;i=j;return}}while(0);if(!((h&16|0)!=0&(n|0)==0)){break}r=b;c[r>>2]=0;c[r+4>>2]=0;r=b+8|0;c[r>>2]=-1;c[r+4>>2]=-1;i=j;return}}while(0);if((e|0)!=0){c[d+12>>2]=(c[d+8>>2]|0)+p;c[d+16>>2]=o}if((h&16|0)!=0){c[m>>2]=(c[d+20>>2]|0)+p}r=b;c[r>>2]=0;c[r+4>>2]=0;r=b+8|0;c[r>>2]=p;c[r+4>>2]=f;i=j;return}}while(0);f=b;c[f>>2]=0;c[f+4>>2]=0;f=b+8|0;c[f>>2]=-1;c[f+4>>2]=-1;i=j;return}function id(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;g=d+8|0;xc[c[(c[b>>2]|0)+16>>2]&31](a,b,c[g>>2]|0,c[g+4>>2]|0,0,e);i=f;return}function jd(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,j=0,k=0;b=i;e=a+44|0;f=c[e>>2]|0;g=c[a+24>>2]|0;if(f>>>0<g>>>0){c[e>>2]=g;h=g}else{h=f}if((c[a+48>>2]&8|0)==0){j=-1;i=b;return j|0}f=a+16|0;g=c[f>>2]|0;e=c[a+12>>2]|0;if(g>>>0<h>>>0){c[f>>2]=h;k=h}else{k=g}if(!(e>>>0<k>>>0)){j=-1;i=b;return j|0}j=d[e]|0;i=b;return j|0}function kd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b+44|0;g=c[f>>2]|0;h=c[b+24>>2]|0;if(g>>>0<h>>>0){c[f>>2]=h;j=h}else{j=g}g=b+8|0;h=c[g>>2]|0;f=b+12|0;k=c[f>>2]|0;if(!(h>>>0<k>>>0)){l=-1;i=e;return l|0}if((d|0)==-1){c[g>>2]=h;c[f>>2]=k+ -1;c[b+16>>2]=j;l=0;i=e;return l|0}do{if((c[b+48>>2]&16|0)==0){m=d&255;n=k+ -1|0;if(m<<24>>24==(a[n]|0)){o=m;p=n;break}else{l=-1}i=e;return l|0}else{o=d&255;p=k+ -1|0}}while(0);c[g>>2]=h;c[f>>2]=p;c[b+16>>2]=j;a[p]=o;l=d;i=e;return l|0}function ld(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;e=i;if((d|0)==-1){f=0;i=e;return f|0}g=b;h=b+12|0;j=b+8|0;k=(c[h>>2]|0)-(c[j>>2]|0)|0;l=b+24|0;m=c[l>>2]|0;n=b+28|0;o=c[n>>2]|0;if((m|0)==(o|0)){p=b+48|0;if((c[p>>2]&16|0)==0){f=-1;i=e;return f|0}q=b+20|0;r=c[q>>2]|0;s=m-r|0;t=b+44|0;u=(c[t>>2]|0)-r|0;r=b+32|0;v=r;w=a[v]|0;x=(w&1)!=0;if(x){y=(c[r>>2]&-2)+ -1|0;z=c[b+36>>2]|0}else{y=10;z=(w&255)>>>1}if((z|0)==(y|0)){Ee(r,y,1,y,y,0,0);if((a[v]&1)==0){A=11}else{A=12}}else{if(x){A=12}else{A=11}}if((A|0)==11){a[v]=(z<<1)+2;B=r+1|0;C=z+1|0}else if((A|0)==12){A=c[b+40>>2]|0;x=z+1|0;c[b+36>>2]=x;B=A;C=x}a[B+z|0]=0;a[B+C|0]=0;C=a[v]|0;if((C&1)==0){D=C;E=10}else{C=c[r>>2]|0;D=C&255;E=(C&-2)+ -1|0}C=(D&1)==0;if(C){F=(D&255)>>>1}else{F=c[b+36>>2]|0}do{if(F>>>0<E>>>0){ze(r,E-F|0,0)|0}else{if(C){a[r+E+1|0]=0;a[v]=E<<1;break}else{a[(c[b+40>>2]|0)+E|0]=0;c[b+36>>2]=E;break}}}while(0);E=a[v]|0;if((E&1)==0){G=r+1|0;H=(E&255)>>>1}else{G=c[b+40>>2]|0;H=c[b+36>>2]|0}E=G+H|0;c[q>>2]=G;c[n>>2]=E;n=G+s|0;c[l>>2]=n;s=G+u|0;c[t>>2]=s;I=p;J=s;K=E;L=n}else{I=b+48|0;J=c[b+44>>2]|0;K=o;L=m}m=L+1|0;o=m>>>0<J>>>0?J:m;c[b+44>>2]=o;if((c[I>>2]&8|0)!=0){I=b+32|0;if((a[I]&1)==0){M=I+1|0}else{M=c[b+40>>2]|0}c[j>>2]=M;c[h>>2]=M+k;c[b+16>>2]=o}if((L|0)==(K|0)){f=yc[c[(c[b>>2]|0)+52>>2]&31](g,d&255)|0;i=e;return f|0}else{c[l>>2]=m;a[L]=d;f=d&255;i=e;return f|0}return 0}function md(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;e=i;f=b+32|0;we(f,d)|0;d=b+44|0;c[d>>2]=0;g=b+48|0;h=c[g>>2]|0;if((h&8|0)!=0){j=a[f]|0;if((j&1)==0){k=f+((j&255)>>>1)+1|0;c[d>>2]=k;l=f+1|0;m=k;n=f+1|0}else{k=(c[b+40>>2]|0)+(c[b+36>>2]|0)|0;c[d>>2]=k;j=c[b+40>>2]|0;l=j;m=k;n=j}c[b+8>>2]=l;c[b+12>>2]=n;c[b+16>>2]=m}if((h&16|0)==0){i=e;return}h=f;m=a[h]|0;if((m&1)==0){n=(m&255)>>>1;c[d>>2]=f+n+1;o=n;p=m;q=10}else{m=c[b+36>>2]|0;c[d>>2]=(c[b+40>>2]|0)+m;d=c[f>>2]|0;o=m;p=d&255;q=(d&-2)+ -1|0}d=(p&1)==0;if(d){r=(p&255)>>>1}else{r=c[b+36>>2]|0}do{if(r>>>0<q>>>0){ze(f,q-r|0,0)|0}else{if(d){a[f+q+1|0]=0;a[h]=q<<1;break}else{a[(c[b+40>>2]|0)+q|0]=0;c[b+36>>2]=q;break}}}while(0);q=a[h]|0;if((q&1)==0){s=f+1|0;t=f+1|0;u=(q&255)>>>1}else{q=c[b+40>>2]|0;s=q;t=q;u=c[b+36>>2]|0}q=b+24|0;c[q>>2]=t;c[b+20>>2]=t;c[b+28>>2]=s+u;if((c[g>>2]&3|0)==0){i=e;return}c[q>>2]=t+o;i=e;return}function nd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;d=i;e=a+4|0;f=c[e>>2]|0;g=a;h=c[g>>2]|0;j=h;k=(f-j|0)/12|0;l=k+1|0;if(l>>>0>357913941){Rj(0)}m=a+8|0;a=((c[m>>2]|0)-j|0)/12|0;if(a>>>0<178956970){j=a<<1;a=j>>>0<l>>>0?l:j;if((a|0)==0){n=0;o=0}else{p=a;q=5}}else{p=357913941;q=5}if((q|0)==5){n=p;o=Pm(p*12|0)|0}p=o+(k*12|0)|0;k=o+(n*12|0)|0;if((p|0)==0){r=f;s=h}else{od(p,b);r=c[e>>2]|0;s=c[g>>2]|0}b=o+(l*12|0)|0;do{if((r|0)==(s|0)){c[g>>2]=p;c[e>>2]=b;c[m>>2]=k;t=r}else{l=r;o=p;do{l=l+ -12|0;od(o+ -12|0,l);o=o+ -12|0;}while((l|0)!=(s|0));l=c[g>>2]|0;h=c[e>>2]|0;c[g>>2]=o;c[e>>2]=b;c[m>>2]=k;if((h|0)==(l|0)){t=l;break}else{u=h}while(1){h=u+ -12|0;f=c[h>>2]|0;if((f|0)!=0){n=u+ -8|0;q=c[n>>2]|0;if((q|0)!=(f|0)){c[n>>2]=q+(~((q+ -4+(0-f)|0)>>>2)<<2)}Rm(f)}if((h|0)==(l|0)){t=l;break}else{u=h}}}}while(0);if((t|0)==0){i=d;return}Rm(t);i=d;return}function od(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;e=a;c[e>>2]=0;f=a+4|0;c[f>>2]=0;g=a+8|0;c[g>>2]=0;a=b+4|0;h=b;b=(c[a>>2]|0)-(c[h>>2]|0)|0;j=b>>2;if((j|0)==0){i=d;return}if(j>>>0>1073741823){Rj(0)}k=Pm(b)|0;c[f>>2]=k;c[e>>2]=k;c[g>>2]=k+(j<<2);j=c[h>>2]|0;h=c[a>>2]|0;if((j|0)==(h|0)){i=d;return}a=(h+ -4+(0-j)|0)>>>2;g=j;j=k;while(1){if((j|0)!=0){c[j>>2]=c[g>>2]}e=g+4|0;if((e|0)==(h|0)){break}else{g=e;j=j+4|0}}c[f>>2]=k+(a+1<<2);i=d;return}function pd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+16|0;f=e;g=a;h=a;c[h>>2]=0;j=a+4|0;c[j>>2]=0;k=a+8|0;c[k>>2]=0;a=b+4|0;l=b;m=(c[a>>2]|0)-(c[l>>2]|0)>>2;n=d+4|0;o=d;p=(c[n>>2]|0)-(c[o>>2]|0)>>2;q=m>>>0>p>>>0?m:p;if(m>>>0<q>>>0){qd(b,q-m|0)}m=c[n>>2]|0;b=c[o>>2]|0;p=m-b>>2;do{if(p>>>0<q>>>0){qd(d,q-p|0)}else{if(!(p>>>0>q>>>0)){break}r=b+(q<<2)|0;if((m|0)==(r|0)){break}c[n>>2]=m+(~((m+ -4+(0-r)|0)>>>2)<<2)}}while(0);m=c[j>>2]|0;n=c[h>>2]|0;b=m-n>>2;do{if(b>>>0<q>>>0){qd(g,q-b|0);s=c[h>>2]|0}else{if(!(b>>>0>q>>>0)){s=n;break}p=n+(q<<2)|0;if((m|0)==(p|0)){s=n;break}c[j>>2]=m+(~((m+ -4+(0-p)|0)>>>2)<<2);s=n}}while(0);c[8]=0;n=c[l>>2]|0;l=c[a>>2]|0;a=c[o>>2]|0;od(f,g);if((n|0)!=(l|0)){g=n;n=s;s=a;while(1){a=(c[s>>2]|0)+(c[g>>2]|0)+(c[8]|0)|0;c[8]=(a>>>0)/1e9|0;c[n>>2]=(a>>>0)%1e9|0;a=g+4|0;if((a|0)==(l|0)){break}else{s=s+4|0;n=n+4|0;g=a}}}g=c[f>>2]|0;if((g|0)!=0){n=f+4|0;f=c[n>>2]|0;if((f|0)!=(g|0)){c[n>>2]=f+(~((f+ -4+(0-g)|0)>>>2)<<2)}Rm(g)}g=c[8]|0;if((g|0)==0){i=e;return}f=c[j>>2]|0;if((f|0)!=(c[k>>2]|0)){if((f|0)!=0){c[f>>2]=g}c[j>>2]=f+4;i=e;return}n=c[h>>2]|0;s=f-n|0;f=s>>2;l=f+1|0;if(l>>>0>1073741823){Rj(0)}if(f>>>0<536870911){a=s>>1;o=a>>>0<l>>>0?l:a;if((o|0)==0){t=0;u=0}else{v=o;w=28}}else{v=1073741823;w=28}if((w|0)==28){t=v;u=Pm(v<<2)|0}v=u+(f<<2)|0;if((v|0)!=0){c[v>>2]=g}g=n;mn(u|0,g|0,s|0)|0;c[h>>2]=u;c[j>>2]=u+(l<<2);c[k>>2]=u+(t<<2);if((n|0)==0){i=e;return}Rm(g);i=e;return}function qd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=i;e=a+8|0;f=a+4|0;g=c[f>>2]|0;h=c[e>>2]|0;j=g;if(!(h-j>>2>>>0<b>>>0)){k=b;l=g;while(1){if((l|0)!=0){c[l>>2]=0}m=k+ -1|0;if((m|0)==0){break}else{k=m;l=l+4|0}}c[f>>2]=g+(b<<2);i=d;return}g=a;a=c[g>>2]|0;l=a;k=j-l|0;j=k>>2;m=j+b|0;if(m>>>0>1073741823){Rj(0)}n=h-l|0;if(n>>2>>>0<536870911){l=n>>1;n=l>>>0<m>>>0?m:l;if((n|0)==0){o=0;p=0}else{q=n;r=10}}else{q=1073741823;r=10}if((r|0)==10){o=q;p=Pm(q<<2)|0}q=b;b=p+(j<<2)|0;while(1){if((b|0)!=0){c[b>>2]=0}j=q+ -1|0;if((j|0)==0){break}else{q=j;b=b+4|0}}b=a;mn(p|0,b|0,k|0)|0;c[g>>2]=p;c[f>>2]=p+(m<<2);c[e>>2]=p+(o<<2);if((a|0)==0){i=d;return}Rm(b);i=d;return}function rd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;b=i;i=i+32|0;d=b;e=b+8|0;f=b+16|0;g=b+24|0;h=c[s>>2]|0;Nd(1104,h,1160);c[98]=2532;c[400>>2]=2552;c[396>>2]=0;Re(400|0,1104);c[472>>2]=0;c[476>>2]=-1;j=c[t>>2]|0;c[302]=2400;Xj(1212|0);c[1216>>2]=0;c[1220>>2]=0;c[1224>>2]=0;c[1228>>2]=0;c[1232>>2]=0;c[1236>>2]=0;c[302]=1720;c[1240>>2]=j;Yj(g,1212|0);k=_j(g,5192)|0;l=k;Zj(g);c[1244>>2]=l;c[1248>>2]=1168;a[1252|0]=(pc[c[(c[k>>2]|0)+28>>2]&127](l)|0)&1;c[120]=2612;c[484>>2]=2632;Re(484|0,1208);c[556>>2]=0;c[560>>2]=-1;l=c[r>>2]|0;c[314]=2400;Xj(1260|0);c[1264>>2]=0;c[1268>>2]=0;c[1272>>2]=0;c[1276>>2]=0;c[1280>>2]=0;c[1284>>2]=0;c[314]=1720;c[1288>>2]=l;Yj(f,1260|0);k=_j(f,5192)|0;g=k;Zj(f);c[1292>>2]=g;c[1296>>2]=1176;a[1300|0]=(pc[c[(c[k>>2]|0)+28>>2]&127](g)|0)&1;c[142]=2612;c[572>>2]=2632;Re(572|0,1256);c[644>>2]=0;c[648>>2]=-1;g=c[(c[(c[142]|0)+ -12>>2]|0)+592>>2]|0;c[164]=2612;c[660>>2]=2632;Re(660|0,g);c[732>>2]=0;c[736>>2]=-1;c[(c[(c[98]|0)+ -12>>2]|0)+464>>2]=480;g=(c[(c[142]|0)+ -12>>2]|0)+572|0;c[g>>2]=c[g>>2]|8192;c[(c[(c[142]|0)+ -12>>2]|0)+640>>2]=480;zd(1304,h,1184|0);c[186]=2572;c[752>>2]=2592;c[748>>2]=0;Re(752|0,1304);c[824>>2]=0;c[828>>2]=-1;c[340]=2464;Xj(1364|0);c[1368>>2]=0;c[1372>>2]=0;c[1376>>2]=0;c[1380>>2]=0;c[1384>>2]=0;c[1388>>2]=0;c[340]=1464;c[1392>>2]=j;Yj(e,1364|0);j=_j(e,5200)|0;h=j;Zj(e);c[1396>>2]=h;c[1400>>2]=1192;a[1404|0]=(pc[c[(c[j>>2]|0)+28>>2]&127](h)|0)&1;c[208]=2652;c[836>>2]=2672;Re(836|0,1360);c[908>>2]=0;c[912>>2]=-1;c[352]=2464;Xj(1412|0);c[1416>>2]=0;c[1420>>2]=0;c[1424>>2]=0;c[1428>>2]=0;c[1432>>2]=0;c[1436>>2]=0;c[352]=1464;c[1440>>2]=l;Yj(d,1412|0);l=_j(d,5200)|0;h=l;Zj(d);c[1444>>2]=h;c[1448>>2]=1200;a[1452|0]=(pc[c[(c[l>>2]|0)+28>>2]&127](h)|0)&1;c[230]=2652;c[924>>2]=2672;Re(924|0,1408);c[996>>2]=0;c[1e3>>2]=-1;h=c[(c[(c[230]|0)+ -12>>2]|0)+944>>2]|0;c[252]=2652;c[1012>>2]=2672;Re(1012|0,h);c[1084>>2]=0;c[1088>>2]=-1;c[(c[(c[186]|0)+ -12>>2]|0)+816>>2]=832;h=(c[(c[230]|0)+ -12>>2]|0)+924|0;c[h>>2]=c[h>>2]|8192;c[(c[(c[230]|0)+ -12>>2]|0)+992>>2]=832;i=b;return}function sd(a){a=a|0;a=i;xf(480)|0;xf(656)|0;Df(832)|0;Df(1008)|0;i=a;return}function td(a){a=a|0;var b=0;b=i;c[a>>2]=2464;Zj(a+4|0);i=b;return}function ud(a){a=a|0;var b=0;b=i;c[a>>2]=2464;Zj(a+4|0);Rm(a);i=b;return}function vd(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;pc[c[(c[b>>2]|0)+24>>2]&127](b)|0;f=_j(d,5200)|0;d=f;c[b+36>>2]=d;a[b+44|0]=(pc[c[(c[f>>2]|0)+28>>2]&127](d)|0)&1;i=e;return}function wd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;i=i+16|0;d=b;e=b+8|0;f=a+36|0;g=a+40|0;h=d;j=d+8|0;k=d;d=a+32|0;while(1){a=c[f>>2]|0;l=zc[c[(c[a>>2]|0)+20>>2]&15](a,c[g>>2]|0,h,j,e)|0;a=(c[e>>2]|0)-k|0;if((ob(h|0,1,a|0,c[d>>2]|0)|0)!=(a|0)){m=-1;n=5;break}if((l|0)==2){m=-1;n=5;break}else if((l|0)!=1){n=4;break}}if((n|0)==4){m=((Rb(c[d>>2]|0)|0)!=0)<<31>>31;i=b;return m|0}else if((n|0)==5){i=b;return m|0}return 0}function xd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;if((a[b+44|0]|0)!=0){g=ob(d|0,4,e|0,c[b+32>>2]|0)|0;i=f;return g|0}h=b;if((e|0)>0){j=d;k=0}else{g=0;i=f;return g|0}while(1){if((yc[c[(c[h>>2]|0)+52>>2]&31](b,c[j>>2]|0)|0)==-1){g=k;l=6;break}d=k+1|0;if((d|0)<(e|0)){j=j+4|0;k=d}else{g=d;l=6;break}}if((l|0)==6){i=f;return g|0}return 0}function yd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=(d|0)==-1;a:do{if(!k){c[g>>2]=d;if((a[b+44|0]|0)!=0){if((ob(g|0,4,1,c[b+32>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}m=f;c[h>>2]=m;n=g+4|0;o=b+36|0;p=b+40|0;q=f+8|0;r=f;s=b+32|0;t=g;while(1){u=c[o>>2]|0;v=uc[c[(c[u>>2]|0)+12>>2]&15](u,c[p>>2]|0,t,n,j,m,q,h)|0;if((c[j>>2]|0)==(t|0)){l=-1;w=12;break}if((v|0)==3){w=7;break}u=(v|0)==1;if(!(v>>>0<2)){l=-1;w=12;break}v=(c[h>>2]|0)-r|0;if((ob(m|0,1,v|0,c[s>>2]|0)|0)!=(v|0)){l=-1;w=12;break}if(u){t=u?c[j>>2]|0:t}else{break a}}if((w|0)==7){if((ob(t|0,1,1,c[s>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}else if((w|0)==12){i=e;return l|0}}}while(0);l=k?0:d;i=e;return l|0}function zd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+8|0;g=f;h=b;c[h>>2]=2464;j=b+4|0;Xj(j);k=b+8|0;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[h>>2]=1576;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=-1;a[b+52|0]=0;Yj(g,j);j=_j(g,5200)|0;e=j;d=b+36|0;c[d>>2]=e;h=b+44|0;c[h>>2]=pc[c[(c[j>>2]|0)+24>>2]&127](e)|0;e=c[d>>2]|0;a[b+53|0]=(pc[c[(c[e>>2]|0)+28>>2]&127](e)|0)&1;if((c[h>>2]|0)>8){ij(1672)}else{Zj(g);i=f;return}}function Ad(a){a=a|0;var b=0;b=i;c[a>>2]=2464;Zj(a+4|0);i=b;return}function Bd(a){a=a|0;var b=0;b=i;c[a>>2]=2464;Zj(a+4|0);Rm(a);i=b;return}function Cd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;f=_j(d,5200)|0;d=f;g=b+36|0;c[g>>2]=d;h=b+44|0;c[h>>2]=pc[c[(c[f>>2]|0)+24>>2]&127](d)|0;d=c[g>>2]|0;a[b+53|0]=(pc[c[(c[d>>2]|0)+28>>2]&127](d)|0)&1;if((c[h>>2]|0)>8){ij(1672)}else{i=e;return}}function Dd(a){a=a|0;var b=0,c=0;b=i;c=Gd(a,0)|0;i=b;return c|0}function Ed(a){a=a|0;var b=0,c=0;b=i;c=Gd(a,1)|0;i=b;return c|0}function Fd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;l=(a[k]|0)!=0;if((d|0)==-1){if(l){m=-1;i=e;return m|0}n=c[b+48>>2]|0;a[k]=(n|0)!=-1|0;m=n;i=e;return m|0}n=b+48|0;a:do{if(l){c[h>>2]=c[n>>2];o=c[b+36>>2]|0;p=f;q=uc[c[(c[o>>2]|0)+12>>2]&15](o,c[b+40>>2]|0,h,h+4|0,j,p,f+8|0,g)|0;if((q|0)==1|(q|0)==2){m=-1;i=e;return m|0}else if((q|0)==3){a[p]=c[n>>2];c[g>>2]=f+1}q=b+32|0;while(1){o=c[g>>2]|0;if(!(o>>>0>p>>>0)){break a}r=o+ -1|0;c[g>>2]=r;if((Qb(a[r]|0,c[q>>2]|0)|0)==-1){m=-1;break}}i=e;return m|0}}while(0);c[n>>2]=d;a[k]=1;m=d;i=e;return m|0}function Gd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;if((a[k]|0)!=0){l=b+48|0;m=c[l>>2]|0;if(!d){n=m;i=e;return n|0}c[l>>2]=-1;a[k]=0;n=m;i=e;return n|0}m=c[b+44>>2]|0;k=(m|0)>1?m:1;a:do{if((k|0)>0){m=b+32|0;l=0;while(1){o=Jb(c[m>>2]|0)|0;if((o|0)==-1){n=-1;break}a[f+l|0]=o;l=l+1|0;if((l|0)>=(k|0)){break a}}i=e;return n|0}}while(0);b:do{if((a[b+53|0]|0)==0){l=b+40|0;m=b+36|0;o=f;p=g+4|0;q=b+32|0;r=k;while(1){s=c[l>>2]|0;t=s;u=c[t>>2]|0;v=c[t+4>>2]|0;t=c[m>>2]|0;w=f+r|0;x=uc[c[(c[t>>2]|0)+16>>2]&15](t,s,o,w,h,g,p,j)|0;if((x|0)==3){y=14;break}else if((x|0)==2){n=-1;y=22;break}else if((x|0)!=1){z=r;break b}x=c[l>>2]|0;c[x>>2]=u;c[x+4>>2]=v;if((r|0)==8){n=-1;y=22;break}v=Jb(c[q>>2]|0)|0;if((v|0)==-1){n=-1;y=22;break}a[w]=v;r=r+1|0}if((y|0)==14){c[g>>2]=a[o]|0;z=r;break}else if((y|0)==22){i=e;return n|0}}else{c[g>>2]=a[f]|0;z=k}}while(0);if(d){d=c[g>>2]|0;c[b+48>>2]=d;n=d;i=e;return n|0}d=b+32|0;b=z;while(1){if((b|0)<=0){break}z=b+ -1|0;if((Qb(a[f+z|0]|0,c[d>>2]|0)|0)==-1){n=-1;y=22;break}else{b=z}}if((y|0)==22){i=e;return n|0}n=c[g>>2]|0;i=e;return n|0}function Hd(a){a=a|0;var b=0;b=i;c[a>>2]=2400;Zj(a+4|0);i=b;return}function Id(a){a=a|0;var b=0;b=i;c[a>>2]=2400;Zj(a+4|0);Rm(a);i=b;return}function Jd(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;pc[c[(c[b>>2]|0)+24>>2]&127](b)|0;f=_j(d,5192)|0;d=f;c[b+36>>2]=d;a[b+44|0]=(pc[c[(c[f>>2]|0)+28>>2]&127](d)|0)&1;i=e;return}function Kd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;i=i+16|0;d=b;e=b+8|0;f=a+36|0;g=a+40|0;h=d;j=d+8|0;k=d;d=a+32|0;while(1){a=c[f>>2]|0;l=zc[c[(c[a>>2]|0)+20>>2]&15](a,c[g>>2]|0,h,j,e)|0;a=(c[e>>2]|0)-k|0;if((ob(h|0,1,a|0,c[d>>2]|0)|0)!=(a|0)){m=-1;n=5;break}if((l|0)==2){m=-1;n=5;break}else if((l|0)!=1){n=4;break}}if((n|0)==4){m=((Rb(c[d>>2]|0)|0)!=0)<<31>>31;i=b;return m|0}else if((n|0)==5){i=b;return m|0}return 0}function Ld(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;if((a[b+44|0]|0)!=0){h=ob(e|0,1,f|0,c[b+32>>2]|0)|0;i=g;return h|0}j=b;if((f|0)>0){k=e;l=0}else{h=0;i=g;return h|0}while(1){if((yc[c[(c[j>>2]|0)+52>>2]&31](b,d[k]|0)|0)==-1){h=l;m=6;break}e=l+1|0;if((e|0)<(f|0)){k=k+1|0;l=e}else{h=e;m=6;break}}if((m|0)==6){i=g;return h|0}return 0}function Md(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=(d|0)==-1;a:do{if(!k){a[g]=d;if((a[b+44|0]|0)!=0){if((ob(g|0,1,1,c[b+32>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}m=f;c[h>>2]=m;n=g+1|0;o=b+36|0;p=b+40|0;q=f+8|0;r=f;s=b+32|0;t=g;while(1){u=c[o>>2]|0;v=uc[c[(c[u>>2]|0)+12>>2]&15](u,c[p>>2]|0,t,n,j,m,q,h)|0;if((c[j>>2]|0)==(t|0)){l=-1;w=12;break}if((v|0)==3){w=7;break}u=(v|0)==1;if(!(v>>>0<2)){l=-1;w=12;break}v=(c[h>>2]|0)-r|0;if((ob(m|0,1,v|0,c[s>>2]|0)|0)!=(v|0)){l=-1;w=12;break}if(u){t=u?c[j>>2]|0:t}else{break a}}if((w|0)==7){if((ob(t|0,1,1,c[s>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}else if((w|0)==12){i=e;return l|0}}}while(0);l=k?0:d;i=e;return l|0}function Nd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+8|0;g=f;h=b;c[h>>2]=2400;j=b+4|0;Xj(j);k=b+8|0;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[h>>2]=1832;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=-1;a[b+52|0]=0;Yj(g,j);j=_j(g,5192)|0;e=j;d=b+36|0;c[d>>2]=e;h=b+44|0;c[h>>2]=pc[c[(c[j>>2]|0)+24>>2]&127](e)|0;e=c[d>>2]|0;a[b+53|0]=(pc[c[(c[e>>2]|0)+28>>2]&127](e)|0)&1;if((c[h>>2]|0)>8){ij(1672)}else{Zj(g);i=f;return}}function Od(a){a=a|0;var b=0;b=i;c[a>>2]=2400;Zj(a+4|0);i=b;return}function Pd(a){a=a|0;var b=0;b=i;c[a>>2]=2400;Zj(a+4|0);Rm(a);i=b;return}function Qd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;f=_j(d,5192)|0;d=f;g=b+36|0;c[g>>2]=d;h=b+44|0;c[h>>2]=pc[c[(c[f>>2]|0)+24>>2]&127](d)|0;d=c[g>>2]|0;a[b+53|0]=(pc[c[(c[d>>2]|0)+28>>2]&127](d)|0)&1;if((c[h>>2]|0)>8){ij(1672)}else{i=e;return}}function Rd(a){a=a|0;var b=0,c=0;b=i;c=Ud(a,0)|0;i=b;return c|0}function Sd(a){a=a|0;var b=0,c=0;b=i;c=Ud(a,1)|0;i=b;return c|0}function Td(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;l=(a[k]|0)!=0;if((d|0)==-1){if(l){m=-1;i=e;return m|0}n=c[b+48>>2]|0;a[k]=(n|0)!=-1|0;m=n;i=e;return m|0}n=b+48|0;a:do{if(l){a[h]=c[n>>2];o=c[b+36>>2]|0;p=f;q=uc[c[(c[o>>2]|0)+12>>2]&15](o,c[b+40>>2]|0,h,h+1|0,j,p,f+8|0,g)|0;if((q|0)==1|(q|0)==2){m=-1;i=e;return m|0}else if((q|0)==3){a[p]=c[n>>2];c[g>>2]=f+1}q=b+32|0;while(1){o=c[g>>2]|0;if(!(o>>>0>p>>>0)){break a}r=o+ -1|0;c[g>>2]=r;if((Qb(a[r]|0,c[q>>2]|0)|0)==-1){m=-1;break}}i=e;return m|0}}while(0);c[n>>2]=d;a[k]=1;m=d;i=e;return m|0}function Ud(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;f=i;i=i+32|0;g=f;h=f+8|0;j=f+16|0;k=f+24|0;l=b+52|0;if((a[l]|0)!=0){m=b+48|0;n=c[m>>2]|0;if(!e){o=n;i=f;return o|0}c[m>>2]=-1;a[l]=0;o=n;i=f;return o|0}n=c[b+44>>2]|0;l=(n|0)>1?n:1;a:do{if((l|0)>0){n=b+32|0;m=0;while(1){p=Jb(c[n>>2]|0)|0;if((p|0)==-1){o=-1;break}a[g+m|0]=p;m=m+1|0;if((m|0)>=(l|0)){break a}}i=f;return o|0}}while(0);b:do{if((a[b+53|0]|0)==0){m=b+40|0;n=b+36|0;p=g;q=h+1|0;r=b+32|0;s=l;while(1){t=c[m>>2]|0;u=t;v=c[u>>2]|0;w=c[u+4>>2]|0;u=c[n>>2]|0;x=g+s|0;y=uc[c[(c[u>>2]|0)+16>>2]&15](u,t,p,x,j,h,q,k)|0;if((y|0)==3){z=14;break}else if((y|0)==2){o=-1;z=23;break}else if((y|0)!=1){A=s;break b}y=c[m>>2]|0;c[y>>2]=v;c[y+4>>2]=w;if((s|0)==8){o=-1;z=23;break}w=Jb(c[r>>2]|0)|0;if((w|0)==-1){o=-1;z=23;break}a[x]=w;s=s+1|0}if((z|0)==14){a[h]=a[p]|0;A=s;break}else if((z|0)==23){i=f;return o|0}}else{a[h]=a[g]|0;A=l}}while(0);do{if(e){l=a[h]|0;c[b+48>>2]=l&255;B=l}else{l=b+32|0;k=A;while(1){if((k|0)<=0){z=21;break}j=k+ -1|0;if((Qb(d[g+j|0]|0,c[l>>2]|0)|0)==-1){o=-1;z=23;break}else{k=j}}if((z|0)==21){B=a[h]|0;break}else if((z|0)==23){i=f;return o|0}}}while(0);o=B&255;i=f;return o|0}function Vd(){var a=0;a=i;rd(0);gc(117,1096,q|0)|0;i=a;return}function Wd(a){a=a|0;i=i;return}function Xd(a){a=a|0;var b=0;b=a+4|0;c[b>>2]=(c[b>>2]|0)+1;i=i;return}function Yd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;e=c[d>>2]|0;c[d>>2]=e+ -1;if((e|0)!=0){f=0;i=b;return f|0}mc[c[(c[a>>2]|0)+8>>2]&255](a);f=1;i=b;return f|0}function Zd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a>>2]=1976;e=on(b|0)|0;f=Qm(e+13|0)|0;c[f+4>>2]=e;c[f>>2]=e;g=f+12|0;c[a+4>>2]=g;c[f+8>>2]=0;mn(g|0,b|0,e+1|0)|0;i=d;return}function _d(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=1976;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Sm((c[d>>2]|0)+ -12|0)}Ta(a|0);Rm(a);i=b;return}function $d(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=1976;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)>=0){g=a;Ta(g|0);i=b;return}Sm((c[d>>2]|0)+ -12|0);g=a;Ta(g|0);i=b;return}function ae(a){a=a|0;i=i;return c[a+4>>2]|0}function be(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;c[b>>2]=2e3;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=on(f|0)|0;g=Qm(d+13|0)|0;c[g+4>>2]=d;c[g>>2]=d;h=g+12|0;c[b+4>>2]=h;c[g+8>>2]=0;mn(h|0,f|0,d+1|0)|0;i=e;return}function ce(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a>>2]=2e3;e=on(b|0)|0;f=Qm(e+13|0)|0;c[f+4>>2]=e;c[f>>2]=e;g=f+12|0;c[a+4>>2]=g;c[f+8>>2]=0;mn(g|0,b|0,e+1|0)|0;i=d;return}function de(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=2e3;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Sm((c[d>>2]|0)+ -12|0)}Ta(a|0);Rm(a);i=b;return}function ee(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=2e3;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)>=0){g=a;Ta(g|0);i=b;return}Sm((c[d>>2]|0)+ -12|0);g=a;Ta(g|0);i=b;return}function fe(a){a=a|0;i=i;return c[a+4>>2]|0}function ge(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=1976;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Sm((c[d>>2]|0)+ -12|0)}Ta(a|0);Rm(a);i=b;return}function he(a){a=a|0;i=i;return}function ie(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=d;c[a+4>>2]=b;i=i;return}function je(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+8|0;f=e;rc[c[(c[a>>2]|0)+12>>2]&3](f,a,b);if((c[f+4>>2]|0)!=(c[d+4>>2]|0)){g=0;i=e;return g|0}g=(c[f>>2]|0)==(c[d>>2]|0);i=e;return g|0}function ke(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b+4>>2]|0)!=(a|0)){f=0;i=e;return f|0}f=(c[b>>2]|0)==(d|0);i=e;return f|0}function le(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;d=i;f=ec(e|0)|0;e=on(f|0)|0;if(e>>>0>4294967279){re(0)}if(e>>>0<11){a[b]=e<<1;g=b+1|0;mn(g|0,f|0,e|0)|0;h=g+e|0;a[h]=0;i=d;return}else{j=e+16&-16;k=Pm(j)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=e;g=k;mn(g|0,f|0,e|0)|0;h=g+e|0;a[h]=0;i=d;return}}function me(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+16|0;g=f;h=d;j=c[h>>2]|0;k=e;do{if((j|0)!=0){l=a[k]|0;if((l&1)==0){m=(l&255)>>>1}else{m=c[e+4>>2]|0}if((m|0)==0){n=j}else{Ce(e,2152,2)|0;n=c[h>>2]|0}l=c[d+4>>2]|0;rc[c[(c[l>>2]|0)+24>>2]&3](g,l,n);l=g;o=a[l]|0;if((o&1)==0){p=g+1|0;q=(o&255)>>>1}else{p=c[g+8>>2]|0;q=c[g+4>>2]|0}Ce(e,p,q)|0;if((a[l]&1)==0){break}Rm(c[g+8>>2]|0)}}while(0);g=b;c[g+0>>2]=c[k+0>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;i=f;return}function ne(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;g=f;h=f+16|0;j=on(e|0)|0;if(j>>>0>4294967279){re(0)}if(j>>>0<11){a[h]=j<<1;k=h+1|0}else{l=j+16&-16;m=Pm(l)|0;c[h+8>>2]=m;c[h>>2]=l|1;c[h+4>>2]=j;k=m}mn(k|0,e|0,j|0)|0;a[k+j|0]=0;me(g,d,h);be(b,g);if(!((a[g]&1)==0)){Rm(c[g+8>>2]|0)}if(!((a[h]&1)==0)){Rm(c[h+8>>2]|0)}c[b>>2]=2168;h=d;d=c[h+4>>2]|0;g=b+8|0;c[g>>2]=c[h>>2];c[g+4>>2]=d;i=f;return}function oe(a){a=a|0;var b=0;b=i;ee(a);Rm(a);i=b;return}function pe(a){a=a|0;var b=0;b=i;ee(a);i=b;return}function qe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;qb(2304)|0;if((c[a>>2]|0)==1){do{Ob(2328,2304)|0;}while((c[a>>2]|0)==1)}if((c[a>>2]|0)==0){c[a>>2]=1;Zb(2304)|0;mc[d&255](b);qb(2304)|0;c[a>>2]=-1;Zb(2304)|0;Hb(2328)|0;i=e;return}else{Zb(2304)|0;i=e;return}}function re(a){a=a|0;a=vb(8)|0;Zd(a,2376);c[a>>2]=2056;cc(a|0,2096,19)}function se(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;f=d;if((a[f]&1)==0){g=b;c[g+0>>2]=c[f+0>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];i=e;return}f=c[d+8>>2]|0;g=c[d+4>>2]|0;if(g>>>0>4294967279){re(0)}if(g>>>0<11){a[b]=g<<1;h=b+1|0}else{d=g+16&-16;j=Pm(d)|0;c[b+8>>2]=j;c[b>>2]=d|1;c[b+4>>2]=g;h=j}mn(h|0,f|0,g|0)|0;a[h+g|0]=0;i=e;return}function te(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;if(e>>>0>4294967279){re(0)}if(e>>>0<11){a[b]=e<<1;g=b+1|0}else{h=e+16&-16;j=Pm(h)|0;c[b+8>>2]=j;c[b>>2]=h|1;c[b+4>>2]=e;g=j}mn(g|0,d|0,e|0)|0;a[g+e|0]=0;i=f;return}function ue(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;if(d>>>0>4294967279){re(0)}if(d>>>0<11){a[b]=d<<1;g=b+1|0}else{h=d+16&-16;j=Pm(h)|0;c[b+8>>2]=j;c[b>>2]=h|1;c[b+4>>2]=d;g=j}jn(g|0,e|0,d|0)|0;a[g+d|0]=0;i=f;return}function ve(b){b=b|0;var d=0;d=i;if((a[b]&1)==0){i=d;return}Rm(c[b+8>>2]|0);i=d;return}function we(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;if((b|0)==(d|0)){i=e;return b|0}f=a[d]|0;if((f&1)==0){g=d+1|0;h=(f&255)>>>1}else{g=c[d+8>>2]|0;h=c[d+4>>2]|0}d=b;f=a[d]|0;if((f&1)==0){j=f;k=10}else{f=c[b>>2]|0;j=f&255;k=(f&-2)+ -1|0}f=(j&1)==0;if(k>>>0<h>>>0){if(f){l=(j&255)>>>1}else{l=c[b+4>>2]|0}De(b,k,h-k|0,l,0,l,h,g);i=e;return b|0}if(f){m=b+1|0}else{m=c[b+8>>2]|0}nn(m|0,g|0,h|0)|0;a[m+h|0]=0;if((a[d]&1)==0){a[d]=h<<1;i=e;return b|0}else{c[b+4>>2]=h;i=e;return b|0}return 0}function xe(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;f=on(d|0)|0;g=b;h=a[g]|0;if((h&1)==0){j=h;k=10}else{h=c[b>>2]|0;j=h&255;k=(h&-2)+ -1|0}h=(j&1)==0;if(k>>>0<f>>>0){if(h){l=(j&255)>>>1}else{l=c[b+4>>2]|0}De(b,k,f-k|0,l,0,l,f,d);i=e;return b|0}if(h){m=b+1|0}else{m=c[b+8>>2]|0}nn(m|0,d|0,f|0)|0;a[m+f|0]=0;if((a[g]&1)==0){a[g]=f<<1;i=e;return b|0}else{c[b+4>>2]=f;i=e;return b|0}return 0}function ye(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;g=b;h=a[g]|0;j=(h&1)==0;if(j){k=(h&255)>>>1}else{k=c[b+4>>2]|0}if(k>>>0<d>>>0){ze(b,d-k|0,e)|0;i=f;return}if(j){a[b+d+1|0]=0;a[g]=d<<1;i=f;return}else{a[(c[b+8>>2]|0)+d|0]=0;c[b+4>>2]=d;i=f;return}}function ze(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;if((d|0)==0){i=f;return b|0}g=b;h=a[g]|0;if((h&1)==0){j=h;k=10}else{h=c[b>>2]|0;j=h&255;k=(h&-2)+ -1|0}if((j&1)==0){l=(j&255)>>>1}else{l=c[b+4>>2]|0}if((k-l|0)>>>0<d>>>0){Ee(b,k,d-k+l|0,l,l,0,0);m=a[g]|0}else{m=j}if((m&1)==0){n=b+1|0}else{n=c[b+8>>2]|0}jn(n+l|0,e|0,d|0)|0;e=l+d|0;if((a[g]&1)==0){a[g]=e<<1}else{c[b+4>>2]=e}a[n+e|0]=0;i=f;return b|0}function Ae(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;if(d>>>0>4294967279){re(0)}f=b;g=a[f]|0;if((g&1)==0){h=g;j=10}else{g=c[b>>2]|0;h=g&255;j=(g&-2)+ -1|0}if((h&1)==0){k=(h&255)>>>1}else{k=c[b+4>>2]|0}g=k>>>0>d>>>0?k:d;if(g>>>0<11){l=10}else{l=(g+16&-16)+ -1|0}if((l|0)==(j|0)){i=e;return}do{if((l|0)==10){m=b+1|0;n=0;o=c[b+8>>2]|0;p=1}else{g=l+1|0;if(l>>>0>j>>>0){q=Pm(g)|0}else{q=Pm(g)|0}if((h&1)==0){m=q;n=1;o=b+1|0;p=0;break}else{m=q;n=1;o=c[b+8>>2]|0;p=1;break}}}while(0);if((h&1)==0){r=(h&255)>>>1}else{r=c[b+4>>2]|0}mn(m|0,o|0,r+1|0)|0;if(p){Rm(o)}if(n){c[b>>2]=l+1|1;c[b+4>>2]=k;c[b+8>>2]=m;i=e;return}else{a[f]=k<<1;i=e;return}}function Be(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b;g=a[f]|0;h=(g&1)!=0;if(h){j=(c[b>>2]&-2)+ -1|0;k=c[b+4>>2]|0}else{j=10;k=(g&255)>>>1}if((k|0)==(j|0)){Ee(b,j,1,j,j,0,0);if((a[f]&1)==0){l=7}else{l=8}}else{if(h){l=8}else{l=7}}if((l|0)==7){a[f]=(k<<1)+2;m=b+1|0;n=k+1|0;o=m+k|0;a[o]=d;p=m+n|0;a[p]=0;i=e;return}else if((l|0)==8){l=c[b+8>>2]|0;f=k+1|0;c[b+4>>2]=f;m=l;n=f;o=m+k|0;a[o]=d;p=m+n|0;a[p]=0;i=e;return}}function Ce(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;g=b;h=a[g]|0;if((h&1)==0){j=10;k=h}else{h=c[b>>2]|0;j=(h&-2)+ -1|0;k=h&255}if((k&1)==0){l=(k&255)>>>1}else{l=c[b+4>>2]|0}if((j-l|0)>>>0<e>>>0){De(b,j,e-j+l|0,l,l,0,e,d);i=f;return b|0}if((e|0)==0){i=f;return b|0}if((k&1)==0){m=b+1|0}else{m=c[b+8>>2]|0}mn(m+l|0,d|0,e|0)|0;d=l+e|0;if((a[g]&1)==0){a[g]=d<<1}else{c[b+4>>2]=d}a[m+d|0]=0;i=f;return b|0}function De(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;l=i;if((-18-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){m=b+1|0}else{m=c[b+8>>2]|0}do{if(d>>>0<2147483623){n=e+d|0;o=d<<1;p=n>>>0<o>>>0?o:n;if(p>>>0<11){q=11;break}q=p+16&-16}else{q=-17}}while(0);e=Pm(q)|0;if((g|0)!=0){mn(e|0,m|0,g|0)|0}if((j|0)!=0){mn(e+g|0,k|0,j|0)|0}k=f-h|0;if((k|0)!=(g|0)){mn(e+(j+g)|0,m+(h+g)|0,k-g|0)|0}if((d|0)==10){r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+u|0;a[w]=0;i=l;return}Rm(m);r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+u|0;a[w]=0;i=l;return}function Ee(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;if((-17-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){l=b+1|0}else{l=c[b+8>>2]|0}do{if(d>>>0<2147483623){m=e+d|0;n=d<<1;o=m>>>0<n>>>0?n:m;if(o>>>0<11){p=11;break}p=o+16&-16}else{p=-17}}while(0);e=Pm(p)|0;if((g|0)!=0){mn(e|0,l|0,g|0)|0}o=f-h|0;if((o|0)!=(g|0)){mn(e+(j+g)|0,l+(h+g)|0,o-g|0)|0}if((d|0)==10){q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}Rm(l);q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}function Fe(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;if(e>>>0>1073741807){re(0)}if(e>>>0<2){a[b]=e<<1;g=b+4|0;lm(g,d,e)|0;h=g+(e<<2)|0;c[h>>2]=0;i=f;return}else{j=e+4&-4;k=Pm(j<<2)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=e;g=k;lm(g,d,e)|0;h=g+(e<<2)|0;c[h>>2]=0;i=f;return}}function Ge(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;if(d>>>0>1073741807){re(0)}if(d>>>0<2){a[b]=d<<1;g=b+4|0;nm(g,e,d)|0;h=g+(d<<2)|0;c[h>>2]=0;i=f;return}else{j=d+4&-4;k=Pm(j<<2)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=d;g=k;nm(g,e,d)|0;h=g+(d<<2)|0;c[h>>2]=0;i=f;return}}function He(b){b=b|0;var d=0;d=i;if((a[b]&1)==0){i=d;return}Rm(c[b+8>>2]|0);i=d;return}function Ie(a,b){a=a|0;b=b|0;var c=0,d=0;c=i;d=Je(a,b,km(b)|0)|0;i=c;return d|0}function Je(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;g=b;h=a[g]|0;if((h&1)==0){j=1;k=h}else{h=c[b>>2]|0;j=(h&-2)+ -1|0;k=h&255}h=(k&1)==0;if(j>>>0<e>>>0){if(h){l=(k&255)>>>1}else{l=c[b+4>>2]|0}Me(b,j,e-j|0,l,0,l,e,d);i=f;return b|0}if(h){m=b+4|0}else{m=c[b+8>>2]|0}mm(m,d,e)|0;c[m+(e<<2)>>2]=0;if((a[g]&1)==0){a[g]=e<<1;i=f;return b|0}else{c[b+4>>2]=e;i=f;return b|0}return 0}function Ke(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;if(d>>>0>1073741807){re(0)}f=b;g=a[f]|0;if((g&1)==0){h=g;j=1}else{g=c[b>>2]|0;h=g&255;j=(g&-2)+ -1|0}if((h&1)==0){k=(h&255)>>>1}else{k=c[b+4>>2]|0}g=k>>>0>d>>>0?k:d;if(g>>>0<2){l=1}else{l=(g+4&-4)+ -1|0}if((l|0)==(j|0)){i=e;return}do{if((l|0)==1){m=b+4|0;n=0;o=c[b+8>>2]|0;p=1}else{g=(l<<2)+4|0;if(l>>>0>j>>>0){q=Pm(g)|0}else{q=Pm(g)|0}g=q;if((h&1)==0){m=g;n=1;o=b+4|0;p=0;break}else{m=g;n=1;o=c[b+8>>2]|0;p=1;break}}}while(0);if((h&1)==0){r=(h&255)>>>1}else{r=c[b+4>>2]|0}lm(m,o,r+1|0)|0;if(p){Rm(o)}if(n){c[b>>2]=l+1|1;c[b+4>>2]=k;c[b+8>>2]=m;i=e;return}else{a[f]=k<<1;i=e;return}}function Le(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b;g=a[f]|0;h=(g&1)!=0;if(h){j=(c[b>>2]&-2)+ -1|0;k=c[b+4>>2]|0}else{j=1;k=(g&255)>>>1}if((k|0)==(j|0)){Ne(b,j,1,j,j,0,0);if((a[f]&1)==0){l=7}else{l=8}}else{if(h){l=8}else{l=7}}if((l|0)==7){a[f]=(k<<1)+2;m=b+4|0;n=k+1|0;o=m+(k<<2)|0;c[o>>2]=d;p=m+(n<<2)|0;c[p>>2]=0;i=e;return}else if((l|0)==8){l=c[b+8>>2]|0;f=k+1|0;c[b+4>>2]=f;m=l;n=f;o=m+(k<<2)|0;c[o>>2]=d;p=m+(n<<2)|0;c[p>>2]=0;i=e;return}}function Me(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;l=i;if((1073741806-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){m=b+4|0}else{m=c[b+8>>2]|0}do{if(d>>>0<536870887){n=e+d|0;o=d<<1;p=n>>>0<o>>>0?o:n;if(p>>>0<2){q=2;break}q=p+4&-4}else{q=1073741807}}while(0);e=Pm(q<<2)|0;if((g|0)!=0){lm(e,m,g)|0}if((j|0)!=0){lm(e+(g<<2)|0,k,j)|0}k=f-h|0;if((k|0)!=(g|0)){lm(e+(j+g<<2)|0,m+(h+g<<2)|0,k-g|0)|0}if((d|0)==1){r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+(u<<2)|0;c[w>>2]=0;i=l;return}Rm(m);r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+(u<<2)|0;c[w>>2]=0;i=l;return}function Ne(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;if((1073741807-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){l=b+4|0}else{l=c[b+8>>2]|0}do{if(d>>>0<536870887){m=e+d|0;n=d<<1;o=m>>>0<n>>>0?n:m;if(o>>>0<2){p=2;break}p=o+4&-4}else{p=1073741807}}while(0);e=Pm(p<<2)|0;if((g|0)!=0){lm(e,l,g)|0}o=f-h|0;if((o|0)!=(g|0)){lm(e+(j+g<<2)|0,l+(h+g<<2)|0,o-g|0)|0}if((d|0)==1){q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}Rm(l);q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}function Oe(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e;g=e+8|0;h=(c[b+24>>2]|0)==0;if(h){c[b+16>>2]=d|1}else{c[b+16>>2]=d}if(((h&1|d)&c[b+20>>2]|0)==0){i=e;return}e=vb(16)|0;do{if((a[2744]|0)==0){if((Ga(2744)|0)==0){break}c[684]=3440;gc(46,2736,q|0)|0;cb(2744)}}while(0);b=e;d=g;c[d>>2]=1;c[d+4>>2]=2736;d=f;h=g;c[d+0>>2]=c[h+0>>2];c[d+4>>2]=c[h+4>>2];ne(b,f,2792);c[e>>2]=2760;cc(e|0,2840,42)}function Pe(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=2784;d=c[a+40>>2]|0;e=a+32|0;f=a+36|0;if((d|0)!=0){g=d;do{g=g+ -1|0;rc[c[(c[e>>2]|0)+(g<<2)>>2]&3](0,a,c[(c[f>>2]|0)+(g<<2)>>2]|0);}while((g|0)!=0)}Zj(a+28|0);Lm(c[e>>2]|0);Lm(c[f>>2]|0);Lm(c[a+48>>2]|0);Lm(c[a+60>>2]|0);i=b;return}function Qe(a,b){a=a|0;b=b|0;var c=0;c=i;Yj(a,b+28|0);i=c;return}function Re(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;c[a+24>>2]=b;c[a+16>>2]=(b|0)==0;c[a+20>>2]=0;c[a+4>>2]=4098;c[a+12>>2]=0;c[a+8>>2]=6;b=a+28|0;e=a+32|0;a=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(a|0));Xj(b);i=d;return}function Se(a){a=a|0;var b=0;b=i;c[a>>2]=2400;Zj(a+4|0);Rm(a);i=b;return}function Te(a){a=a|0;var b=0;b=i;c[a>>2]=2400;Zj(a+4|0);i=b;return}function Ue(a,b){a=a|0;b=b|0;i=i;return}function Ve(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return a|0}function We(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;g=a;c[g>>2]=0;c[g+4>>2]=0;g=a+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=i;return}function Xe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a;c[e>>2]=0;c[e+4>>2]=0;e=a+8|0;c[e>>2]=-1;c[e+4>>2]=-1;i=i;return}function Ye(a){a=a|0;i=i;return 0}function Ze(a){a=a|0;i=i;return 0}function _e(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;g=b;if((e|0)<=0){h=0;i=f;return h|0}j=b+12|0;k=b+16|0;l=d;d=0;while(1){m=c[j>>2]|0;if(m>>>0<(c[k>>2]|0)>>>0){c[j>>2]=m+1;n=a[m]|0}else{m=pc[c[(c[g>>2]|0)+40>>2]&127](b)|0;if((m|0)==-1){h=d;o=8;break}n=m&255}a[l]=n;m=d+1|0;if((m|0)<(e|0)){l=l+1|0;d=m}else{h=m;o=8;break}}if((o|0)==8){i=f;return h|0}return 0}function $e(a){a=a|0;i=i;return-1}function af(a){a=a|0;var b=0,e=0,f=0;b=i;if((pc[c[(c[a>>2]|0)+36>>2]&127](a)|0)==-1){e=-1;i=b;return e|0}f=a+12|0;a=c[f>>2]|0;c[f>>2]=a+1;e=d[a]|0;i=b;return e|0}function bf(a,b){a=a|0;b=b|0;i=i;return-1}function cf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;h=b;if((f|0)<=0){j=0;i=g;return j|0}k=b+24|0;l=b+28|0;m=e;e=0;while(1){n=c[k>>2]|0;if(n>>>0<(c[l>>2]|0)>>>0){o=a[m]|0;c[k>>2]=n+1;a[n]=o}else{if((yc[c[(c[h>>2]|0)+52>>2]&31](b,d[m]|0)|0)==-1){j=e;p=7;break}}o=e+1|0;if((o|0)<(f|0)){m=m+1|0;e=o}else{j=o;p=7;break}}if((p|0)==7){i=g;return j|0}return 0}function df(a,b){a=a|0;b=b|0;i=i;return-1}function ef(a){a=a|0;var b=0;b=i;c[a>>2]=2464;Zj(a+4|0);Rm(a);i=b;return}function ff(a){a=a|0;var b=0;b=i;c[a>>2]=2464;Zj(a+4|0);i=b;return}function gf(a,b){a=a|0;b=b|0;i=i;return}function hf(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return a|0}function jf(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;g=a;c[g>>2]=0;c[g+4>>2]=0;g=a+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=i;return}function kf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a;c[e>>2]=0;c[e+4>>2]=0;e=a+8|0;c[e>>2]=-1;c[e+4>>2]=-1;i=i;return}function lf(a){a=a|0;i=i;return 0}function mf(a){a=a|0;i=i;return 0}function nf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=a;if((d|0)<=0){g=0;i=e;return g|0}h=a+12|0;j=a+16|0;k=b;b=0;while(1){l=c[h>>2]|0;if(l>>>0<(c[j>>2]|0)>>>0){c[h>>2]=l+4;m=c[l>>2]|0}else{l=pc[c[(c[f>>2]|0)+40>>2]&127](a)|0;if((l|0)==-1){g=b;n=8;break}else{m=l}}c[k>>2]=m;l=b+1|0;if((l|0)>=(d|0)){g=l;n=8;break}k=k+4|0;b=l}if((n|0)==8){i=e;return g|0}return 0}function of(a){a=a|0;i=i;return-1}function pf(a){a=a|0;var b=0,d=0,e=0;b=i;if((pc[c[(c[a>>2]|0)+36>>2]&127](a)|0)==-1){d=-1;i=b;return d|0}e=a+12|0;a=c[e>>2]|0;c[e>>2]=a+4;d=c[a>>2]|0;i=b;return d|0}function qf(a,b){a=a|0;b=b|0;i=i;return-1}function rf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=a;if((d|0)<=0){g=0;i=e;return g|0}h=a+24|0;j=a+28|0;k=b;b=0;while(1){l=c[h>>2]|0;if(l>>>0<(c[j>>2]|0)>>>0){m=c[k>>2]|0;c[h>>2]=l+4;c[l>>2]=m}else{if((yc[c[(c[f>>2]|0)+52>>2]&31](a,c[k>>2]|0)|0)==-1){g=b;n=8;break}}m=b+1|0;if((m|0)>=(d|0)){g=m;n=8;break}k=k+4|0;b=m}if((n|0)==8){i=e;return g|0}return 0}function sf(a,b){a=a|0;b=b|0;i=i;return-1}function tf(a){a=a|0;var b=0;b=i;Pe(a+8|0);Rm(a);i=b;return}function uf(a){a=a|0;var b=0;b=i;Pe(a+8|0);i=b;return}function vf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Pe(d+(e+8)|0);Rm(d+e|0);i=b;return}function wf(a){a=a|0;var b=0;b=i;Pe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+8)|0);i=b;return}function xf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+8|0;e=d;f=b;g=c[(c[f>>2]|0)+ -12>>2]|0;h=b;if((c[h+(g+24)>>2]|0)==0){i=d;return b|0}j=e;a[j]=0;c[e+4>>2]=b;do{if((c[h+(g+16)>>2]|0)==0){k=c[h+(g+72)>>2]|0;if((k|0)==0){l=g}else{xf(k)|0;l=c[(c[f>>2]|0)+ -12>>2]|0}a[j]=1;k=c[h+(l+24)>>2]|0;if(!((pc[c[(c[k>>2]|0)+24>>2]&127](k)|0)==-1)){break}k=c[(c[f>>2]|0)+ -12>>2]|0;Oe(h+k|0,c[h+(k+16)>>2]|1)}}while(0);If(e);i=d;return b|0}function yf(a){a=a|0;var b=0;b=a+16|0;c[b>>2]=c[b>>2]|1;if((c[a+20>>2]&1|0)==0){i=i;return}else{Wa()}}function zf(a){a=a|0;var b=0;b=i;Pe(a+8|0);Rm(a);i=b;return}function Af(a){a=a|0;var b=0;b=i;Pe(a+8|0);i=b;return}function Bf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Pe(d+(e+8)|0);Rm(d+e|0);i=b;return}function Cf(a){a=a|0;var b=0;b=i;Pe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+8)|0);i=b;return}function Df(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+8|0;e=d;f=b;g=c[(c[f>>2]|0)+ -12>>2]|0;h=b;if((c[h+(g+24)>>2]|0)==0){i=d;return b|0}j=e;a[j]=0;c[e+4>>2]=b;do{if((c[h+(g+16)>>2]|0)==0){k=c[h+(g+72)>>2]|0;if((k|0)==0){l=g}else{Df(k)|0;l=c[(c[f>>2]|0)+ -12>>2]|0}a[j]=1;k=c[h+(l+24)>>2]|0;if(!((pc[c[(c[k>>2]|0)+24>>2]&127](k)|0)==-1)){break}k=c[(c[f>>2]|0)+ -12>>2]|0;Oe(h+k|0,c[h+(k+16)>>2]|1)}}while(0);Pf(e);i=d;return b|0}function Ef(a){a=a|0;var b=0;b=i;Pe(a+4|0);Rm(a);i=b;return}function Ff(a){a=a|0;var b=0;b=i;Pe(a+4|0);i=b;return}function Gf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Pe(d+(e+4)|0);Rm(d+e|0);i=b;return}function Hf(a){a=a|0;var b=0;b=i;Pe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+4)|0);i=b;return}function If(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;a=c[d>>2]|0;e=c[(c[a>>2]|0)+ -12>>2]|0;f=a;if((c[f+(e+24)>>2]|0)==0){i=b;return}if((c[f+(e+16)>>2]|0)!=0){i=b;return}if((c[f+(e+4)>>2]&8192|0)==0){i=b;return}if(Ia()|0){i=b;return}e=c[d>>2]|0;f=c[e+((c[(c[e>>2]|0)+ -12>>2]|0)+24)>>2]|0;if(!((pc[c[(c[f>>2]|0)+24>>2]&127](f)|0)==-1)){i=b;return}f=c[d>>2]|0;d=c[(c[f>>2]|0)+ -12>>2]|0;e=f;Oe(e+d|0,c[e+(d+16)>>2]|1);i=b;return}function Jf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+48|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=e+40|0;m=j;a[m]=0;c[j+4>>2]=b;n=b;o=c[(c[n>>2]|0)+ -12>>2]|0;p=b;if((c[p+(o+16)>>2]|0)!=0){If(j);i=e;return b|0}q=c[p+(o+72)>>2]|0;if((q|0)==0){r=o}else{xf(q)|0;r=c[(c[n>>2]|0)+ -12>>2]|0}a[m]=1;Yj(k,p+(r+28)|0);r=_j(k,3848)|0;m=r;Zj(k);k=c[(c[n>>2]|0)+ -12>>2]|0;q=c[p+(k+24)>>2]|0;o=p+(k+76)|0;s=c[o>>2]|0;if((s|0)==-1){Yj(h,p+(k+28)|0);t=_j(h,5128)|0;u=yc[c[(c[t>>2]|0)+28>>2]&31](t,32)|0;Zj(h);h=u<<24>>24;c[o>>2]=h;v=h}else{v=s}s=v&255;v=p+k|0;k=c[(c[r>>2]|0)+24>>2]|0;c[g>>2]=q;q=f;r=g;c[q+0>>2]=c[r+0>>2];xc[k&31](l,m,f,v,s,d);if((c[l>>2]|0)!=0){If(j);i=e;return b|0}l=c[(c[n>>2]|0)+ -12>>2]|0;Oe(p+l|0,c[p+(l+16)>>2]|5);If(j);i=e;return b|0}function Kf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+48|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=e+40|0;m=j;a[m]=0;c[j+4>>2]=b;n=b;o=c[(c[n>>2]|0)+ -12>>2]|0;p=b;if((c[p+(o+16)>>2]|0)!=0){If(j);i=e;return b|0}q=c[p+(o+72)>>2]|0;if((q|0)==0){r=o}else{xf(q)|0;r=c[(c[n>>2]|0)+ -12>>2]|0}a[m]=1;Yj(k,p+(r+28)|0);r=_j(k,3848)|0;m=r;Zj(k);k=c[(c[n>>2]|0)+ -12>>2]|0;q=c[p+(k+24)>>2]|0;o=p+(k+76)|0;s=c[o>>2]|0;if((s|0)==-1){Yj(h,p+(k+28)|0);t=_j(h,5128)|0;u=yc[c[(c[t>>2]|0)+28>>2]&31](t,32)|0;Zj(h);h=u<<24>>24;c[o>>2]=h;v=h}else{v=s}s=v&255;v=p+k|0;k=c[(c[r>>2]|0)+24>>2]|0;c[g>>2]=q;q=f;r=g;c[q+0>>2]=c[r+0>>2];xc[k&31](l,m,f,v,s,d);if((c[l>>2]|0)!=0){If(j);i=e;return b|0}l=c[(c[n>>2]|0)+ -12>>2]|0;Oe(p+l|0,c[p+(l+16)>>2]|5);If(j);i=e;return b|0}function Lf(a){a=a|0;var b=0;b=i;Pe(a+4|0);Rm(a);i=b;return}function Mf(a){a=a|0;var b=0;b=i;Pe(a+4|0);i=b;return}function Nf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Pe(d+(e+4)|0);Rm(d+e|0);i=b;return}function Of(a){a=a|0;var b=0;b=i;Pe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+4)|0);i=b;return}function Pf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;a=c[d>>2]|0;e=c[(c[a>>2]|0)+ -12>>2]|0;f=a;if((c[f+(e+24)>>2]|0)==0){i=b;return}if((c[f+(e+16)>>2]|0)!=0){i=b;return}if((c[f+(e+4)>>2]&8192|0)==0){i=b;return}if(Ia()|0){i=b;return}e=c[d>>2]|0;f=c[e+((c[(c[e>>2]|0)+ -12>>2]|0)+24)>>2]|0;if(!((pc[c[(c[f>>2]|0)+24>>2]&127](f)|0)==-1)){i=b;return}f=c[d>>2]|0;d=c[(c[f>>2]|0)+ -12>>2]|0;e=f;Oe(e+d|0,c[e+(d+16)>>2]|1);i=b;return}function Qf(a){a=a|0;i=i;return 2680}function Rf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=i;if((c|0)==1){te(a,2696,35);i=d;return}else{le(a,b,c);i=d;return}}function Sf(a){a=a|0;i=i;return}function Tf(a){a=a|0;var b=0;b=i;pe(a);Rm(a);i=b;return}function Uf(a){a=a|0;var b=0;b=i;pe(a);i=b;return}function Vf(a){a=a|0;var b=0;b=i;Pe(a);Rm(a);i=b;return}function Wf(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Xf(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Yf(a){a=a|0;i=i;return}function Zf(a){a=a|0;i=i;return}function _f(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;a:do{if((e|0)==(f|0)){g=c;h=6}else{j=e;k=c;while(1){if((k|0)==(d|0)){l=-1;break a}m=a[k]|0;n=a[j]|0;if(m<<24>>24<n<<24>>24){l=-1;break a}if(n<<24>>24<m<<24>>24){l=1;break a}m=k+1|0;n=j+1|0;if((n|0)==(f|0)){g=m;h=6;break}else{j=n;k=m}}}}while(0);if((h|0)==6){l=(g|0)!=(d|0)|0}i=b;return l|0}function $f(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;d=i;g=e;h=f-g|0;if(h>>>0>4294967279){re(b)}if(h>>>0<11){a[b]=h<<1;j=b+1|0}else{k=h+16&-16;l=Pm(k)|0;c[b+8>>2]=l;c[b>>2]=k|1;c[b+4>>2]=h;j=l}if((e|0)==(f|0)){m=j;a[m]=0;i=d;return}else{n=e;o=j}while(1){a[o]=a[n]|0;e=n+1|0;if((e|0)==(f|0)){break}else{o=o+1|0;n=e}}m=j+(f+(0-g))|0;a[m]=0;i=d;return}function ag(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;b=i;if((c|0)==(d|0)){e=0;i=b;return e|0}else{f=0;g=c}while(1){c=(a[g]|0)+(f<<4)|0;h=c&-268435456;j=(h>>>24|h)^c;c=g+1|0;if((c|0)==(d|0)){e=j;break}else{g=c;f=j}}i=b;return e|0}function bg(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function cg(a){a=a|0;i=i;return}function dg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;a=i;a:do{if((e|0)==(f|0)){g=b;h=6}else{j=e;k=b;while(1){if((k|0)==(d|0)){l=-1;break a}m=c[k>>2]|0;n=c[j>>2]|0;if((m|0)<(n|0)){l=-1;break a}if((n|0)<(m|0)){l=1;break a}m=k+4|0;n=j+4|0;if((n|0)==(f|0)){g=m;h=6;break}else{j=n;k=m}}}}while(0);if((h|0)==6){l=(g|0)!=(d|0)|0}i=a;return l|0}function eg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;d=i;g=e;h=f-g|0;j=h>>2;if(j>>>0>1073741807){re(b)}if(j>>>0<2){a[b]=h>>>1;k=b+4|0}else{h=j+4&-4;l=Pm(h<<2)|0;c[b+8>>2]=l;c[b>>2]=h|1;c[b+4>>2]=j;k=l}if((e|0)==(f|0)){m=k;c[m>>2]=0;i=d;return}l=f+ -4+(0-g)|0;g=e;e=k;while(1){c[e>>2]=c[g>>2];j=g+4|0;if((j|0)==(f|0)){break}else{e=e+4|0;g=j}}m=k+((l>>>2)+1<<2)|0;c[m>>2]=0;i=d;return}function fg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;a=i;if((b|0)==(d|0)){e=0;i=a;return e|0}else{f=0;g=b}while(1){b=(c[g>>2]|0)+(f<<4)|0;h=b&-268435456;j=(h>>>24|h)^b;b=g+4|0;if((b|0)==(d|0)){e=j;break}else{g=b;f=j}}i=a;return e|0}function gg(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function hg(a){a=a|0;i=i;return}function ig(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+136|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=k+40|0;q=k+56|0;r=k+64|0;s=k+72|0;t=k+80|0;u=k+88|0;v=k+96|0;w=k+104|0;x=k+128|0;if((c[g+4>>2]&1|0)==0){c[q>>2]=-1;y=c[(c[d>>2]|0)+16>>2]|0;z=e;c[s>>2]=c[z>>2];c[t>>2]=c[f>>2];A=n;B=s;c[A+0>>2]=c[B+0>>2];B=m;A=t;c[B+0>>2]=c[A+0>>2];kc[y&63](r,d,n,m,g,h,q);m=c[r>>2]|0;c[z>>2]=m;z=c[q>>2]|0;if((z|0)==0){a[j]=0}else if((z|0)==1){a[j]=1}else{a[j]=1;c[h>>2]=4}c[b>>2]=m;i=k;return}Qe(u,g);m=u;u=c[m>>2]|0;if(!((c[1282]|0)==-1)){c[p>>2]=5128;c[p+4>>2]=118;c[p+8>>2]=0;qe(5128,p,119)}p=(c[5132>>2]|0)+ -1|0;z=c[u+8>>2]|0;if(!((c[u+12>>2]|0)-z>>2>>>0>p>>>0)){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}u=c[z+(p<<2)>>2]|0;if((u|0)==0){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}C=u;Yd(c[m>>2]|0)|0;Qe(v,g);g=v;v=c[g>>2]|0;if(!((c[1318]|0)==-1)){c[o>>2]=5272;c[o+4>>2]=118;c[o+8>>2]=0;qe(5272,o,119)}o=(c[5276>>2]|0)+ -1|0;m=c[v+8>>2]|0;if(!((c[v+12>>2]|0)-m>>2>>>0>o>>>0)){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}v=c[m+(o<<2)>>2]|0;if((v|0)==0){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}E=v;Yd(c[g>>2]|0)|0;g=w;F=v;nc[c[(c[F>>2]|0)+24>>2]&63](g,E);nc[c[(c[F>>2]|0)+28>>2]&63](w+12|0,E);c[x>>2]=c[f>>2];f=w+24|0;E=l;F=x;c[E+0>>2]=c[F+0>>2];F=jg(e,l,g,f,C,h,1)|0;a[j]=(F|0)==(g|0)|0;c[b>>2]=c[e>>2];ve(w+12|0);ve(w);i=k;return}function jg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;l=i;i=i+104|0;m=(g-f|0)/12|0;n=l;do{if(m>>>0>100){o=Km(m)|0;if((o|0)!=0){p=o;q=o;break}Wm()}else{p=0;q=n}}while(0);n=(f|0)==(g|0);if(n){r=0;s=m}else{o=f;t=0;u=m;m=q;while(1){v=a[o]|0;if((v&1)==0){w=(v&255)>>>1}else{w=c[o+4>>2]|0}if((w|0)==0){a[m]=2;x=t+1|0;y=u+ -1|0}else{a[m]=1;x=t;y=u}v=o+12|0;if((v|0)==(g|0)){r=x;s=y;break}else{o=v;t=x;u=y;m=m+1|0}}}m=b;b=e;e=h;y=0;u=r;r=s;a:while(1){s=c[m>>2]|0;do{if((s|0)==0){z=0}else{if((c[s+12>>2]|0)!=(c[s+16>>2]|0)){z=s;break}if((pc[c[(c[s>>2]|0)+36>>2]&127](s)|0)==-1){c[m>>2]=0;z=0;break}else{z=c[m>>2]|0;break}}}while(0);s=(z|0)==0;x=c[b>>2]|0;do{if((x|0)==0){A=0}else{if((c[x+12>>2]|0)!=(c[x+16>>2]|0)){A=x;break}if(!((pc[c[(c[x>>2]|0)+36>>2]&127](x)|0)==-1)){A=x;break}c[b>>2]=0;A=0}}while(0);B=(A|0)==0;C=c[m>>2]|0;if(!((s^B)&(r|0)!=0)){break}x=c[C+12>>2]|0;if((x|0)==(c[C+16>>2]|0)){D=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{D=d[x]|0}x=D&255;if(k){E=x}else{E=yc[c[(c[e>>2]|0)+12>>2]&31](h,x)|0}x=y+1|0;if(n){y=x;r=r;u=u;continue}b:do{if(k){t=0;o=f;w=u;v=r;F=q;while(1){do{if((a[F]|0)==1){G=a[o]|0;H=(G&1)==0;if(H){I=o+1|0}else{I=c[o+8>>2]|0}if(!(E<<24>>24==(a[I+y|0]|0))){a[F]=0;J=t;K=w;L=v+ -1|0;break}if(H){M=(G&255)>>>1}else{M=c[o+4>>2]|0}if((M|0)!=(x|0)){J=1;K=w;L=v;break}a[F]=2;J=1;K=w+1|0;L=v+ -1|0}else{J=t;K=w;L=v}}while(0);G=o+12|0;if((G|0)==(g|0)){N=J;O=K;P=L;break b}t=J;o=G;w=K;v=L;F=F+1|0}}else{F=0;v=f;w=u;o=r;t=q;while(1){do{if((a[t]|0)==1){G=v;if((a[G]&1)==0){Q=v+1|0}else{Q=c[v+8>>2]|0}if(!(E<<24>>24==(yc[c[(c[e>>2]|0)+12>>2]&31](h,a[Q+y|0]|0)|0)<<24>>24)){a[t]=0;R=F;S=w;T=o+ -1|0;break}H=a[G]|0;if((H&1)==0){U=(H&255)>>>1}else{U=c[v+4>>2]|0}if((U|0)!=(x|0)){R=1;S=w;T=o;break}a[t]=2;R=1;S=w+1|0;T=o+ -1|0}else{R=F;S=w;T=o}}while(0);H=v+12|0;if((H|0)==(g|0)){N=R;O=S;P=T;break b}F=R;v=H;w=S;o=T;t=t+1|0}}}while(0);if(!N){y=x;u=O;r=P;continue}s=c[m>>2]|0;t=s+12|0;o=c[t>>2]|0;if((o|0)==(c[s+16>>2]|0)){pc[c[(c[s>>2]|0)+40>>2]&127](s)|0}else{c[t>>2]=o+1}if((P+O|0)>>>0<2){y=x;u=O;r=P;continue}else{V=f;W=O;X=q}while(1){do{if((a[X]|0)==2){o=a[V]|0;if((o&1)==0){Y=(o&255)>>>1}else{Y=c[V+4>>2]|0}if((Y|0)==(x|0)){Z=W;break}a[X]=0;Z=W+ -1|0}else{Z=W}}while(0);o=V+12|0;if((o|0)==(g|0)){y=x;u=Z;r=P;continue a}else{V=o;W=Z;X=X+1|0}}}do{if((C|0)==0){_=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){_=C;break}if((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1){c[m>>2]=0;_=0;break}else{_=c[m>>2]|0;break}}}while(0);m=(_|0)==0;do{if(B){$=78}else{if((c[A+12>>2]|0)!=(c[A+16>>2]|0)){if(m){break}else{$=80;break}}if((pc[c[(c[A>>2]|0)+36>>2]&127](A)|0)==-1){c[b>>2]=0;$=78;break}else{if(m){break}else{$=80;break}}}}while(0);if(($|0)==78){if(m){$=80}}if(($|0)==80){c[j>>2]=c[j>>2]|2}c:do{if(n){$=85}else{if((a[q]|0)==2){aa=f;break}else{ba=f;ca=q}while(1){m=ba+12|0;b=ca+1|0;if((m|0)==(g|0)){$=85;break c}if((a[b]|0)==2){aa=m;break}else{ca=b;ba=m}}}}while(0);if(($|0)==85){c[j>>2]=c[j>>2]|4;aa=g}if((p|0)==0){i=l;return aa|0}Lm(p);i=l;return aa|0}function kg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];lg(a,0,k,j,f,g,h);i=b;return}function lg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==0){u=0}else if((t|0)==8){u=16}else if((t|0)==64){u=8}else{u=10}t=l;bh(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((pc[c[(c[m>>2]|0)+36>>2]&127](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}ye(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}ye(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{Q=d[I]|0}if((Dg(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){pc[c[(c[C>>2]|0)+40>>2]&127](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Vl(H,c[p>>2]|0,j,u)|0;mj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}function mg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];ng(a,0,k,j,f,g,h);i=b;return}function ng(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;bh(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((pc[c[(c[m>>2]|0)+36>>2]&127](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){K=(D&255)>>>1}else{K=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(K|0)){if(I){L=(D&255)>>>1;M=(D&255)>>>1}else{D=c[z>>2]|0;L=D;M=D}ye(o,M<<1,0);if((a[h]&1)==0){N=10}else{N=(c[g>>2]&-2)+ -1|0}ye(o,N,0);if((a[h]&1)==0){O=v}else{O=c[w>>2]|0}c[p>>2]=O+L;P=O}else{P=B}D=C+12|0;I=c[D>>2]|0;Q=C+16|0;if((I|0)==(c[Q>>2]|0)){R=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{R=d[I]|0}if((Dg(R&255,u,P,p,s,A,n,l,r,t)|0)!=0){G=F;H=P;break}I=c[D>>2]|0;if((I|0)==(c[Q>>2]|0)){pc[c[(c[C>>2]|0)+40>>2]&127](C)|0;m=C;B=P;continue}else{c[D>>2]=I+1;m=C;B=P;continue}}P=a[n]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[n+4>>2]|0}do{if((S|0)!=0){P=c[r>>2]|0;if((P-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=P+4;c[P>>2]=B}}while(0);s=Ul(H,c[p>>2]|0,j,u)|0;u=k;c[u>>2]=s;c[u+4>>2]=J;mj(n,l,c[r>>2]|0,j);do{if((C|0)==0){T=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){T=C;break}if(!((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1)){T=C;break}c[y>>2]=0;T=0}}while(0);y=(T|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}function og(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];pg(a,0,k,j,f,g,h);i=b;return}function pg(e,f,g,h,j,k,l){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;f=i;i=i+256|0;m=f;n=f+32|0;o=f+40|0;p=f+56|0;q=f+72|0;r=f+80|0;s=f+240|0;t=f+248|0;u=c[j+4>>2]&74;if((u|0)==64){v=8}else if((u|0)==0){v=0}else if((u|0)==8){v=16}else{v=10}u=m;bh(o,j,u,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ye(p,10,0);if((a[j]&1)==0){m=p+1|0;w=m;x=p+8|0;y=m}else{m=p+8|0;w=p+1|0;x=m;y=c[m>>2]|0}c[q>>2]=y;m=r;c[s>>2]=m;c[t>>2]=0;z=g;g=h;h=p;A=p+4|0;B=a[n]|0;n=c[z>>2]|0;C=y;a:while(1){do{if((n|0)==0){D=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){D=n;break}if(!((pc[c[(c[n>>2]|0)+36>>2]&127](n)|0)==-1)){D=n;break}c[z>>2]=0;D=0}}while(0);y=(D|0)==0;E=c[g>>2]|0;do{if((E|0)==0){F=18}else{if((c[E+12>>2]|0)!=(c[E+16>>2]|0)){if(y){G=E;break}else{H=E;I=C;break a}}if((pc[c[(c[E>>2]|0)+36>>2]&127](E)|0)==-1){c[g>>2]=0;F=18;break}else{if(y){G=E;break}else{H=E;I=C;break a}}}}while(0);if((F|0)==18){F=0;if(y){H=0;I=C;break}else{G=0}}E=a[j]|0;J=(E&1)==0;if(J){K=(E&255)>>>1}else{K=c[A>>2]|0}if(((c[q>>2]|0)-C|0)==(K|0)){if(J){L=(E&255)>>>1;M=(E&255)>>>1}else{E=c[A>>2]|0;L=E;M=E}ye(p,M<<1,0);if((a[j]&1)==0){N=10}else{N=(c[h>>2]&-2)+ -1|0}ye(p,N,0);if((a[j]&1)==0){O=w}else{O=c[x>>2]|0}c[q>>2]=O+L;P=O}else{P=C}E=D+12|0;J=c[E>>2]|0;Q=D+16|0;if((J|0)==(c[Q>>2]|0)){R=pc[c[(c[D>>2]|0)+36>>2]&127](D)|0}else{R=d[J]|0}if((Dg(R&255,v,P,q,t,B,o,m,s,u)|0)!=0){H=G;I=P;break}J=c[E>>2]|0;if((J|0)==(c[Q>>2]|0)){pc[c[(c[D>>2]|0)+40>>2]&127](D)|0;n=D;C=P;continue}else{c[E>>2]=J+1;n=D;C=P;continue}}P=a[o]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[o+4>>2]|0}do{if((S|0)!=0){P=c[s>>2]|0;if((P-r|0)>=160){break}C=c[t>>2]|0;c[s>>2]=P+4;c[P>>2]=C}}while(0);b[l>>1]=Tl(I,c[q>>2]|0,k,v)|0;mj(o,m,c[s>>2]|0,k);do{if((D|0)==0){T=0}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){T=D;break}if(!((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1)){T=D;break}c[z>>2]=0;T=0}}while(0);z=(T|0)==0;do{if((H|0)==0){F=54}else{if((c[H+12>>2]|0)!=(c[H+16>>2]|0)){if(!z){break}U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}if((pc[c[(c[H>>2]|0)+36>>2]&127](H)|0)==-1){c[g>>2]=0;F=54;break}if(!(z^(H|0)==0)){break}U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}}while(0);do{if((F|0)==54){if(z){break}U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}}while(0);c[k>>2]=c[k>>2]|2;U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}function qg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];rg(a,0,k,j,f,g,h);i=b;return}function rg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;bh(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((pc[c[(c[m>>2]|0)+36>>2]&127](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}ye(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}ye(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{Q=d[I]|0}if((Dg(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){pc[c[(c[C>>2]|0)+40>>2]&127](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Sl(H,c[p>>2]|0,j,u)|0;mj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}function sg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];tg(a,0,k,j,f,g,h);i=b;return}function tg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;bh(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((pc[c[(c[m>>2]|0)+36>>2]&127](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}ye(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}ye(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{Q=d[I]|0}if((Dg(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){pc[c[(c[C>>2]|0)+40>>2]&127](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Rl(H,c[p>>2]|0,j,u)|0;mj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}function ug(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];vg(a,0,k,j,f,g,h);i=b;return}function vg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==0){u=0}else if((t|0)==64){u=8}else if((t|0)==8){u=16}else{u=10}t=l;bh(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((pc[c[(c[m>>2]|0)+36>>2]&127](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((pc[c[(c[D>>2]|0)+36>>2]&127](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){K=(D&255)>>>1}else{K=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(K|0)){if(I){L=(D&255)>>>1;M=(D&255)>>>1}else{D=c[z>>2]|0;L=D;M=D}ye(o,M<<1,0);if((a[h]&1)==0){N=10}else{N=(c[g>>2]&-2)+ -1|0}ye(o,N,0);if((a[h]&1)==0){O=v}else{O=c[w>>2]|0}c[p>>2]=O+L;P=O}else{P=B}D=C+12|0;I=c[D>>2]|0;Q=C+16|0;if((I|0)==(c[Q>>2]|0)){R=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{R=d[I]|0}if((Dg(R&255,u,P,p,s,A,n,l,r,t)|0)!=0){G=F;H=P;break}I=c[D>>2]|0;if((I|0)==(c[Q>>2]|0)){pc[c[(c[C>>2]|0)+40>>2]&127](C)|0;m=C;B=P;continue}else{c[D>>2]=I+1;m=C;B=P;continue}}P=a[n]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[n+4>>2]|0}do{if((S|0)!=0){P=c[r>>2]|0;if((P-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=P+4;c[P>>2]=B}}while(0);s=Ql(H,c[p>>2]|0,j,u)|0;u=k;c[u>>2]=s;c[u+4>>2]=J;mj(n,l,c[r>>2]|0,j);do{if((C|0)==0){T=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){T=C;break}if(!((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1)){T=C;break}c[y>>2]=0;T=0}}while(0);y=(T|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}function wg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];xg(a,0,k,j,f,g,h);i=b;return}function xg(b,e,f,h,j,k,l){b=b|0;e=e|0;f=f|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;ch(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ye(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=h;h=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((pc[c[(c[n>>2]|0)+36>>2]&127](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}ye(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[h>>2]&-2)+ -1|0}ye(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=pc[c[(c[F>>2]|0)+36>>2]&127](F)|0}else{T=d[L]|0}if((dh(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){pc[c[(c[F>>2]|0)+40>>2]&127](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);g[l>>2]=+Pl(K,c[q>>2]|0,k);mj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((pc[c[(c[F>>2]|0)+36>>2]&127](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}if((pc[c[(c[J>>2]|0)+36>>2]&127](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}function yg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];zg(a,0,k,j,f,g,h);i=b;return}function zg(b,e,f,g,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;ch(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ye(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=g;g=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((pc[c[(c[n>>2]|0)+36>>2]&127](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}ye(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[g>>2]&-2)+ -1|0}ye(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=pc[c[(c[F>>2]|0)+36>>2]&127](F)|0}else{T=d[L]|0}if((dh(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){pc[c[(c[F>>2]|0)+40>>2]&127](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);h[l>>3]=+Ol(K,c[q>>2]|0,k);mj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((pc[c[(c[F>>2]|0)+36>>2]&127](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}if((pc[c[(c[J>>2]|0)+36>>2]&127](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}function Ag(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Bg(a,0,k,j,f,g,h);i=b;return}function Bg(b,e,f,g,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;ch(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ye(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=g;g=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((pc[c[(c[n>>2]|0)+36>>2]&127](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((pc[c[(c[G>>2]|0)+36>>2]&127](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}ye(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[g>>2]&-2)+ -1|0}ye(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=pc[c[(c[F>>2]|0)+36>>2]&127](F)|0}else{T=d[L]|0}if((dh(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){pc[c[(c[F>>2]|0)+40>>2]&127](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);h[l>>3]=+Nl(K,c[q>>2]|0,k);mj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((pc[c[(c[F>>2]|0)+36>>2]&127](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}if((pc[c[(c[J>>2]|0)+36>>2]&127](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}function Cg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0;e=i;i=i+8|0;l=e;m=i;i=i+16|0;n=i;i=i+32|0;o=i;i=i+16|0;p=i;i=i+8|0;q=i;i=i+16|0;r=i;i=i+160|0;s=o;c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;Qe(p,h);h=p;p=c[h>>2]|0;if(!((c[1282]|0)==-1)){c[m>>2]=5128;c[m+4>>2]=118;c[m+8>>2]=0;qe(5128,m,119)}m=(c[5132>>2]|0)+ -1|0;t=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-t>>2>>>0>m>>>0)){u=vb(4)|0;v=u;pm(v);cc(u|0,13088,107)}p=c[t+(m<<2)>>2]|0;if((p|0)==0){u=vb(4)|0;v=u;pm(v);cc(u|0,13088,107)}u=n;vc[c[(c[p>>2]|0)+32>>2]&7](p,3672,3698|0,u)|0;Yd(c[h>>2]|0)|0;h=q;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(q,10,0);if((a[h]&1)==0){p=q+1|0;w=p;x=q+8|0;y=p}else{p=q+8|0;w=q+1|0;x=p;y=c[p>>2]|0}p=f;f=g;g=q;v=q+4|0;m=n+24|0;t=n+25|0;z=r;A=n+26|0;B=n;n=o+4|0;C=c[p>>2]|0;D=y;E=r;r=0;F=y;a:while(1){do{if((C|0)==0){G=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){G=C;break}if(!((pc[c[(c[C>>2]|0)+36>>2]&127](C)|0)==-1)){G=C;break}c[p>>2]=0;G=0}}while(0);y=(G|0)==0;H=c[f>>2]|0;do{if((H|0)==0){I=19}else{if((c[H+12>>2]|0)!=(c[H+16>>2]|0)){if(y){break}else{J=F;break a}}if((pc[c[(c[H>>2]|0)+36>>2]&127](H)|0)==-1){c[f>>2]=0;I=19;break}else{if(y){break}else{J=F;break a}}}}while(0);if((I|0)==19){I=0;if(y){J=F;break}}H=a[h]|0;K=(H&1)==0;if(K){L=(H&255)>>>1}else{L=c[v>>2]|0}if((D-F|0)==(L|0)){if(K){M=(H&255)>>>1;N=(H&255)>>>1}else{H=c[v>>2]|0;M=H;N=H}ye(q,N<<1,0);if((a[h]&1)==0){O=10}else{O=(c[g>>2]&-2)+ -1|0}ye(q,O,0);if((a[h]&1)==0){P=w}else{P=c[x>>2]|0}Q=P+M|0;R=P}else{Q=D;R=F}H=c[G+12>>2]|0;if((H|0)==(c[G+16>>2]|0)){S=pc[c[(c[G>>2]|0)+36>>2]&127](G)|0}else{S=d[H]|0}H=S&255;K=(Q|0)==(R|0);do{if(K){T=(a[m]|0)==H<<24>>24;if(!T){if(!((a[t]|0)==H<<24>>24)){I=40;break}}a[Q]=T?43:45;U=Q+1|0;V=E;W=0}else{I=40}}while(0);do{if((I|0)==40){I=0;y=a[s]|0;if((y&1)==0){X=(y&255)>>>1}else{X=c[n>>2]|0}if((X|0)!=0&H<<24>>24==0){if((E-z|0)>=160){U=Q;V=E;W=r;break}c[E>>2]=r;U=Q;V=E+4|0;W=0;break}else{Y=u}while(1){y=Y+1|0;if((a[Y]|0)==H<<24>>24){Z=Y;break}if((y|0)==(A|0)){Z=A;break}else{Y=y}}y=Z-B|0;if((y|0)>23){J=R;break a}if((y|0)<22){a[Q]=a[3672+y|0]|0;U=Q+1|0;V=E;W=r+1|0;break}if(K){J=Q;break a}if((Q-R|0)>=3){J=R;break a}if((a[Q+ -1|0]|0)!=48){J=R;break a}a[Q]=a[3672+y|0]|0;U=Q+1|0;V=E;W=0}}while(0);K=c[p>>2]|0;H=K+12|0;y=c[H>>2]|0;if((y|0)==(c[K+16>>2]|0)){pc[c[(c[K>>2]|0)+40>>2]&127](K)|0;C=K;D=U;E=V;r=W;F=R;continue}else{c[H>>2]=y+1;C=K;D=U;E=V;r=W;F=R;continue}}a[J+3|0]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);R=c[1254]|0;c[l>>2]=k;if((Eg(J,R,3712,l)|0)!=1){c[j>>2]=4}l=c[p>>2]|0;do{if((l|0)==0){_=0}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){_=l;break}if(!((pc[c[(c[l>>2]|0)+36>>2]&127](l)|0)==-1)){_=l;break}c[p>>2]=0;_=0}}while(0);p=(_|0)==0;l=c[f>>2]|0;do{if((l|0)==0){I=72}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){if(!p){break}$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}if((pc[c[(c[l>>2]|0)+36>>2]&127](l)|0)==-1){c[f>>2]=0;I=72;break}if(!(p^(l|0)==0)){break}$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}}while(0);do{if((I|0)==72){if(p){break}$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}function Dg(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;o=c[f>>2]|0;p=(o|0)==(e|0);do{if(p){q=(a[m+24|0]|0)==b<<24>>24;if(!q){if(!((a[m+25|0]|0)==b<<24>>24)){break}}c[f>>2]=e+1;a[e]=q?43:45;c[g>>2]=0;r=0;i=n;return r|0}}while(0);q=a[j]|0;if((q&1)==0){s=(q&255)>>>1}else{s=c[j+4>>2]|0}if((s|0)!=0&b<<24>>24==h<<24>>24){h=c[l>>2]|0;if((h-k|0)>=160){r=0;i=n;return r|0}k=c[g>>2]|0;c[l>>2]=h+4;c[h>>2]=k;c[g>>2]=0;r=0;i=n;return r|0}k=m+26|0;h=m;while(1){l=h+1|0;if((a[h]|0)==b<<24>>24){t=h;break}if((l|0)==(k|0)){t=k;break}else{h=l}}h=t-m|0;if((h|0)>23){r=-1;i=n;return r|0}do{if((d|0)==10|(d|0)==8){if((h|0)<(d|0)){break}else{r=-1}i=n;return r|0}else if((d|0)==16){if((h|0)<22){break}if(p){r=-1;i=n;return r|0}if((o-e|0)>=3){r=-1;i=n;return r|0}if((a[o+ -1|0]|0)!=48){r=-1;i=n;return r|0}c[g>>2]=0;m=a[3672+h|0]|0;c[f>>2]=o+1;a[o]=m;r=0;i=n;return r|0}}while(0);e=a[3672+h|0]|0;c[f>>2]=o+1;a[o]=e;c[g>>2]=(c[g>>2]|0)+1;r=0;i=n;return r|0}function Eg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;e=zb(b|0)|0;b=Ea(a|0,d|0,g|0)|0;if((e|0)==0){i=f;return b|0}zb(e|0)|0;i=f;return b|0}function Fg(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Gg(a){a=a|0;i=i;return}function Hg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+136|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=k+40|0;q=k+56|0;r=k+64|0;s=k+72|0;t=k+80|0;u=k+88|0;v=k+96|0;w=k+104|0;x=k+128|0;if((c[g+4>>2]&1|0)==0){c[q>>2]=-1;y=c[(c[d>>2]|0)+16>>2]|0;z=e;c[s>>2]=c[z>>2];c[t>>2]=c[f>>2];A=n;B=s;c[A+0>>2]=c[B+0>>2];B=m;A=t;c[B+0>>2]=c[A+0>>2];kc[y&63](r,d,n,m,g,h,q);m=c[r>>2]|0;c[z>>2]=m;z=c[q>>2]|0;if((z|0)==1){a[j]=1}else if((z|0)==0){a[j]=0}else{a[j]=1;c[h>>2]=4}c[b>>2]=m;i=k;return}Qe(u,g);m=u;u=c[m>>2]|0;if(!((c[1280]|0)==-1)){c[p>>2]=5120;c[p+4>>2]=118;c[p+8>>2]=0;qe(5120,p,119)}p=(c[5124>>2]|0)+ -1|0;z=c[u+8>>2]|0;if(!((c[u+12>>2]|0)-z>>2>>>0>p>>>0)){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}u=c[z+(p<<2)>>2]|0;if((u|0)==0){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}C=u;Yd(c[m>>2]|0)|0;Qe(v,g);g=v;v=c[g>>2]|0;if(!((c[1320]|0)==-1)){c[o>>2]=5280;c[o+4>>2]=118;c[o+8>>2]=0;qe(5280,o,119)}o=(c[5284>>2]|0)+ -1|0;m=c[v+8>>2]|0;if(!((c[v+12>>2]|0)-m>>2>>>0>o>>>0)){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}v=c[m+(o<<2)>>2]|0;if((v|0)==0){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}E=v;Yd(c[g>>2]|0)|0;g=w;F=v;nc[c[(c[F>>2]|0)+24>>2]&63](g,E);nc[c[(c[F>>2]|0)+28>>2]&63](w+12|0,E);c[x>>2]=c[f>>2];f=w+24|0;E=l;F=x;c[E+0>>2]=c[F+0>>2];F=Ig(e,l,g,f,C,h,1)|0;a[j]=(F|0)==(g|0)|0;c[b>>2]=c[e>>2];He(w+12|0);He(w);i=k;return}function Ig(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0;k=i;i=i+104|0;l=(f-e|0)/12|0;m=k;do{if(l>>>0>100){n=Km(l)|0;if((n|0)!=0){o=n;p=n;break}Wm()}else{o=0;p=m}}while(0);m=(e|0)==(f|0);if(m){q=0;r=l}else{n=e;s=0;t=l;l=p;while(1){u=a[n]|0;if((u&1)==0){v=(u&255)>>>1}else{v=c[n+4>>2]|0}if((v|0)==0){a[l]=2;w=s+1|0;x=t+ -1|0}else{a[l]=1;w=s;x=t}u=n+12|0;if((u|0)==(f|0)){q=w;r=x;break}else{n=u;s=w;t=x;l=l+1|0}}}l=b;b=d;d=g;x=0;t=q;q=r;a:while(1){r=c[l>>2]|0;do{if((r|0)==0){y=1}else{w=c[r+12>>2]|0;if((w|0)==(c[r+16>>2]|0)){z=pc[c[(c[r>>2]|0)+36>>2]&127](r)|0}else{z=c[w>>2]|0}if((z|0)==-1){c[l>>2]=0;y=1;break}else{y=(c[l>>2]|0)==0;break}}}while(0);r=c[b>>2]|0;do{if((r|0)==0){A=0;B=1}else{w=c[r+12>>2]|0;if((w|0)==(c[r+16>>2]|0)){C=pc[c[(c[r>>2]|0)+36>>2]&127](r)|0}else{C=c[w>>2]|0}if(!((C|0)==-1)){A=r;B=0;break}c[b>>2]=0;A=0;B=1}}while(0);D=c[l>>2]|0;if(!((y^B)&(q|0)!=0)){break}r=c[D+12>>2]|0;if((r|0)==(c[D+16>>2]|0)){E=pc[c[(c[D>>2]|0)+36>>2]&127](D)|0}else{E=c[r>>2]|0}if(j){F=E}else{F=yc[c[(c[d>>2]|0)+28>>2]&31](g,E)|0}r=x+1|0;if(m){x=r;q=q;t=t;continue}b:do{if(j){w=0;s=e;n=t;v=q;u=p;while(1){do{if((a[u]|0)==1){G=a[s]|0;H=(G&1)==0;if(H){I=s+4|0}else{I=c[s+8>>2]|0}if((F|0)!=(c[I+(x<<2)>>2]|0)){a[u]=0;J=w;K=n;L=v+ -1|0;break}if(H){M=(G&255)>>>1}else{M=c[s+4>>2]|0}if((M|0)!=(r|0)){J=1;K=n;L=v;break}a[u]=2;J=1;K=n+1|0;L=v+ -1|0}else{J=w;K=n;L=v}}while(0);G=s+12|0;if((G|0)==(f|0)){N=J;O=K;P=L;break b}w=J;s=G;n=K;v=L;u=u+1|0}}else{u=0;v=e;n=t;s=q;w=p;while(1){do{if((a[w]|0)==1){G=v;if((a[G]&1)==0){Q=v+4|0}else{Q=c[v+8>>2]|0}if((F|0)!=(yc[c[(c[d>>2]|0)+28>>2]&31](g,c[Q+(x<<2)>>2]|0)|0)){a[w]=0;R=u;S=n;T=s+ -1|0;break}H=a[G]|0;if((H&1)==0){U=(H&255)>>>1}else{U=c[v+4>>2]|0}if((U|0)!=(r|0)){R=1;S=n;T=s;break}a[w]=2;R=1;S=n+1|0;T=s+ -1|0}else{R=u;S=n;T=s}}while(0);H=v+12|0;if((H|0)==(f|0)){N=R;O=S;P=T;break b}u=R;v=H;n=S;s=T;w=w+1|0}}}while(0);if(!N){x=r;t=O;q=P;continue}w=c[l>>2]|0;s=w+12|0;n=c[s>>2]|0;if((n|0)==(c[w+16>>2]|0)){pc[c[(c[w>>2]|0)+40>>2]&127](w)|0}else{c[s>>2]=n+4}if((P+O|0)>>>0<2){x=r;t=O;q=P;continue}else{V=e;W=O;X=p}while(1){do{if((a[X]|0)==2){n=a[V]|0;if((n&1)==0){Y=(n&255)>>>1}else{Y=c[V+4>>2]|0}if((Y|0)==(r|0)){Z=W;break}a[X]=0;Z=W+ -1|0}else{Z=W}}while(0);n=V+12|0;if((n|0)==(f|0)){x=r;t=Z;q=P;continue a}else{V=n;W=Z;X=X+1|0}}}do{if((D|0)==0){_=1}else{X=c[D+12>>2]|0;if((X|0)==(c[D+16>>2]|0)){$=pc[c[(c[D>>2]|0)+36>>2]&127](D)|0}else{$=c[X>>2]|0}if(($|0)==-1){c[l>>2]=0;_=1;break}else{_=(c[l>>2]|0)==0;break}}}while(0);do{if((A|0)==0){aa=85}else{l=c[A+12>>2]|0;if((l|0)==(c[A+16>>2]|0)){ba=pc[c[(c[A>>2]|0)+36>>2]&127](A)|0}else{ba=c[l>>2]|0}if((ba|0)==-1){c[b>>2]=0;aa=85;break}else{if(_){break}else{aa=87;break}}}}while(0);if((aa|0)==85){if(_){aa=87}}if((aa|0)==87){c[h>>2]=c[h>>2]|2}c:do{if(m){aa=92}else{if((a[p]|0)==2){ca=e;break}else{da=e;ea=p}while(1){_=da+12|0;b=ea+1|0;if((_|0)==(f|0)){aa=92;break c}if((a[b]|0)==2){ca=_;break}else{ea=b;da=_}}}}while(0);if((aa|0)==92){c[h>>2]=c[h>>2]|4;ca=f}if((o|0)==0){i=k;return ca|0}Lm(o);i=k;return ca|0}function Jg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Kg(a,0,k,j,f,g,h);i=b;return}function Kg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==64){t=8}else if((s|0)==0){t=0}else{t=10}s=k;eh(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=pc[c[(c[l>>2]|0)+36>>2]&127](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=pc[c[(c[w>>2]|0)+36>>2]&127](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}ye(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}ye(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{R=c[F>>2]|0}if((ah(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){pc[c[(c[B>>2]|0)+40>>2]&127](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Vl(J,c[o>>2]|0,h,t)|0;mj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=pc[c[(c[I>>2]|0)+36>>2]&127](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}function Lg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Mg(a,0,k,j,f,g,h);i=b;return}function Mg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==64){t=8}else if((s|0)==0){t=0}else{t=10}s=k;eh(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=pc[c[(c[l>>2]|0)+36>>2]&127](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=pc[c[(c[w>>2]|0)+36>>2]&127](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;K=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;K=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){L=(w&255)>>>1}else{L=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(L|0)){if(F){M=(w&255)>>>1;N=(w&255)>>>1}else{w=c[y>>2]|0;M=w;N=w}ye(n,N<<1,0);if((a[g]&1)==0){O=10}else{O=(c[f>>2]&-2)+ -1|0}ye(n,O,0);if((a[g]&1)==0){P=u}else{P=c[v>>2]|0}c[o>>2]=P+M;Q=P}else{Q=A}w=B+12|0;F=c[w>>2]|0;R=B+16|0;if((F|0)==(c[R>>2]|0)){S=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{S=c[F>>2]|0}if((ah(S,t,Q,o,r,z,m,k,q,s)|0)!=0){I=H;K=Q;break}F=c[w>>2]|0;if((F|0)==(c[R>>2]|0)){pc[c[(c[B>>2]|0)+40>>2]&127](B)|0;l=B;A=Q;continue}else{c[w>>2]=F+4;l=B;A=Q;continue}}Q=a[m]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[m+4>>2]|0}do{if((T|0)!=0){Q=c[q>>2]|0;if((Q-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=Q+4;c[Q>>2]=A}}while(0);r=Ul(K,c[o>>2]|0,h,t)|0;t=j;c[t>>2]=r;c[t+4>>2]=J;mj(m,k,c[q>>2]|0,h);do{if((B|0)==0){U=0;V=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){W=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{W=c[q>>2]|0}if(!((W|0)==-1)){U=B;V=0;break}c[x>>2]=0;U=0;V=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){X=pc[c[(c[I>>2]|0)+36>>2]&127](I)|0}else{X=c[x>>2]|0}if((X|0)==-1){c[e>>2]=0;E=60;break}if(!V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}function Ng(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Og(a,0,k,j,f,g,h);i=b;return}function Og(d,e,f,g,h,j,k){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;e=i;i=i+328|0;l=e;m=e+104|0;n=e+112|0;o=e+128|0;p=e+144|0;q=e+152|0;r=e+312|0;s=e+320|0;t=c[h+4>>2]&74;if((t|0)==0){u=0}else if((t|0)==64){u=8}else if((t|0)==8){u=16}else{u=10}t=l;eh(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=c[m>>2]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0;D=1}else{x=c[m+12>>2]|0;if((x|0)==(c[m+16>>2]|0)){E=pc[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{E=c[x>>2]|0}if(!((E|0)==-1)){C=m;D=0;break}c[y>>2]=0;C=0;D=1}}while(0);x=c[f>>2]|0;do{if((x|0)==0){F=21}else{G=c[x+12>>2]|0;if((G|0)==(c[x+16>>2]|0)){H=pc[c[(c[x>>2]|0)+36>>2]&127](x)|0}else{H=c[G>>2]|0}if((H|0)==-1){c[f>>2]=0;F=21;break}else{if(D){I=x;break}else{J=x;K=B;break a}}}}while(0);if((F|0)==21){F=0;if(D){J=0;K=B;break}else{I=0}}x=a[h]|0;G=(x&1)==0;if(G){L=(x&255)>>>1}else{L=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(L|0)){if(G){M=(x&255)>>>1;N=(x&255)>>>1}else{x=c[z>>2]|0;M=x;N=x}ye(o,N<<1,0);if((a[h]&1)==0){O=10}else{O=(c[g>>2]&-2)+ -1|0}ye(o,O,0);if((a[h]&1)==0){P=v}else{P=c[w>>2]|0}c[p>>2]=P+M;Q=P}else{Q=B}x=C+12|0;G=c[x>>2]|0;R=C+16|0;if((G|0)==(c[R>>2]|0)){S=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{S=c[G>>2]|0}if((ah(S,u,Q,p,s,A,n,l,r,t)|0)!=0){J=I;K=Q;break}G=c[x>>2]|0;if((G|0)==(c[R>>2]|0)){pc[c[(c[C>>2]|0)+40>>2]&127](C)|0;m=C;B=Q;continue}else{c[x>>2]=G+4;m=C;B=Q;continue}}Q=a[n]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[n+4>>2]|0}do{if((T|0)!=0){Q=c[r>>2]|0;if((Q-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=Q+4;c[Q>>2]=B}}while(0);b[k>>1]=Tl(K,c[p>>2]|0,j,u)|0;mj(n,l,c[r>>2]|0,j);do{if((C|0)==0){U=0;V=1}else{r=c[C+12>>2]|0;if((r|0)==(c[C+16>>2]|0)){W=pc[c[(c[C>>2]|0)+36>>2]&127](C)|0}else{W=c[r>>2]|0}if(!((W|0)==-1)){U=C;V=0;break}c[y>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){F=60}else{y=c[J+12>>2]|0;if((y|0)==(c[J+16>>2]|0)){X=pc[c[(c[J>>2]|0)+36>>2]&127](J)|0}else{X=c[y>>2]|0}if((X|0)==-1){c[f>>2]=0;F=60;break}if(!V){break}Y=d;c[Y>>2]=U;ve(o);ve(n);i=e;return}}while(0);do{if((F|0)==60){if(V){break}Y=d;c[Y>>2]=U;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;Y=d;c[Y>>2]=U;ve(o);ve(n);i=e;return}function Pg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Qg(a,0,k,j,f,g,h);i=b;return}function Qg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==64){t=8}else if((s|0)==0){t=0}else if((s|0)==8){t=16}else{t=10}s=k;eh(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=pc[c[(c[l>>2]|0)+36>>2]&127](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=pc[c[(c[w>>2]|0)+36>>2]&127](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}ye(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}ye(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{R=c[F>>2]|0}if((ah(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){pc[c[(c[B>>2]|0)+40>>2]&127](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Sl(J,c[o>>2]|0,h,t)|0;mj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=pc[c[(c[I>>2]|0)+36>>2]&127](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}function Rg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Sg(a,0,k,j,f,g,h);i=b;return}function Sg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==64){t=8}else if((s|0)==0){t=0}else{t=10}s=k;eh(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=pc[c[(c[l>>2]|0)+36>>2]&127](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=pc[c[(c[w>>2]|0)+36>>2]&127](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}ye(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}ye(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{R=c[F>>2]|0}if((ah(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){pc[c[(c[B>>2]|0)+40>>2]&127](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Rl(J,c[o>>2]|0,h,t)|0;mj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=pc[c[(c[I>>2]|0)+36>>2]&127](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}function Tg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Ug(a,0,k,j,f,g,h);i=b;return}function Ug(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==64){t=8}else if((s|0)==0){t=0}else{t=10}s=k;eh(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;ye(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=pc[c[(c[l>>2]|0)+36>>2]&127](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=pc[c[(c[w>>2]|0)+36>>2]&127](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;K=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;K=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){L=(w&255)>>>1}else{L=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(L|0)){if(F){M=(w&255)>>>1;N=(w&255)>>>1}else{w=c[y>>2]|0;M=w;N=w}ye(n,N<<1,0);if((a[g]&1)==0){O=10}else{O=(c[f>>2]&-2)+ -1|0}ye(n,O,0);if((a[g]&1)==0){P=u}else{P=c[v>>2]|0}c[o>>2]=P+M;Q=P}else{Q=A}w=B+12|0;F=c[w>>2]|0;R=B+16|0;if((F|0)==(c[R>>2]|0)){S=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{S=c[F>>2]|0}if((ah(S,t,Q,o,r,z,m,k,q,s)|0)!=0){I=H;K=Q;break}F=c[w>>2]|0;if((F|0)==(c[R>>2]|0)){pc[c[(c[B>>2]|0)+40>>2]&127](B)|0;l=B;A=Q;continue}else{c[w>>2]=F+4;l=B;A=Q;continue}}Q=a[m]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[m+4>>2]|0}do{if((T|0)!=0){Q=c[q>>2]|0;if((Q-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=Q+4;c[Q>>2]=A}}while(0);r=Ql(K,c[o>>2]|0,h,t)|0;t=j;c[t>>2]=r;c[t+4>>2]=J;mj(m,k,c[q>>2]|0,h);do{if((B|0)==0){U=0;V=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){W=pc[c[(c[B>>2]|0)+36>>2]&127](B)|0}else{W=c[q>>2]|0}if(!((W|0)==-1)){U=B;V=0;break}c[x>>2]=0;U=0;V=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){X=pc[c[(c[I>>2]|0)+36>>2]&127](I)|0}else{X=c[x>>2]|0}if((X|0)==-1){c[e>>2]=0;E=60;break}if(!V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}function Vg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Wg(a,0,k,j,f,g,h);i=b;return}function Wg(b,d,e,f,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;fh(n,h,v,l,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ye(o,10,0);if((a[h]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=pc[c[(c[m>>2]|0)+36>>2]&127](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=pc[c[(c[z>>2]|0)+36>>2]&127](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[h]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}ye(o,P<<1,0);if((a[h]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}ye(o,Q,0);if((a[h]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=pc[c[(c[E>>2]|0)+36>>2]&127](E)|0}else{U=c[I>>2]|0}if((gh(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){pc[c[(c[E>>2]|0)+40>>2]&127](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);g[k>>2]=+Pl(M,c[p>>2]|0,j);mj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=pc[c[(c[E>>2]|0)+36>>2]&127](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=pc[c[(c[L>>2]|0)+36>>2]&127](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}function Xg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Yg(a,0,k,j,f,g,h);i=b;return}\n\n\n\nfunction qj(b,e,f,g,h,j,k,l,m,n,o){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,kc=0,lc=0,nc=0,oc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec=0,Fc=0;p=i;i=i+408|0;q=p;r=p+400|0;s=r;t=i;i=i+8|0;u=i;i=i+8|0;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+8|0;B=i;i=i+8|0;C=q;c[r>>2]=0;D=v;c[D+0>>2]=0;c[D+4>>2]=0;c[D+8>>2]=0;E=w;c[E+0>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;F=x;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;G=y;c[G+0>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;H=z;c[H+0>>2]=0;c[H+4>>2]=0;c[H+8>>2]=0;tj(f,g,s,t,u,v,w,x,y,A);s=m;c[n>>2]=c[s>>2];g=b;b=e;e=r;r=l;f=y+4|0;I=y+8|0;J=x+4|0;K=x+8|0;L=(h&512|0)!=0;h=w+4|0;M=w+8|0;N=z+4|0;O=z+8|0;P=e+3|0;Q=m+4|0;m=v+4|0;R=q+400|0;q=C;S=C;C=o;o=0;T=0;U=120;a:while(1){V=c[g>>2]|0;do{if((V|0)==0){W=1}else{X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){Y=pc[c[(c[V>>2]|0)+36>>2]&127](V)|0}else{Y=c[X>>2]|0}if((Y|0)==-1){c[g>>2]=0;W=1;break}else{W=(c[g>>2]|0)==0;break}}}while(0);V=c[b>>2]|0;do{if((V|0)==0){Z=15}else{X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){_=pc[c[(c[V>>2]|0)+36>>2]&127](V)|0}else{_=c[X>>2]|0}if((_|0)==-1){c[b>>2]=0;Z=15;break}else{if(W){$=V;break}else{aa=S;ba=q;ca=T;da=U;Z=292;break a}}}}while(0);if((Z|0)==15){Z=0;if(W){aa=S;ba=q;ca=T;da=U;Z=292;break}else{$=0}}b:do{switch(a[e+o|0]|0){case 2:{if(!((T|0)!=0|o>>>0<2)){if((o|0)==2){ea=(a[P]|0)!=0}else{ea=0}if(!(L|ea)){fa=C;ga=S;ha=q;ia=R;ja=0;ka=U;break b}}V=a[E]|0;X=(V&1)==0?h:c[M>>2]|0;c:do{if((o|0)==0){la=$;ma=$;na=V;oa=X}else{if((d[e+(o+ -1)|0]|0)<2){pa=V;qa=X}else{la=$;ma=$;na=V;oa=X;break}while(1){if((pa&1)==0){ra=h;sa=(pa&255)>>>1}else{ra=c[M>>2]|0;sa=c[h>>2]|0}if((qa|0)==(ra+(sa<<2)|0)){ta=pa;break}if(!(jc[c[(c[r>>2]|0)+12>>2]&31](l,8192,c[qa>>2]|0)|0)){Z=129;break}pa=a[E]|0;qa=qa+4|0}if((Z|0)==129){Z=0;ta=a[E]|0}ua=(ta&1)==0;va=qa-(ua?h:c[M>>2]|0)>>2;wa=a[H]|0;xa=(wa&1)==0;if(xa){ya=(wa&255)>>>1}else{ya=c[N>>2]|0}d:do{if(!(va>>>0>ya>>>0)){if(xa){za=N+(((wa&255)>>>1)-va<<2)|0;Aa=N;Ba=(wa&255)>>>1}else{Ca=c[O>>2]|0;Da=c[N>>2]|0;za=Ca+(Da-va<<2)|0;Aa=Ca;Ba=Da}Da=Aa+(Ba<<2)|0;if((za|0)==(Da|0)){la=$;ma=$;na=ta;oa=qa;break c}else{Ea=ua?h:c[M>>2]|0;Fa=za}while(1){if((c[Fa>>2]|0)!=(c[Ea>>2]|0)){break d}Ca=Fa+4|0;if((Ca|0)==(Da|0)){la=$;ma=$;na=ta;oa=qa;break c}Ea=Ea+4|0;Fa=Ca}}}while(0);la=$;ma=$;na=ta;oa=ua?h:c[M>>2]|0}}while(0);e:while(1){if((na&1)==0){Ga=h;Ha=(na&255)>>>1}else{Ga=c[M>>2]|0;Ha=c[h>>2]|0}if((oa|0)==(Ga+(Ha<<2)|0)){break}X=c[g>>2]|0;do{if((X|0)==0){Ia=1}else{V=c[X+12>>2]|0;if((V|0)==(c[X+16>>2]|0)){Ja=pc[c[(c[X>>2]|0)+36>>2]&127](X)|0}else{Ja=c[V>>2]|0}if((Ja|0)==-1){c[g>>2]=0;Ia=1;break}else{Ia=(c[g>>2]|0)==0;break}}}while(0);do{if((ma|0)==0){Ka=la;Z=159}else{X=c[ma+12>>2]|0;if((X|0)==(c[ma+16>>2]|0)){La=pc[c[(c[ma>>2]|0)+36>>2]&127](ma)|0}else{La=c[X>>2]|0}if((La|0)==-1){c[b>>2]=0;Ka=0;Z=159;break}else{if(Ia^(la|0)==0){Ma=la;Na=la;break}else{break e}}}}while(0);if((Z|0)==159){Z=0;if(Ia){break}else{Ma=Ka;Na=0}}X=c[g>>2]|0;ua=c[X+12>>2]|0;if((ua|0)==(c[X+16>>2]|0)){Oa=pc[c[(c[X>>2]|0)+36>>2]&127](X)|0}else{Oa=c[ua>>2]|0}if((Oa|0)!=(c[oa>>2]|0)){break}ua=c[g>>2]|0;X=ua+12|0;V=c[X>>2]|0;if((V|0)==(c[ua+16>>2]|0)){pc[c[(c[ua>>2]|0)+40>>2]&127](ua)|0}else{c[X>>2]=V+4}la=Ma;ma=Na;na=a[E]|0;oa=oa+4|0}if(!L){fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break b}V=a[E]|0;if((V&1)==0){Pa=h;Qa=(V&255)>>>1}else{Pa=c[M>>2]|0;Qa=c[h>>2]|0}if((oa|0)==(Pa+(Qa<<2)|0)){fa=C;ga=S;ha=q;ia=R;ja=T;ka=U}else{Z=174;break a}break};case 4:{V=C;X=S;ua=q;va=R;wa=0;xa=U;f:while(1){Da=c[g>>2]|0;do{if((Da|0)==0){Ra=1}else{Ca=c[Da+12>>2]|0;if((Ca|0)==(c[Da+16>>2]|0)){Sa=pc[c[(c[Da>>2]|0)+36>>2]&127](Da)|0}else{Sa=c[Ca>>2]|0}if((Sa|0)==-1){c[g>>2]=0;Ra=1;break}else{Ra=(c[g>>2]|0)==0;break}}}while(0);Da=c[b>>2]|0;do{if((Da|0)==0){Z=188}else{Ca=c[Da+12>>2]|0;if((Ca|0)==(c[Da+16>>2]|0)){Ta=pc[c[(c[Da>>2]|0)+36>>2]&127](Da)|0}else{Ta=c[Ca>>2]|0}if((Ta|0)==-1){c[b>>2]=0;Z=188;break}else{if(Ra){break}else{break f}}}}while(0);if((Z|0)==188){Z=0;if(Ra){break}}Da=c[g>>2]|0;Ca=c[Da+12>>2]|0;if((Ca|0)==(c[Da+16>>2]|0)){Ua=pc[c[(c[Da>>2]|0)+36>>2]&127](Da)|0}else{Ua=c[Ca>>2]|0}if(jc[c[(c[r>>2]|0)+12>>2]&31](l,2048,Ua)|0){Ca=c[n>>2]|0;if((Ca|0)==(V|0)){Da=(c[Q>>2]|0)!=120;Va=c[s>>2]|0;Wa=V-Va|0;Xa=Wa>>>0<2147483647?Wa<<1:-1;Ya=Wa>>2;if(Da){Za=Va}else{Za=0}Va=Mm(Za,Xa)|0;Wa=Va;if((Va|0)==0){Z=198;break a}do{if(Da){c[s>>2]=Wa;_a=Wa}else{Va=c[s>>2]|0;c[s>>2]=Wa;if((Va|0)==0){_a=Wa;break}mc[c[Q>>2]&255](Va);_a=c[s>>2]|0}}while(0);c[Q>>2]=121;Wa=_a+(Ya<<2)|0;c[n>>2]=Wa;$a=Wa;ab=(c[s>>2]|0)+(Xa>>>2<<2)|0}else{$a=Ca;ab=V}c[n>>2]=$a+4;c[$a>>2]=Ua;bb=ab;cb=X;db=ua;eb=va;fb=wa+1|0;gb=xa}else{Wa=a[D]|0;if((Wa&1)==0){hb=(Wa&255)>>>1}else{hb=c[m>>2]|0}if((hb|0)==0|(wa|0)==0){break}if((Ua|0)!=(c[u>>2]|0)){break}if((ua|0)==(va|0)){Wa=ua-X|0;Da=Wa>>>0<2147483647?Wa<<1:-1;if((xa|0)!=120){ib=X}else{ib=0}Va=Mm(ib,Da)|0;jb=Va;if((Va|0)==0){Z=214;break a}kb=jb;lb=jb+(Wa>>2<<2)|0;mb=jb+(Da>>>2<<2)|0;nb=121}else{kb=X;lb=ua;mb=va;nb=xa}c[lb>>2]=wa;bb=V;cb=kb;db=lb+4|0;eb=mb;fb=0;gb=nb}Da=c[g>>2]|0;jb=Da+12|0;Wa=c[jb>>2]|0;if((Wa|0)==(c[Da+16>>2]|0)){pc[c[(c[Da>>2]|0)+40>>2]&127](Da)|0;V=bb;X=cb;ua=db;va=eb;wa=fb;xa=gb;continue}else{c[jb>>2]=Wa+4;V=bb;X=cb;ua=db;va=eb;wa=fb;xa=gb;continue}}if((X|0)==(ua|0)|(wa|0)==0){ob=X;pb=ua;qb=va;rb=xa}else{if((ua|0)==(va|0)){Wa=ua-X|0;jb=Wa>>>0<2147483647?Wa<<1:-1;if((xa|0)!=120){sb=X}else{sb=0}Da=Mm(sb,jb)|0;Va=Da;if((Da|0)==0){Z=225;break a}tb=Va;ub=Va+(Wa>>2<<2)|0;vb=Va+(jb>>>2<<2)|0;wb=121}else{tb=X;ub=ua;vb=va;wb=xa}c[ub>>2]=wa;ob=tb;pb=ub+4|0;qb=vb;rb=wb}jb=c[A>>2]|0;if((jb|0)>0){Va=c[g>>2]|0;do{if((Va|0)==0){xb=1}else{Wa=c[Va+12>>2]|0;if((Wa|0)==(c[Va+16>>2]|0)){yb=pc[c[(c[Va>>2]|0)+36>>2]&127](Va)|0}else{yb=c[Wa>>2]|0}if((yb|0)==-1){c[g>>2]=0;xb=1;break}else{xb=(c[g>>2]|0)==0;break}}}while(0);Va=c[b>>2]|0;do{if((Va|0)==0){Z=242}else{wa=c[Va+12>>2]|0;if((wa|0)==(c[Va+16>>2]|0)){zb=pc[c[(c[Va>>2]|0)+36>>2]&127](Va)|0}else{zb=c[wa>>2]|0}if((zb|0)==-1){c[b>>2]=0;Z=242;break}else{if(xb){Ab=Va;break}else{Z=248;break a}}}}while(0);if((Z|0)==242){Z=0;if(xb){Z=248;break a}else{Ab=0}}Va=c[g>>2]|0;wa=c[Va+12>>2]|0;if((wa|0)==(c[Va+16>>2]|0)){Bb=pc[c[(c[Va>>2]|0)+36>>2]&127](Va)|0}else{Bb=c[wa>>2]|0}if((Bb|0)!=(c[t>>2]|0)){Z=248;break a}wa=c[g>>2]|0;Va=wa+12|0;xa=c[Va>>2]|0;if((xa|0)==(c[wa+16>>2]|0)){pc[c[(c[wa>>2]|0)+40>>2]&127](wa)|0;Cb=Ab;Db=jb;Eb=Ab;Fb=V}else{c[Va>>2]=xa+4;Cb=Ab;Db=jb;Eb=Ab;Fb=V}while(1){xa=c[g>>2]|0;do{if((xa|0)==0){Gb=1}else{Va=c[xa+12>>2]|0;if((Va|0)==(c[xa+16>>2]|0)){Hb=pc[c[(c[xa>>2]|0)+36>>2]&127](xa)|0}else{Hb=c[Va>>2]|0}if((Hb|0)==-1){c[g>>2]=0;Gb=1;break}else{Gb=(c[g>>2]|0)==0;break}}}while(0);do{if((Eb|0)==0){Ib=Cb;Z=265}else{xa=c[Eb+12>>2]|0;if((xa|0)==(c[Eb+16>>2]|0)){Jb=pc[c[(c[Eb>>2]|0)+36>>2]&127](Eb)|0}else{Jb=c[xa>>2]|0}if((Jb|0)==-1){c[b>>2]=0;Ib=0;Z=265;break}else{if(Gb^(Cb|0)==0){Kb=Cb;Lb=Cb;break}else{Z=271;break a}}}}while(0);if((Z|0)==265){Z=0;if(Gb){Z=271;break a}else{Kb=Ib;Lb=0}}xa=c[g>>2]|0;Ca=c[xa+12>>2]|0;if((Ca|0)==(c[xa+16>>2]|0)){Mb=pc[c[(c[xa>>2]|0)+36>>2]&127](xa)|0}else{Mb=c[Ca>>2]|0}if(!(jc[c[(c[r>>2]|0)+12>>2]&31](l,2048,Mb)|0)){Z=271;break a}Ca=c[n>>2]|0;if((Ca|0)==(Fb|0)){xa=(c[Q>>2]|0)!=120;Xa=c[s>>2]|0;Ya=Fb-Xa|0;Va=Ya>>>0<2147483647?Ya<<1:-1;wa=Ya>>2;if(xa){Nb=Xa}else{Nb=0}Xa=Mm(Nb,Va)|0;Ya=Xa;if((Xa|0)==0){Z=276;break a}do{if(xa){c[s>>2]=Ya;Ob=Ya}else{Xa=c[s>>2]|0;c[s>>2]=Ya;if((Xa|0)==0){Ob=Ya;break}mc[c[Q>>2]&255](Xa);Ob=c[s>>2]|0}}while(0);c[Q>>2]=121;Ya=Ob+(wa<<2)|0;c[n>>2]=Ya;Pb=Ya;Qb=(c[s>>2]|0)+(Va>>>2<<2)|0}else{Pb=Ca;Qb=Fb}Ya=c[g>>2]|0;xa=c[Ya+12>>2]|0;if((xa|0)==(c[Ya+16>>2]|0)){Xa=pc[c[(c[Ya>>2]|0)+36>>2]&127](Ya)|0;Rb=Xa;Sb=c[n>>2]|0}else{Rb=c[xa>>2]|0;Sb=Pb}c[n>>2]=Sb+4;c[Sb>>2]=Rb;xa=Db+ -1|0;c[A>>2]=xa;Xa=c[g>>2]|0;Ya=Xa+12|0;va=c[Ya>>2]|0;if((va|0)==(c[Xa+16>>2]|0)){pc[c[(c[Xa>>2]|0)+40>>2]&127](Xa)|0}else{c[Ya>>2]=va+4}if((xa|0)>0){Cb=Kb;Db=xa;Eb=Lb;Fb=Qb}else{Tb=Qb;break}}}else{Tb=V}if((c[n>>2]|0)==(c[s>>2]|0)){Z=290;break a}else{fa=Tb;ga=ob;ha=pb;ia=qb;ja=T;ka=rb}break};case 3:{jb=a[F]|0;xa=(jb&1)==0;if(xa){Ub=(jb&255)>>>1}else{Ub=c[J>>2]|0}va=a[G]|0;Ya=(va&1)==0;if(Ya){Vb=(va&255)>>>1}else{Vb=c[f>>2]|0}if((Ub|0)==(0-Vb|0)){fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break b}if(xa){Wb=(jb&255)>>>1}else{Wb=c[J>>2]|0}do{if((Wb|0)!=0){if(Ya){Xb=(va&255)>>>1}else{Xb=c[f>>2]|0}if((Xb|0)==0){break}Xa=c[g>>2]|0;ua=c[Xa+12>>2]|0;if((ua|0)==(c[Xa+16>>2]|0)){X=pc[c[(c[Xa>>2]|0)+36>>2]&127](Xa)|0;Yb=X;Zb=a[F]|0}else{Yb=c[ua>>2]|0;Zb=jb}ua=c[g>>2]|0;X=ua+12|0;Xa=c[X>>2]|0;Wa=(Xa|0)==(c[ua+16>>2]|0);if((Yb|0)==(c[((Zb&1)==0?J:c[K>>2]|0)>>2]|0)){if(Wa){pc[c[(c[ua>>2]|0)+40>>2]&127](ua)|0}else{c[X>>2]=Xa+4}X=a[F]|0;if((X&1)==0){_b=(X&255)>>>1}else{_b=c[J>>2]|0}fa=C;ga=S;ha=q;ia=R;ja=_b>>>0>1?x:T;ka=U;break b}if(Wa){$b=pc[c[(c[ua>>2]|0)+36>>2]&127](ua)|0}else{$b=c[Xa>>2]|0}if(($b|0)!=(c[((a[G]&1)==0?f:c[I>>2]|0)>>2]|0)){Z=116;break a}Xa=c[g>>2]|0;ua=Xa+12|0;Wa=c[ua>>2]|0;if((Wa|0)==(c[Xa+16>>2]|0)){pc[c[(c[Xa>>2]|0)+40>>2]&127](Xa)|0}else{c[ua>>2]=Wa+4}a[k]=1;Wa=a[G]|0;if((Wa&1)==0){ac=(Wa&255)>>>1}else{ac=c[f>>2]|0}fa=C;ga=S;ha=q;ia=R;ja=ac>>>0>1?y:T;ka=U;break b}}while(0);if(xa){bc=(jb&255)>>>1}else{bc=c[J>>2]|0}Ya=c[g>>2]|0;V=c[Ya+12>>2]|0;Wa=(V|0)==(c[Ya+16>>2]|0);if((bc|0)==0){if(Wa){ua=pc[c[(c[Ya>>2]|0)+36>>2]&127](Ya)|0;cc=ua;dc=a[G]|0}else{cc=c[V>>2]|0;dc=va}if((cc|0)!=(c[((dc&1)==0?f:c[I>>2]|0)>>2]|0)){fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break b}ua=c[g>>2]|0;Xa=ua+12|0;X=c[Xa>>2]|0;if((X|0)==(c[ua+16>>2]|0)){pc[c[(c[ua>>2]|0)+40>>2]&127](ua)|0}else{c[Xa>>2]=X+4}a[k]=1;X=a[G]|0;if((X&1)==0){ec=(X&255)>>>1}else{ec=c[f>>2]|0}fa=C;ga=S;ha=q;ia=R;ja=ec>>>0>1?y:T;ka=U;break b}if(Wa){Wa=pc[c[(c[Ya>>2]|0)+36>>2]&127](Ya)|0;fc=Wa;gc=a[F]|0}else{fc=c[V>>2]|0;gc=jb}if((fc|0)!=(c[((gc&1)==0?J:c[K>>2]|0)>>2]|0)){a[k]=1;fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break b}V=c[g>>2]|0;Wa=V+12|0;Ya=c[Wa>>2]|0;if((Ya|0)==(c[V+16>>2]|0)){pc[c[(c[V>>2]|0)+40>>2]&127](V)|0}else{c[Wa>>2]=Ya+4}Ya=a[F]|0;if((Ya&1)==0){hc=(Ya&255)>>>1}else{hc=c[J>>2]|0}fa=C;ga=S;ha=q;ia=R;ja=hc>>>0>1?x:T;ka=U;break};case 1:{if((o|0)==3){aa=S;ba=q;ca=T;da=U;Z=292;break a}Ya=c[g>>2]|0;Wa=c[Ya+12>>2]|0;if((Wa|0)==(c[Ya+16>>2]|0)){ic=pc[c[(c[Ya>>2]|0)+36>>2]&127](Ya)|0}else{ic=c[Wa>>2]|0}if(!(jc[c[(c[r>>2]|0)+12>>2]&31](l,8192,ic)|0)){Z=27;break a}Wa=c[g>>2]|0;Ya=Wa+12|0;V=c[Ya>>2]|0;if((V|0)==(c[Wa+16>>2]|0)){kc=pc[c[(c[Wa>>2]|0)+40>>2]&127](Wa)|0}else{c[Ya>>2]=V+4;kc=c[V>>2]|0}Le(z,kc);Z=28;break};case 0:{Z=28;break};default:{fa=C;ga=S;ha=q;ia=R;ja=T;ka=U}}}while(0);g:do{if((Z|0)==28){Z=0;if((o|0)==3){aa=S;ba=q;ca=T;da=U;Z=292;break a}else{lc=$;nc=$}while(1){V=c[g>>2]|0;do{if((V|0)==0){oc=1}else{Ya=c[V+12>>2]|0;if((Ya|0)==(c[V+16>>2]|0)){qc=pc[c[(c[V>>2]|0)+36>>2]&127](V)|0}else{qc=c[Ya>>2]|0}if((qc|0)==-1){c[g>>2]=0;oc=1;break}else{oc=(c[g>>2]|0)==0;break}}}while(0);do{if((nc|0)==0){rc=lc;Z=42}else{V=c[nc+12>>2]|0;if((V|0)==(c[nc+16>>2]|0)){sc=pc[c[(c[nc>>2]|0)+36>>2]&127](nc)|0}else{sc=c[V>>2]|0}if((sc|0)==-1){c[b>>2]=0;rc=0;Z=42;break}else{if(oc^(lc|0)==0){tc=lc;uc=lc;break}else{fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break g}}}}while(0);if((Z|0)==42){Z=0;if(oc){fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break g}else{tc=rc;uc=0}}V=c[g>>2]|0;Ca=c[V+12>>2]|0;if((Ca|0)==(c[V+16>>2]|0)){vc=pc[c[(c[V>>2]|0)+36>>2]&127](V)|0}else{vc=c[Ca>>2]|0}if(!(jc[c[(c[r>>2]|0)+12>>2]&31](l,8192,vc)|0)){fa=C;ga=S;ha=q;ia=R;ja=T;ka=U;break g}Ca=c[g>>2]|0;V=Ca+12|0;Va=c[V>>2]|0;if((Va|0)==(c[Ca+16>>2]|0)){wc=pc[c[(c[Ca>>2]|0)+40>>2]&127](Ca)|0}else{c[V>>2]=Va+4;wc=c[Va>>2]|0}Le(z,wc);lc=tc;nc=uc}}}while(0);jb=o+1|0;if(jb>>>0<4){R=ia;q=ha;S=ga;C=fa;o=jb;T=ja;U=ka}else{aa=ga;ba=ha;ca=ja;da=ka;Z=292;break}}h:do{if((Z|0)==27){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==116){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==174){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==198){Wm()}else if((Z|0)==214){Wm()}else if((Z|0)==225){Wm()}else if((Z|0)==248){c[j>>2]=c[j>>2]|4;xc=0;yc=ob;zc=rb}else if((Z|0)==271){c[j>>2]=c[j>>2]|4;xc=0;yc=ob;zc=rb}else if((Z|0)==276){Wm()}else if((Z|0)==290){c[j>>2]=c[j>>2]|4;xc=0;yc=ob;zc=rb}else if((Z|0)==292){i:do{if((ca|0)!=0){ka=ca;ja=ca+4|0;ha=ca+8|0;ga=1;j:while(1){T=a[ka]|0;if((T&1)==0){Ac=(T&255)>>>1}else{Ac=c[ja>>2]|0}if(!(ga>>>0<Ac>>>0)){break i}T=c[g>>2]|0;do{if((T|0)==0){Bc=1}else{o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Cc=pc[c[(c[T>>2]|0)+36>>2]&127](T)|0}else{Cc=c[o>>2]|0}if((Cc|0)==-1){c[g>>2]=0;Bc=1;break}else{Bc=(c[g>>2]|0)==0;break}}}while(0);T=c[b>>2]|0;do{if((T|0)==0){Z=311}else{o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Dc=pc[c[(c[T>>2]|0)+36>>2]&127](T)|0}else{Dc=c[o>>2]|0}if((Dc|0)==-1){c[b>>2]=0;Z=311;break}else{if(Bc){break}else{break j}}}}while(0);if((Z|0)==311){Z=0;if(Bc){break}}T=c[g>>2]|0;o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Ec=pc[c[(c[T>>2]|0)+36>>2]&127](T)|0}else{Ec=c[o>>2]|0}if((a[ka]&1)==0){Fc=ja}else{Fc=c[ha>>2]|0}if((Ec|0)!=(c[Fc+(ga<<2)>>2]|0)){break}o=ga+1|0;T=c[g>>2]|0;fa=T+12|0;C=c[fa>>2]|0;if((C|0)==(c[T+16>>2]|0)){pc[c[(c[T>>2]|0)+40>>2]&127](T)|0;ga=o;continue}else{c[fa>>2]=C+4;ga=o;continue}}c[j>>2]=c[j>>2]|4;xc=0;yc=aa;zc=da;break h}}while(0);if((aa|0)==(ba|0)){xc=1;yc=ba;zc=da;break}c[B>>2]=0;mj(v,aa,ba,B);if((c[B>>2]|0)==0){xc=1;yc=aa;zc=da;break}c[j>>2]=c[j>>2]|4;xc=0;yc=aa;zc=da}}while(0);He(z);He(y);He(x);He(w);ve(v);if((yc|0)==0){i=p;return xc|0}mc[zc&255](yc);i=p;return xc|0}function rj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+464|0;l=d;m=d+8|0;n=d+24|0;o=d+424|0;p=d+432|0;q=d+440|0;r=d+448|0;s=d+456|0;t=o;c[t>>2]=n;u=o+4|0;c[u>>2]=120;v=n+400|0;Qe(q,h);n=q;w=c[n>>2]|0;if(!((c[1280]|0)==-1)){c[m>>2]=5120;c[m+4>>2]=118;c[m+8>>2]=0;qe(5120,m,119)}m=(c[5124>>2]|0)+ -1|0;x=c[w+8>>2]|0;if(!((c[w+12>>2]|0)-x>>2>>>0>m>>>0)){y=vb(4)|0;z=y;pm(z);cc(y|0,13088,107)}w=c[x+(m<<2)>>2]|0;if((w|0)==0){y=vb(4)|0;z=y;pm(z);cc(y|0,13088,107)}y=w;a[r]=0;z=f;f=c[z>>2]|0;c[s>>2]=f;m=c[h+4>>2]|0;h=l;x=s;c[h+0>>2]=c[x+0>>2];x=qj(e,l,g,q,m,j,r,y,o,p,v)|0;if(x){x=k;if((a[x]&1)==0){c[k+4>>2]=0;a[x]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}x=w;if((a[r]|0)!=0){Le(k,yc[c[(c[x>>2]|0)+44>>2]&31](y,45)|0)}r=yc[c[(c[x>>2]|0)+44>>2]&31](y,48)|0;y=c[t>>2]|0;x=c[p>>2]|0;p=x+ -4|0;a:do{if(y>>>0<p>>>0){w=y;while(1){v=w+4|0;if((c[w>>2]|0)!=(r|0)){A=w;break a}if(v>>>0<p>>>0){w=v}else{A=v;break}}}else{A=y}}while(0);sj(k,A,x)|0}x=e;e=c[x>>2]|0;do{if((e|0)==0){B=1}else{A=c[e+12>>2]|0;if((A|0)==(c[e+16>>2]|0)){C=pc[c[(c[e>>2]|0)+36>>2]&127](e)|0}else{C=c[A>>2]|0}if((C|0)==-1){c[x>>2]=0;B=1;break}else{B=(c[x>>2]|0)==0;break}}}while(0);do{if((f|0)==0){D=29}else{C=c[f+12>>2]|0;if((C|0)==(c[f+16>>2]|0)){E=pc[c[(c[f>>2]|0)+36>>2]&127](f)|0}else{E=c[C>>2]|0}if((E|0)==-1){c[z>>2]=0;D=29;break}else{if(B){break}else{D=31;break}}}}while(0);if((D|0)==29){if(B){D=31}}if((D|0)==31){c[j>>2]=c[j>>2]|2}c[b>>2]=c[x>>2];Yd(c[n>>2]|0)|0;n=c[t>>2]|0;c[t>>2]=0;if((n|0)==0){i=d;return}mc[c[u>>2]&255](n);i=d;return}function sj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;g=b;h=d;j=a[g]|0;if((j&1)==0){k=(j&255)>>>1;l=j;m=1}else{j=c[b>>2]|0;k=c[b+4>>2]|0;l=j&255;m=(j&-2)+ -1|0}j=e-h>>2;if((j|0)==0){i=f;return b|0}if((m-k|0)>>>0<j>>>0){Ne(b,m,k+j-m|0,k,k,0,0);n=a[g]|0}else{n=l}if((n&1)==0){o=b+4|0}else{o=c[b+8>>2]|0}n=o+(k<<2)|0;if((d|0)==(e|0)){p=n}else{l=k+((e+ -4+(0-h)|0)>>>2)+1|0;h=d;d=n;while(1){c[d>>2]=c[h>>2];n=h+4|0;if((n|0)==(e|0)){break}else{d=d+4|0;h=n}}p=o+(l<<2)|0}c[p>>2]=0;p=k+j|0;if((a[g]&1)==0){a[g]=p<<1;i=f;return b|0}else{c[b+4>>2]=p;i=f;return b|0}return 0}function tj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;n=i;i=i+176|0;o=n;p=n+16|0;q=n+32|0;r=n+40|0;s=n+56|0;t=n+72|0;u=n+88|0;v=n+104|0;w=n+112|0;x=n+128|0;y=n+144|0;z=n+160|0;if(b){b=c[d>>2]|0;if(!((c[1174]|0)==-1)){c[p>>2]=4696;c[p+4>>2]=118;c[p+8>>2]=0;qe(4696,p,119)}p=(c[4700>>2]|0)+ -1|0;A=c[b+8>>2]|0;if(!((c[b+12>>2]|0)-A>>2>>>0>p>>>0)){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}b=c[A+(p<<2)>>2]|0;if((b|0)==0){B=vb(4)|0;C=B;pm(C);cc(B|0,13088,107)}B=b;nc[c[(c[b>>2]|0)+44>>2]&63](q,B);C=e;p=c[q>>2]|0;a[C]=p;a[C+1|0]=p>>8;a[C+2|0]=p>>16;a[C+3|0]=p>>24;p=b;nc[c[(c[p>>2]|0)+32>>2]&63](r,B);C=l;if((a[C]&1)==0){c[l+4>>2]=0;a[C]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ke(l,0);q=r;c[C+0>>2]=c[q+0>>2];c[C+4>>2]=c[q+4>>2];c[C+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;He(r);nc[c[(c[p>>2]|0)+28>>2]&63](s,B);r=k;if((a[r]&1)==0){c[k+4>>2]=0;a[r]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ke(k,0);q=s;c[r+0>>2]=c[q+0>>2];c[r+4>>2]=c[q+4>>2];c[r+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;He(s);s=b;c[f>>2]=pc[c[(c[s>>2]|0)+12>>2]&127](B)|0;c[g>>2]=pc[c[(c[s>>2]|0)+16>>2]&127](B)|0;nc[c[(c[b>>2]|0)+20>>2]&63](t,B);b=h;if((a[b]&1)==0){a[h+1|0]=0;a[b]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}Ae(h,0);q=t;c[b+0>>2]=c[q+0>>2];c[b+4>>2]=c[q+4>>2];c[b+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(t);nc[c[(c[p>>2]|0)+24>>2]&63](u,B);p=j;if((a[p]&1)==0){c[j+4>>2]=0;a[p]=0}else{c[c[j+8>>2]>>2]=0;c[j+4>>2]=0}Ke(j,0);t=u;c[p+0>>2]=c[t+0>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;He(u);D=pc[c[(c[s>>2]|0)+36>>2]&127](B)|0;c[m>>2]=D;i=n;return}else{B=c[d>>2]|0;if(!((c[1158]|0)==-1)){c[o>>2]=4632;c[o+4>>2]=118;c[o+8>>2]=0;qe(4632,o,119)}o=(c[4636>>2]|0)+ -1|0;d=c[B+8>>2]|0;if(!((c[B+12>>2]|0)-d>>2>>>0>o>>>0)){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}B=c[d+(o<<2)>>2]|0;if((B|0)==0){E=vb(4)|0;F=E;pm(F);cc(E|0,13088,107)}E=B;nc[c[(c[B>>2]|0)+44>>2]&63](v,E);F=e;e=c[v>>2]|0;a[F]=e;a[F+1|0]=e>>8;a[F+2|0]=e>>16;a[F+3|0]=e>>24;e=B;nc[c[(c[e>>2]|0)+32>>2]&63](w,E);F=l;if((a[F]&1)==0){c[l+4>>2]=0;a[F]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ke(l,0);l=w;c[F+0>>2]=c[l+0>>2];c[F+4>>2]=c[l+4>>2];c[F+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;He(w);nc[c[(c[e>>2]|0)+28>>2]&63](x,E);w=k;if((a[w]&1)==0){c[k+4>>2]=0;a[w]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ke(k,0);k=x;c[w+0>>2]=c[k+0>>2];c[w+4>>2]=c[k+4>>2];c[w+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;He(x);x=B;c[f>>2]=pc[c[(c[x>>2]|0)+12>>2]&127](E)|0;c[g>>2]=pc[c[(c[x>>2]|0)+16>>2]&127](E)|0;nc[c[(c[B>>2]|0)+20>>2]&63](y,E);B=h;if((a[B]&1)==0){a[h+1|0]=0;a[B]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}Ae(h,0);h=y;c[B+0>>2]=c[h+0>>2];c[B+4>>2]=c[h+4>>2];c[B+8>>2]=c[h+8>>2];c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ve(y);nc[c[(c[e>>2]|0)+24>>2]&63](z,E);e=j;if((a[e]&1)==0){c[j+4>>2]=0;a[e]=0}else{c[c[j+8>>2]>>2]=0;c[j+4>>2]=0}Ke(j,0);j=z;c[e+0>>2]=c[j+0>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;He(z);D=pc[c[(c[x>>2]|0)+36>>2]&127](E)|0;c[m>>2]=D;i=n;return}}function uj(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function vj(a){a=a|0;i=i;return}function wj(b,d,e,f,g,j,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;l=+l;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0;d=i;i=i+16|0;m=d;n=d+8|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+104|0;r=i;i=i+8|0;s=i;i=i+104|0;t=i;i=i+8|0;u=i;i=i+8|0;v=u;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+104|0;D=i;i=i+8|0;E=i;i=i+8|0;F=i;i=i+8|0;G=q;c[r>>2]=G;q=s;s=o;h[k>>3]=l;c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];s=Ab(G|0,100,4880,o|0)|0;do{if(s>>>0>99){do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);o=c[1254]|0;G=n;h[k>>3]=l;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];G=rh(r,o,4880,n)|0;o=c[r>>2]|0;if((o|0)==0){Wm()}H=Km(G)|0;if((H|0)!=0){I=o;J=H;K=H;L=G;break}Wm()}else{I=0;J=0;K=q;L=s}}while(0);Qe(t,g);s=t;q=c[s>>2]|0;if(!((c[1282]|0)==-1)){c[p>>2]=5128;c[p+4>>2]=118;c[p+8>>2]=0;qe(5128,p,119)}p=(c[5132>>2]|0)+ -1|0;n=c[q+8>>2]|0;if(!((c[q+12>>2]|0)-n>>2>>>0>p>>>0)){M=vb(4)|0;N=M;pm(N);cc(M|0,13088,107)}q=c[n+(p<<2)>>2]|0;if((q|0)==0){M=vb(4)|0;N=M;pm(N);cc(M|0,13088,107)}M=q;N=c[r>>2]|0;vc[c[(c[q>>2]|0)+32>>2]&7](M,N,N+L|0,K)|0;if((L|0)==0){O=0}else{O=(a[c[r>>2]|0]|0)==45}c[u>>2]=0;u=y;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;u=z;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;r=A;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;xj(f,O,t,v,w,x,y,z,A,B);t=C;C=c[B>>2]|0;if((L|0)>(C|0)){B=a[r]|0;if((B&1)==0){P=(B&255)>>>1}else{P=c[A+4>>2]|0}B=a[u]|0;if((B&1)==0){Q=(B&255)>>>1}else{Q=c[z+4>>2]|0}R=P+(L-C<<1|1)+Q|0}else{Q=a[r]|0;if((Q&1)==0){S=(Q&255)>>>1}else{S=c[A+4>>2]|0}Q=a[u]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[z+4>>2]|0}R=S+2+T|0}T=R+C|0;do{if(T>>>0>100){R=Km(T)|0;if((R|0)!=0){U=R;V=R;break}Wm()}else{U=0;V=t}}while(0);yj(V,D,E,c[g+4>>2]|0,K,K+L|0,M,O,v,a[w]|0,a[x]|0,y,z,A,C);c[F>>2]=c[e>>2];e=c[D>>2]|0;D=c[E>>2]|0;E=m;C=F;c[E+0>>2]=c[C+0>>2];ad(b,m,V,e,D,g,j);if((U|0)!=0){Lm(U)}ve(A);ve(z);ve(y);Yd(c[s>>2]|0)|0;if((J|0)!=0){Lm(J)}if((I|0)==0){i=d;return}Lm(I);i=d;return}function xj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=i;i=i+40|0;o=n;p=n+16|0;q=n+32|0;r=q;s=i;i=i+16|0;t=i;i=i+8|0;u=t;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+8|0;z=y;A=i;i=i+16|0;B=i;i=i+8|0;C=B;D=i;i=i+16|0;E=i;i=i+16|0;F=i;i=i+16|0;G=c[e>>2]|0;if(b){if(!((c[1142]|0)==-1)){c[p>>2]=4568;c[p+4>>2]=118;c[p+8>>2]=0;qe(4568,p,119)}p=(c[4572>>2]|0)+ -1|0;b=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-b>>2>>>0>p>>>0)){H=vb(4)|0;I=H;pm(I);cc(H|0,13088,107)}e=c[b+(p<<2)>>2]|0;if((e|0)==0){H=vb(4)|0;I=H;pm(I);cc(H|0,13088,107)}H=e;I=c[e>>2]|0;if(d){nc[c[I+44>>2]&63](r,H);r=f;p=c[q>>2]|0;a[r]=p;a[r+1|0]=p>>8;a[r+2|0]=p>>16;a[r+3|0]=p>>24;nc[c[(c[e>>2]|0)+32>>2]&63](s,H);p=l;if((a[p]&1)==0){a[l+1|0]=0;a[p]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}Ae(l,0);r=s;c[p+0>>2]=c[r+0>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;ve(s)}else{nc[c[I+40>>2]&63](u,H);u=f;I=c[t>>2]|0;a[u]=I;a[u+1|0]=I>>8;a[u+2|0]=I>>16;a[u+3|0]=I>>24;nc[c[(c[e>>2]|0)+28>>2]&63](v,H);I=l;if((a[I]&1)==0){a[l+1|0]=0;a[I]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}Ae(l,0);u=v;c[I+0>>2]=c[u+0>>2];c[I+4>>2]=c[u+4>>2];c[I+8>>2]=c[u+8>>2];c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;ve(v)}v=e;a[g]=pc[c[(c[v>>2]|0)+12>>2]&127](H)|0;a[h]=pc[c[(c[v>>2]|0)+16>>2]&127](H)|0;v=e;nc[c[(c[v>>2]|0)+20>>2]&63](w,H);u=j;if((a[u]&1)==0){a[j+1|0]=0;a[u]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}Ae(j,0);I=w;c[u+0>>2]=c[I+0>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;ve(w);nc[c[(c[v>>2]|0)+24>>2]&63](x,H);v=k;if((a[v]&1)==0){a[k+1|0]=0;a[v]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}Ae(k,0);w=x;c[v+0>>2]=c[w+0>>2];c[v+4>>2]=c[w+4>>2];c[v+8>>2]=c[w+8>>2];c[w+0>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;ve(x);J=pc[c[(c[e>>2]|0)+36>>2]&127](H)|0;c[m>>2]=J;i=n;return}else{if(!((c[1126]|0)==-1)){c[o>>2]=4504;c[o+4>>2]=118;c[o+8>>2]=0;qe(4504,o,119)}o=(c[4508>>2]|0)+ -1|0;H=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-H>>2>>>0>o>>>0)){K=vb(4)|0;L=K;pm(L);cc(K|0,13088,107)}G=c[H+(o<<2)>>2]|0;if((G|0)==0){K=vb(4)|0;L=K;pm(L);cc(K|0,13088,107)}K=G;L=c[G>>2]|0;if(d){nc[c[L+44>>2]&63](z,K);z=f;d=c[y>>2]|0;a[z]=d;a[z+1|0]=d>>8;a[z+2|0]=d>>16;a[z+3|0]=d>>24;nc[c[(c[G>>2]|0)+32>>2]&63](A,K);d=l;if((a[d]&1)==0){a[l+1|0]=0;a[d]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}Ae(l,0);z=A;c[d+0>>2]=c[z+0>>2];c[d+4>>2]=c[z+4>>2];c[d+8>>2]=c[z+8>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;ve(A)}else{nc[c[L+40>>2]&63](C,K);C=f;f=c[B>>2]|0;a[C]=f;a[C+1|0]=f>>8;a[C+2|0]=f>>16;a[C+3|0]=f>>24;nc[c[(c[G>>2]|0)+28>>2]&63](D,K);f=l;if((a[f]&1)==0){a[l+1|0]=0;a[f]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}Ae(l,0);l=D;c[f+0>>2]=c[l+0>>2];c[f+4>>2]=c[l+4>>2];c[f+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;ve(D)}D=G;a[g]=pc[c[(c[D>>2]|0)+12>>2]&127](K)|0;a[h]=pc[c[(c[D>>2]|0)+16>>2]&127](K)|0;D=G;nc[c[(c[D>>2]|0)+20>>2]&63](E,K);h=j;if((a[h]&1)==0){a[j+1|0]=0;a[h]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}Ae(j,0);j=E;c[h+0>>2]=c[j+0>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ve(E);nc[c[(c[D>>2]|0)+24>>2]&63](F,K);D=k;if((a[D]&1)==0){a[k+1|0]=0;a[D]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}Ae(k,0);k=F;c[D+0>>2]=c[k+0>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;ve(F);J=pc[c[(c[G>>2]|0)+36>>2]&127](K)|0;c[m>>2]=J;i=n;return}}function yj(d,e,f,g,h,j,k,l,m,n,o,p,q,r,s){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;s=s|0;var t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0;t=i;c[f>>2]=d;u=k;v=r;w=r+1|0;x=r+8|0;y=r+4|0;r=q;z=(g&512|0)==0;A=q+1|0;B=q+8|0;C=q+4|0;q=(s|0)>0;D=p;E=p+1|0;F=p+8|0;G=p+4|0;p=k+8|0;H=0-s|0;I=h;h=0;while(1){a:do{switch(a[m+h|0]|0){case 0:{c[e>>2]=c[f>>2];J=I;break};case 2:{K=a[r]|0;L=(K&1)==0;if(L){M=(K&255)>>>1}else{M=c[C>>2]|0}if((M|0)==0|z){J=I;break a}if(L){N=A;O=(K&255)>>>1}else{N=c[B>>2]|0;O=c[C>>2]|0}K=N+O|0;L=c[f>>2]|0;if((N|0)==(K|0)){P=L}else{Q=L;L=N;while(1){a[Q]=a[L]|0;R=L+1|0;S=Q+1|0;if((R|0)==(K|0)){P=S;break}else{L=R;Q=S}}}c[f>>2]=P;J=I;break};case 1:{c[e>>2]=c[f>>2];Q=yc[c[(c[u>>2]|0)+28>>2]&31](k,32)|0;L=c[f>>2]|0;c[f>>2]=L+1;a[L]=Q;J=I;break};case 4:{Q=c[f>>2]|0;L=l?I+1|0:I;b:do{if(L>>>0<j>>>0){K=L;while(1){S=a[K]|0;if(!(S<<24>>24>-1)){T=K;break b}R=K+1|0;if((b[(c[p>>2]|0)+(S<<24>>24<<1)>>1]&2048)==0){T=K;break b}if(R>>>0<j>>>0){K=R}else{T=R;break}}}else{T=L}}while(0);K=T;if(q){if(T>>>0>L>>>0){R=L+(0-K)|0;K=R>>>0<H>>>0?H:R;R=K+s|0;S=Q;U=T;V=s;while(1){W=U+ -1|0;X=a[W]|0;c[f>>2]=S+1;a[S]=X;X=V+ -1|0;Y=(X|0)>0;if(!(W>>>0>L>>>0&Y)){break}S=c[f>>2]|0;V=X;U=W}U=T+K|0;if(Y){Z=U;_=R;$=32}else{aa=0;ba=U;ca=R}}else{Z=T;_=s;$=32}if(($|0)==32){$=0;aa=yc[c[(c[u>>2]|0)+28>>2]&31](k,48)|0;ba=Z;ca=_}U=c[f>>2]|0;c[f>>2]=U+1;if((ca|0)>0){V=U;S=ca;while(1){a[V]=aa;W=S+ -1|0;X=c[f>>2]|0;c[f>>2]=X+1;if((W|0)>0){S=W;V=X}else{da=X;break}}}else{da=U}a[da]=n;ea=ba}else{ea=T}if((ea|0)==(L|0)){V=yc[c[(c[u>>2]|0)+28>>2]&31](k,48)|0;S=c[f>>2]|0;c[f>>2]=S+1;a[S]=V}else{V=a[D]|0;S=(V&1)==0;if(S){fa=(V&255)>>>1}else{fa=c[G>>2]|0}if((fa|0)==0){ga=ea;ha=-1;ia=0;ja=0}else{if(S){ka=E}else{ka=c[F>>2]|0}ga=ea;ha=a[ka]|0;ia=0;ja=0}while(1){do{if((ja|0)==(ha|0)){S=c[f>>2]|0;c[f>>2]=S+1;a[S]=o;S=ia+1|0;V=a[D]|0;R=(V&1)==0;if(R){la=(V&255)>>>1}else{la=c[G>>2]|0}if(!(S>>>0<la>>>0)){ma=ha;na=S;oa=0;break}if(R){pa=E}else{pa=c[F>>2]|0}if((a[pa+S|0]|0)==127){ma=-1;na=S;oa=0;break}if(R){qa=E}else{qa=c[F>>2]|0}ma=a[qa+S|0]|0;na=S;oa=0}else{ma=ha;na=ia;oa=ja}}while(0);S=ga+ -1|0;R=a[S]|0;V=c[f>>2]|0;c[f>>2]=V+1;a[V]=R;if((S|0)==(L|0)){break}else{ga=S;ha=ma;ia=na;ja=oa+1|0}}}U=c[f>>2]|0;if((Q|0)==(U|0)){J=L;break a}S=U+ -1|0;if(S>>>0>Q>>>0){ra=Q;sa=S}else{J=L;break a}while(1){S=a[ra]|0;a[ra]=a[sa]|0;a[sa]=S;S=ra+1|0;U=sa+ -1|0;if(S>>>0<U>>>0){sa=U;ra=S}else{J=L;break}}break};case 3:{L=a[v]|0;Q=(L&1)==0;if(Q){ta=(L&255)>>>1}else{ta=c[y>>2]|0}if((ta|0)==0){J=I;break a}if(Q){ua=w}else{ua=c[x>>2]|0}Q=a[ua]|0;L=c[f>>2]|0;c[f>>2]=L+1;a[L]=Q;J=I;break};default:{J=I}}}while(0);Q=h+1|0;if((Q|0)==4){break}else{I=J;h=Q}}h=a[v]|0;v=(h&1)==0;if(v){va=(h&255)>>>1}else{va=c[y>>2]|0}if(va>>>0>1){if(v){wa=w;xa=(h&255)>>>1}else{wa=c[x>>2]|0;xa=c[y>>2]|0}y=wa+1|0;x=wa+xa|0;xa=c[f>>2]|0;if((y|0)==(x|0)){ya=xa}else{wa=xa;xa=y;while(1){a[wa]=a[xa]|0;y=xa+1|0;h=wa+1|0;if((y|0)==(x|0)){ya=h;break}else{xa=y;wa=h}}}c[f>>2]=ya}ya=g&176;if((ya|0)==32){c[e>>2]=c[f>>2];i=t;return}else if((ya|0)==16){i=t;return}else{c[e>>2]=d;i=t;return}}function zj(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;d=i;i=i+40|0;k=d;l=d+8|0;m=d+24|0;n=d+32|0;o=n;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+16|0;s=i;i=i+16|0;t=i;i=i+16|0;u=i;i=i+8|0;v=i;i=i+104|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;Qe(m,g);z=m;A=c[z>>2]|0;if(!((c[1282]|0)==-1)){c[l>>2]=5128;c[l+4>>2]=118;c[l+8>>2]=0;qe(5128,l,119)}l=(c[5132>>2]|0)+ -1|0;B=c[A+8>>2]|0;if(!((c[A+12>>2]|0)-B>>2>>>0>l>>>0)){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}A=c[B+(l<<2)>>2]|0;if((A|0)==0){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}C=A;D=j;l=a[D]|0;B=(l&1)==0;if(B){E=(l&255)>>>1}else{E=c[j+4>>2]|0}if((E|0)==0){F=0}else{if(B){G=j+1|0}else{G=c[j+8>>2]|0}B=a[G]|0;F=B<<24>>24==(yc[c[(c[A>>2]|0)+28>>2]&31](C,45)|0)<<24>>24}c[n>>2]=0;n=r;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;n=s;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;A=t;c[A+0>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;xj(f,F,m,o,p,q,r,s,t,u);m=v;v=a[D]|0;D=(v&1)==0;if(D){H=(v&255)>>>1}else{H=c[j+4>>2]|0}f=c[u>>2]|0;if((H|0)>(f|0)){if(D){I=(v&255)>>>1}else{I=c[j+4>>2]|0}D=a[A]|0;if((D&1)==0){J=(D&255)>>>1}else{J=c[t+4>>2]|0}D=a[n]|0;if((D&1)==0){K=(D&255)>>>1}else{K=c[s+4>>2]|0}L=J+(I-f<<1|1)+K|0}else{K=a[A]|0;if((K&1)==0){M=(K&255)>>>1}else{M=c[t+4>>2]|0}K=a[n]|0;if((K&1)==0){N=(K&255)>>>1}else{N=c[s+4>>2]|0}L=M+2+N|0}N=L+f|0;do{if(N>>>0>100){L=Km(N)|0;if((L|0)!=0){O=L;P=L;break}Wm()}else{O=0;P=m}}while(0);if((v&1)==0){Q=j+1|0;R=(v&255)>>>1}else{Q=c[j+8>>2]|0;R=c[j+4>>2]|0}yj(P,w,x,c[g+4>>2]|0,Q,Q+R|0,C,F,o,a[p]|0,a[q]|0,r,s,t,f);c[y>>2]=c[e>>2];e=c[w>>2]|0;w=c[x>>2]|0;x=k;f=y;c[x+0>>2]=c[f+0>>2];ad(b,k,P,e,w,g,h);if((O|0)==0){ve(t);ve(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}Lm(O);ve(t);ve(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}function Aj(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Bj(a){a=a|0;i=i;return}function Cj(b,d,e,f,g,j,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;l=+l;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;d=i;i=i+16|0;m=d;n=d+8|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+104|0;r=i;i=i+8|0;s=i;i=i+400|0;t=i;i=i+8|0;u=i;i=i+8|0;v=u;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+400|0;D=i;i=i+8|0;E=i;i=i+8|0;F=i;i=i+8|0;G=q;c[r>>2]=G;q=s;s=o;h[k>>3]=l;c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];s=Ab(G|0,100,4880,o|0)|0;do{if(s>>>0>99){do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);o=c[1254]|0;G=n;h[k>>3]=l;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];G=rh(r,o,4880,n)|0;o=c[r>>2]|0;if((o|0)==0){Wm()}H=Km(G<<2)|0;I=H;if((H|0)!=0){J=o;K=I;L=I;M=G;break}Wm()}else{J=0;K=0;L=q;M=s}}while(0);Qe(t,g);s=t;q=c[s>>2]|0;if(!((c[1280]|0)==-1)){c[p>>2]=5120;c[p+4>>2]=118;c[p+8>>2]=0;qe(5120,p,119)}p=(c[5124>>2]|0)+ -1|0;n=c[q+8>>2]|0;if(!((c[q+12>>2]|0)-n>>2>>>0>p>>>0)){N=vb(4)|0;O=N;pm(O);cc(N|0,13088,107)}q=c[n+(p<<2)>>2]|0;if((q|0)==0){N=vb(4)|0;O=N;pm(O);cc(N|0,13088,107)}N=q;O=c[r>>2]|0;vc[c[(c[q>>2]|0)+48>>2]&7](N,O,O+M|0,L)|0;if((M|0)==0){P=0}else{P=(a[c[r>>2]|0]|0)==45}c[u>>2]=0;u=y;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;u=z;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;r=A;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;Dj(f,P,t,v,w,x,y,z,A,B);t=C;C=c[B>>2]|0;if((M|0)>(C|0)){B=a[r]|0;if((B&1)==0){Q=(B&255)>>>1}else{Q=c[A+4>>2]|0}B=a[u]|0;if((B&1)==0){R=(B&255)>>>1}else{R=c[z+4>>2]|0}S=Q+(M-C<<1|1)+R|0}else{R=a[r]|0;if((R&1)==0){T=(R&255)>>>1}else{T=c[A+4>>2]|0}R=a[u]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[z+4>>2]|0}S=T+2+U|0}U=S+C|0;do{if(U>>>0>100){S=Km(U<<2)|0;T=S;if((S|0)!=0){V=T;W=T;break}Wm()}else{V=0;W=t}}while(0);Ej(W,D,E,c[g+4>>2]|0,L,L+(M<<2)|0,N,P,v,c[w>>2]|0,c[x>>2]|0,y,z,A,C);c[F>>2]=c[e>>2];e=c[D>>2]|0;D=c[E>>2]|0;E=m;C=F;c[E+0>>2]=c[C+0>>2];Ah(b,m,W,e,D,g,j);if((V|0)!=0){Lm(V)}He(A);He(z);ve(y);Yd(c[s>>2]|0)|0;if((K|0)!=0){Lm(K)}if((J|0)==0){i=d;return}Lm(J);i=d;return}function Dj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=i;i=i+40|0;o=n;p=n+16|0;q=n+32|0;r=q;s=i;i=i+16|0;t=i;i=i+8|0;u=t;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+8|0;z=y;A=i;i=i+16|0;B=i;i=i+8|0;C=B;D=i;i=i+16|0;E=i;i=i+16|0;F=i;i=i+16|0;G=c[e>>2]|0;if(b){if(!((c[1174]|0)==-1)){c[p>>2]=4696;c[p+4>>2]=118;c[p+8>>2]=0;qe(4696,p,119)}p=(c[4700>>2]|0)+ -1|0;b=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-b>>2>>>0>p>>>0)){H=vb(4)|0;I=H;pm(I);cc(H|0,13088,107)}e=c[b+(p<<2)>>2]|0;if((e|0)==0){H=vb(4)|0;I=H;pm(I);cc(H|0,13088,107)}H=e;I=c[e>>2]|0;if(d){nc[c[I+44>>2]&63](r,H);r=f;p=c[q>>2]|0;a[r]=p;a[r+1|0]=p>>8;a[r+2|0]=p>>16;a[r+3|0]=p>>24;nc[c[(c[e>>2]|0)+32>>2]&63](s,H);p=l;if((a[p]&1)==0){c[l+4>>2]=0;a[p]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ke(l,0);r=s;c[p+0>>2]=c[r+0>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;He(s)}else{nc[c[I+40>>2]&63](u,H);u=f;I=c[t>>2]|0;a[u]=I;a[u+1|0]=I>>8;a[u+2|0]=I>>16;a[u+3|0]=I>>24;nc[c[(c[e>>2]|0)+28>>2]&63](v,H);I=l;if((a[I]&1)==0){c[l+4>>2]=0;a[I]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ke(l,0);u=v;c[I+0>>2]=c[u+0>>2];c[I+4>>2]=c[u+4>>2];c[I+8>>2]=c[u+8>>2];c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;He(v)}v=e;c[g>>2]=pc[c[(c[v>>2]|0)+12>>2]&127](H)|0;c[h>>2]=pc[c[(c[v>>2]|0)+16>>2]&127](H)|0;nc[c[(c[e>>2]|0)+20>>2]&63](w,H);u=j;if((a[u]&1)==0){a[j+1|0]=0;a[u]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}Ae(j,0);I=w;c[u+0>>2]=c[I+0>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;ve(w);nc[c[(c[e>>2]|0)+24>>2]&63](x,H);e=k;if((a[e]&1)==0){c[k+4>>2]=0;a[e]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ke(k,0);w=x;c[e+0>>2]=c[w+0>>2];c[e+4>>2]=c[w+4>>2];c[e+8>>2]=c[w+8>>2];c[w+0>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;He(x);J=pc[c[(c[v>>2]|0)+36>>2]&127](H)|0;c[m>>2]=J;i=n;return}else{if(!((c[1158]|0)==-1)){c[o>>2]=4632;c[o+4>>2]=118;c[o+8>>2]=0;qe(4632,o,119)}o=(c[4636>>2]|0)+ -1|0;H=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-H>>2>>>0>o>>>0)){K=vb(4)|0;L=K;pm(L);cc(K|0,13088,107)}G=c[H+(o<<2)>>2]|0;if((G|0)==0){K=vb(4)|0;L=K;pm(L);cc(K|0,13088,107)}K=G;L=c[G>>2]|0;if(d){nc[c[L+44>>2]&63](z,K);z=f;d=c[y>>2]|0;a[z]=d;a[z+1|0]=d>>8;a[z+2|0]=d>>16;a[z+3|0]=d>>24;nc[c[(c[G>>2]|0)+32>>2]&63](A,K);d=l;if((a[d]&1)==0){c[l+4>>2]=0;a[d]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ke(l,0);z=A;c[d+0>>2]=c[z+0>>2];c[d+4>>2]=c[z+4>>2];c[d+8>>2]=c[z+8>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;He(A)}else{nc[c[L+40>>2]&63](C,K);C=f;f=c[B>>2]|0;a[C]=f;a[C+1|0]=f>>8;a[C+2|0]=f>>16;a[C+3|0]=f>>24;nc[c[(c[G>>2]|0)+28>>2]&63](D,K);f=l;if((a[f]&1)==0){c[l+4>>2]=0;a[f]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ke(l,0);l=D;c[f+0>>2]=c[l+0>>2];c[f+4>>2]=c[l+4>>2];c[f+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;He(D)}D=G;c[g>>2]=pc[c[(c[D>>2]|0)+12>>2]&127](K)|0;c[h>>2]=pc[c[(c[D>>2]|0)+16>>2]&127](K)|0;nc[c[(c[G>>2]|0)+20>>2]&63](E,K);h=j;if((a[h]&1)==0){a[j+1|0]=0;a[h]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}Ae(j,0);j=E;c[h+0>>2]=c[j+0>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ve(E);nc[c[(c[G>>2]|0)+24>>2]&63](F,K);G=k;if((a[G]&1)==0){c[k+4>>2]=0;a[G]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ke(k,0);k=F;c[G+0>>2]=c[k+0>>2];c[G+4>>2]=c[k+4>>2];c[G+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;He(F);J=pc[c[(c[D>>2]|0)+36>>2]&127](K)|0;c[m>>2]=J;i=n;return}}function Ej(b,d,e,f,g,h,j,k,l,m,n,o,p,q,r){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0;s=i;c[e>>2]=b;t=j;u=q;v=q+4|0;w=q+8|0;q=p;x=(f&512|0)==0;y=p+4|0;z=p+8|0;p=(r|0)>0;A=o;B=o+1|0;C=o+8|0;D=o+4|0;o=j;E=g;g=0;while(1){a:do{switch(a[l+g|0]|0){case 1:{c[d>>2]=c[e>>2];F=yc[c[(c[t>>2]|0)+44>>2]&31](j,32)|0;G=c[e>>2]|0;c[e>>2]=G+4;c[G>>2]=F;H=E;break};case 4:{F=c[e>>2]|0;G=k?E+4|0:E;b:do{if(G>>>0<h>>>0){I=G;while(1){J=I+4|0;if(!(jc[c[(c[o>>2]|0)+12>>2]&31](j,2048,c[I>>2]|0)|0)){K=I;break b}if(J>>>0<h>>>0){I=J}else{K=J;break}}}else{K=G}}while(0);if(p){do{if(K>>>0>G>>>0){I=c[e>>2]|0;J=K;L=r;while(1){M=J+ -4|0;N=I+4|0;c[I>>2]=c[M>>2];O=L+ -1|0;P=(O|0)>0;if(M>>>0>G>>>0&P){L=O;J=M;I=N}else{break}}c[e>>2]=N;if(P){Q=M;R=O;S=34;break}I=c[e>>2]|0;c[e>>2]=I+4;T=I;U=M}else{Q=K;R=r;S=34}}while(0);do{if((S|0)==34){S=0;I=yc[c[(c[t>>2]|0)+44>>2]&31](j,48)|0;J=c[e>>2]|0;L=J+4|0;c[e>>2]=L;if((R|0)>0){V=L;W=J;X=R}else{T=J;U=Q;break}while(1){c[W>>2]=I;L=X+ -1|0;if((L|0)>0){X=L;W=V;V=V+4|0}else{break}}c[e>>2]=J+(R+1<<2);T=J+(R<<2)|0;U=Q}}while(0);c[T>>2]=m;Y=U}else{Y=K}if((Y|0)==(G|0)){I=yc[c[(c[t>>2]|0)+44>>2]&31](j,48)|0;L=c[e>>2]|0;Z=L+4|0;c[e>>2]=Z;c[L>>2]=I;_=Z}else{Z=a[A]|0;I=(Z&1)==0;if(I){$=(Z&255)>>>1}else{$=c[D>>2]|0}if(($|0)==0){aa=Y;ba=-1;ca=0;da=0}else{if(I){ea=B}else{ea=c[C>>2]|0}aa=Y;ba=a[ea]|0;ca=0;da=0}while(1){I=c[e>>2]|0;do{if((da|0)==(ba|0)){Z=I+4|0;c[e>>2]=Z;c[I>>2]=n;L=ca+1|0;fa=a[A]|0;ga=(fa&1)==0;if(ga){ha=(fa&255)>>>1}else{ha=c[D>>2]|0}if(!(L>>>0<ha>>>0)){ia=Z;ja=ba;ka=L;la=0;break}if(ga){ma=B}else{ma=c[C>>2]|0}if((a[ma+L|0]|0)==127){ia=Z;ja=-1;ka=L;la=0;break}if(ga){na=B}else{na=c[C>>2]|0}ia=Z;ja=a[na+L|0]|0;ka=L;la=0}else{ia=I;ja=ba;ka=ca;la=da}}while(0);I=aa+ -4|0;J=c[I>>2]|0;L=ia+4|0;c[e>>2]=L;c[ia>>2]=J;if((I|0)==(G|0)){_=L;break}else{aa=I;ba=ja;ca=ka;da=la+1|0}}}if((F|0)==(_|0)){H=G;break a}I=_+ -4|0;if(I>>>0>F>>>0){oa=F;pa=I}else{H=G;break a}while(1){I=c[oa>>2]|0;c[oa>>2]=c[pa>>2];c[pa>>2]=I;I=oa+4|0;L=pa+ -4|0;if(I>>>0<L>>>0){pa=L;oa=I}else{H=G;break}}break};case 3:{G=a[u]|0;F=(G&1)==0;if(F){qa=(G&255)>>>1}else{qa=c[v>>2]|0}if((qa|0)==0){H=E;break a}if(F){ra=v}else{ra=c[w>>2]|0}F=c[ra>>2]|0;G=c[e>>2]|0;c[e>>2]=G+4;c[G>>2]=F;H=E;break};case 0:{c[d>>2]=c[e>>2];H=E;break};case 2:{F=a[q]|0;G=(F&1)==0;if(G){sa=(F&255)>>>1}else{sa=c[y>>2]|0}if((sa|0)==0|x){H=E;break a}if(G){ta=y;ua=(F&255)>>>1}else{ta=c[z>>2]|0;ua=c[y>>2]|0}F=ta+(ua<<2)|0;G=c[e>>2]|0;if((ta|0)==(F|0)){va=G}else{I=(ta+(ua+ -1<<2)+(0-ta)|0)>>>2;L=G;J=ta;while(1){c[L>>2]=c[J>>2];Z=J+4|0;if((Z|0)==(F|0)){break}L=L+4|0;J=Z}va=G+(I+1<<2)|0}c[e>>2]=va;H=E;break};default:{H=E}}}while(0);J=g+1|0;if((J|0)==4){break}else{E=H;g=J}}g=a[u]|0;u=(g&1)==0;if(u){wa=(g&255)>>>1}else{wa=c[v>>2]|0}if(wa>>>0>1){if(u){xa=v;ya=(g&255)>>>1}else{xa=c[w>>2]|0;ya=c[v>>2]|0}v=xa+4|0;w=xa+(ya<<2)|0;g=c[e>>2]|0;if((v|0)==(w|0)){za=g}else{u=(xa+(ya+ -1<<2)+(0-v)|0)>>>2;ya=g;xa=v;while(1){c[ya>>2]=c[xa>>2];v=xa+4|0;if((v|0)==(w|0)){break}else{xa=v;ya=ya+4|0}}za=g+(u+1<<2)|0}c[e>>2]=za}za=f&176;if((za|0)==32){c[d>>2]=c[e>>2];i=s;return}else if((za|0)==16){i=s;return}else{c[d>>2]=b;i=s;return}}function Fj(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;d=i;i=i+40|0;k=d;l=d+8|0;m=d+24|0;n=d+32|0;o=n;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+16|0;s=i;i=i+16|0;t=i;i=i+16|0;u=i;i=i+8|0;v=i;i=i+400|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;Qe(m,g);z=m;A=c[z>>2]|0;if(!((c[1280]|0)==-1)){c[l>>2]=5120;c[l+4>>2]=118;c[l+8>>2]=0;qe(5120,l,119)}l=(c[5124>>2]|0)+ -1|0;B=c[A+8>>2]|0;if(!((c[A+12>>2]|0)-B>>2>>>0>l>>>0)){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}A=c[B+(l<<2)>>2]|0;if((A|0)==0){C=vb(4)|0;D=C;pm(D);cc(C|0,13088,107)}C=A;D=j;l=a[D]|0;B=(l&1)==0;if(B){E=(l&255)>>>1}else{E=c[j+4>>2]|0}if((E|0)==0){F=0}else{if(B){G=j+4|0}else{G=c[j+8>>2]|0}B=c[G>>2]|0;F=(B|0)==(yc[c[(c[A>>2]|0)+44>>2]&31](C,45)|0)}c[n>>2]=0;n=r;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;n=s;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;A=t;c[A+0>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;Dj(f,F,m,o,p,q,r,s,t,u);m=v;v=a[D]|0;D=(v&1)==0;if(D){H=(v&255)>>>1}else{H=c[j+4>>2]|0}f=c[u>>2]|0;if((H|0)>(f|0)){if(D){I=(v&255)>>>1}else{I=c[j+4>>2]|0}D=a[A]|0;if((D&1)==0){J=(D&255)>>>1}else{J=c[t+4>>2]|0}D=a[n]|0;if((D&1)==0){K=(D&255)>>>1}else{K=c[s+4>>2]|0}L=J+(I-f<<1|1)+K|0}else{K=a[A]|0;if((K&1)==0){M=(K&255)>>>1}else{M=c[t+4>>2]|0}K=a[n]|0;if((K&1)==0){N=(K&255)>>>1}else{N=c[s+4>>2]|0}L=M+2+N|0}N=L+f|0;do{if(N>>>0>100){L=Km(N<<2)|0;M=L;if((L|0)!=0){O=M;P=M;break}Wm()}else{O=0;P=m}}while(0);if((v&1)==0){Q=j+4|0;R=(v&255)>>>1}else{Q=c[j+8>>2]|0;R=c[j+4>>2]|0}Ej(P,w,x,c[g+4>>2]|0,Q,Q+(R<<2)|0,C,F,o,c[p>>2]|0,c[q>>2]|0,r,s,t,f);c[y>>2]=c[e>>2];e=c[w>>2]|0;w=c[x>>2]|0;x=k;f=y;c[x+0>>2]=c[f+0>>2];Ah(b,k,P,e,w,g,h);if((O|0)==0){He(t);He(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}Lm(O);He(t);He(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}function Gj(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Hj(a){a=a|0;i=i;return}function Ij(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=rb(f|0,1)|0;i=e;return d>>>((d|0)!=(-1|0)|0)|0}function Jj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;i=i+16|0;j=d;k=j;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;l=a[h]|0;if((l&1)==0){m=h+1|0;n=h+1|0;o=(l&255)>>>1}else{l=c[h+8>>2]|0;m=l;n=l;o=c[h+4>>2]|0}h=m+o|0;do{if(n>>>0<h>>>0){o=n;do{Be(j,a[o]|0);o=o+1|0;}while((o|0)!=(h|0));o=(e|0)==-1?-1:e<<1;if((a[k]&1)==0){p=o;q=9;break}r=o;s=c[j+8>>2]|0}else{p=(e|0)==-1?-1:e<<1;q=9}}while(0);if((q|0)==9){r=p;s=j+1|0}p=Ub(r|0,f|0,g|0,s|0)|0;s=b;c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;s=on(p|0)|0;g=p+s|0;if((s|0)>0){t=p}else{ve(j);i=d;return}do{Be(b,a[t]|0);t=t+1|0;}while((t|0)!=(g|0));ve(j);i=d;return}function Kj(a,b){a=a|0;b=b|0;a=i;Xa(((b|0)==-1?-1:b<<1)|0)|0;i=a;return}function Lj(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Mj(a){a=a|0;i=i;return}function Nj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=rb(f|0,1)|0;i=e;return d>>>((d|0)!=(-1|0)|0)|0}function Oj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;d=i;i=i+240|0;j=d;k=d+8|0;l=d+40|0;m=d+48|0;n=d+56|0;o=d+64|0;p=d+192|0;q=d+200|0;r=d+208|0;s=d+224|0;t=d+232|0;u=r;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[s+4>>2]=0;c[s>>2]=6784;v=a[h]|0;if((v&1)==0){w=h+4|0;x=h+4|0;y=(v&255)>>>1}else{v=c[h+8>>2]|0;w=v;x=v;y=c[h+4>>2]|0}h=w+(y<<2)|0;y=k;w=j;v=j;c[v>>2]=0;c[v+4>>2]=0;a:do{if(x>>>0<h>>>0){v=s;j=s;z=k+32|0;A=x;B=6784|0;while(1){c[m>>2]=A;C=(uc[c[B+12>>2]&15](v,w,A,h,m,y,z,l)|0)==2;D=c[m>>2]|0;if(C|(D|0)==(A|0)){break}if(y>>>0<(c[l>>2]|0)>>>0){C=y;do{Be(r,a[C]|0);C=C+1|0;}while(C>>>0<(c[l>>2]|0)>>>0);E=c[m>>2]|0}else{E=D}if(!(E>>>0<h>>>0)){break a}A=E;B=c[j>>2]|0}ij(6008)}}while(0);if((a[u]&1)==0){F=r+1|0}else{F=c[r+8>>2]|0}u=Ub(((e|0)==-1?-1:e<<1)|0,f|0,g|0,F|0)|0;F=b;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;c[t+4>>2]=0;c[t>>2]=6888;F=on(u|0)|0;g=u+F|0;f=n;e=n;c[e>>2]=0;c[e+4>>2]=0;if((F|0)<=0){ve(r);i=d;return}F=t;e=t;t=g;n=o;E=o+128|0;o=u;u=6888|0;while(1){c[q>>2]=o;h=(uc[c[u+16>>2]&15](F,f,o,(t-o|0)>32?o+32|0:g,q,n,E,p)|0)==2;m=c[q>>2]|0;if(h|(m|0)==(o|0)){G=20;break}if(n>>>0<(c[p>>2]|0)>>>0){h=n;do{Le(b,c[h>>2]|0);h=h+4|0;}while(h>>>0<(c[p>>2]|0)>>>0);H=c[q>>2]|0}else{H=m}if(!(H>>>0<g>>>0)){G=25;break}o=H;u=c[e>>2]|0}if((G|0)==20){ij(6008)}else if((G|0)==25){ve(r);i=d;return}}function Pj(a,b){a=a|0;b=b|0;a=i;Xa(((b|0)==-1?-1:b<<1)|0)|0;i=a;return}function Qj(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=5216;e=b+8|0;b=c[e>>2]|0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);if((b|0)==(c[1254]|0)){i=d;return}ib(c[e>>2]|0);i=d;return}function Rj(a){a=a|0;a=vb(8)|0;Zd(a,5008);c[a>>2]=2056;cc(a|0,2096,19)}function Sj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;e=i;i=i+448|0;f=e;g=e+16|0;h=e+32|0;j=e+48|0;k=e+64|0;l=e+80|0;m=e+96|0;n=e+112|0;o=e+128|0;p=e+144|0;q=e+160|0;r=e+176|0;s=e+192|0;t=e+208|0;u=e+224|0;v=e+240|0;w=e+256|0;x=e+272|0;y=e+288|0;z=e+304|0;A=e+320|0;B=e+336|0;C=e+352|0;D=e+368|0;E=e+384|0;F=e+400|0;G=e+416|0;H=e+432|0;c[b+4>>2]=d+ -1;c[b>>2]=5048;d=b+8|0;I=b+12|0;J=b+136|0;a[J]=1;K=b+24|0;c[I>>2]=K;c[d>>2]=K;c[b+16>>2]=J;J=28;L=K;do{if((L|0)==0){M=0}else{c[L>>2]=0;M=c[I>>2]|0}L=M+4|0;c[I>>2]=L;J=J+ -1|0;}while((J|0)!=0);te(b+144|0,5032,1);J=c[d>>2]|0;d=c[I>>2]|0;if((d|0)!=(J|0)){c[I>>2]=d+(~((d+ -4+(0-J)|0)>>>2)<<2)}c[9940>>2]=0;c[2484]=3528;if(!((c[888]|0)==-1)){c[G>>2]=3552;c[G+4>>2]=118;c[G+8>>2]=0;qe(3552,G,119)}Tj(b,9936,(c[3556>>2]|0)+ -1|0);c[9932>>2]=0;c[2482]=3568;if(!((c[898]|0)==-1)){c[F>>2]=3592;c[F+4>>2]=118;c[F+8>>2]=0;qe(3592,F,119)}Tj(b,9928,(c[3596>>2]|0)+ -1|0);c[9916>>2]=0;c[2478]=5144;c[9920>>2]=0;a[9924|0]=0;c[9920>>2]=c[(tb()|0)>>2];if(!((c[1282]|0)==-1)){c[E>>2]=5128;c[E+4>>2]=118;c[E+8>>2]=0;qe(5128,E,119)}Tj(b,9912,(c[5132>>2]|0)+ -1|0);c[9908>>2]=0;c[2476]=6104;if(!((c[1280]|0)==-1)){c[D>>2]=5120;c[D+4>>2]=118;c[D+8>>2]=0;qe(5120,D,119)}Tj(b,9904,(c[5124>>2]|0)+ -1|0);c[9900>>2]=0;c[2474]=6320;if(!((c[1298]|0)==-1)){c[C>>2]=5192;c[C+4>>2]=118;c[C+8>>2]=0;qe(5192,C,119)}Tj(b,9896,(c[5196>>2]|0)+ -1|0);c[9884>>2]=0;c[2470]=5216;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);c[9888>>2]=c[1254];if(!((c[1300]|0)==-1)){c[B>>2]=5200;c[B+4>>2]=118;c[B+8>>2]=0;qe(5200,B,119)}Tj(b,9880,(c[5204>>2]|0)+ -1|0);c[9876>>2]=0;c[2468]=6544;if(!((c[1314]|0)==-1)){c[A>>2]=5256;c[A+4>>2]=118;c[A+8>>2]=0;qe(5256,A,119)}Tj(b,9872,(c[5260>>2]|0)+ -1|0);c[9868>>2]=0;c[2466]=6664;if(!((c[1316]|0)==-1)){c[z>>2]=5264;c[z+4>>2]=118;c[z+8>>2]=0;qe(5264,z,119)}Tj(b,9864,(c[5268>>2]|0)+ -1|0);c[9844>>2]=0;c[2460]=5296;a[9848|0]=46;a[9849|0]=44;c[9852>>2]=0;c[9856>>2]=0;c[9860>>2]=0;if(!((c[1318]|0)==-1)){c[y>>2]=5272;c[y+4>>2]=118;c[y+8>>2]=0;qe(5272,y,119)}Tj(b,9840,(c[5276>>2]|0)+ -1|0);c[9812>>2]=0;c[2452]=5336;c[9816>>2]=46;c[9820>>2]=44;c[9824>>2]=0;c[9828>>2]=0;c[9832>>2]=0;if(!((c[1320]|0)==-1)){c[x>>2]=5280;c[x+4>>2]=118;c[x+8>>2]=0;qe(5280,x,119)}Tj(b,9808,(c[5284>>2]|0)+ -1|0);c[9804>>2]=0;c[2450]=3608;if(!((c[916]|0)==-1)){c[w>>2]=3664;c[w+4>>2]=118;c[w+8>>2]=0;qe(3664,w,119)}Tj(b,9800,(c[3668>>2]|0)+ -1|0);c[9796>>2]=0;c[2448]=3728;if(!((c[946]|0)==-1)){c[v>>2]=3784;c[v+4>>2]=118;c[v+8>>2]=0;qe(3784,v,119)}Tj(b,9792,(c[3788>>2]|0)+ -1|0);c[9788>>2]=0;c[2446]=3800;if(!((c[962]|0)==-1)){c[u>>2]=3848;c[u+4>>2]=118;c[u+8>>2]=0;qe(3848,u,119)}Tj(b,9784,(c[3852>>2]|0)+ -1|0);c[9780>>2]=0;c[2444]=3864;if(!((c[978]|0)==-1)){c[t>>2]=3912;c[t+4>>2]=118;c[t+8>>2]=0;qe(3912,t,119)}Tj(b,9776,(c[3916>>2]|0)+ -1|0);c[9772>>2]=0;c[2442]=4456;if(!((c[1126]|0)==-1)){c[s>>2]=4504;c[s+4>>2]=118;c[s+8>>2]=0;qe(4504,s,119)}Tj(b,9768,(c[4508>>2]|0)+ -1|0);c[9764>>2]=0;c[2440]=4520;if(!((c[1142]|0)==-1)){c[r>>2]=4568;c[r+4>>2]=118;c[r+8>>2]=0;qe(4568,r,119)}Tj(b,9760,(c[4572>>2]|0)+ -1|0);c[9756>>2]=0;c[2438]=4584;if(!((c[1158]|0)==-1)){c[q>>2]=4632;c[q+4>>2]=118;c[q+8>>2]=0;qe(4632,q,119)}Tj(b,9752,(c[4636>>2]|0)+ -1|0);c[9748>>2]=0;c[2436]=4648;if(!((c[1174]|0)==-1)){c[p>>2]=4696;c[p+4>>2]=118;c[p+8>>2]=0;qe(4696,p,119)}Tj(b,9744,(c[4700>>2]|0)+ -1|0);c[9740>>2]=0;c[2434]=4712;if(!((c[1184]|0)==-1)){c[o>>2]=4736;c[o+4>>2]=118;c[o+8>>2]=0;qe(4736,o,119)}Tj(b,9736,(c[4740>>2]|0)+ -1|0);c[9732>>2]=0;c[2432]=4792;if(!((c[1204]|0)==-1)){c[n>>2]=4816;c[n+4>>2]=118;c[n+8>>2]=0;qe(4816,n,119)}Tj(b,9728,(c[4820>>2]|0)+ -1|0);c[9724>>2]=0;c[2430]=4848;if(!((c[1218]|0)==-1)){c[m>>2]=4872;c[m+4>>2]=118;c[m+8>>2]=0;qe(4872,m,119)}Tj(b,9720,(c[4876>>2]|0)+ -1|0);c[9716>>2]=0;c[2428]=4896;if(!((c[1230]|0)==-1)){c[l>>2]=4920;c[l+4>>2]=118;c[l+8>>2]=0;qe(4920,l,119)}Tj(b,9712,(c[4924>>2]|0)+ -1|0);c[9700>>2]=0;c[2424]=3944;c[9704>>2]=3992;if(!((c[1006]|0)==-1)){c[k>>2]=4024;c[k+4>>2]=118;c[k+8>>2]=0;qe(4024,k,119)}Tj(b,9696,(c[4028>>2]|0)+ -1|0);c[9684>>2]=0;c[2420]=4096;c[9688>>2]=4144;if(!((c[1044]|0)==-1)){c[j>>2]=4176;c[j+4>>2]=118;c[j+8>>2]=0;qe(4176,j,119)}Tj(b,9680,(c[4180>>2]|0)+ -1|0);c[9668>>2]=0;c[2416]=6040;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);c[9672>>2]=c[1254];c[2416]=4392;if(!((c[1102]|0)==-1)){c[h>>2]=4408;c[h+4>>2]=118;c[h+8>>2]=0;qe(4408,h,119)}Tj(b,9664,(c[4412>>2]|0)+ -1|0);c[9652>>2]=0;c[2412]=6040;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);c[9656>>2]=c[1254];c[2412]=4424;if(!((c[1110]|0)==-1)){c[g>>2]=4440;c[g+4>>2]=118;c[g+8>>2]=0;qe(4440,g,119)}Tj(b,9648,(c[4444>>2]|0)+ -1|0);c[9644>>2]=0;c[2410]=4936;if(!((c[1240]|0)==-1)){c[f>>2]=4960;c[f+4>>2]=118;c[f+8>>2]=0;qe(4960,f,119)}Tj(b,9640,(c[4964>>2]|0)+ -1|0);c[9636>>2]=0;c[2408]=4976;if((c[1250]|0)==-1){N=c[5004>>2]|0;O=N+ -1|0;Tj(b,9632,O);i=e;return}c[H>>2]=5e3;c[H+4>>2]=118;c[H+8>>2]=0;qe(5e3,H,119);N=c[5004>>2]|0;O=N+ -1|0;Tj(b,9632,O);i=e;return}function Tj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;Xd(b);f=a+8|0;g=a+12|0;a=c[g>>2]|0;h=f;j=c[h>>2]|0;k=a-j>>2;do{if(k>>>0>d>>>0){l=j}else{m=d+1|0;if(k>>>0<m>>>0){Xl(f,m-k|0);l=c[h>>2]|0;break}if(!(k>>>0>m>>>0)){l=j;break}n=j+(m<<2)|0;if((a|0)==(n|0)){l=j;break}c[g>>2]=a+(~((a+ -4+(0-n)|0)>>>2)<<2);l=j}}while(0);j=c[l+(d<<2)>>2]|0;if((j|0)==0){o=l;p=o+(d<<2)|0;c[p>>2]=b;i=e;return}Yd(j)|0;o=c[h>>2]|0;p=o+(d<<2)|0;c[p>>2]=b;i=e;return}function Uj(a){a=a|0;var b=0;b=i;Vj(a);Rm(a);i=b;return}function Vj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;d=i;c[b>>2]=5048;e=b+12|0;f=c[e>>2]|0;g=b+8|0;h=c[g>>2]|0;if((f|0)!=(h|0)){j=f;f=h;h=0;while(1){k=c[f+(h<<2)>>2]|0;if((k|0)==0){l=f;m=j}else{Yd(k)|0;l=c[g>>2]|0;m=c[e>>2]|0}k=h+1|0;if(k>>>0<m-l>>2>>>0){j=m;f=l;h=k}else{break}}}ve(b+144|0);h=c[g>>2]|0;if((h|0)==0){i=d;return}g=c[e>>2]|0;if((g|0)!=(h|0)){c[e>>2]=g+(~((g+ -4+(0-h)|0)>>>2)<<2)}if((b+24|0)==(h|0)){a[b+136|0]=0;i=d;return}else{Rm(h);i=d;return}}function Wj(){var b=0,d=0,e=0;b=i;if((a[5104]|0)!=0){d=c[1274]|0;i=b;return d|0}if((Ga(5104)|0)==0){d=c[1274]|0;i=b;return d|0}do{if((a[5080]|0)==0){if((Ga(5080)|0)==0){break}Sj(9472,1);c[1266]=9472;c[1268]=5064;cb(5080)}}while(0);e=c[c[1268]>>2]|0;c[1272]=e;Xd(e);c[1274]=5088;cb(5104);d=c[1274]|0;i=b;return d|0}function Xj(a){a=a|0;var b=0,d=0;b=i;d=c[(Wj()|0)>>2]|0;c[a>>2]=d;Xd(d);i=b;return}function Yj(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;e=c[b>>2]|0;c[a>>2]=e;Xd(e);i=d;return}function Zj(a){a=a|0;var b=0;b=i;Yd(c[a>>2]|0)|0;i=b;return}function _j(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d;f=c[a>>2]|0;a=b;if(!((c[a>>2]|0)==-1)){c[e>>2]=b;c[e+4>>2]=118;c[e+8>>2]=0;qe(a,e,119)}e=(c[b+4>>2]|0)+ -1|0;b=c[f+8>>2]|0;if(!((c[f+12>>2]|0)-b>>2>>>0>e>>>0)){g=vb(4)|0;h=g;pm(h);cc(g|0,13088,107)}f=c[b+(e<<2)>>2]|0;if((f|0)==0){g=vb(4)|0;h=g;pm(h);cc(g|0,13088,107)}else{i=d;return f|0}return 0}function $j(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function ak(a){a=a|0;var b=0;b=i;if((a|0)==0){i=b;return}mc[c[(c[a>>2]|0)+4>>2]&255](a);i=b;return}function bk(a){a=a|0;var b=0;b=c[1278]|0;c[1278]=b+1;c[a+4>>2]=b+1;i=i;return}function ck(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function dk(a,d,e){a=a|0;d=d|0;e=e|0;var f=0;a=i;if(!(e>>>0<128)){f=0;i=a;return f|0}f=(b[(c[(tb()|0)>>2]|0)+(e<<1)>>1]&d)<<16>>16!=0;i=a;return f|0}function ek(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;a=i;if((d|0)==(e|0)){g=d;i=a;return g|0}else{h=d;j=f}while(1){f=c[h>>2]|0;if(f>>>0<128){k=b[(c[(tb()|0)>>2]|0)+(f<<1)>>1]|0}else{k=0}b[j>>1]=k;f=h+4|0;if((f|0)==(e|0)){g=e;break}else{h=f;j=j+2|0}}i=a;return g|0}function fk(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;a=i;a:do{if((e|0)==(f|0)){g=e}else{h=e;while(1){j=c[h>>2]|0;if(j>>>0<128){if(!((b[(c[(tb()|0)>>2]|0)+(j<<1)>>1]&d)<<16>>16==0)){g=h;break a}}j=h+4|0;if((j|0)==(f|0)){g=f;break}else{h=j}}}}while(0);i=a;return g|0}function gk(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;a=i;a:do{if((e|0)==(f|0)){g=e}else{h=e;while(1){j=c[h>>2]|0;if(!(j>>>0<128)){g=h;break a}k=h+4|0;if((b[(c[(tb()|0)>>2]|0)+(j<<1)>>1]&d)<<16>>16==0){g=h;break a}if((k|0)==(f|0)){g=f;break}else{h=k}}}}while(0);i=a;return g|0}function hk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b>>>0<128)){d=b;i=a;return d|0}d=c[(c[(Ja()|0)>>2]|0)+(b<<2)>>2]|0;i=a;return d|0}function ik(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;a=i;if((b|0)==(d|0)){e=b;i=a;return e|0}else{f=b}while(1){b=c[f>>2]|0;if(b>>>0<128){g=c[(c[(Ja()|0)>>2]|0)+(b<<2)>>2]|0}else{g=b}c[f>>2]=g;b=f+4|0;if((b|0)==(d|0)){e=d;break}else{f=b}}i=a;return e|0}function jk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b>>>0<128)){d=b;i=a;return d|0}d=c[(c[(Yb()|0)>>2]|0)+(b<<2)>>2]|0;i=a;return d|0}function kk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;a=i;if((b|0)==(d|0)){e=b;i=a;return e|0}else{f=b}while(1){b=c[f>>2]|0;if(b>>>0<128){g=c[(c[(Yb()|0)>>2]|0)+(b<<2)>>2]|0}else{g=b}c[f>>2]=g;b=f+4|0;if((b|0)==(d|0)){e=d;break}else{f=b}}i=a;return e|0}function lk(a,b){a=a|0;b=b|0;i=i;return b<<24>>24|0}function mk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;b=i;if((d|0)==(e|0)){g=d;i=b;return g|0}else{h=d;j=f}while(1){c[j>>2]=a[h]|0;f=h+1|0;if((f|0)==(e|0)){g=e;break}else{j=j+4|0;h=f}}i=b;return g|0}function nk(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return(b>>>0<128?b&255:c)|0}function ok(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0;b=i;if((d|0)==(e|0)){h=d;i=b;return h|0}j=((e+ -4+(0-d)|0)>>>2)+1|0;k=d;l=g;while(1){g=c[k>>2]|0;a[l]=g>>>0<128?g&255:f;g=k+4|0;if((g|0)==(e|0)){break}else{l=l+1|0;k=g}}h=d+(j<<2)|0;i=b;return h|0}function pk(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=5144;e=c[b+8>>2]|0;do{if((e|0)!=0){if((a[b+12|0]|0)==0){break}Sm(e)}}while(0);Rm(b);i=d;return}function qk(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=5144;e=c[b+8>>2]|0;if((e|0)==0){i=d;return}if((a[b+12|0]|0)==0){i=d;return}Sm(e);i=d;return}function rk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b<<24>>24>-1)){d=b;i=a;return d|0}d=c[(c[(Ja()|0)>>2]|0)+((b&255)<<2)>>2]&255;i=a;return d|0}function sk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;b=i;if((d|0)==(e|0)){f=d;i=b;return f|0}else{g=d}while(1){d=a[g]|0;if(d<<24>>24>-1){h=c[(c[(Ja()|0)>>2]|0)+(d<<24>>24<<2)>>2]&255}else{h=d}a[g]=h;d=g+1|0;if((d|0)==(e|0)){f=e;break}else{g=d}}i=b;return f|0}function tk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b<<24>>24>-1)){d=b;i=a;return d|0}d=c[(c[(Yb()|0)>>2]|0)+(b<<24>>24<<2)>>2]&255;i=a;return d|0}function uk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;b=i;if((d|0)==(e|0)){f=d;i=b;return f|0}else{g=d}while(1){d=a[g]|0;if(d<<24>>24>-1){h=c[(c[(Yb()|0)>>2]|0)+(d<<24>>24<<2)>>2]&255}else{h=d}a[g]=h;d=g+1|0;if((d|0)==(e|0)){f=e;break}else{g=d}}i=b;return f|0}function vk(a,b){a=a|0;b=b|0;i=i;return b|0}function wk(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;b=i;if((c|0)==(d|0)){f=c}else{g=c;c=e;while(1){a[c]=a[g]|0;e=g+1|0;if((e|0)==(d|0)){f=d;break}else{c=c+1|0;g=e}}}i=b;return f|0}function xk(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return(b<<24>>24>-1?b:c)|0}function yk(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;b=i;if((c|0)==(d|0)){g=c;i=b;return g|0}else{h=c;j=f}while(1){f=a[h]|0;a[j]=f<<24>>24>-1?f:e;f=h+1|0;if((f|0)==(d|0)){g=d;break}else{j=j+1|0;h=f}}i=b;return g|0}function zk(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Ak(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;c[f>>2]=d;c[j>>2]=g;i=i;return 3}function Bk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;c[f>>2]=d;c[j>>2]=g;i=i;return 3}function Ck(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function Dk(a){a=a|0;i=i;return 1}function Ek(a){a=a|0;i=i;return 1}function Fk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=d-c|0;i=i;return(b>>>0<e>>>0?b:e)|0}function Gk(a){a=a|0;i=i;return 1}function Hk(a){a=a|0;var b=0;b=i;Qj(a);Rm(a);i=b;return}function Ik(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;l=i;i=i+8|0;m=l;n=m;o=i;i=i+8|0;p=(e|0)==(f|0);a:do{if(p){c[k>>2]=h;c[g>>2]=e;q=e}else{r=e;while(1){s=r+4|0;if((c[r>>2]|0)==0){t=r;break}if((s|0)==(f|0)){t=f;break}else{r=s}}c[k>>2]=h;c[g>>2]=e;if(p|(h|0)==(j|0)){q=e;break}r=d;s=j;u=b+8|0;v=o;w=e;x=h;y=t;while(1){z=r;A=c[z+4>>2]|0;B=m;c[B>>2]=c[z>>2];c[B+4>>2]=A;A=zb(c[u>>2]|0)|0;B=im(x,g,y-w>>2,s-x|0,d)|0;if((A|0)!=0){zb(A|0)|0}if((B|0)==-1){C=10;break}else if((B|0)==0){D=1;C=33;break}A=(c[k>>2]|0)+B|0;c[k>>2]=A;if((A|0)==(j|0)){C=31;break}if((y|0)==(f|0)){E=c[g>>2]|0;F=A;G=f}else{A=zb(c[u>>2]|0)|0;B=hm(v,0,d)|0;if((A|0)!=0){zb(A|0)|0}if((B|0)==-1){D=2;C=33;break}A=c[k>>2]|0;if(B>>>0>(s-A|0)>>>0){D=1;C=33;break}b:do{if((B|0)!=0){z=A;H=B;I=v;while(1){J=a[I]|0;c[k>>2]=z+1;a[z]=J;J=H+ -1|0;if((J|0)==0){break b}z=c[k>>2]|0;I=I+1|0;H=J}}}while(0);B=(c[g>>2]|0)+4|0;c[g>>2]=B;c:do{if((B|0)==(f|0)){K=f}else{A=B;while(1){H=A+4|0;if((c[A>>2]|0)==0){K=A;break c}if((H|0)==(f|0)){K=f;break}else{A=H}}}}while(0);E=B;F=c[k>>2]|0;G=K}if((E|0)==(f|0)|(F|0)==(j|0)){q=E;break a}else{w=E;x=F;y=G}}if((C|0)==10){c[k>>2]=x;d:do{if((w|0)==(c[g>>2]|0)){L=w}else{y=w;v=x;while(1){s=c[y>>2]|0;r=zb(c[u>>2]|0)|0;A=hm(v,s,n)|0;if((r|0)!=0){zb(r|0)|0}if((A|0)==-1){L=y;break d}r=(c[k>>2]|0)+A|0;c[k>>2]=r;A=y+4|0;if((A|0)==(c[g>>2]|0)){L=A;break}else{y=A;v=r}}}}while(0);c[g>>2]=L;D=2;i=l;return D|0}else if((C|0)==31){q=c[g>>2]|0;break}else if((C|0)==33){i=l;return D|0}}}while(0);D=(q|0)!=(f|0)|0;i=l;return D|0}function Jk(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;l=i;i=i+8|0;m=l;n=m;o=(e|0)==(f|0);a:do{if(o){c[k>>2]=h;c[g>>2]=e;p=e}else{q=e;while(1){r=q+1|0;if((a[q]|0)==0){s=q;break}if((r|0)==(f|0)){s=f;break}else{q=r}}c[k>>2]=h;c[g>>2]=e;if(o|(h|0)==(j|0)){p=e;break}q=d;r=j;t=b+8|0;u=e;v=h;w=s;while(1){x=q;y=c[x+4>>2]|0;z=m;c[z>>2]=c[x>>2];c[z+4>>2]=y;A=w;y=zb(c[t>>2]|0)|0;z=em(v,g,A-u|0,r-v>>2,d)|0;if((y|0)!=0){zb(y|0)|0}if((z|0)==-1){B=10;break}else if((z|0)==0){C=2;B=32;break}y=(c[k>>2]|0)+(z<<2)|0;c[k>>2]=y;if((y|0)==(j|0)){B=30;break}z=c[g>>2]|0;if((w|0)==(f|0)){D=z;E=y;F=f}else{x=zb(c[t>>2]|0)|0;G=dm(y,z,1,d)|0;if((x|0)!=0){zb(x|0)|0}if((G|0)!=0){C=2;B=32;break}c[k>>2]=(c[k>>2]|0)+4;G=(c[g>>2]|0)+1|0;c[g>>2]=G;b:do{if((G|0)==(f|0)){H=f}else{x=G;while(1){z=x+1|0;if((a[x]|0)==0){H=x;break b}if((z|0)==(f|0)){H=f;break}else{x=z}}}}while(0);D=G;E=c[k>>2]|0;F=H}if((D|0)==(f|0)|(E|0)==(j|0)){p=D;break a}else{u=D;v=E;w=F}}if((B|0)==10){c[k>>2]=v;c:do{if((u|0)==(c[g>>2]|0)){I=u}else{w=u;r=v;while(1){q=zb(c[t>>2]|0)|0;x=dm(r,w,A-w|0,n)|0;if((q|0)!=0){zb(q|0)|0}if((x|0)==-1){B=15;break}else if((x|0)==-2){B=16;break}else if((x|0)==0){J=w+1|0}else{J=w+x|0}x=(c[k>>2]|0)+4|0;c[k>>2]=x;if((J|0)==(c[g>>2]|0)){I=J;break c}else{w=J;r=x}}if((B|0)==15){c[g>>2]=w;C=2;i=l;return C|0}else if((B|0)==16){c[g>>2]=w;C=1;i=l;return C|0}}}while(0);c[g>>2]=I;C=(I|0)!=(f|0)|0;i=l;return C|0}else if((B|0)==30){p=c[g>>2]|0;break}else if((B|0)==32){i=l;return C|0}}}while(0);C=(p|0)!=(f|0)|0;i=l;return C|0}function Kk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+8|0;c[g>>2]=e;e=h;j=zb(c[b+8>>2]|0)|0;b=hm(e,0,d)|0;if((j|0)!=0){zb(j|0)|0}if((b|0)==0|(b|0)==-1){k=2;i=h;return k|0}j=b+ -1|0;b=c[g>>2]|0;if(j>>>0>(f-b|0)>>>0){k=1;i=h;return k|0}if((j|0)==0){k=0;i=h;return k|0}else{l=b;m=j;n=e}while(1){e=a[n]|0;c[g>>2]=l+1;a[l]=e;e=m+ -1|0;if((e|0)==0){k=0;break}l=c[g>>2]|0;n=n+1|0;m=e}i=h;return k|0}function Lk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;d=a+8|0;a=zb(c[d>>2]|0)|0;e=gm(0,0,4)|0;if((a|0)!=0){zb(a|0)|0}do{if((e|0)==0){a=c[d>>2]|0;if((a|0)==0){f=1;break}g=zb(a|0)|0;if((g|0)==0){f=0;break}zb(g|0)|0;f=0}else{f=-1}}while(0);i=b;return f|0}function Mk(a){a=a|0;i=i;return 0}function Nk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;if((f|0)==0|(d|0)==(e|0)){h=0;i=g;return h|0}j=e;k=a+8|0;a=d;d=0;l=0;while(1){m=zb(c[k>>2]|0)|0;n=cm(a,j-a|0,b)|0;if((m|0)!=0){zb(m|0)|0}if((n|0)==0){o=a+1|0;p=1}else if((n|0)==-2|(n|0)==-1){h=d;q=9;break}else{o=a+n|0;p=n}n=p+d|0;m=l+1|0;if(m>>>0>=f>>>0|(o|0)==(e|0)){h=n;q=9;break}else{a=o;d=n;l=m}}if((q|0)==9){i=g;return h|0}return 0}function Ok(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a+8>>2]|0;do{if((d|0)==0){e=1}else{a=zb(d|0)|0;if((a|0)==0){e=4;break}zb(a|0)|0;e=4}}while(0);i=b;return e|0}function Pk(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Qk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Rk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d>>1<<1);c[j>>2]=g+((c[k>>2]|0)-g);i=b;return l|0}function Rk(d,f,g,h,j,k,l,m){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;c[g>>2]=d;c[k>>2]=h;do{if((m&2|0)!=0){if((j-h|0)<3){o=1;i=n;return o|0}else{c[k>>2]=h+1;a[h]=-17;d=c[k>>2]|0;c[k>>2]=d+1;a[d]=-69;d=c[k>>2]|0;c[k>>2]=d+1;a[d]=-65;break}}}while(0);h=f;m=c[g>>2]|0;if(!(m>>>0<f>>>0)){o=0;i=n;return o|0}d=j;j=m;a:while(1){m=b[j>>1]|0;p=m&65535;if(p>>>0>l>>>0){o=2;q=26;break}do{if((m&65535)<128){r=c[k>>2]|0;if((d-r|0)<1){o=1;q=26;break a}c[k>>2]=r+1;a[r]=m}else{if((m&65535)<2048){r=c[k>>2]|0;if((d-r|0)<2){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>6|192;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if((m&65535)<55296){r=c[k>>2]|0;if((d-r|0)<3){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>12|224;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p>>>6&63|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if(!((m&65535)<56320)){if((m&65535)<57344){o=2;q=26;break a}r=c[k>>2]|0;if((d-r|0)<3){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>12|224;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p>>>6&63|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if((h-j|0)<4){o=1;q=26;break a}r=j+2|0;s=e[r>>1]|0;if((s&64512|0)!=56320){o=2;q=26;break a}if((d-(c[k>>2]|0)|0)<4){o=1;q=26;break a}t=p&960;if(((t<<10)+65536|p<<10&64512|s&1023)>>>0>l>>>0){o=2;q=26;break a}c[g>>2]=r;r=(t>>>6)+1|0;t=c[k>>2]|0;c[k>>2]=t+1;a[t]=r>>>2|240;t=c[k>>2]|0;c[k>>2]=t+1;a[t]=p>>>2&15|r<<4&48|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p<<4&48|s>>>6&15|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=s&63|128}}while(0);p=(c[g>>2]|0)+2|0;c[g>>2]=p;if(p>>>0<f>>>0){j=p}else{o=0;q=26;break}}if((q|0)==26){i=n;return o|0}return 0}function Sk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Tk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d);c[j>>2]=g+((c[k>>2]|0)-g>>1<<1);i=b;return l|0}function Tk(e,f,g,h,j,k,l,m){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;n=i;c[g>>2]=e;c[k>>2]=h;h=c[g>>2]|0;do{if((m&4|0)==0){o=h}else{if((f-h|0)<=2){o=h;break}if(!((a[h]|0)==-17)){o=h;break}if(!((a[h+1|0]|0)==-69)){o=h;break}if(!((a[h+2|0]|0)==-65)){o=h;break}e=h+3|0;c[g>>2]=e;o=e}}while(0);a:do{if(o>>>0<f>>>0){h=f;m=j;e=o;p=c[k>>2]|0;b:while(1){if(!(p>>>0<j>>>0)){q=e;break a}r=a[e]|0;s=r&255;if(s>>>0>l>>>0){t=2;u=41;break}do{if(r<<24>>24>-1){b[p>>1]=r&255;c[g>>2]=e+1}else{if((r&255)<194){t=2;u=41;break b}if((r&255)<224){if((h-e|0)<2){t=1;u=41;break b}v=d[e+1|0]|0;if((v&192|0)!=128){t=2;u=41;break b}w=v&63|s<<6&1984;if(w>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=w;c[g>>2]=e+2;break}if((r&255)<240){if((h-e|0)<3){t=1;u=41;break b}w=a[e+1|0]|0;v=a[e+2|0]|0;if((s|0)==224){if(!((w&-32)<<24>>24==-96)){t=2;u=41;break b}}else if((s|0)==237){if(!((w&-32)<<24>>24==-128)){t=2;u=41;break b}}else{if(!((w&-64)<<24>>24==-128)){t=2;u=41;break b}}x=v&255;if((x&192|0)!=128){t=2;u=41;break b}v=(w&255)<<6&4032|s<<12|x&63;if((v&65535)>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=v;c[g>>2]=e+3;break}if(!((r&255)<245)){t=2;u=41;break b}if((h-e|0)<4){t=1;u=41;break b}v=a[e+1|0]|0;x=a[e+2|0]|0;w=a[e+3|0]|0;if((s|0)==244){if(!((v&-16)<<24>>24==-128)){t=2;u=41;break b}}else if((s|0)==240){if(!((v+112<<24>>24&255)<48)){t=2;u=41;break b}}else{if(!((v&-64)<<24>>24==-128)){t=2;u=41;break b}}y=x&255;if((y&192|0)!=128){t=2;u=41;break b}x=w&255;if((x&192|0)!=128){t=2;u=41;break b}if((m-p|0)<4){t=1;u=41;break b}w=s&7;z=v&255;v=y<<6;A=x&63;if((z<<12&258048|w<<18|v&4032|A)>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=z<<2&60|y>>>4&3|((z>>>4&3|w<<2)<<6)+16320|55296;w=p+2|0;c[k>>2]=w;b[w>>1]=A|v&960|56320;c[g>>2]=(c[g>>2]|0)+4}}while(0);s=(c[k>>2]|0)+2|0;c[k>>2]=s;r=c[g>>2]|0;if(r>>>0<f>>>0){e=r;p=s}else{q=r;break a}}if((u|0)==41){i=n;return t|0}}else{q=o}}while(0);t=q>>>0<f>>>0|0;i=n;return t|0}function Uk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function Vk(a){a=a|0;i=i;return 0}function Wk(a){a=a|0;i=i;return 0}function Xk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=i;a=Yk(c,d,e,1114111,0)|0;i=b;return a|0}function Yk(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;h=i;do{if((g&4|0)==0){j=b}else{if((c-b|0)<=2){j=b;break}if(!((a[b]|0)==-17)){j=b;break}if(!((a[b+1|0]|0)==-69)){j=b;break}j=(a[b+2|0]|0)==-65?b+3|0:b}}while(0);a:do{if(j>>>0<c>>>0&(e|0)!=0){g=c;k=j;l=0;b:while(1){m=a[k]|0;n=m&255;if(n>>>0>f>>>0){o=k;break a}do{if(m<<24>>24>-1){p=k+1|0;q=l}else{if((m&255)<194){o=k;break a}if((m&255)<224){if((g-k|0)<2){o=k;break a}r=d[k+1|0]|0;if((r&192|0)!=128){o=k;break a}if((r&63|n<<6&1984)>>>0>f>>>0){o=k;break a}p=k+2|0;q=l;break}if((m&255)<240){s=k;if((g-s|0)<3){o=k;break a}r=a[k+1|0]|0;t=a[k+2|0]|0;if((n|0)==224){if(!((r&-32)<<24>>24==-96)){u=21;break b}}else if((n|0)==237){if(!((r&-32)<<24>>24==-128)){u=23;break b}}else{if(!((r&-64)<<24>>24==-128)){u=25;break b}}v=t&255;if((v&192|0)!=128){o=k;break a}if(((r&255)<<6&4032|n<<12&61440|v&63)>>>0>f>>>0){o=k;break a}p=k+3|0;q=l;break}if(!((m&255)<245)){o=k;break a}w=k;if((g-w|0)<4){o=k;break a}if((e-l|0)>>>0<2){o=k;break a}v=a[k+1|0]|0;r=a[k+2|0]|0;t=a[k+3|0]|0;if((n|0)==244){if(!((v&-16)<<24>>24==-128)){u=36;break b}}else if((n|0)==240){if(!((v+112<<24>>24&255)<48)){u=34;break b}}else{if(!((v&-64)<<24>>24==-128)){u=38;break b}}x=r&255;if((x&192|0)!=128){o=k;break a}r=t&255;if((r&192|0)!=128){o=k;break a}if(((v&255)<<12&258048|n<<18&1835008|x<<6&4032|r&63)>>>0>f>>>0){o=k;break a}p=k+4|0;q=l+1|0}}while(0);n=q+1|0;if(p>>>0<c>>>0&n>>>0<e>>>0){k=p;l=n}else{o=p;break a}}if((u|0)==21){y=s-b|0;i=h;return y|0}else if((u|0)==23){y=s-b|0;i=h;return y|0}else if((u|0)==25){y=s-b|0;i=h;return y|0}else if((u|0)==34){y=w-b|0;i=h;return y|0}else if((u|0)==36){y=w-b|0;i=h;return y|0}else if((u|0)==38){y=w-b|0;i=h;return y|0}}else{o=j}}while(0);y=o-b|0;i=h;return y|0}function Zk(a){a=a|0;i=i;return 4}function _k(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function $k(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=al(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d>>2<<2);c[j>>2]=g+((c[k>>2]|0)-g);i=b;return l|0}function al(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0;l=i;c[e>>2]=b;c[h>>2]=f;do{if((k&2|0)!=0){if((g-f|0)<3){m=1;i=l;return m|0}else{c[h>>2]=f+1;a[f]=-17;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=-69;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=-65;break}}}while(0);f=c[e>>2]|0;if(!(f>>>0<d>>>0)){m=0;i=l;return m|0}k=g;g=f;a:while(1){f=c[g>>2]|0;if((f&-2048|0)==55296|f>>>0>j>>>0){m=2;n=19;break}do{if(f>>>0<128){b=c[h>>2]|0;if((k-b|0)<1){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f}else{if(f>>>0<2048){b=c[h>>2]|0;if((k-b|0)<2){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>6|192;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f&63|128;break}b=c[h>>2]|0;o=k-b|0;if(f>>>0<65536){if((o|0)<3){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>12|224;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=f>>>6&63|128;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=f&63|128;break}else{if((o|0)<4){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>18|240;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f>>>12&63|128;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f>>>6&63|128;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f&63|128;break}}}while(0);f=(c[e>>2]|0)+4|0;c[e>>2]=f;if(f>>>0<d>>>0){g=f}else{m=0;n=19;break}}if((n|0)==19){i=l;return m|0}return 0}function bl(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=cl(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d);c[j>>2]=g+((c[k>>2]|0)-g>>2<<2);i=b;return l|0}function cl(b,e,f,g,h,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;m=i;c[f>>2]=b;c[j>>2]=g;g=c[f>>2]|0;do{if((l&4|0)==0){n=g}else{if((e-g|0)<=2){n=g;break}if(!((a[g]|0)==-17)){n=g;break}if(!((a[g+1|0]|0)==-69)){n=g;break}if(!((a[g+2|0]|0)==-65)){n=g;break}b=g+3|0;c[f>>2]=b;n=b}}while(0);a:do{if(n>>>0<e>>>0){g=e;l=n;b=c[j>>2]|0;while(1){if(!(b>>>0<h>>>0)){o=l;p=39;break a}q=a[l]|0;r=q&255;do{if(q<<24>>24>-1){if(r>>>0>k>>>0){s=2;break a}c[b>>2]=r;c[f>>2]=l+1}else{if((q&255)<194){s=2;break a}if((q&255)<224){if((g-l|0)<2){s=1;break a}t=d[l+1|0]|0;if((t&192|0)!=128){s=2;break a}u=t&63|r<<6&1984;if(u>>>0>k>>>0){s=2;break a}c[b>>2]=u;c[f>>2]=l+2;break}if((q&255)<240){if((g-l|0)<3){s=1;break a}u=a[l+1|0]|0;t=a[l+2|0]|0;if((r|0)==224){if(!((u&-32)<<24>>24==-96)){s=2;break a}}else if((r|0)==237){if(!((u&-32)<<24>>24==-128)){s=2;break a}}else{if(!((u&-64)<<24>>24==-128)){s=2;break a}}v=t&255;if((v&192|0)!=128){s=2;break a}t=(u&255)<<6&4032|r<<12&61440|v&63;if(t>>>0>k>>>0){s=2;break a}c[b>>2]=t;c[f>>2]=l+3;break}if(!((q&255)<245)){s=2;break a}if((g-l|0)<4){s=1;break a}t=a[l+1|0]|0;v=a[l+2|0]|0;u=a[l+3|0]|0;if((r|0)==244){if(!((t&-16)<<24>>24==-128)){s=2;break a}}else if((r|0)==240){if(!((t+112<<24>>24&255)<48)){s=2;break a}}else{if(!((t&-64)<<24>>24==-128)){s=2;break a}}w=v&255;if((w&192|0)!=128){s=2;break a}v=u&255;if((v&192|0)!=128){s=2;break a}u=(t&255)<<12&258048|r<<18&1835008|w<<6&4032|v&63;if(u>>>0>k>>>0){s=2;break a}c[b>>2]=u;c[f>>2]=l+4}}while(0);r=(c[j>>2]|0)+4|0;c[j>>2]=r;q=c[f>>2]|0;if(q>>>0<e>>>0){l=q;b=r}else{o=q;p=39;break}}}else{o=n;p=39}}while(0);if((p|0)==39){s=o>>>0<e>>>0|0}i=m;return s|0}function dl(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function el(a){a=a|0;i=i;return 0}function fl(a){a=a|0;i=i;return 0}function gl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=i;a=hl(c,d,e,1114111,0)|0;i=b;return a|0}function hl(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=i;do{if((g&4|0)==0){j=b}else{if((c-b|0)<=2){j=b;break}if(!((a[b]|0)==-17)){j=b;break}if(!((a[b+1|0]|0)==-69)){j=b;break}j=(a[b+2|0]|0)==-65?b+3|0:b}}while(0);a:do{if(j>>>0<c>>>0&(e|0)!=0){g=c;k=j;l=1;b:while(1){m=a[k]|0;n=m&255;do{if(m<<24>>24>-1){if(n>>>0>f>>>0){o=k;break a}p=k+1|0}else{if((m&255)<194){o=k;break a}if((m&255)<224){if((g-k|0)<2){o=k;break a}q=d[k+1|0]|0;if((q&192|0)!=128){o=k;break a}if((q&63|n<<6&1984)>>>0>f>>>0){o=k;break a}p=k+2|0;break}if((m&255)<240){r=k;if((g-r|0)<3){o=k;break a}q=a[k+1|0]|0;s=a[k+2|0]|0;if((n|0)==224){if(!((q&-32)<<24>>24==-96)){t=21;break b}}else if((n|0)==237){if(!((q&-32)<<24>>24==-128)){t=23;break b}}else{if(!((q&-64)<<24>>24==-128)){t=25;break b}}u=s&255;if((u&192|0)!=128){o=k;break a}if(((q&255)<<6&4032|n<<12&61440|u&63)>>>0>f>>>0){o=k;break a}p=k+3|0;break}if(!((m&255)<245)){o=k;break a}v=k;if((g-v|0)<4){o=k;break a}u=a[k+1|0]|0;q=a[k+2|0]|0;s=a[k+3|0]|0;if((n|0)==244){if(!((u&-16)<<24>>24==-128)){t=35;break b}}else if((n|0)==240){if(!((u+112<<24>>24&255)<48)){t=33;break b}}else{if(!((u&-64)<<24>>24==-128)){t=37;break b}}w=q&255;if((w&192|0)!=128){o=k;break a}q=s&255;if((q&192|0)!=128){o=k;break a}if(((u&255)<<12&258048|n<<18&1835008|w<<6&4032|q&63)>>>0>f>>>0){o=k;break a}p=k+4|0}}while(0);if(!(p>>>0<c>>>0&l>>>0<e>>>0)){o=p;break a}k=p;l=l+1|0}if((t|0)==21){x=r-b|0;i=h;return x|0}else if((t|0)==23){x=r-b|0;i=h;return x|0}else if((t|0)==25){x=r-b|0;i=h;return x|0}else if((t|0)==33){x=v-b|0;i=h;return x|0}else if((t|0)==35){x=v-b|0;i=h;return x|0}else if((t|0)==37){x=v-b|0;i=h;return x|0}}else{o=j}}while(0);x=o-b|0;i=h;return x|0}function il(a){a=a|0;i=i;return 4}function jl(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function kl(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function ll(a){a=a|0;var b=0;b=i;c[a>>2]=5296;ve(a+12|0);Rm(a);i=b;return}function ml(a){a=a|0;var b=0;b=i;c[a>>2]=5296;ve(a+12|0);i=b;return}function nl(a){a=a|0;var b=0;b=i;c[a>>2]=5336;ve(a+16|0);Rm(a);i=b;return}function ol(a){a=a|0;var b=0;b=i;c[a>>2]=5336;ve(a+16|0);i=b;return}function pl(b){b=b|0;i=i;return a[b+8|0]|0}function ql(a){a=a|0;i=i;return c[a+8>>2]|0}function rl(b){b=b|0;i=i;return a[b+9|0]|0}function sl(a){a=a|0;i=i;return c[a+12>>2]|0}function tl(a,b){a=a|0;b=b|0;var c=0;c=i;se(a,b+12|0);i=c;return}function ul(a,b){a=a|0;b=b|0;var c=0;c=i;se(a,b+16|0);i=c;return}function vl(a,b){a=a|0;b=b|0;b=i;te(a,5368,4);i=b;return}function wl(a,b){a=a|0;b=b|0;b=i;Fe(a,5376,km(5376)|0);i=b;return}function xl(a,b){a=a|0;b=b|0;b=i;te(a,5400,5);i=b;return}function yl(a,b){a=a|0;b=b|0;b=i;Fe(a,5408,km(5408)|0);i=b;return}function zl(b){b=b|0;var d=0;b=i;if((a[5440]|0)!=0){d=c[1358]|0;i=b;return d|0}if((Ga(5440)|0)==0){d=c[1358]|0;i=b;return d|0}do{if((a[12640]|0)==0){if((Ga(12640)|0)==0){break}jn(12472,0,168)|0;gc(122,0,q|0)|0;cb(12640)}}while(0);xe(12472,12648)|0;xe(12484|0,12656)|0;xe(12496|0,12664)|0;xe(12508|0,12672)|0;xe(12520|0,12688)|0;xe(12532|0,12704)|0;xe(12544|0,12712)|0;xe(12556|0,12728)|0;xe(12568|0,12736)|0;xe(12580|0,12744)|0;xe(12592|0,12752)|0;xe(12604|0,12760)|0;xe(12616|0,12768)|0;xe(12628|0,12776)|0;c[1358]=12472;cb(5440);d=c[1358]|0;i=b;return d|0}function Al(b){b=b|0;var d=0;b=i;if((a[5456]|0)!=0){d=c[1362]|0;i=b;return d|0}if((Ga(5456)|0)==0){d=c[1362]|0;i=b;return d|0}do{if((a[12104]|0)==0){if((Ga(12104)|0)==0){break}jn(11936,0,168)|0;gc(123,0,q|0)|0;cb(12104)}}while(0);Ie(11936,12112)|0;Ie(11948|0,12144)|0;Ie(11960|0,12176)|0;Ie(11972|0,12208)|0;Ie(11984|0,12248)|0;Ie(11996|0,12288)|0;Ie(12008|0,12320)|0;Ie(12020|0,12360)|0;Ie(12032|0,12376)|0;Ie(12044|0,12392)|0;Ie(12056|0,12408)|0;Ie(12068|0,12424)|0;Ie(12080|0,12440)|0;Ie(12092|0,12456)|0;c[1362]=11936;cb(5456);d=c[1362]|0;i=b;return d|0}function Bl(b){b=b|0;var d=0;b=i;if((a[5472]|0)!=0){d=c[1366]|0;i=b;return d|0}if((Ga(5472)|0)==0){d=c[1366]|0;i=b;return d|0}do{if((a[11712]|0)==0){if((Ga(11712)|0)==0){break}jn(11424,0,288)|0;gc(124,0,q|0)|0;cb(11712)}}while(0);xe(11424,11720)|0;xe(11436|0,11728)|0;xe(11448|0,11744)|0;xe(11460|0,11752)|0;xe(11472|0,11760)|0;xe(11484|0,11768)|0;xe(11496|0,11776)|0;xe(11508|0,11784)|0;xe(11520|0,11792)|0;xe(11532|0,11808)|0;xe(11544|0,11816)|0;xe(11556|0,11832)|0;xe(11568|0,11848)|0;xe(11580|0,11856)|0;xe(11592|0,11864)|0;xe(11604|0,11872)|0;xe(11616|0,11760)|0;xe(11628|0,11880)|0;xe(11640|0,11888)|0;xe(11652|0,11896)|0;xe(11664|0,11904)|0;xe(11676|0,11912)|0;xe(11688|0,11920)|0;xe(11700|0,11928)|0;c[1366]=11424;cb(5472);d=c[1366]|0;i=b;return d|0}function Cl(b){b=b|0;var d=0;b=i;if((a[5488]|0)!=0){d=c[1370]|0;i=b;return d|0}if((Ga(5488)|0)==0){d=c[1370]|0;i=b;return d|0}do{if((a[10872]|0)==0){if((Ga(10872)|0)==0){break}jn(10584,0,288)|0;gc(125,0,q|0)|0;cb(10872)}}while(0);Ie(10584,10880)|0;Ie(10596|0,10912)|0;Ie(10608|0,10952)|0;Ie(10620|0,10976)|0;Ie(10632|0,11296)|0;Ie(10644|0,11e3)|0;Ie(10656|0,11024)|0;Ie(10668|0,11048)|0;Ie(10680|0,11080)|0;Ie(10692|0,11120)|0;Ie(10704|0,11152)|0;Ie(10716|0,11192)|0;Ie(10728|0,11232)|0;Ie(10740|0,11248)|0;Ie(10752|0,11264)|0;Ie(10764|0,11280)|0;Ie(10776|0,11296)|0;Ie(10788|0,11312)|0;Ie(10800|0,11328)|0;Ie(10812|0,11344)|0;Ie(10824|0,11360)|0;Ie(10836|0,11376)|0;Ie(10848|0,11392)|0;Ie(10860|0,11408)|0;c[1370]=10584;cb(5488);d=c[1370]|0;i=b;return d|0}function Dl(b){b=b|0;var d=0;b=i;if((a[5504]|0)!=0){d=c[1374]|0;i=b;return d|0}if((Ga(5504)|0)==0){d=c[1374]|0;i=b;return d|0}do{if((a[10560]|0)==0){if((Ga(10560)|0)==0){break}jn(10272,0,288)|0;gc(126,0,q|0)|0;cb(10560)}}while(0);xe(10272,10568)|0;xe(10284|0,10576)|0;c[1374]=10272;cb(5504);d=c[1374]|0;i=b;return d|0}function El(b){b=b|0;var d=0;b=i;if((a[5520]|0)!=0){d=c[1378]|0;i=b;return d|0}if((Ga(5520)|0)==0){d=c[1378]|0;i=b;return d|0}do{if((a[10232]|0)==0){if((Ga(10232)|0)==0){break}jn(9944,0,288)|0;gc(127,0,q|0)|0;cb(10232)}}while(0);Ie(9944,10240)|0;Ie(9956|0,10256)|0;c[1378]=9944;cb(5520);d=c[1378]|0;i=b;return d|0}function Fl(b){b=b|0;b=i;do{if((a[5544]|0)==0){if((Ga(5544)|0)==0){break}te(5528,5552,8);gc(128,5528,q|0)|0;cb(5544)}}while(0);i=b;return 5528}function Gl(b){b=b|0;b=i;if((a[5584]|0)!=0){i=b;return 5568}if((Ga(5584)|0)==0){i=b;return 5568}Fe(5568,5592,km(5592)|0);gc(129,5568,q|0)|0;cb(5584);i=b;return 5568}function Hl(b){b=b|0;b=i;do{if((a[5648]|0)==0){if((Ga(5648)|0)==0){break}te(5632,5656,8);gc(128,5632,q|0)|0;cb(5648)}}while(0);i=b;return 5632}function Il(b){b=b|0;b=i;if((a[5688]|0)!=0){i=b;return 5672}if((Ga(5688)|0)==0){i=b;return 5672}Fe(5672,5696,km(5696)|0);gc(129,5672,q|0)|0;cb(5688);i=b;return 5672}function Jl(b){b=b|0;b=i;do{if((a[5752]|0)==0){if((Ga(5752)|0)==0){break}te(5736,5760,20);gc(128,5736,q|0)|0;cb(5752)}}while(0);i=b;return 5736}function Kl(b){b=b|0;b=i;if((a[5800]|0)!=0){i=b;return 5784}if((Ga(5800)|0)==0){i=b;return 5784}Fe(5784,5808,km(5808)|0);gc(129,5784,q|0)|0;cb(5800);i=b;return 5784}function Ll(b){b=b|0;b=i;do{if((a[5912]|0)==0){if((Ga(5912)|0)==0){break}te(5896,5920,11);gc(128,5896,q|0)|0;cb(5912)}}while(0);i=b;return 5896}function Ml(b){b=b|0;b=i;if((a[5952]|0)!=0){i=b;return 5936}if((Ga(5952)|0)==0){i=b;return 5936}Fe(5936,5960,km(5960)|0);gc(129,5936,q|0)|0;cb(5952);i=b;return 5936}function Nl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=ac()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);l=+dn(b,g,c[1254]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)!=34){h=l;i=f;return+h}c[e>>2]=4;h=l;i=f;return+h}function Ol(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=ac()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);l=+dn(b,g,c[1254]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)!=34){h=l;i=f;return+h}c[e>>2]=4;h=l;i=f;return+h}function Pl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=ac()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);l=+dn(b,g,c[1254]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)==34){c[e>>2]=4}h=l;i=f;return+h}function Ql(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+8|0;h=g;do{if((b|0)==(d|0)){c[e>>2]=4;j=0;k=0}else{if((a[b]|0)==45){c[e>>2]=4;j=0;k=0;break}l=ac()|0;m=c[l>>2]|0;c[l>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);n=mb(b|0,h|0,f|0,c[1254]|0)|0;o=c[l>>2]|0;if((o|0)==0){c[l>>2]=m}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;k=0;break}if((o|0)!=34){j=n;k=J;break}c[e>>2]=4;j=-1;k=-1}}while(0);J=k;i=g;return j|0}function Rl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=ac()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);m=mb(b|0,h|0,f|0,c[1254]|0)|0;f=J;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>4294967295)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m;i=g;return j|0}return 0}function Sl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=ac()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);m=mb(b|0,h|0,f|0,c[1254]|0)|0;f=J;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>4294967295)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m;i=g;return j|0}return 0}function Tl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=ac()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);m=mb(b|0,h|0,f|0,c[1254]|0)|0;f=J;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>65535)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m&65535;i=g;return j|0}return 0}function Ul(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;k=0;J=k;i=g;return j|0}l=ac()|0;m=c[l>>2]|0;c[l>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);n=Wb(b|0,h|0,f|0,c[1254]|0)|0;f=J;b=c[l>>2]|0;if((b|0)==0){c[l>>2]=m}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;k=0;J=k;i=g;return j|0}if((b|0)==34){c[e>>2]=4;e=(f|0)>0|(f|0)==0&n>>>0>0;J=e?2147483647:-2147483648;i=g;return(e?-1:0)|0}else{j=n;k=f;J=k;i=g;return j|0}return 0}function Vl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}k=ac()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[5024]|0)==0){if((Ga(5024)|0)==0){break}c[1254]=fb(2147483647,5032,0)|0;cb(5024)}}while(0);m=Wb(b|0,h|0,f|0,c[1254]|0)|0;f=J;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}do{if((b|0)==34){c[e>>2]=4;if((f|0)>0|(f|0)==0&m>>>0>0){j=2147483647}else{break}i=g;return j|0}else{if((f|0)<-1|(f|0)==-1&m>>>0<2147483648){c[e>>2]=4;break}if((f|0)>0|(f|0)==0&m>>>0>2147483647){c[e>>2]=4;j=2147483647;i=g;return j|0}else{j=m;i=g;return j|0}}}while(0);j=-2147483648;i=g;return j|0}function Wl(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;b=i;e=a+4|0;f=e;g=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;f=e+4|0;e=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;f=(c[a>>2]|0)+(e>>1)|0;a=f;if((e&1|0)==0){h=g;mc[h&255](a);i=b;return}else{h=c[(c[f>>2]|0)+g>>2]|0;mc[h&255](a);i=b;return}}function Xl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;f=b+8|0;g=b+4|0;h=c[g>>2]|0;j=c[f>>2]|0;k=h;if(!(j-k>>2>>>0<d>>>0)){l=d;m=h;do{if((m|0)==0){n=0}else{c[m>>2]=0;n=c[g>>2]|0}m=n+4|0;c[g>>2]=m;l=l+ -1|0;}while((l|0)!=0);i=e;return}l=b+16|0;m=b;n=c[m>>2]|0;h=k-n>>2;k=h+d|0;if(k>>>0>1073741823){Rj(0)}o=j-n|0;do{if(o>>2>>>0<536870911){n=o>>1;j=n>>>0<k>>>0?k:n;if((j|0)==0){p=0;q=0;break}n=b+128|0;if(!((a[n]|0)==0&j>>>0<29)){r=j;s=11;break}a[n]=1;p=j;q=l}else{r=1073741823;s=11}}while(0);if((s|0)==11){p=r;q=Pm(r<<2)|0}r=d;d=q+(h<<2)|0;do{if((d|0)==0){t=0}else{c[d>>2]=0;t=d}d=t+4|0;r=r+ -1|0;}while((r|0)!=0);r=c[m>>2]|0;t=(c[g>>2]|0)-r|0;s=q+(h-(t>>2)<<2)|0;h=r;mn(s|0,h|0,t|0)|0;c[m>>2]=s;c[g>>2]=d;c[f>>2]=q+(p<<2);if((r|0)==0){i=e;return}if((l|0)==(r|0)){a[b+128|0]=0;i=e;return}else{Rm(h);i=e;return}}function Yl(a){a=a|0;a=i;He(10220|0);He(10208|0);He(10196|0);He(10184|0);He(10172|0);He(10160|0);He(10148|0);He(10136|0);He(10124|0);He(10112|0);He(10100|0);He(10088|0);He(10076|0);He(10064|0);He(10052|0);He(10040|0);He(10028|0);He(10016|0);He(10004|0);He(9992|0);He(9980|0);He(9968|0);He(9956|0);He(9944);i=a;return}function Zl(a){a=a|0;a=i;ve(10548|0);ve(10536|0);ve(10524|0);ve(10512|0);ve(10500|0);ve(10488|0);ve(10476|0);ve(10464|0);ve(10452|0);ve(10440|0);ve(10428|0);ve(10416|0);ve(10404|0);ve(10392|0);ve(10380|0);ve(10368|0);ve(10356|0);ve(10344|0);ve(10332|0);ve(10320|0);ve(10308|0);ve(10296|0);ve(10284|0);ve(10272);i=a;return}function _l(a){a=a|0;a=i;He(10860|0);He(10848|0);He(10836|0);He(10824|0);He(10812|0);He(10800|0);He(10788|0);He(10776|0);He(10764|0);He(10752|0);He(10740|0);He(10728|0);He(10716|0);He(10704|0);He(10692|0);He(10680|0);He(10668|0);He(10656|0);He(10644|0);He(10632|0);He(10620|0);He(10608|0);He(10596|0);He(10584);i=a;return}function $l(a){a=a|0;a=i;ve(11700|0);ve(11688|0);ve(11676|0);ve(11664|0);ve(11652|0);ve(11640|0);ve(11628|0);ve(11616|0);ve(11604|0);ve(11592|0);ve(11580|0);ve(11568|0);ve(11556|0);ve(11544|0);ve(11532|0);ve(11520|0);ve(11508|0);ve(11496|0);ve(11484|0);ve(11472|0);ve(11460|0);ve(11448|0);ve(11436|0);ve(11424);i=a;return}function am(a){a=a|0;a=i;He(12092|0);He(12080|0);He(12068|0);He(12056|0);He(12044|0);He(12032|0);He(12020|0);He(12008|0);He(11996|0);He(11984|0);He(11972|0);He(11960|0);He(11948|0);He(11936);i=a;return}function bm(a){a=a|0;a=i;ve(12628|0);ve(12616|0);ve(12604|0);ve(12592|0);ve(12580|0);ve(12568|0);ve(12556|0);ve(12544|0);ve(12532|0);ve(12520|0);ve(12508|0);ve(12496|0);ve(12484|0);ve(12472);i=a;return}function cm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=i;e=dm(0,a,b,(c|0)!=0?c:12992)|0;i=d;return e|0}function dm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;i=i+8|0;h=g;c[h>>2]=b;j=(f|0)==0?13e3:f;f=c[j>>2]|0;a:do{if((d|0)==0){if((f|0)==0){k=0}else{break}i=g;return k|0}else{if((b|0)==0){l=h;c[h>>2]=l;m=l}else{m=b}if((e|0)==0){k=-2;i=g;return k|0}do{if((f|0)==0){l=a[d]|0;n=l&255;if(l<<24>>24>-1){c[m>>2]=n;k=l<<24>>24!=0|0;i=g;return k|0}else{l=n+ -194|0;if(l>>>0>50){break a}o=e+ -1|0;p=c[12784+(l<<2)>>2]|0;q=d+1|0;break}}else{o=e;p=f;q=d}}while(0);b:do{if((o|0)==0){r=p}else{l=a[q]|0;n=(l&255)>>>3;if((n+ -16|n+(p>>26))>>>0>7){break a}else{s=o;t=l;u=p;v=q}while(1){v=v+1|0;u=(t&255)+ -128|u<<6;s=s+ -1|0;if((u|0)>=0){break}if((s|0)==0){r=u;break b}t=a[v]|0;if(((t&255)+ -128|0)>>>0>63){break a}}c[j>>2]=0;c[m>>2]=u;k=e-s|0;i=g;return k|0}}while(0);c[j>>2]=r;k=-2;i=g;return k|0}}while(0);c[j>>2]=0;c[(ac()|0)>>2]=84;k=-1;i=g;return k|0}function em(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;g=i;i=i+1032|0;h=g+1024|0;j=c[b>>2]|0;c[h>>2]=j;k=(a|0)!=0;l=g;m=k?e:256;e=k?a:l;a:do{if((j|0)==0|(m|0)==0){n=d;o=m;p=j;q=0;r=e}else{a=d;s=m;t=j;u=0;v=e;while(1){w=a>>>2;x=w>>>0>=s>>>0;if(!(x|a>>>0>131)){n=a;o=s;p=t;q=u;r=v;break a}y=x?s:w;z=a-y|0;w=fm(v,h,y,f)|0;if((w|0)==-1){break}if((v|0)==(l|0)){A=s;B=l}else{A=s-w|0;B=v+(w<<2)|0}y=w+u|0;w=c[h>>2]|0;if((w|0)==0|(A|0)==0){n=z;o=A;p=w;q=y;r=B;break a}else{a=z;s=A;t=w;u=y;v=B}}n=z;o=0;p=c[h>>2]|0;q=-1;r=v}}while(0);b:do{if((p|0)==0){C=q}else{if((o|0)==0|(n|0)==0){C=q;break}else{D=n;E=o;F=p;G=q;H=r}while(1){I=dm(H,F,D,f)|0;if((I+2|0)>>>0<3){break}z=(c[h>>2]|0)+I|0;c[h>>2]=z;B=E+ -1|0;A=G+1|0;if((B|0)==0|(D|0)==(I|0)){C=A;break b}else{D=D-I|0;E=B;F=z;G=A;H=H+4|0}}if((I|0)==0){c[h>>2]=0;C=G;break}else if((I|0)==-1){C=-1;break}else{c[f>>2]=0;C=G;break}}}while(0);if(!k){i=g;return C|0}c[b>>2]=c[h>>2];i=g;return C|0}function fm(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0;h=i;j=c[e>>2]|0;do{if((g|0)==0){k=5}else{l=g;m=c[l>>2]|0;if((m|0)==0){k=5;break}if((b|0)==0){n=f;o=m;p=j;k=16;break}c[l>>2]=0;q=b;r=f;s=m;t=j;k=36}}while(0);if((k|0)==5){if((b|0)==0){u=f;v=j;k=7}else{w=b;x=f;y=j;k=6}}a:while(1){if((k|0)==6){k=0;if((x|0)==0){z=f;k=53;break}else{A=w;B=x;C=y}while(1){j=a[C]|0;do{if(((j&255)+ -1|0)>>>0<127){if((C&3|0)==0&B>>>0>3){D=A;E=B;F=C}else{G=A;H=B;I=j;J=C;break}while(1){K=c[F>>2]|0;if(((K+ -16843009|K)&-2139062144|0)!=0){k=30;break}c[D>>2]=K&255;c[D+4>>2]=d[F+1|0]|0;c[D+8>>2]=d[F+2|0]|0;L=F+4|0;M=D+16|0;c[D+12>>2]=d[F+3|0]|0;N=E+ -4|0;if(N>>>0>3){D=M;E=N;F=L}else{k=31;break}}if((k|0)==30){k=0;G=D;H=E;I=K&255;J=F;break}else if((k|0)==31){k=0;G=M;H=N;I=a[L]|0;J=L;break}}else{G=A;H=B;I=j;J=C}}while(0);O=I&255;if(!((O+ -1|0)>>>0<127)){break}c[G>>2]=O;j=H+ -1|0;if((j|0)==0){z=f;k=53;break a}else{A=G+4|0;B=j;C=J+1|0}}j=O+ -194|0;if(j>>>0>50){P=G;Q=H;R=J;k=47;break}q=G;r=H;s=c[12784+(j<<2)>>2]|0;t=J+1|0;k=36;continue}else if((k|0)==7){k=0;j=a[v]|0;do{if(((j&255)+ -1|0)>>>0<127){if((v&3|0)!=0){S=u;T=j;U=v;break}g=c[v>>2]|0;if(((g+ -16843009|g)&-2139062144|0)==0){m=u;l=v;while(1){V=l+4|0;W=m+ -4|0;X=c[V>>2]|0;if(((X+ -16843009|X)&-2139062144|0)==0){l=V;m=W}else{Y=W;Z=X;_=V;break}}}else{Y=u;Z=g;_=v}S=Y;T=Z&255;U=_}else{S=u;T=j;U=v}}while(0);j=T&255;if((j+ -1|0)>>>0<127){u=S+ -1|0;v=U+1|0;k=7;continue}m=j+ -194|0;if(m>>>0>50){P=b;Q=S;R=U;k=47;break}n=S;o=c[12784+(m<<2)>>2]|0;p=U+1|0;k=16;continue}else if((k|0)==16){k=0;m=(d[p]|0)>>>3;if((m+ -16|m+(o>>26))>>>0>7){k=17;break}m=p+1|0;do{if((o&33554432|0)==0){$=m}else{if(((d[m]|0)+ -128|0)>>>0>63){k=20;break a}j=p+2|0;if((o&524288|0)==0){$=j;break}if(((d[j]|0)+ -128|0)>>>0>63){k=23;break a}$=p+3|0}}while(0);u=n+ -1|0;v=$;k=7;continue}else if((k|0)==36){k=0;m=d[t]|0;j=m>>>3;if((j+ -16|j+(s>>26))>>>0>7){k=37;break}j=t+1|0;aa=m+ -128|s<<6;do{if((aa|0)<0){m=(d[j]|0)+ -128|0;if(m>>>0>63){k=40;break a}l=t+2|0;ba=m|aa<<6;if((ba|0)>=0){ca=ba;da=l;break}m=(d[l]|0)+ -128|0;if(m>>>0>63){k=43;break a}ca=m|ba<<6;da=t+3|0}else{ca=aa;da=j}}while(0);c[q>>2]=ca;w=q+4|0;x=r+ -1|0;y=da;k=6;continue}}if((k|0)==17){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==20){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==23){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==37){ea=q;fa=r;ga=s;ha=t+ -1|0;k=46}else if((k|0)==40){ea=q;fa=r;ga=aa;ha=t+ -1|0;k=46}else if((k|0)==43){ea=q;fa=r;ga=ba;ha=t+ -1|0;k=46}else if((k|0)==53){i=h;return z|0}if((k|0)==46){if((ga|0)==0){P=ea;Q=fa;R=ha;k=47}else{ia=ea;ja=ha}}do{if((k|0)==47){if((a[R]|0)!=0){ia=P;ja=R;break}if((P|0)!=0){c[P>>2]=0;c[e>>2]=0}z=f-Q|0;i=h;return z|0}}while(0);c[(ac()|0)>>2]=84;if((ia|0)==0){z=-1;i=h;return z|0}c[e>>2]=ja;z=-1;i=h;return z|0}function gm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+8|0;h=g;c[h>>2]=b;if((e|0)==0){j=0;i=g;return j|0}do{if((f|0)!=0){if((b|0)==0){k=h;c[h>>2]=k;l=k}else{l=b}k=a[e]|0;m=k&255;if(k<<24>>24>-1){c[l>>2]=m;j=k<<24>>24!=0|0;i=g;return j|0}k=m+ -194|0;if(k>>>0>50){break}m=e+1|0;n=c[12784+(k<<2)>>2]|0;if(f>>>0<4){if((n&-2147483648>>>((f*6|0)+ -6|0)|0)!=0){break}}k=d[m]|0;m=k>>>3;if((m+ -16|m+(n>>26))>>>0>7){break}m=k+ -128|n<<6;if((m|0)>=0){c[l>>2]=m;j=2;i=g;return j|0}n=(d[e+2|0]|0)+ -128|0;if(n>>>0>63){break}k=n|m<<6;if((k|0)>=0){c[l>>2]=k;j=3;i=g;return j|0}m=(d[e+3|0]|0)+ -128|0;if(m>>>0>63){break}c[l>>2]=m|k<<6;j=4;i=g;return j|0}}while(0);c[(ac()|0)>>2]=84;j=-1;i=g;return j|0}function hm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((b|0)==0){f=1;i=e;return f|0}if(d>>>0<128){a[b]=d;f=1;i=e;return f|0}if(d>>>0<2048){a[b]=d>>>6|192;a[b+1|0]=d&63|128;f=2;i=e;return f|0}if(d>>>0<55296|(d+ -57344|0)>>>0<8192){a[b]=d>>>12|224;a[b+1|0]=d>>>6&63|128;a[b+2|0]=d&63|128;f=3;i=e;return f|0}if((d+ -65536|0)>>>0<1048576){a[b]=d>>>18|240;a[b+1|0]=d>>>12&63|128;a[b+2|0]=d>>>6&63|128;a[b+3|0]=d&63|128;f=4;i=e;return f|0}else{c[(ac()|0)>>2]=84;f=-1;i=e;return f|0}return 0}function im(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;f=i;i=i+264|0;g=f+256|0;h=f;j=c[b>>2]|0;c[g>>2]=j;k=(a|0)!=0;l=k?e:256;e=k?a:h;a:do{if((j|0)==0|(l|0)==0){m=d;n=l;o=j;p=0;q=e}else{a=d;r=l;s=j;t=0;u=e;while(1){v=a>>>0>=r>>>0;if(!(v|a>>>0>32)){m=a;n=r;o=s;p=t;q=u;break a}w=v?r:a;x=a-w|0;v=jm(u,g,w,0)|0;if((v|0)==-1){break}if((u|0)==(h|0)){y=r;z=h}else{y=r-v|0;z=u+v|0}w=v+t|0;v=c[g>>2]|0;if((v|0)==0|(y|0)==0){m=x;n=y;o=v;p=w;q=z;break a}else{a=x;r=y;s=v;t=w;u=z}}m=x;n=0;o=c[g>>2]|0;p=-1;q=u}}while(0);b:do{if((o|0)==0){A=p}else{if((n|0)==0|(m|0)==0){A=p;break}else{B=m;C=n;D=o;E=p;F=q}while(1){G=hm(F,c[D>>2]|0,0)|0;if((G+1|0)>>>0<2){break}x=(c[g>>2]|0)+4|0;c[g>>2]=x;z=B+ -1|0;y=E+1|0;if((C|0)==(G|0)|(z|0)==0){A=y;break b}else{B=z;C=C-G|0;D=x;E=y;F=F+G|0}}if((G|0)!=0){A=-1;break}c[g>>2]=0;A=E}}while(0);if(!k){i=f;return A|0}c[b>>2]=c[g>>2];i=f;return A|0}function jm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=i;i=i+8|0;g=f;if((b|0)==0){h=c[d>>2]|0;j=g;k=c[h>>2]|0;if((k|0)==0){l=0;i=f;return l|0}else{m=0;n=k;o=h}while(1){if(n>>>0>127){h=hm(j,n,0)|0;if((h|0)==-1){l=-1;p=26;break}else{q=h}}else{q=1}h=q+m|0;k=o+4|0;r=c[k>>2]|0;if((r|0)==0){l=h;p=26;break}else{m=h;n=r;o=k}}if((p|0)==26){i=f;return l|0}}a:do{if(e>>>0>3){o=b;n=e;m=c[d>>2]|0;while(1){q=c[m>>2]|0;if((q|0)==0){s=o;t=n;break a}if(q>>>0>127){j=hm(o,q,0)|0;if((j|0)==-1){l=-1;break}u=o+j|0;v=n-j|0;w=m}else{a[o]=q;u=o+1|0;v=n+ -1|0;w=c[d>>2]|0}q=w+4|0;c[d>>2]=q;if(v>>>0>3){o=u;n=v;m=q}else{s=u;t=v;break a}}i=f;return l|0}else{s=b;t=e}}while(0);b:do{if((t|0)==0){x=0}else{b=g;v=s;u=t;w=c[d>>2]|0;while(1){m=c[w>>2]|0;if((m|0)==0){p=24;break}if(m>>>0>127){n=hm(b,m,0)|0;if((n|0)==-1){l=-1;p=26;break}if(n>>>0>u>>>0){p=20;break}hm(v,c[w>>2]|0,0)|0;y=v+n|0;z=u-n|0;A=w}else{a[v]=m;y=v+1|0;z=u+ -1|0;A=c[d>>2]|0}m=A+4|0;c[d>>2]=m;if((z|0)==0){x=0;break b}else{v=y;u=z;w=m}}if((p|0)==20){l=e-u|0;i=f;return l|0}else if((p|0)==24){a[v]=0;x=u;break}else if((p|0)==26){i=f;return l|0}}}while(0);c[d>>2]=0;l=e-x|0;i=f;return l|0}function km(a){a=a|0;var b=0,d=0;b=i;d=a;while(1){if((c[d>>2]|0)==0){break}else{d=d+4|0}}i=b;return d-a>>2|0}function lm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;if((d|0)==0){i=e;return a|0}else{f=d;g=b;h=a}while(1){b=f+ -1|0;c[h>>2]=c[g>>2];if((b|0)==0){break}else{h=h+4|0;g=g+4|0;f=b}}i=e;return a|0}function mm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;f=(d|0)==0;do{if(a-b>>2>>>0<d>>>0){if(f){break}else{g=d}do{g=g+ -1|0;c[a+(g<<2)>>2]=c[b+(g<<2)>>2];}while((g|0)!=0)}else{if(f){break}else{h=b;j=a;k=d}while(1){l=k+ -1|0;c[j>>2]=c[h>>2];if((l|0)==0){break}else{k=l;j=j+4|0;h=h+4|0}}}}while(0);i=e;return a|0}function nm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;if((d|0)!=0){f=d;d=a;while(1){g=f+ -1|0;c[d>>2]=b;if((g|0)==0){break}else{d=d+4|0;f=g}}}i=e;return a|0}function om(a){a=a|0;i=i;return}function pm(a){a=a|0;c[a>>2]=13016;i=i;return}function qm(a){a=a|0;var b=0;b=i;Ta(a|0);Rm(a);i=b;return}function rm(a){a=a|0;var b=0;b=i;Ta(a|0);i=b;return}function sm(a){a=a|0;i=i;return 13032}function tm(a){a=a|0;i=i;return}function um(a){a=a|0;i=i;return}function vm(a){a=a|0;i=i;return}function wm(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function xm(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function ym(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function zm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+56|0;f=e;if((a|0)==(b|0)){g=1;i=e;return g|0}if((b|0)==0){g=0;i=e;return g|0}h=Dm(b,13144,13200,0)|0;b=h;if((h|0)==0){g=0;i=e;return g|0}j=f+0|0;k=j+56|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));c[f>>2]=b;c[f+8>>2]=a;c[f+12>>2]=-1;c[f+48>>2]=1;Ac[c[(c[h>>2]|0)+28>>2]&15](b,f,c[d>>2]|0,1);if((c[f+24>>2]|0)!=1){g=0;i=e;return g|0}c[d>>2]=c[f+16>>2];g=1;i=e;return g|0}function Am(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;if((c[d+8>>2]|0)!=(b|0)){i=g;return}b=d+16|0;h=c[b>>2]|0;if((h|0)==0){c[b>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((h|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}e=d+24|0;if((c[e>>2]|0)!=2){i=g;return}c[e>>2]=f;i=g;return}function Bm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;if((b|0)!=(c[d+8>>2]|0)){h=c[b+8>>2]|0;Ac[c[(c[h>>2]|0)+28>>2]&15](h,d,e,f);i=g;return}h=d+16|0;b=c[h>>2]|0;if((b|0)==0){c[h>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((b|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}e=d+24|0;if((c[e>>2]|0)!=2){i=g;return}c[e>>2]=f;i=g;return}function Cm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;if((b|0)==(c[d+8>>2]|0)){h=d+16|0;j=c[h>>2]|0;if((j|0)==0){c[h>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((j|0)!=(e|0)){j=d+36|0;c[j>>2]=(c[j>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}j=d+24|0;if((c[j>>2]|0)!=2){i=g;return}c[j>>2]=f;i=g;return}j=c[b+12>>2]|0;h=b+(j<<3)+16|0;k=c[b+20>>2]|0;l=k>>8;if((k&1|0)==0){m=l}else{m=c[(c[e>>2]|0)+l>>2]|0}l=c[b+16>>2]|0;Ac[c[(c[l>>2]|0)+28>>2]&15](l,d,e+m|0,(k&2|0)!=0?f:2);if((j|0)<=1){i=g;return}j=d+54|0;k=e;m=b+24|0;while(1){b=c[m+4>>2]|0;l=b>>8;if((b&1|0)==0){n=l}else{n=c[(c[k>>2]|0)+l>>2]|0}l=c[m>>2]|0;Ac[c[(c[l>>2]|0)+28>>2]&15](l,d,e+n|0,(b&2|0)!=0?f:2);if((a[j]|0)!=0){o=16;break}b=m+8|0;if(b>>>0<h>>>0){m=b}else{o=16;break}}if((o|0)==16){i=g;return}}function Dm(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+56|0;j=h;k=c[d>>2]|0;l=d+(c[k+ -8>>2]|0)|0;m=c[k+ -4>>2]|0;k=m;c[j>>2]=f;c[j+4>>2]=d;c[j+8>>2]=e;c[j+12>>2]=g;g=j+16|0;e=j+20|0;d=j+24|0;n=j+28|0;o=j+32|0;p=j+40|0;q=(m|0)==(f|0);f=g;r=f+0|0;s=r+36|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(s|0));b[f+36>>1]=0;a[f+38|0]=0;if(q){c[j+48>>2]=1;xc[c[(c[m>>2]|0)+20>>2]&31](k,j,l,l,1,0);t=(c[d>>2]|0)==1?l:0;i=h;return t|0}lc[c[(c[m>>2]|0)+24>>2]&3](k,j,l,1,0);l=c[j+36>>2]|0;if((l|0)==1){do{if((c[d>>2]|0)!=1){if((c[p>>2]|0)!=0){t=0;i=h;return t|0}if((c[n>>2]|0)!=1){t=0;i=h;return t|0}if((c[o>>2]|0)==1){break}else{t=0}i=h;return t|0}}while(0);t=c[g>>2]|0;i=h;return t|0}else if((l|0)==0){if((c[p>>2]|0)!=1){t=0;i=h;return t|0}if((c[n>>2]|0)!=1){t=0;i=h;return t|0}t=(c[o>>2]|0)==1?c[e>>2]|0:0;i=h;return t|0}else{t=0;i=h;return t|0}return 0}function Em(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;h=i;j=b;if((j|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)!=(e|0)){i=h;return}k=d+28|0;if((c[k>>2]|0)==1){i=h;return}c[k>>2]=f;i=h;return}if((j|0)==(c[d>>2]|0)){do{if((c[d+16>>2]|0)!=(e|0)){j=d+20|0;if((c[j>>2]|0)==(e|0)){break}c[d+32>>2]=f;k=d+44|0;if((c[k>>2]|0)==4){i=h;return}l=c[b+12>>2]|0;m=b+(l<<3)+16|0;a:do{if((l|0)>0){n=d+52|0;o=d+53|0;p=d+54|0;q=b+8|0;r=d+24|0;s=e;t=0;u=0;v=b+16|0;b:while(1){a[n]=0;a[o]=0;w=c[v+4>>2]|0;x=w>>8;if((w&1|0)==0){y=x}else{y=c[(c[s>>2]|0)+x>>2]|0}x=c[v>>2]|0;xc[c[(c[x>>2]|0)+20>>2]&31](x,d,e,e+y|0,2-(w>>>1&1)|0,g);if((a[p]|0)!=0){z=t;A=u;break}do{if((a[o]|0)==0){B=t;C=u}else{if((a[n]|0)==0){if((c[q>>2]&1|0)==0){z=t;A=1;break b}else{B=t;C=1;break}}if((c[r>>2]|0)==1){D=27;break a}if((c[q>>2]&2|0)==0){D=27;break a}else{B=1;C=1}}}while(0);w=v+8|0;if(w>>>0<m>>>0){t=B;u=C;v=w}else{z=B;A=C;break}}if(z){E=A;D=26}else{F=A;D=23}}else{F=0;D=23}}while(0);do{if((D|0)==23){c[j>>2]=e;m=d+40|0;c[m>>2]=(c[m>>2]|0)+1;if((c[d+36>>2]|0)!=1){E=F;D=26;break}if((c[d+24>>2]|0)!=2){E=F;D=26;break}a[d+54|0]=1;if(F){D=27}else{D=28}}}while(0);if((D|0)==26){if(E){D=27}else{D=28}}if((D|0)==27){c[k>>2]=3;i=h;return}else if((D|0)==28){c[k>>2]=4;i=h;return}}}while(0);if((f|0)!=1){i=h;return}c[d+32>>2]=1;i=h;return}E=c[b+12>>2]|0;F=b+(E<<3)+16|0;A=c[b+20>>2]|0;z=A>>8;if((A&1|0)==0){G=z}else{G=c[(c[e>>2]|0)+z>>2]|0}z=c[b+16>>2]|0;lc[c[(c[z>>2]|0)+24>>2]&3](z,d,e+G|0,(A&2|0)!=0?f:2,g);A=b+24|0;if((E|0)<=1){i=h;return}E=c[b+8>>2]|0;do{if((E&2|0)==0){b=d+36|0;if((c[b>>2]|0)==1){break}if((E&1|0)==0){G=d+54|0;z=e;C=A;while(1){if((a[G]|0)!=0){D=53;break}if((c[b>>2]|0)==1){D=53;break}B=c[C+4>>2]|0;y=B>>8;if((B&1|0)==0){H=y}else{H=c[(c[z>>2]|0)+y>>2]|0}y=c[C>>2]|0;lc[c[(c[y>>2]|0)+24>>2]&3](y,d,e+H|0,(B&2|0)!=0?f:2,g);B=C+8|0;if(B>>>0<F>>>0){C=B}else{D=53;break}}if((D|0)==53){i=h;return}}C=d+24|0;z=d+54|0;G=e;k=A;while(1){if((a[z]|0)!=0){D=53;break}if((c[b>>2]|0)==1){if((c[C>>2]|0)==1){D=53;break}}B=c[k+4>>2]|0;y=B>>8;if((B&1|0)==0){I=y}else{I=c[(c[G>>2]|0)+y>>2]|0}y=c[k>>2]|0;lc[c[(c[y>>2]|0)+24>>2]&3](y,d,e+I|0,(B&2|0)!=0?f:2,g);B=k+8|0;if(B>>>0<F>>>0){k=B}else{D=53;break}}if((D|0)==53){i=h;return}}}while(0);I=d+54|0;H=e;E=A;while(1){if((a[I]|0)!=0){D=53;break}A=c[E+4>>2]|0;k=A>>8;if((A&1|0)==0){J=k}else{J=c[(c[H>>2]|0)+k>>2]|0}k=c[E>>2]|0;lc[c[(c[k>>2]|0)+24>>2]&3](k,d,e+J|0,(A&2|0)!=0?f:2,g);A=E+8|0;if(A>>>0<F>>>0){E=A}else{D=53;break}}if((D|0)==53){i=h;return}}function Fm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=i;j=b;if((j|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)!=(e|0)){i=h;return}k=d+28|0;if((c[k>>2]|0)==1){i=h;return}c[k>>2]=f;i=h;return}if((j|0)!=(c[d>>2]|0)){j=c[b+8>>2]|0;lc[c[(c[j>>2]|0)+24>>2]&3](j,d,e,f,g);i=h;return}do{if((c[d+16>>2]|0)!=(e|0)){j=d+20|0;if((c[j>>2]|0)==(e|0)){break}c[d+32>>2]=f;k=d+44|0;if((c[k>>2]|0)==4){i=h;return}l=d+52|0;a[l]=0;m=d+53|0;a[m]=0;n=c[b+8>>2]|0;xc[c[(c[n>>2]|0)+20>>2]&31](n,d,e,e,1,g);if((a[m]|0)==0){o=0;p=13}else{if((a[l]|0)==0){o=1;p=13}}a:do{if((p|0)==13){c[j>>2]=e;l=d+40|0;c[l>>2]=(c[l>>2]|0)+1;do{if((c[d+36>>2]|0)==1){if((c[d+24>>2]|0)!=2){p=16;break}a[d+54|0]=1;if(o){break a}}else{p=16}}while(0);if((p|0)==16){if(o){break}}c[k>>2]=4;i=h;return}}while(0);c[k>>2]=3;i=h;return}}while(0);if((f|0)!=1){i=h;return}c[d+32>>2]=1;i=h;return}function Gm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;g=i;if((c[d+8>>2]|0)==(b|0)){if((c[d+4>>2]|0)!=(e|0)){i=g;return}h=d+28|0;if((c[h>>2]|0)==1){i=g;return}c[h>>2]=f;i=g;return}if((c[d>>2]|0)!=(b|0)){i=g;return}do{if((c[d+16>>2]|0)!=(e|0)){b=d+20|0;if((c[b>>2]|0)==(e|0)){break}c[d+32>>2]=f;c[b>>2]=e;b=d+40|0;c[b>>2]=(c[b>>2]|0)+1;do{if((c[d+36>>2]|0)==1){if((c[d+24>>2]|0)!=2){break}a[d+54|0]=1}}while(0);c[d+44>>2]=4;i=g;return}}while(0);if((f|0)!=1){i=g;return}c[d+32>>2]=1;i=g;return}function Hm(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;j=i;if((b|0)!=(c[d+8>>2]|0)){k=d+52|0;l=a[k]|0;m=d+53|0;n=a[m]|0;o=c[b+12>>2]|0;p=b+(o<<3)+16|0;a[k]=0;a[m]=0;q=c[b+20>>2]|0;r=q>>8;if((q&1|0)==0){s=r}else{s=c[(c[f>>2]|0)+r>>2]|0}r=c[b+16>>2]|0;xc[c[(c[r>>2]|0)+20>>2]&31](r,d,e,f+s|0,(q&2|0)!=0?g:2,h);a:do{if((o|0)>1){q=d+24|0;s=b+8|0;r=d+54|0;t=f;u=b+24|0;do{if((a[r]|0)!=0){break a}do{if((a[k]|0)==0){if((a[m]|0)==0){break}if((c[s>>2]&1|0)==0){break a}}else{if((c[q>>2]|0)==1){break a}if((c[s>>2]&2|0)==0){break a}}}while(0);a[k]=0;a[m]=0;v=c[u+4>>2]|0;w=v>>8;if((v&1|0)==0){x=w}else{x=c[(c[t>>2]|0)+w>>2]|0}w=c[u>>2]|0;xc[c[(c[w>>2]|0)+20>>2]&31](w,d,e,f+x|0,(v&2|0)!=0?g:2,h);u=u+8|0;}while(u>>>0<p>>>0)}}while(0);a[k]=l;a[m]=n;i=j;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=j;return}a[d+52|0]=1;f=d+16|0;n=c[f>>2]|0;if((n|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}if((n|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=j;return}e=d+24|0;n=c[e>>2]|0;if((n|0)==2){c[e>>2]=g;y=g}else{y=n}if(!((c[d+48>>2]|0)==1&(y|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}function Im(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0;j=i;if((b|0)!=(c[d+8>>2]|0)){k=c[b+8>>2]|0;xc[c[(c[k>>2]|0)+20>>2]&31](k,d,e,f,g,h);i=j;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=j;return}a[d+52|0]=1;f=d+16|0;h=c[f>>2]|0;if((h|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}if((h|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=j;return}e=d+24|0;h=c[e>>2]|0;if((h|0)==2){c[e>>2]=g;l=g}else{l=h}if(!((c[d+48>>2]|0)==1&(l|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}function Jm(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0;h=i;if((c[d+8>>2]|0)!=(b|0)){i=h;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=h;return}a[d+52|0]=1;f=d+16|0;b=c[f>>2]|0;if((b|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=h;return}a[d+54|0]=1;i=h;return}if((b|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=h;return}e=d+24|0;b=c[e>>2]|0;if((b|0)==2){c[e>>2]=g;j=g}else{j=b}if(!((c[d+48>>2]|0)==1&(j|0)==1)){i=h;return}a[d+54|0]=1;i=h;return}\n\n\n\nfunction Km(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,Ma=0,Na=0,Pa=0;b=i;do{if(a>>>0<245){if(a>>>0<11){d=16}else{d=a+11&-8}e=d>>>3;f=c[3362]|0;g=f>>>e;if((g&3|0)!=0){h=(g&1^1)+e|0;j=h<<1;k=13488+(j<<2)|0;l=13488+(j+2<<2)|0;j=c[l>>2]|0;m=j+8|0;n=c[m>>2]|0;do{if((k|0)==(n|0)){c[3362]=f&~(1<<h)}else{if(n>>>0<(c[13464>>2]|0)>>>0){Mb()}o=n+12|0;if((c[o>>2]|0)==(j|0)){c[o>>2]=k;c[l>>2]=n;break}else{Mb()}}}while(0);n=h<<3;c[j+4>>2]=n|3;l=j+(n|4)|0;c[l>>2]=c[l>>2]|1;p=m;i=b;return p|0}if(!(d>>>0>(c[13456>>2]|0)>>>0)){q=d;break}if((g|0)!=0){l=2<<e;n=g<<e&(l|0-l);l=(n&0-n)+ -1|0;n=l>>>12&16;k=l>>>n;l=k>>>5&8;o=k>>>l;k=o>>>2&4;r=o>>>k;o=r>>>1&2;s=r>>>o;r=s>>>1&1;t=(l|n|k|o|r)+(s>>>r)|0;r=t<<1;s=13488+(r<<2)|0;o=13488+(r+2<<2)|0;r=c[o>>2]|0;k=r+8|0;n=c[k>>2]|0;do{if((s|0)==(n|0)){c[3362]=f&~(1<<t)}else{if(n>>>0<(c[13464>>2]|0)>>>0){Mb()}l=n+12|0;if((c[l>>2]|0)==(r|0)){c[l>>2]=s;c[o>>2]=n;break}else{Mb()}}}while(0);n=t<<3;o=n-d|0;c[r+4>>2]=d|3;s=r;f=s+d|0;c[s+(d|4)>>2]=o|1;c[s+n>>2]=o;n=c[13456>>2]|0;if((n|0)!=0){s=c[13468>>2]|0;e=n>>>3;n=e<<1;g=13488+(n<<2)|0;m=c[3362]|0;j=1<<e;do{if((m&j|0)==0){c[3362]=m|j;u=13488+(n+2<<2)|0;v=g}else{e=13488+(n+2<<2)|0;h=c[e>>2]|0;if(!(h>>>0<(c[13464>>2]|0)>>>0)){u=e;v=h;break}Mb()}}while(0);c[u>>2]=s;c[v+12>>2]=s;c[s+8>>2]=v;c[s+12>>2]=g}c[13456>>2]=o;c[13468>>2]=f;p=k;i=b;return p|0}n=c[13452>>2]|0;if((n|0)==0){q=d;break}j=(n&0-n)+ -1|0;n=j>>>12&16;m=j>>>n;j=m>>>5&8;r=m>>>j;m=r>>>2&4;t=r>>>m;r=t>>>1&2;h=t>>>r;t=h>>>1&1;e=c[13752+((j|n|m|r|t)+(h>>>t)<<2)>>2]|0;t=(c[e+4>>2]&-8)-d|0;h=e;r=e;while(1){e=c[h+16>>2]|0;if((e|0)==0){m=c[h+20>>2]|0;if((m|0)==0){break}else{w=m}}else{w=e}e=(c[w+4>>2]&-8)-d|0;m=e>>>0<t>>>0;t=m?e:t;h=w;r=m?w:r}h=r;k=c[13464>>2]|0;if(h>>>0<k>>>0){Mb()}f=h+d|0;o=f;if(!(h>>>0<f>>>0)){Mb()}f=c[r+24>>2]|0;g=c[r+12>>2]|0;do{if((g|0)==(r|0)){s=r+20|0;m=c[s>>2]|0;if((m|0)==0){e=r+16|0;n=c[e>>2]|0;if((n|0)==0){x=0;break}else{y=n;z=e}}else{y=m;z=s}while(1){s=y+20|0;m=c[s>>2]|0;if((m|0)!=0){z=s;y=m;continue}m=y+16|0;s=c[m>>2]|0;if((s|0)==0){break}else{y=s;z=m}}if(z>>>0<k>>>0){Mb()}else{c[z>>2]=0;x=y;break}}else{m=c[r+8>>2]|0;if(m>>>0<k>>>0){Mb()}s=m+12|0;if((c[s>>2]|0)!=(r|0)){Mb()}e=g+8|0;if((c[e>>2]|0)==(r|0)){c[s>>2]=g;c[e>>2]=m;x=g;break}else{Mb()}}}while(0);a:do{if((f|0)!=0){g=c[r+28>>2]|0;k=13752+(g<<2)|0;do{if((r|0)==(c[k>>2]|0)){c[k>>2]=x;if((x|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<g);break a}else{if(f>>>0<(c[13464>>2]|0)>>>0){Mb()}m=f+16|0;if((c[m>>2]|0)==(r|0)){c[m>>2]=x}else{c[f+20>>2]=x}if((x|0)==0){break a}}}while(0);if(x>>>0<(c[13464>>2]|0)>>>0){Mb()}c[x+24>>2]=f;g=c[r+16>>2]|0;do{if((g|0)!=0){if(g>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[x+16>>2]=g;c[g+24>>2]=x;break}}}while(0);g=c[r+20>>2]|0;if((g|0)==0){break}if(g>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[x+20>>2]=g;c[g+24>>2]=x;break}}}while(0);if(t>>>0<16){f=t+d|0;c[r+4>>2]=f|3;g=h+(f+4)|0;c[g>>2]=c[g>>2]|1}else{c[r+4>>2]=d|3;c[h+(d|4)>>2]=t|1;c[h+(t+d)>>2]=t;g=c[13456>>2]|0;if((g|0)!=0){f=c[13468>>2]|0;k=g>>>3;g=k<<1;m=13488+(g<<2)|0;e=c[3362]|0;s=1<<k;do{if((e&s|0)==0){c[3362]=e|s;A=13488+(g+2<<2)|0;B=m}else{k=13488+(g+2<<2)|0;n=c[k>>2]|0;if(!(n>>>0<(c[13464>>2]|0)>>>0)){A=k;B=n;break}Mb()}}while(0);c[A>>2]=f;c[B+12>>2]=f;c[f+8>>2]=B;c[f+12>>2]=m}c[13456>>2]=t;c[13468>>2]=o}p=r+8|0;i=b;return p|0}else{if(a>>>0>4294967231){q=-1;break}g=a+11|0;s=g&-8;e=c[13452>>2]|0;if((e|0)==0){q=s;break}h=0-s|0;n=g>>>8;do{if((n|0)==0){C=0}else{if(s>>>0>16777215){C=31;break}g=(n+1048320|0)>>>16&8;k=n<<g;j=(k+520192|0)>>>16&4;l=k<<j;k=(l+245760|0)>>>16&2;D=14-(j|g|k)+(l<<k>>>15)|0;C=s>>>(D+7|0)&1|D<<1}}while(0);n=c[13752+(C<<2)>>2]|0;b:do{if((n|0)==0){E=h;F=0;G=0}else{if((C|0)==31){H=0}else{H=25-(C>>>1)|0}r=h;o=0;t=s<<H;m=n;f=0;while(1){D=c[m+4>>2]&-8;k=D-s|0;if(k>>>0<r>>>0){if((D|0)==(s|0)){E=k;F=m;G=m;break b}else{I=k;J=m}}else{I=r;J=f}k=c[m+20>>2]|0;D=c[m+(t>>>31<<2)+16>>2]|0;l=(k|0)==0|(k|0)==(D|0)?o:k;if((D|0)==0){E=I;F=l;G=J;break}else{r=I;o=l;t=t<<1;m=D;f=J}}}}while(0);if((F|0)==0&(G|0)==0){n=2<<C;h=e&(n|0-n);if((h|0)==0){q=s;break}n=(h&0-h)+ -1|0;h=n>>>12&16;f=n>>>h;n=f>>>5&8;m=f>>>n;f=m>>>2&4;t=m>>>f;m=t>>>1&2;o=t>>>m;t=o>>>1&1;K=c[13752+((n|h|f|m|t)+(o>>>t)<<2)>>2]|0}else{K=F}if((K|0)==0){L=E;M=G}else{t=E;o=K;m=G;while(1){f=(c[o+4>>2]&-8)-s|0;h=f>>>0<t>>>0;n=h?f:t;f=h?o:m;h=c[o+16>>2]|0;if((h|0)!=0){N=f;O=n;m=N;o=h;t=O;continue}h=c[o+20>>2]|0;if((h|0)==0){L=n;M=f;break}else{N=f;O=n;o=h;m=N;t=O}}}if((M|0)==0){q=s;break}if(!(L>>>0<((c[13456>>2]|0)-s|0)>>>0)){q=s;break}t=M;m=c[13464>>2]|0;if(t>>>0<m>>>0){Mb()}o=t+s|0;e=o;if(!(t>>>0<o>>>0)){Mb()}h=c[M+24>>2]|0;n=c[M+12>>2]|0;do{if((n|0)==(M|0)){f=M+20|0;r=c[f>>2]|0;if((r|0)==0){D=M+16|0;l=c[D>>2]|0;if((l|0)==0){P=0;break}else{Q=l;R=D}}else{Q=r;R=f}while(1){f=Q+20|0;r=c[f>>2]|0;if((r|0)!=0){R=f;Q=r;continue}r=Q+16|0;f=c[r>>2]|0;if((f|0)==0){break}else{Q=f;R=r}}if(R>>>0<m>>>0){Mb()}else{c[R>>2]=0;P=Q;break}}else{r=c[M+8>>2]|0;if(r>>>0<m>>>0){Mb()}f=r+12|0;if((c[f>>2]|0)!=(M|0)){Mb()}D=n+8|0;if((c[D>>2]|0)==(M|0)){c[f>>2]=n;c[D>>2]=r;P=n;break}else{Mb()}}}while(0);c:do{if((h|0)!=0){n=c[M+28>>2]|0;m=13752+(n<<2)|0;do{if((M|0)==(c[m>>2]|0)){c[m>>2]=P;if((P|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<n);break c}else{if(h>>>0<(c[13464>>2]|0)>>>0){Mb()}r=h+16|0;if((c[r>>2]|0)==(M|0)){c[r>>2]=P}else{c[h+20>>2]=P}if((P|0)==0){break c}}}while(0);if(P>>>0<(c[13464>>2]|0)>>>0){Mb()}c[P+24>>2]=h;n=c[M+16>>2]|0;do{if((n|0)!=0){if(n>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[P+16>>2]=n;c[n+24>>2]=P;break}}}while(0);n=c[M+20>>2]|0;if((n|0)==0){break}if(n>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[P+20>>2]=n;c[n+24>>2]=P;break}}}while(0);d:do{if(L>>>0<16){h=L+s|0;c[M+4>>2]=h|3;n=t+(h+4)|0;c[n>>2]=c[n>>2]|1}else{c[M+4>>2]=s|3;c[t+(s|4)>>2]=L|1;c[t+(L+s)>>2]=L;n=L>>>3;if(L>>>0<256){h=n<<1;m=13488+(h<<2)|0;r=c[3362]|0;D=1<<n;do{if((r&D|0)==0){c[3362]=r|D;S=13488+(h+2<<2)|0;T=m}else{n=13488+(h+2<<2)|0;f=c[n>>2]|0;if(!(f>>>0<(c[13464>>2]|0)>>>0)){S=n;T=f;break}Mb()}}while(0);c[S>>2]=e;c[T+12>>2]=e;c[t+(s+8)>>2]=T;c[t+(s+12)>>2]=m;break}h=o;D=L>>>8;do{if((D|0)==0){U=0}else{if(L>>>0>16777215){U=31;break}r=(D+1048320|0)>>>16&8;f=D<<r;n=(f+520192|0)>>>16&4;l=f<<n;f=(l+245760|0)>>>16&2;k=14-(n|r|f)+(l<<f>>>15)|0;U=L>>>(k+7|0)&1|k<<1}}while(0);D=13752+(U<<2)|0;c[t+(s+28)>>2]=U;c[t+(s+20)>>2]=0;c[t+(s+16)>>2]=0;m=c[13452>>2]|0;k=1<<U;if((m&k|0)==0){c[13452>>2]=m|k;c[D>>2]=h;c[t+(s+24)>>2]=D;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break}k=c[D>>2]|0;if((U|0)==31){V=0}else{V=25-(U>>>1)|0}e:do{if((c[k+4>>2]&-8|0)==(L|0)){W=k}else{D=L<<V;m=k;while(1){X=m+(D>>>31<<2)+16|0;f=c[X>>2]|0;if((f|0)==0){break}if((c[f+4>>2]&-8|0)==(L|0)){W=f;break e}else{D=D<<1;m=f}}if(X>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[X>>2]=h;c[t+(s+24)>>2]=m;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break d}}}while(0);k=W+8|0;D=c[k>>2]|0;f=c[13464>>2]|0;if(W>>>0<f>>>0){Mb()}if(D>>>0<f>>>0){Mb()}else{c[D+12>>2]=h;c[k>>2]=h;c[t+(s+8)>>2]=D;c[t+(s+12)>>2]=W;c[t+(s+24)>>2]=0;break}}}while(0);p=M+8|0;i=b;return p|0}}while(0);M=c[13456>>2]|0;if(!(q>>>0>M>>>0)){W=M-q|0;X=c[13468>>2]|0;if(W>>>0>15){L=X;c[13468>>2]=L+q;c[13456>>2]=W;c[L+(q+4)>>2]=W|1;c[L+M>>2]=W;c[X+4>>2]=q|3}else{c[13456>>2]=0;c[13468>>2]=0;c[X+4>>2]=M|3;W=X+(M+4)|0;c[W>>2]=c[W>>2]|1}p=X+8|0;i=b;return p|0}X=c[13460>>2]|0;if(q>>>0<X>>>0){W=X-q|0;c[13460>>2]=W;X=c[13472>>2]|0;M=X;c[13472>>2]=M+q;c[M+(q+4)>>2]=W|1;c[X+4>>2]=q|3;p=X+8|0;i=b;return p|0}do{if((c[3480]|0)==0){X=Oa(30)|0;if((X+ -1&X|0)==0){c[13928>>2]=X;c[13924>>2]=X;c[13932>>2]=-1;c[13936>>2]=-1;c[13940>>2]=0;c[13892>>2]=0;c[3480]=(pb(0)|0)&-16^1431655768;break}else{Mb()}}}while(0);X=q+48|0;W=c[13928>>2]|0;M=q+47|0;L=W+M|0;V=0-W|0;W=L&V;if(!(W>>>0>q>>>0)){p=0;i=b;return p|0}U=c[13888>>2]|0;do{if((U|0)!=0){T=c[13880>>2]|0;S=T+W|0;if(S>>>0<=T>>>0|S>>>0>U>>>0){p=0}else{break}i=b;return p|0}}while(0);f:do{if((c[13892>>2]&4|0)==0){U=c[13472>>2]|0;g:do{if((U|0)==0){Y=182}else{S=U;T=13896|0;while(1){Z=T;P=c[Z>>2]|0;if(!(P>>>0>S>>>0)){_=T+4|0;if((P+(c[_>>2]|0)|0)>>>0>S>>>0){break}}P=c[T+8>>2]|0;if((P|0)==0){Y=182;break g}else{T=P}}if((T|0)==0){Y=182;break}S=L-(c[13460>>2]|0)&V;if(!(S>>>0<2147483647)){$=0;break}h=La(S|0)|0;P=(h|0)==((c[Z>>2]|0)+(c[_>>2]|0)|0);aa=h;ba=S;ca=P?h:-1;da=P?S:0;Y=191}}while(0);do{if((Y|0)==182){U=La(0)|0;if((U|0)==(-1|0)){$=0;break}S=U;P=c[13924>>2]|0;h=P+ -1|0;if((h&S|0)==0){ea=W}else{ea=W-S+(h+S&0-P)|0}P=c[13880>>2]|0;S=P+ea|0;if(!(ea>>>0>q>>>0&ea>>>0<2147483647)){$=0;break}h=c[13888>>2]|0;if((h|0)!=0){if(S>>>0<=P>>>0|S>>>0>h>>>0){$=0;break}}h=La(ea|0)|0;S=(h|0)==(U|0);aa=h;ba=ea;ca=S?U:-1;da=S?ea:0;Y=191}}while(0);h:do{if((Y|0)==191){S=0-ba|0;if((ca|0)!=(-1|0)){fa=ca;ga=da;Y=202;break f}do{if((aa|0)!=(-1|0)&ba>>>0<2147483647&ba>>>0<X>>>0){U=c[13928>>2]|0;h=M-ba+U&0-U;if(!(h>>>0<2147483647)){ha=ba;break}if((La(h|0)|0)==(-1|0)){La(S|0)|0;$=da;break h}else{ha=h+ba|0;break}}else{ha=ba}}while(0);if((aa|0)==(-1|0)){$=da}else{fa=aa;ga=ha;Y=202;break f}}}while(0);c[13892>>2]=c[13892>>2]|4;ia=$;Y=199}else{ia=0;Y=199}}while(0);do{if((Y|0)==199){if(!(W>>>0<2147483647)){break}$=La(W|0)|0;ha=La(0)|0;if(!((ha|0)!=(-1|0)&($|0)!=(-1|0)&$>>>0<ha>>>0)){break}aa=ha-$|0;ha=aa>>>0>(q+40|0)>>>0;if(ha){fa=$;ga=ha?aa:ia;Y=202}}}while(0);do{if((Y|0)==202){ia=(c[13880>>2]|0)+ga|0;c[13880>>2]=ia;if(ia>>>0>(c[13884>>2]|0)>>>0){c[13884>>2]=ia}ia=c[13472>>2]|0;i:do{if((ia|0)==0){W=c[13464>>2]|0;if((W|0)==0|fa>>>0<W>>>0){c[13464>>2]=fa}c[13896>>2]=fa;c[13900>>2]=ga;c[13908>>2]=0;c[13484>>2]=c[3480];c[13480>>2]=-1;W=0;do{aa=W<<1;ha=13488+(aa<<2)|0;c[13488+(aa+3<<2)>>2]=ha;c[13488+(aa+2<<2)>>2]=ha;W=W+1|0;}while((W|0)!=32);W=fa+8|0;if((W&7|0)==0){ja=0}else{ja=0-W&7}W=ga+ -40-ja|0;c[13472>>2]=fa+ja;c[13460>>2]=W;c[fa+(ja+4)>>2]=W|1;c[fa+(ga+ -36)>>2]=40;c[13476>>2]=c[13936>>2]}else{W=13896|0;while(1){ka=c[W>>2]|0;la=W+4|0;ma=c[la>>2]|0;if((fa|0)==(ka+ma|0)){Y=214;break}ha=c[W+8>>2]|0;if((ha|0)==0){break}else{W=ha}}do{if((Y|0)==214){if((c[W+12>>2]&8|0)!=0){break}ha=ia;if(!(ha>>>0>=ka>>>0&ha>>>0<fa>>>0)){break}c[la>>2]=ma+ga;aa=(c[13460>>2]|0)+ga|0;$=ia+8|0;if(($&7|0)==0){na=0}else{na=0-$&7}$=aa-na|0;c[13472>>2]=ha+na;c[13460>>2]=$;c[ha+(na+4)>>2]=$|1;c[ha+(aa+4)>>2]=40;c[13476>>2]=c[13936>>2];break i}}while(0);if(fa>>>0<(c[13464>>2]|0)>>>0){c[13464>>2]=fa}W=fa+ga|0;aa=13896|0;while(1){oa=aa;if((c[oa>>2]|0)==(W|0)){Y=224;break}ha=c[aa+8>>2]|0;if((ha|0)==0){break}else{aa=ha}}do{if((Y|0)==224){if((c[aa+12>>2]&8|0)!=0){break}c[oa>>2]=fa;W=aa+4|0;c[W>>2]=(c[W>>2]|0)+ga;W=fa+8|0;if((W&7|0)==0){pa=0}else{pa=0-W&7}W=fa+(ga+8)|0;if((W&7|0)==0){qa=0}else{qa=0-W&7}W=fa+(qa+ga)|0;ha=W;$=pa+q|0;da=fa+$|0;ba=da;M=W-(fa+pa)-q|0;c[fa+(pa+4)>>2]=q|3;j:do{if((ha|0)==(c[13472>>2]|0)){X=(c[13460>>2]|0)+M|0;c[13460>>2]=X;c[13472>>2]=ba;c[fa+($+4)>>2]=X|1}else{if((ha|0)==(c[13468>>2]|0)){X=(c[13456>>2]|0)+M|0;c[13456>>2]=X;c[13468>>2]=ba;c[fa+($+4)>>2]=X|1;c[fa+(X+$)>>2]=X;break}X=ga+4|0;ca=c[fa+(X+qa)>>2]|0;if((ca&3|0)==1){ea=ca&-8;_=ca>>>3;k:do{if(ca>>>0<256){Z=c[fa+((qa|8)+ga)>>2]|0;V=c[fa+(ga+12+qa)>>2]|0;L=13488+(_<<1<<2)|0;do{if((Z|0)!=(L|0)){if(Z>>>0<(c[13464>>2]|0)>>>0){Mb()}if((c[Z+12>>2]|0)==(ha|0)){break}Mb()}}while(0);if((V|0)==(Z|0)){c[3362]=c[3362]&~(1<<_);break}do{if((V|0)==(L|0)){ra=V+8|0}else{if(V>>>0<(c[13464>>2]|0)>>>0){Mb()}S=V+8|0;if((c[S>>2]|0)==(ha|0)){ra=S;break}Mb()}}while(0);c[Z+12>>2]=V;c[ra>>2]=Z}else{L=W;S=c[fa+((qa|24)+ga)>>2]|0;T=c[fa+(ga+12+qa)>>2]|0;do{if((T|0)==(L|0)){h=qa|16;U=fa+(X+h)|0;P=c[U>>2]|0;if((P|0)==0){Q=fa+(h+ga)|0;h=c[Q>>2]|0;if((h|0)==0){sa=0;break}else{ta=h;ua=Q}}else{ta=P;ua=U}while(1){U=ta+20|0;P=c[U>>2]|0;if((P|0)!=0){ua=U;ta=P;continue}P=ta+16|0;U=c[P>>2]|0;if((U|0)==0){break}else{ta=U;ua=P}}if(ua>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[ua>>2]=0;sa=ta;break}}else{P=c[fa+((qa|8)+ga)>>2]|0;if(P>>>0<(c[13464>>2]|0)>>>0){Mb()}U=P+12|0;if((c[U>>2]|0)!=(L|0)){Mb()}Q=T+8|0;if((c[Q>>2]|0)==(L|0)){c[U>>2]=T;c[Q>>2]=P;sa=T;break}else{Mb()}}}while(0);if((S|0)==0){break}T=c[fa+(ga+28+qa)>>2]|0;Z=13752+(T<<2)|0;do{if((L|0)==(c[Z>>2]|0)){c[Z>>2]=sa;if((sa|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<T);break k}else{if(S>>>0<(c[13464>>2]|0)>>>0){Mb()}V=S+16|0;if((c[V>>2]|0)==(L|0)){c[V>>2]=sa}else{c[S+20>>2]=sa}if((sa|0)==0){break k}}}while(0);if(sa>>>0<(c[13464>>2]|0)>>>0){Mb()}c[sa+24>>2]=S;L=qa|16;T=c[fa+(L+ga)>>2]|0;do{if((T|0)!=0){if(T>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[sa+16>>2]=T;c[T+24>>2]=sa;break}}}while(0);T=c[fa+(X+L)>>2]|0;if((T|0)==0){break}if(T>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[sa+20>>2]=T;c[T+24>>2]=sa;break}}}while(0);va=fa+((ea|qa)+ga)|0;wa=ea+M|0}else{va=ha;wa=M}X=va+4|0;c[X>>2]=c[X>>2]&-2;c[fa+($+4)>>2]=wa|1;c[fa+(wa+$)>>2]=wa;X=wa>>>3;if(wa>>>0<256){_=X<<1;ca=13488+(_<<2)|0;T=c[3362]|0;S=1<<X;do{if((T&S|0)==0){c[3362]=T|S;xa=13488+(_+2<<2)|0;ya=ca}else{X=13488+(_+2<<2)|0;Z=c[X>>2]|0;if(!(Z>>>0<(c[13464>>2]|0)>>>0)){xa=X;ya=Z;break}Mb()}}while(0);c[xa>>2]=ba;c[ya+12>>2]=ba;c[fa+($+8)>>2]=ya;c[fa+($+12)>>2]=ca;break}_=da;S=wa>>>8;do{if((S|0)==0){za=0}else{if(wa>>>0>16777215){za=31;break}T=(S+1048320|0)>>>16&8;ea=S<<T;Z=(ea+520192|0)>>>16&4;X=ea<<Z;ea=(X+245760|0)>>>16&2;V=14-(Z|T|ea)+(X<<ea>>>15)|0;za=wa>>>(V+7|0)&1|V<<1}}while(0);S=13752+(za<<2)|0;c[fa+($+28)>>2]=za;c[fa+($+20)>>2]=0;c[fa+($+16)>>2]=0;ca=c[13452>>2]|0;V=1<<za;if((ca&V|0)==0){c[13452>>2]=ca|V;c[S>>2]=_;c[fa+($+24)>>2]=S;c[fa+($+12)>>2]=_;c[fa+($+8)>>2]=_;break}V=c[S>>2]|0;if((za|0)==31){Aa=0}else{Aa=25-(za>>>1)|0}l:do{if((c[V+4>>2]&-8|0)==(wa|0)){Ba=V}else{S=wa<<Aa;ca=V;while(1){Ca=ca+(S>>>31<<2)+16|0;ea=c[Ca>>2]|0;if((ea|0)==0){break}if((c[ea+4>>2]&-8|0)==(wa|0)){Ba=ea;break l}else{S=S<<1;ca=ea}}if(Ca>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[Ca>>2]=_;c[fa+($+24)>>2]=ca;c[fa+($+12)>>2]=_;c[fa+($+8)>>2]=_;break j}}}while(0);V=Ba+8|0;S=c[V>>2]|0;L=c[13464>>2]|0;if(Ba>>>0<L>>>0){Mb()}if(S>>>0<L>>>0){Mb()}else{c[S+12>>2]=_;c[V>>2]=_;c[fa+($+8)>>2]=S;c[fa+($+12)>>2]=Ba;c[fa+($+24)>>2]=0;break}}}while(0);p=fa+(pa|8)|0;i=b;return p|0}}while(0);aa=ia;$=13896|0;while(1){Da=c[$>>2]|0;if(!(Da>>>0>aa>>>0)){Ea=c[$+4>>2]|0;Fa=Da+Ea|0;if(Fa>>>0>aa>>>0){break}}$=c[$+8>>2]|0}$=Da+(Ea+ -39)|0;if(($&7|0)==0){Ga=0}else{Ga=0-$&7}$=Da+(Ea+ -47+Ga)|0;da=$>>>0<(ia+16|0)>>>0?aa:$;$=da+8|0;ba=$;M=fa+8|0;if((M&7|0)==0){Ha=0}else{Ha=0-M&7}M=ga+ -40-Ha|0;c[13472>>2]=fa+Ha;c[13460>>2]=M;c[fa+(Ha+4)>>2]=M|1;c[fa+(ga+ -36)>>2]=40;c[13476>>2]=c[13936>>2];c[da+4>>2]=27;c[$+0>>2]=c[13896>>2];c[$+4>>2]=c[13900>>2];c[$+8>>2]=c[13904>>2];c[$+12>>2]=c[13908>>2];c[13896>>2]=fa;c[13900>>2]=ga;c[13908>>2]=0;c[13904>>2]=ba;ba=da+28|0;c[ba>>2]=7;if((da+32|0)>>>0<Fa>>>0){$=ba;while(1){ba=$+4|0;c[ba>>2]=7;if(($+8|0)>>>0<Fa>>>0){$=ba}else{break}}}if((da|0)==(aa|0)){break}$=da-ia|0;ba=aa+($+4)|0;c[ba>>2]=c[ba>>2]&-2;c[ia+4>>2]=$|1;c[aa+$>>2]=$;ba=$>>>3;if($>>>0<256){M=ba<<1;ha=13488+(M<<2)|0;W=c[3362]|0;m=1<<ba;do{if((W&m|0)==0){c[3362]=W|m;Ia=13488+(M+2<<2)|0;Ja=ha}else{ba=13488+(M+2<<2)|0;S=c[ba>>2]|0;if(!(S>>>0<(c[13464>>2]|0)>>>0)){Ia=ba;Ja=S;break}Mb()}}while(0);c[Ia>>2]=ia;c[Ja+12>>2]=ia;c[ia+8>>2]=Ja;c[ia+12>>2]=ha;break}M=ia;m=$>>>8;do{if((m|0)==0){Ka=0}else{if($>>>0>16777215){Ka=31;break}W=(m+1048320|0)>>>16&8;aa=m<<W;da=(aa+520192|0)>>>16&4;S=aa<<da;aa=(S+245760|0)>>>16&2;ba=14-(da|W|aa)+(S<<aa>>>15)|0;Ka=$>>>(ba+7|0)&1|ba<<1}}while(0);m=13752+(Ka<<2)|0;c[ia+28>>2]=Ka;c[ia+20>>2]=0;c[ia+16>>2]=0;ha=c[13452>>2]|0;ba=1<<Ka;if((ha&ba|0)==0){c[13452>>2]=ha|ba;c[m>>2]=M;c[ia+24>>2]=m;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break}ba=c[m>>2]|0;if((Ka|0)==31){Ma=0}else{Ma=25-(Ka>>>1)|0}m:do{if((c[ba+4>>2]&-8|0)==($|0)){Na=ba}else{m=$<<Ma;ha=ba;while(1){Pa=ha+(m>>>31<<2)+16|0;aa=c[Pa>>2]|0;if((aa|0)==0){break}if((c[aa+4>>2]&-8|0)==($|0)){Na=aa;break m}else{m=m<<1;ha=aa}}if(Pa>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[Pa>>2]=M;c[ia+24>>2]=ha;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break i}}}while(0);$=Na+8|0;ba=c[$>>2]|0;m=c[13464>>2]|0;if(Na>>>0<m>>>0){Mb()}if(ba>>>0<m>>>0){Mb()}else{c[ba+12>>2]=M;c[$>>2]=M;c[ia+8>>2]=ba;c[ia+12>>2]=Na;c[ia+24>>2]=0;break}}}while(0);ia=c[13460>>2]|0;if(!(ia>>>0>q>>>0)){break}ba=ia-q|0;c[13460>>2]=ba;ia=c[13472>>2]|0;$=ia;c[13472>>2]=$+q;c[$+(q+4)>>2]=ba|1;c[ia+4>>2]=q|3;p=ia+8|0;i=b;return p|0}}while(0);c[(ac()|0)>>2]=12;p=0;i=b;return p|0}function Lm(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;b=i;if((a|0)==0){i=b;return}d=a+ -8|0;e=d;f=c[13464>>2]|0;if(d>>>0<f>>>0){Mb()}g=c[a+ -4>>2]|0;h=g&3;if((h|0)==1){Mb()}j=g&-8;k=a+(j+ -8)|0;l=k;a:do{if((g&1|0)==0){m=c[d>>2]|0;if((h|0)==0){i=b;return}n=-8-m|0;o=a+n|0;p=o;q=m+j|0;if(o>>>0<f>>>0){Mb()}if((p|0)==(c[13468>>2]|0)){r=a+(j+ -4)|0;if((c[r>>2]&3|0)!=3){s=p;t=q;break}c[13456>>2]=q;c[r>>2]=c[r>>2]&-2;c[a+(n+4)>>2]=q|1;c[k>>2]=q;i=b;return}r=m>>>3;if(m>>>0<256){m=c[a+(n+8)>>2]|0;u=c[a+(n+12)>>2]|0;v=13488+(r<<1<<2)|0;do{if((m|0)!=(v|0)){if(m>>>0<f>>>0){Mb()}if((c[m+12>>2]|0)==(p|0)){break}Mb()}}while(0);if((u|0)==(m|0)){c[3362]=c[3362]&~(1<<r);s=p;t=q;break}do{if((u|0)==(v|0)){w=u+8|0}else{if(u>>>0<f>>>0){Mb()}x=u+8|0;if((c[x>>2]|0)==(p|0)){w=x;break}Mb()}}while(0);c[m+12>>2]=u;c[w>>2]=m;s=p;t=q;break}v=o;r=c[a+(n+24)>>2]|0;x=c[a+(n+12)>>2]|0;do{if((x|0)==(v|0)){y=a+(n+20)|0;z=c[y>>2]|0;if((z|0)==0){A=a+(n+16)|0;B=c[A>>2]|0;if((B|0)==0){C=0;break}else{D=B;E=A}}else{D=z;E=y}while(1){y=D+20|0;z=c[y>>2]|0;if((z|0)!=0){E=y;D=z;continue}z=D+16|0;y=c[z>>2]|0;if((y|0)==0){break}else{D=y;E=z}}if(E>>>0<f>>>0){Mb()}else{c[E>>2]=0;C=D;break}}else{z=c[a+(n+8)>>2]|0;if(z>>>0<f>>>0){Mb()}y=z+12|0;if((c[y>>2]|0)!=(v|0)){Mb()}A=x+8|0;if((c[A>>2]|0)==(v|0)){c[y>>2]=x;c[A>>2]=z;C=x;break}else{Mb()}}}while(0);if((r|0)==0){s=p;t=q;break}x=c[a+(n+28)>>2]|0;o=13752+(x<<2)|0;do{if((v|0)==(c[o>>2]|0)){c[o>>2]=C;if((C|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<x);s=p;t=q;break a}else{if(r>>>0<(c[13464>>2]|0)>>>0){Mb()}m=r+16|0;if((c[m>>2]|0)==(v|0)){c[m>>2]=C}else{c[r+20>>2]=C}if((C|0)==0){s=p;t=q;break a}}}while(0);if(C>>>0<(c[13464>>2]|0)>>>0){Mb()}c[C+24>>2]=r;v=c[a+(n+16)>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[C+16>>2]=v;c[v+24>>2]=C;break}}}while(0);v=c[a+(n+20)>>2]|0;if((v|0)==0){s=p;t=q;break}if(v>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[C+20>>2]=v;c[v+24>>2]=C;s=p;t=q;break}}else{s=e;t=j}}while(0);e=s;if(!(e>>>0<k>>>0)){Mb()}C=a+(j+ -4)|0;f=c[C>>2]|0;if((f&1|0)==0){Mb()}do{if((f&2|0)==0){if((l|0)==(c[13472>>2]|0)){D=(c[13460>>2]|0)+t|0;c[13460>>2]=D;c[13472>>2]=s;c[s+4>>2]=D|1;if((s|0)!=(c[13468>>2]|0)){i=b;return}c[13468>>2]=0;c[13456>>2]=0;i=b;return}if((l|0)==(c[13468>>2]|0)){D=(c[13456>>2]|0)+t|0;c[13456>>2]=D;c[13468>>2]=s;c[s+4>>2]=D|1;c[e+D>>2]=D;i=b;return}D=(f&-8)+t|0;E=f>>>3;b:do{if(f>>>0<256){w=c[a+j>>2]|0;h=c[a+(j|4)>>2]|0;d=13488+(E<<1<<2)|0;do{if((w|0)!=(d|0)){if(w>>>0<(c[13464>>2]|0)>>>0){Mb()}if((c[w+12>>2]|0)==(l|0)){break}Mb()}}while(0);if((h|0)==(w|0)){c[3362]=c[3362]&~(1<<E);break}do{if((h|0)==(d|0)){F=h+8|0}else{if(h>>>0<(c[13464>>2]|0)>>>0){Mb()}g=h+8|0;if((c[g>>2]|0)==(l|0)){F=g;break}Mb()}}while(0);c[w+12>>2]=h;c[F>>2]=w}else{d=k;g=c[a+(j+16)>>2]|0;v=c[a+(j|4)>>2]|0;do{if((v|0)==(d|0)){r=a+(j+12)|0;x=c[r>>2]|0;if((x|0)==0){o=a+(j+8)|0;m=c[o>>2]|0;if((m|0)==0){G=0;break}else{H=m;I=o}}else{H=x;I=r}while(1){r=H+20|0;x=c[r>>2]|0;if((x|0)!=0){I=r;H=x;continue}x=H+16|0;r=c[x>>2]|0;if((r|0)==0){break}else{H=r;I=x}}if(I>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[I>>2]=0;G=H;break}}else{x=c[a+j>>2]|0;if(x>>>0<(c[13464>>2]|0)>>>0){Mb()}r=x+12|0;if((c[r>>2]|0)!=(d|0)){Mb()}o=v+8|0;if((c[o>>2]|0)==(d|0)){c[r>>2]=v;c[o>>2]=x;G=v;break}else{Mb()}}}while(0);if((g|0)==0){break}v=c[a+(j+20)>>2]|0;w=13752+(v<<2)|0;do{if((d|0)==(c[w>>2]|0)){c[w>>2]=G;if((G|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<v);break b}else{if(g>>>0<(c[13464>>2]|0)>>>0){Mb()}h=g+16|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=G}else{c[g+20>>2]=G}if((G|0)==0){break b}}}while(0);if(G>>>0<(c[13464>>2]|0)>>>0){Mb()}c[G+24>>2]=g;d=c[a+(j+8)>>2]|0;do{if((d|0)!=0){if(d>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[G+16>>2]=d;c[d+24>>2]=G;break}}}while(0);d=c[a+(j+12)>>2]|0;if((d|0)==0){break}if(d>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[G+20>>2]=d;c[d+24>>2]=G;break}}}while(0);c[s+4>>2]=D|1;c[e+D>>2]=D;if((s|0)!=(c[13468>>2]|0)){J=D;break}c[13456>>2]=D;i=b;return}else{c[C>>2]=f&-2;c[s+4>>2]=t|1;c[e+t>>2]=t;J=t}}while(0);t=J>>>3;if(J>>>0<256){e=t<<1;f=13488+(e<<2)|0;C=c[3362]|0;G=1<<t;do{if((C&G|0)==0){c[3362]=C|G;K=13488+(e+2<<2)|0;L=f}else{t=13488+(e+2<<2)|0;j=c[t>>2]|0;if(!(j>>>0<(c[13464>>2]|0)>>>0)){K=t;L=j;break}Mb()}}while(0);c[K>>2]=s;c[L+12>>2]=s;c[s+8>>2]=L;c[s+12>>2]=f;i=b;return}f=s;L=J>>>8;do{if((L|0)==0){M=0}else{if(J>>>0>16777215){M=31;break}K=(L+1048320|0)>>>16&8;e=L<<K;G=(e+520192|0)>>>16&4;C=e<<G;e=(C+245760|0)>>>16&2;j=14-(G|K|e)+(C<<e>>>15)|0;M=J>>>(j+7|0)&1|j<<1}}while(0);L=13752+(M<<2)|0;c[s+28>>2]=M;c[s+20>>2]=0;c[s+16>>2]=0;j=c[13452>>2]|0;e=1<<M;c:do{if((j&e|0)==0){c[13452>>2]=j|e;c[L>>2]=f;c[s+24>>2]=L;c[s+12>>2]=s;c[s+8>>2]=s}else{C=c[L>>2]|0;if((M|0)==31){N=0}else{N=25-(M>>>1)|0}d:do{if((c[C+4>>2]&-8|0)==(J|0)){O=C}else{K=J<<N;G=C;while(1){P=G+(K>>>31<<2)+16|0;t=c[P>>2]|0;if((t|0)==0){break}if((c[t+4>>2]&-8|0)==(J|0)){O=t;break d}else{K=K<<1;G=t}}if(P>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[P>>2]=f;c[s+24>>2]=G;c[s+12>>2]=s;c[s+8>>2]=s;break c}}}while(0);C=O+8|0;D=c[C>>2]|0;K=c[13464>>2]|0;if(O>>>0<K>>>0){Mb()}if(D>>>0<K>>>0){Mb()}else{c[D+12>>2]=f;c[C>>2]=f;c[s+8>>2]=D;c[s+12>>2]=O;c[s+24>>2]=0;break}}}while(0);s=(c[13480>>2]|0)+ -1|0;c[13480>>2]=s;if((s|0)==0){Q=13904|0}else{i=b;return}while(1){s=c[Q>>2]|0;if((s|0)==0){break}else{Q=s+8|0}}c[13480>>2]=-1;i=b;return}function Mm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;if((a|0)==0){e=Km(b)|0;i=d;return e|0}if(b>>>0>4294967231){c[(ac()|0)>>2]=12;e=0;i=d;return e|0}if(b>>>0<11){f=16}else{f=b+11&-8}g=Nm(a+ -8|0,f)|0;if((g|0)!=0){e=g+8|0;i=d;return e|0}g=Km(b)|0;if((g|0)==0){e=0;i=d;return e|0}f=c[a+ -4>>2]|0;h=(f&-8)-((f&3|0)==0?8:4)|0;mn(g|0,a|0,(h>>>0<b>>>0?h:b)|0)|0;Lm(a);e=g;i=d;return e|0}function Nm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;d=i;e=a+4|0;f=c[e>>2]|0;g=f&-8;h=a;j=h+g|0;k=j;l=c[13464>>2]|0;if(h>>>0<l>>>0){Mb()}m=f&3;if(!((m|0)!=1&h>>>0<j>>>0)){Mb()}n=h+(g|4)|0;o=c[n>>2]|0;if((o&1|0)==0){Mb()}if((m|0)==0){if(b>>>0<256){p=0;i=d;return p|0}do{if(!(g>>>0<(b+4|0)>>>0)){if((g-b|0)>>>0>c[13928>>2]<<1>>>0){break}else{p=a}i=d;return p|0}}while(0);p=0;i=d;return p|0}if(!(g>>>0<b>>>0)){m=g-b|0;if(!(m>>>0>15)){p=a;i=d;return p|0}c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=m|3;c[n>>2]=c[n>>2]|1;Om(h+b|0,m);p=a;i=d;return p|0}if((k|0)==(c[13472>>2]|0)){m=(c[13460>>2]|0)+g|0;if(!(m>>>0>b>>>0)){p=0;i=d;return p|0}n=m-b|0;c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=n|1;c[13472>>2]=h+b;c[13460>>2]=n;p=a;i=d;return p|0}if((k|0)==(c[13468>>2]|0)){n=(c[13456>>2]|0)+g|0;if(n>>>0<b>>>0){p=0;i=d;return p|0}m=n-b|0;if(m>>>0>15){c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=m|1;c[h+n>>2]=m;q=h+(n+4)|0;c[q>>2]=c[q>>2]&-2;r=h+b|0;s=m}else{c[e>>2]=f&1|n|2;f=h+(n+4)|0;c[f>>2]=c[f>>2]|1;r=0;s=0}c[13456>>2]=s;c[13468>>2]=r;p=a;i=d;return p|0}if((o&2|0)!=0){p=0;i=d;return p|0}r=(o&-8)+g|0;if(r>>>0<b>>>0){p=0;i=d;return p|0}s=r-b|0;f=o>>>3;a:do{if(o>>>0<256){n=c[h+(g+8)>>2]|0;m=c[h+(g+12)>>2]|0;q=13488+(f<<1<<2)|0;do{if((n|0)!=(q|0)){if(n>>>0<l>>>0){Mb()}if((c[n+12>>2]|0)==(k|0)){break}Mb()}}while(0);if((m|0)==(n|0)){c[3362]=c[3362]&~(1<<f);break}do{if((m|0)==(q|0)){t=m+8|0}else{if(m>>>0<l>>>0){Mb()}u=m+8|0;if((c[u>>2]|0)==(k|0)){t=u;break}Mb()}}while(0);c[n+12>>2]=m;c[t>>2]=n}else{q=j;u=c[h+(g+24)>>2]|0;v=c[h+(g+12)>>2]|0;do{if((v|0)==(q|0)){w=h+(g+20)|0;x=c[w>>2]|0;if((x|0)==0){y=h+(g+16)|0;z=c[y>>2]|0;if((z|0)==0){A=0;break}else{B=z;C=y}}else{B=x;C=w}while(1){w=B+20|0;x=c[w>>2]|0;if((x|0)!=0){C=w;B=x;continue}x=B+16|0;w=c[x>>2]|0;if((w|0)==0){break}else{B=w;C=x}}if(C>>>0<l>>>0){Mb()}else{c[C>>2]=0;A=B;break}}else{x=c[h+(g+8)>>2]|0;if(x>>>0<l>>>0){Mb()}w=x+12|0;if((c[w>>2]|0)!=(q|0)){Mb()}y=v+8|0;if((c[y>>2]|0)==(q|0)){c[w>>2]=v;c[y>>2]=x;A=v;break}else{Mb()}}}while(0);if((u|0)==0){break}v=c[h+(g+28)>>2]|0;n=13752+(v<<2)|0;do{if((q|0)==(c[n>>2]|0)){c[n>>2]=A;if((A|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<v);break a}else{if(u>>>0<(c[13464>>2]|0)>>>0){Mb()}m=u+16|0;if((c[m>>2]|0)==(q|0)){c[m>>2]=A}else{c[u+20>>2]=A}if((A|0)==0){break a}}}while(0);if(A>>>0<(c[13464>>2]|0)>>>0){Mb()}c[A+24>>2]=u;q=c[h+(g+16)>>2]|0;do{if((q|0)!=0){if(q>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[A+16>>2]=q;c[q+24>>2]=A;break}}}while(0);q=c[h+(g+20)>>2]|0;if((q|0)==0){break}if(q>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[A+20>>2]=q;c[q+24>>2]=A;break}}}while(0);if(s>>>0<16){c[e>>2]=r|c[e>>2]&1|2;A=h+(r|4)|0;c[A>>2]=c[A>>2]|1;p=a;i=d;return p|0}else{c[e>>2]=c[e>>2]&1|b|2;c[h+(b+4)>>2]=s|3;e=h+(r|4)|0;c[e>>2]=c[e>>2]|1;Om(h+b|0,s);p=a;i=d;return p|0}return 0}function Om(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;d=i;e=a;f=e+b|0;g=f;h=c[a+4>>2]|0;a:do{if((h&1|0)==0){j=c[a>>2]|0;if((h&3|0)==0){i=d;return}k=e+(0-j)|0;l=k;m=j+b|0;n=c[13464>>2]|0;if(k>>>0<n>>>0){Mb()}if((l|0)==(c[13468>>2]|0)){o=e+(b+4)|0;if((c[o>>2]&3|0)!=3){p=l;q=m;break}c[13456>>2]=m;c[o>>2]=c[o>>2]&-2;c[e+(4-j)>>2]=m|1;c[f>>2]=m;i=d;return}o=j>>>3;if(j>>>0<256){r=c[e+(8-j)>>2]|0;s=c[e+(12-j)>>2]|0;t=13488+(o<<1<<2)|0;do{if((r|0)!=(t|0)){if(r>>>0<n>>>0){Mb()}if((c[r+12>>2]|0)==(l|0)){break}Mb()}}while(0);if((s|0)==(r|0)){c[3362]=c[3362]&~(1<<o);p=l;q=m;break}do{if((s|0)==(t|0)){u=s+8|0}else{if(s>>>0<n>>>0){Mb()}v=s+8|0;if((c[v>>2]|0)==(l|0)){u=v;break}Mb()}}while(0);c[r+12>>2]=s;c[u>>2]=r;p=l;q=m;break}t=k;o=c[e+(24-j)>>2]|0;v=c[e+(12-j)>>2]|0;do{if((v|0)==(t|0)){w=16-j|0;x=e+(w+4)|0;y=c[x>>2]|0;if((y|0)==0){z=e+w|0;w=c[z>>2]|0;if((w|0)==0){A=0;break}else{B=w;C=z}}else{B=y;C=x}while(1){x=B+20|0;y=c[x>>2]|0;if((y|0)!=0){C=x;B=y;continue}y=B+16|0;x=c[y>>2]|0;if((x|0)==0){break}else{B=x;C=y}}if(C>>>0<n>>>0){Mb()}else{c[C>>2]=0;A=B;break}}else{y=c[e+(8-j)>>2]|0;if(y>>>0<n>>>0){Mb()}x=y+12|0;if((c[x>>2]|0)!=(t|0)){Mb()}z=v+8|0;if((c[z>>2]|0)==(t|0)){c[x>>2]=v;c[z>>2]=y;A=v;break}else{Mb()}}}while(0);if((o|0)==0){p=l;q=m;break}v=c[e+(28-j)>>2]|0;n=13752+(v<<2)|0;do{if((t|0)==(c[n>>2]|0)){c[n>>2]=A;if((A|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<v);p=l;q=m;break a}else{if(o>>>0<(c[13464>>2]|0)>>>0){Mb()}k=o+16|0;if((c[k>>2]|0)==(t|0)){c[k>>2]=A}else{c[o+20>>2]=A}if((A|0)==0){p=l;q=m;break a}}}while(0);if(A>>>0<(c[13464>>2]|0)>>>0){Mb()}c[A+24>>2]=o;t=16-j|0;v=c[e+t>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[A+16>>2]=v;c[v+24>>2]=A;break}}}while(0);v=c[e+(t+4)>>2]|0;if((v|0)==0){p=l;q=m;break}if(v>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[A+20>>2]=v;c[v+24>>2]=A;p=l;q=m;break}}else{p=a;q=b}}while(0);a=c[13464>>2]|0;if(f>>>0<a>>>0){Mb()}A=e+(b+4)|0;B=c[A>>2]|0;do{if((B&2|0)==0){if((g|0)==(c[13472>>2]|0)){C=(c[13460>>2]|0)+q|0;c[13460>>2]=C;c[13472>>2]=p;c[p+4>>2]=C|1;if((p|0)!=(c[13468>>2]|0)){i=d;return}c[13468>>2]=0;c[13456>>2]=0;i=d;return}if((g|0)==(c[13468>>2]|0)){C=(c[13456>>2]|0)+q|0;c[13456>>2]=C;c[13468>>2]=p;c[p+4>>2]=C|1;c[p+C>>2]=C;i=d;return}C=(B&-8)+q|0;u=B>>>3;b:do{if(B>>>0<256){h=c[e+(b+8)>>2]|0;v=c[e+(b+12)>>2]|0;j=13488+(u<<1<<2)|0;do{if((h|0)!=(j|0)){if(h>>>0<a>>>0){Mb()}if((c[h+12>>2]|0)==(g|0)){break}Mb()}}while(0);if((v|0)==(h|0)){c[3362]=c[3362]&~(1<<u);break}do{if((v|0)==(j|0)){D=v+8|0}else{if(v>>>0<a>>>0){Mb()}o=v+8|0;if((c[o>>2]|0)==(g|0)){D=o;break}Mb()}}while(0);c[h+12>>2]=v;c[D>>2]=h}else{j=f;o=c[e+(b+24)>>2]|0;n=c[e+(b+12)>>2]|0;do{if((n|0)==(j|0)){k=e+(b+20)|0;r=c[k>>2]|0;if((r|0)==0){s=e+(b+16)|0;y=c[s>>2]|0;if((y|0)==0){E=0;break}else{F=y;G=s}}else{F=r;G=k}while(1){k=F+20|0;r=c[k>>2]|0;if((r|0)!=0){G=k;F=r;continue}r=F+16|0;k=c[r>>2]|0;if((k|0)==0){break}else{F=k;G=r}}if(G>>>0<a>>>0){Mb()}else{c[G>>2]=0;E=F;break}}else{r=c[e+(b+8)>>2]|0;if(r>>>0<a>>>0){Mb()}k=r+12|0;if((c[k>>2]|0)!=(j|0)){Mb()}s=n+8|0;if((c[s>>2]|0)==(j|0)){c[k>>2]=n;c[s>>2]=r;E=n;break}else{Mb()}}}while(0);if((o|0)==0){break}n=c[e+(b+28)>>2]|0;h=13752+(n<<2)|0;do{if((j|0)==(c[h>>2]|0)){c[h>>2]=E;if((E|0)!=0){break}c[13452>>2]=c[13452>>2]&~(1<<n);break b}else{if(o>>>0<(c[13464>>2]|0)>>>0){Mb()}v=o+16|0;if((c[v>>2]|0)==(j|0)){c[v>>2]=E}else{c[o+20>>2]=E}if((E|0)==0){break b}}}while(0);if(E>>>0<(c[13464>>2]|0)>>>0){Mb()}c[E+24>>2]=o;j=c[e+(b+16)>>2]|0;do{if((j|0)!=0){if(j>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[E+16>>2]=j;c[j+24>>2]=E;break}}}while(0);j=c[e+(b+20)>>2]|0;if((j|0)==0){break}if(j>>>0<(c[13464>>2]|0)>>>0){Mb()}else{c[E+20>>2]=j;c[j+24>>2]=E;break}}}while(0);c[p+4>>2]=C|1;c[p+C>>2]=C;if((p|0)!=(c[13468>>2]|0)){H=C;break}c[13456>>2]=C;i=d;return}else{c[A>>2]=B&-2;c[p+4>>2]=q|1;c[p+q>>2]=q;H=q}}while(0);q=H>>>3;if(H>>>0<256){B=q<<1;A=13488+(B<<2)|0;E=c[3362]|0;b=1<<q;do{if((E&b|0)==0){c[3362]=E|b;I=13488+(B+2<<2)|0;J=A}else{q=13488+(B+2<<2)|0;e=c[q>>2]|0;if(!(e>>>0<(c[13464>>2]|0)>>>0)){I=q;J=e;break}Mb()}}while(0);c[I>>2]=p;c[J+12>>2]=p;c[p+8>>2]=J;c[p+12>>2]=A;i=d;return}A=p;J=H>>>8;do{if((J|0)==0){K=0}else{if(H>>>0>16777215){K=31;break}I=(J+1048320|0)>>>16&8;B=J<<I;b=(B+520192|0)>>>16&4;E=B<<b;B=(E+245760|0)>>>16&2;e=14-(b|I|B)+(E<<B>>>15)|0;K=H>>>(e+7|0)&1|e<<1}}while(0);J=13752+(K<<2)|0;c[p+28>>2]=K;c[p+20>>2]=0;c[p+16>>2]=0;e=c[13452>>2]|0;B=1<<K;if((e&B|0)==0){c[13452>>2]=e|B;c[J>>2]=A;c[p+24>>2]=J;c[p+12>>2]=p;c[p+8>>2]=p;i=d;return}B=c[J>>2]|0;if((K|0)==31){L=0}else{L=25-(K>>>1)|0}c:do{if((c[B+4>>2]&-8|0)==(H|0)){M=B}else{K=H<<L;J=B;while(1){N=J+(K>>>31<<2)+16|0;e=c[N>>2]|0;if((e|0)==0){break}if((c[e+4>>2]&-8|0)==(H|0)){M=e;break c}else{K=K<<1;J=e}}if(N>>>0<(c[13464>>2]|0)>>>0){Mb()}c[N>>2]=A;c[p+24>>2]=J;c[p+12>>2]=p;c[p+8>>2]=p;i=d;return}}while(0);N=M+8|0;H=c[N>>2]|0;B=c[13464>>2]|0;if(M>>>0<B>>>0){Mb()}if(H>>>0<B>>>0){Mb()}c[H+12>>2]=A;c[N>>2]=A;c[p+8>>2]=H;c[p+12>>2]=M;c[p+24>>2]=0;i=d;return}function Pm(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=(a|0)==0?1:a;while(1){e=Km(d)|0;if((e|0)!=0){f=6;break}a=c[3486]|0;c[3486]=a+0;if((a|0)==0){f=5;break}tc[a&0]()}if((f|0)==5){d=vb(4)|0;c[d>>2]=13960;cc(d|0,14008,115)}else if((f|0)==6){i=b;return e|0}return 0}function Qm(a){a=a|0;var b=0,c=0;b=i;c=Pm(a)|0;i=b;return c|0}function Rm(a){a=a|0;var b=0;b=i;if((a|0)!=0){Lm(a)}i=b;return}function Sm(a){a=a|0;var b=0;b=i;Rm(a);i=b;return}function Tm(a){a=a|0;var b=0;b=i;Ta(a|0);Rm(a);i=b;return}function Um(a){a=a|0;var b=0;b=i;Ta(a|0);i=b;return}function Vm(a){a=a|0;i=i;return 13976}function Wm(){var a=0;a=vb(4)|0;c[a>>2]=13960;cc(a|0,14008,115)}function Xm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0.0,T=0,V=0.0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,ga=0,ha=0,ia=0.0,ja=0,ka=0.0,la=0,ma=0.0,na=0,oa=0.0,pa=0.0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0.0,ya=0,za=0.0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0.0,Fa=0,Ga=0.0,Ha=0.0,Ia=0,Ja=0.0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0.0,Bc=0,Cc=0,Dc=0.0,Ec=0.0,Fc=0.0,Gc=0.0,Hc=0.0,Ic=0.0,Jc=0,Kc=0,Lc=0.0,Mc=0,Nc=0.0,Oc=0;g=i;i=i+512|0;h=g;if((e|0)==1){j=53;k=-1074}else if((e|0)==2){j=53;k=-1074}else if((e|0)==0){j=24;k=-149}else{l=0.0;i=g;return+l}e=b+4|0;m=b+100|0;do{n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;o=d[n]|0}else{o=_m(b)|0}}while((Nb(o|0)|0)!=0);do{if((o|0)==43|(o|0)==45){n=1-(((o|0)==45)<<1)|0;p=c[e>>2]|0;if(p>>>0<(c[m>>2]|0)>>>0){c[e>>2]=p+1;q=d[p]|0;r=n;break}else{q=_m(b)|0;r=n;break}}else{q=o;r=1}}while(0);o=q;q=0;while(1){if((o|32|0)!=(a[14024+q|0]|0)){s=o;t=q;break}do{if(q>>>0<7){n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;u=d[n]|0;break}else{u=_m(b)|0;break}}else{u=o}}while(0);n=q+1|0;if(n>>>0<8){o=u;q=n}else{s=u;t=n;break}}do{if((t|0)==3){v=23}else if((t|0)!=8){u=(f|0)==0;if(!(t>>>0<4|u)){if((t|0)==8){break}else{v=23;break}}a:do{if((t|0)==0){q=s;o=0;while(1){if((q|32|0)!=(a[14040+o|0]|0)){w=q;x=o;break a}do{if(o>>>0<2){n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;A=d[n]|0;break}else{A=_m(b)|0;break}}else{A=q}}while(0);n=o+1|0;if(n>>>0<3){q=A;o=n}else{w=A;x=n;break}}}else{w=s;x=t}}while(0);if((x|0)==3){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;B=d[o]|0}else{B=_m(b)|0}if((B|0)==40){C=1}else{if((c[m>>2]|0)==0){l=y;i=g;return+l}c[e>>2]=(c[e>>2]|0)+ -1;l=y;i=g;return+l}while(1){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;D=d[o]|0}else{D=_m(b)|0}if(!((D+ -48|0)>>>0<10|(D+ -65|0)>>>0<26)){if(!((D+ -97|0)>>>0<26|(D|0)==95)){break}}C=C+1|0}if((D|0)==41){l=y;i=g;return+l}o=(c[m>>2]|0)==0;if(!o){c[e>>2]=(c[e>>2]|0)+ -1}if(u){c[(ac()|0)>>2]=22;Zm(b,0);l=0.0;i=g;return+l}if((C|0)==0|o){l=y;i=g;return+l}else{E=C}while(1){o=E+ -1|0;c[e>>2]=(c[e>>2]|0)+ -1;if((o|0)==0){l=y;break}else{E=o}}i=g;return+l}else if((x|0)==0){do{if((w|0)==48){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;F=d[o]|0}else{F=_m(b)|0}if((F|32|0)!=120){if((c[m>>2]|0)==0){G=48;break}c[e>>2]=(c[e>>2]|0)+ -1;G=48;break}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;H=d[o]|0;I=0}else{H=_m(b)|0;I=0}while(1){if((H|0)==46){v=70;break}else if((H|0)!=48){K=0;L=0;M=0;N=0;O=H;P=I;Q=0;R=0;S=1.0;T=0;V=0.0;break}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;H=d[o]|0;I=1;continue}else{H=_m(b)|0;I=1;continue}}b:do{if((v|0)==70){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;W=d[o]|0}else{W=_m(b)|0}if((W|0)==48){X=-1;Y=-1}else{K=0;L=0;M=0;N=0;O=W;P=I;Q=1;R=0;S=1.0;T=0;V=0.0;break}while(1){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;Z=d[o]|0}else{Z=_m(b)|0}if((Z|0)!=48){K=X;L=Y;M=0;N=0;O=Z;P=1;Q=1;R=0;S=1.0;T=0;V=0.0;break b}o=ln(X|0,Y|0,-1,-1)|0;X=o;Y=J}}}while(0);c:while(1){o=O+ -48|0;do{if(o>>>0<10){_=o;v=84}else{q=O|32;n=(O|0)==46;if(!((q+ -97|0)>>>0<6|n)){$=O;break c}if(n){if((Q|0)==0){aa=M;ba=N;ca=M;da=N;ea=P;ga=1;ha=R;ia=S;ja=T;ka=V;break}else{$=46;break c}}else{_=(O|0)>57?q+ -87|0:o;v=84;break}}}while(0);if((v|0)==84){v=0;do{if((N|0)<0|(N|0)==0&M>>>0<8){la=R;ma=S;na=_+(T<<4)|0;oa=V}else{if((N|0)<0|(N|0)==0&M>>>0<14){pa=S*.0625;la=R;ma=pa;na=T;oa=V+pa*+(_|0);break}if(!((_|0)!=0&(R|0)==0)){la=R;ma=S;na=T;oa=V;break}la=1;ma=S;na=T;oa=V+S*.5}}while(0);o=ln(M|0,N|0,1,0)|0;aa=K;ba=L;ca=o;da=J;ea=1;ga=Q;ha=la;ia=ma;ja=na;ka=oa}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;K=aa;L=ba;M=ca;N=da;O=d[o]|0;P=ea;Q=ga;R=ha;S=ia;T=ja;V=ka;continue}else{K=aa;L=ba;M=ca;N=da;O=_m(b)|0;P=ea;Q=ga;R=ha;S=ia;T=ja;V=ka;continue}}if((P|0)==0){o=(c[m>>2]|0)==0;if(!o){c[e>>2]=(c[e>>2]|0)+ -1}do{if(u){Zm(b,0)}else{if(o){break}q=c[e>>2]|0;c[e>>2]=q+ -1;if((Q|0)==0){break}c[e>>2]=q+ -2}}while(0);l=+(r|0)*0.0;i=g;return+l}o=(Q|0)==0;q=o?M:K;n=o?N:L;if((N|0)<0|(N|0)==0&M>>>0<8){o=M;p=N;qa=T;while(1){ra=qa<<4;sa=ln(o|0,p|0,1,0)|0;ta=J;if((ta|0)<0|(ta|0)==0&sa>>>0<8){qa=ra;p=ta;o=sa}else{ua=ra;break}}}else{ua=T}do{if(($|32|0)==112){o=Ym(b,f)|0;p=J;if(!((o|0)==0&(p|0)==-2147483648)){va=o;wa=p;break}if(u){Zm(b,0);l=0.0;i=g;return+l}else{if((c[m>>2]|0)==0){va=0;wa=0;break}c[e>>2]=(c[e>>2]|0)+ -1;va=0;wa=0;break}}else{if((c[m>>2]|0)==0){va=0;wa=0;break}c[e>>2]=(c[e>>2]|0)+ -1;va=0;wa=0}}while(0);p=pn(q|0,n|0,2)|0;o=ln(p|0,J|0,-32,-1)|0;p=ln(o|0,J|0,va|0,wa|0)|0;o=J;if((ua|0)==0){l=+(r|0)*0.0;i=g;return+l}if((o|0)>0|(o|0)==0&p>>>0>(0-k|0)>>>0){c[(ac()|0)>>2]=34;l=+(r|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+l}qa=k+ -106|0;ra=((qa|0)<0)<<31>>31;if((o|0)<(ra|0)|(o|0)==(ra|0)&p>>>0<qa>>>0){c[(ac()|0)>>2]=34;l=+(r|0)*2.2250738585072014e-308*2.2250738585072014e-308;i=g;return+l}if((ua|0)>-1){qa=p;ra=o;sa=ua;pa=V;while(1){ta=sa<<1;if(!(pa>=.5)){xa=pa;ya=ta}else{xa=pa+-1.0;ya=ta|1}za=pa+xa;ta=ln(qa|0,ra|0,-1,-1)|0;Aa=J;if((ya|0)>-1){qa=ta;ra=Aa;sa=ya;pa=za}else{Ba=ta;Ca=Aa;Da=ya;Ea=za;break}}}else{Ba=p;Ca=o;Da=ua;Ea=V}sa=kn(32,0,k|0,((k|0)<0)<<31>>31|0)|0;ra=ln(Ba|0,Ca|0,sa|0,J|0)|0;sa=J;if(0>(sa|0)|0==(sa|0)&j>>>0>ra>>>0){Fa=(ra|0)<0?0:ra}else{Fa=j}do{if((Fa|0)<53){pa=+(r|0);za=+bc(+(+$m(1.0,84-Fa|0)),+pa);if(!((Fa|0)<32&Ea!=0.0)){Ga=pa;Ha=za;Ia=Da;Ja=Ea;break}ra=Da&1;Ga=pa;Ha=za;Ia=(ra^1)+Da|0;Ja=(ra|0)==0?0.0:Ea}else{Ga=+(r|0);Ha=0.0;Ia=Da;Ja=Ea}}while(0);za=Ga*Ja+(Ha+Ga*+(Ia>>>0))-Ha;if(!(za!=0.0)){c[(ac()|0)>>2]=34}l=+an(za,Ba);i=g;return+l}else{G=w}}while(0);o=k+j|0;p=0-o|0;ra=G;sa=0;while(1){if((ra|0)==46){v=139;break}else if((ra|0)!=48){Ka=ra;La=0;Ma=0;Na=sa;Oa=0;break}qa=c[e>>2]|0;if(qa>>>0<(c[m>>2]|0)>>>0){c[e>>2]=qa+1;ra=d[qa]|0;sa=1;continue}else{ra=_m(b)|0;sa=1;continue}}d:do{if((v|0)==139){ra=c[e>>2]|0;if(ra>>>0<(c[m>>2]|0)>>>0){c[e>>2]=ra+1;Pa=d[ra]|0}else{Pa=_m(b)|0}if((Pa|0)==48){Qa=-1;Ra=-1}else{Ka=Pa;La=0;Ma=0;Na=sa;Oa=1;break}while(1){ra=c[e>>2]|0;if(ra>>>0<(c[m>>2]|0)>>>0){c[e>>2]=ra+1;Sa=d[ra]|0}else{Sa=_m(b)|0}if((Sa|0)!=48){Ka=Sa;La=Qa;Ma=Ra;Na=1;Oa=1;break d}ra=ln(Qa|0,Ra|0,-1,-1)|0;Qa=ra;Ra=J}}}while(0);sa=h;c[sa>>2]=0;ra=Ka+ -48|0;qa=(Ka|0)==46;e:do{if(ra>>>0<10|qa){n=h+496|0;q=Ka;Aa=qa;ta=ra;Ta=0;Ua=0;Va=La;Wa=Ma;Xa=Na;Ya=Oa;Za=0;_a=0;$a=0;while(1){do{if(Aa){if((Ya|0)==0){ab=Ta;bb=Ua;cb=Ta;db=Ua;eb=Xa;fb=1;gb=Za;hb=_a;ib=$a}else{jb=q;kb=Ta;lb=Ua;mb=Va;nb=Wa;ob=Xa;pb=Za;qb=_a;rb=$a;break e}}else{sb=ln(Ta|0,Ua|0,1,0)|0;tb=J;vb=(q|0)!=48;if((_a|0)>=125){if(!vb){ab=Va;bb=Wa;cb=sb;db=tb;eb=Xa;fb=Ya;gb=Za;hb=_a;ib=$a;break}c[n>>2]=c[n>>2]|1;ab=Va;bb=Wa;cb=sb;db=tb;eb=Xa;fb=Ya;gb=Za;hb=_a;ib=$a;break}wb=h+(_a<<2)|0;if((Za|0)==0){xb=ta}else{xb=q+ -48+((c[wb>>2]|0)*10|0)|0}c[wb>>2]=xb;wb=Za+1|0;yb=(wb|0)==9;ab=Va;bb=Wa;cb=sb;db=tb;eb=1;fb=Ya;gb=yb?0:wb;hb=(yb&1)+_a|0;ib=vb?sb:$a}}while(0);sb=c[e>>2]|0;if(sb>>>0<(c[m>>2]|0)>>>0){c[e>>2]=sb+1;zb=d[sb]|0}else{zb=_m(b)|0}sb=zb+ -48|0;vb=(zb|0)==46;if(sb>>>0<10|vb){q=zb;Aa=vb;ta=sb;Ta=cb;Ua=db;Va=ab;Wa=bb;Xa=eb;Ya=fb;Za=gb;_a=hb;$a=ib}else{Ab=zb;Bb=cb;Cb=db;Db=ab;Eb=bb;Fb=eb;Gb=fb;Hb=gb;Ib=hb;Jb=ib;v=162;break}}}else{Ab=Ka;Bb=0;Cb=0;Db=La;Eb=Ma;Fb=Na;Gb=Oa;Hb=0;Ib=0;Jb=0;v=162}}while(0);if((v|0)==162){ra=(Gb|0)==0;jb=Ab;kb=Bb;lb=Cb;mb=ra?Bb:Db;nb=ra?Cb:Eb;ob=Fb;pb=Hb;qb=Ib;rb=Jb}ra=(ob|0)!=0;do{if(ra){if((jb|32|0)!=101){v=171;break}qa=Ym(b,f)|0;$a=J;do{if((qa|0)==0&($a|0)==-2147483648){if(u){Zm(b,0);l=0.0;i=g;return+l}else{if((c[m>>2]|0)==0){Kb=0;Lb=0;break}c[e>>2]=(c[e>>2]|0)+ -1;Kb=0;Lb=0;break}}else{Kb=qa;Lb=$a}}while(0);$a=ln(Kb|0,Lb|0,mb|0,nb|0)|0;Mb=$a;Ob=J}else{v=171}}while(0);do{if((v|0)==171){if(!((jb|0)>-1)){Mb=mb;Ob=nb;break}if((c[m>>2]|0)==0){Mb=mb;Ob=nb;break}c[e>>2]=(c[e>>2]|0)+ -1;Mb=mb;Ob=nb}}while(0);if(!ra){c[(ac()|0)>>2]=22;Zm(b,0);l=0.0;i=g;return+l}u=c[sa>>2]|0;if((u|0)==0){l=+(r|0)*0.0;i=g;return+l}do{if((Mb|0)==(kb|0)&(Ob|0)==(lb|0)&((lb|0)<0|(lb|0)==0&kb>>>0<10)){if(!(j>>>0>30)){if((u>>>j|0)!=0){break}}l=+(r|0)*+(u>>>0);i=g;return+l}}while(0);u=(k|0)/-2|0;ra=((u|0)<0)<<31>>31;if((Ob|0)>(ra|0)|(Ob|0)==(ra|0)&Mb>>>0>u>>>0){c[(ac()|0)>>2]=34;l=+(r|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+l}u=k+ -106|0;ra=((u|0)<0)<<31>>31;if((Ob|0)<(ra|0)|(Ob|0)==(ra|0)&Mb>>>0<u>>>0){c[(ac()|0)>>2]=34;l=+(r|0)*2.2250738585072014e-308*2.2250738585072014e-308;i=g;return+l}if((pb|0)==0){Pb=qb}else{if((pb|0)<9){u=h+(qb<<2)|0;ra=c[u>>2]|0;$a=pb;do{ra=ra*10|0;$a=$a+1|0;}while(($a|0)!=9);c[u>>2]=ra}Pb=qb+1|0}do{if((rb|0)<9){if(!((rb|0)<=(Mb|0)&(Mb|0)<18)){break}if((Mb|0)==9){l=+(r|0)*+((c[sa>>2]|0)>>>0);i=g;return+l}if((Mb|0)<9){l=+(r|0)*+((c[sa>>2]|0)>>>0)/+(c[14056+(8-Mb<<2)>>2]|0);i=g;return+l}$a=j+27+(fa(Mb,-3)|0)|0;qa=c[sa>>2]|0;if(($a|0)<=30){if((qa>>>$a|0)!=0){break}}l=+(r|0)*+(qa>>>0)*+(c[14056+(Mb+ -10<<2)>>2]|0);i=g;return+l}}while(0);sa=(Mb|0)%9|0;if((sa|0)==0){Qb=0;Rb=0;Sb=Mb;Tb=Pb}else{ra=(Mb|0)>-1?sa:sa+9|0;sa=c[14056+(8-ra<<2)>>2]|0;do{if((Pb|0)==0){Ub=0;Vb=Mb;Wb=0}else{u=1e9/(sa|0)|0;qa=0;$a=0;_a=0;Za=Mb;while(1){Ya=h+(_a<<2)|0;Xa=c[Ya>>2]|0;Wa=((Xa>>>0)/(sa>>>0)|0)+$a|0;c[Ya>>2]=Wa;Xb=fa((Xa>>>0)%(sa>>>0)|0,u)|0;Xa=_a+1|0;if((_a|0)==(qa|0)&(Wa|0)==0){Yb=Xa&127;Zb=Za+ -9|0}else{Yb=qa;Zb=Za}if((Xa|0)==(Pb|0)){break}else{qa=Yb;Za=Zb;_a=Xa;$a=Xb}}if((Xb|0)==0){Ub=Yb;Vb=Zb;Wb=Pb;break}c[h+(Pb<<2)>>2]=Xb;Ub=Yb;Vb=Zb;Wb=Pb+1|0}}while(0);Qb=Ub;Rb=0;Sb=9-ra+Vb|0;Tb=Wb}f:while(1){sa=h+(Qb<<2)|0;if((Sb|0)<18){$a=Rb;_a=Tb;while(1){Za=0;qa=_a+127|0;u=_a;while(1){Xa=qa&127;Wa=h+(Xa<<2)|0;Ya=pn(c[Wa>>2]|0,0,29)|0;Va=ln(Ya|0,J|0,Za|0,0)|0;Ya=J;if(Ya>>>0>0|(Ya|0)==0&Va>>>0>1e9){Ua=yn(Va|0,Ya|0,1e9,0)|0;Ta=zn(Va|0,Ya|0,1e9,0)|0;_b=Ta;$b=Ua}else{_b=Va;$b=0}c[Wa>>2]=_b;Wa=(Xa|0)==(Qb|0);if((Xa|0)!=(u+127&127|0)|Wa){cc=u}else{cc=(_b|0)==0?Xa:u}if(Wa){break}else{Za=$b;qa=Xa+ -1|0;u=cc}}u=$a+ -29|0;if(($b|0)==0){$a=u;_a=cc}else{dc=u;ec=$b;fc=cc;break}}}else{if((Sb|0)==18){gc=Rb;hc=Tb}else{ic=Qb;jc=Rb;kc=Sb;lc=Tb;break}while(1){if(!((c[sa>>2]|0)>>>0<9007199)){ic=Qb;jc=gc;kc=18;lc=hc;break f}_a=0;$a=hc+127|0;u=hc;while(1){qa=$a&127;Za=h+(qa<<2)|0;Xa=pn(c[Za>>2]|0,0,29)|0;Wa=ln(Xa|0,J|0,_a|0,0)|0;Xa=J;if(Xa>>>0>0|(Xa|0)==0&Wa>>>0>1e9){Va=yn(Wa|0,Xa|0,1e9,0)|0;Ua=zn(Wa|0,Xa|0,1e9,0)|0;mc=Ua;nc=Va}else{mc=Wa;nc=0}c[Za>>2]=mc;Za=(qa|0)==(Qb|0);if((qa|0)!=(u+127&127|0)|Za){oc=u}else{oc=(mc|0)==0?qa:u}if(Za){break}else{_a=nc;$a=qa+ -1|0;u=oc}}u=gc+ -29|0;if((nc|0)==0){gc=u;hc=oc}else{dc=u;ec=nc;fc=oc;break}}}sa=Qb+127&127;if((sa|0)==(fc|0)){u=fc+127&127;$a=h+((fc+126&127)<<2)|0;c[$a>>2]=c[$a>>2]|c[h+(u<<2)>>2];pc=u}else{pc=fc}c[h+(sa<<2)>>2]=ec;Qb=sa;Rb=dc;Sb=Sb+9|0;Tb=pc}g:while(1){qc=lc+1&127;ra=h+((lc+127&127)<<2)|0;sa=ic;u=jc;$a=kc;while(1){_a=($a|0)==18;qa=($a|0)>27?9:1;rc=sa;sc=u;while(1){Za=0;while(1){Wa=Za+rc&127;if((Wa|0)==(lc|0)){tc=2;break}Va=c[h+(Wa<<2)>>2]|0;Wa=c[14048+(Za<<2)>>2]|0;if(Va>>>0<Wa>>>0){tc=2;break}Ua=Za+1|0;if(Va>>>0>Wa>>>0){tc=Za;break}if((Ua|0)<2){Za=Ua}else{tc=Ua;break}}if((tc|0)==2&_a){break g}uc=qa+sc|0;if((rc|0)==(lc|0)){rc=lc;sc=uc}else{break}}_a=(1<<qa)+ -1|0;Za=1e9>>>qa;vc=rc;wc=0;Ua=rc;xc=$a;do{Wa=h+(Ua<<2)|0;Va=c[Wa>>2]|0;Xa=(Va>>>qa)+wc|0;c[Wa>>2]=Xa;wc=fa(Va&_a,Za)|0;Va=(Ua|0)==(vc|0)&(Xa|0)==0;Ua=Ua+1&127;xc=Va?xc+ -9|0:xc;vc=Va?Ua:vc;}while((Ua|0)!=(lc|0));if((wc|0)==0){sa=vc;u=uc;$a=xc;continue}if((qc|0)!=(vc|0)){break}c[ra>>2]=c[ra>>2]|1;sa=vc;u=uc;$a=xc}c[h+(lc<<2)>>2]=wc;ic=vc;jc=uc;kc=xc;lc=qc}$a=rc&127;if(($a|0)==(lc|0)){c[h+(qc+ -1<<2)>>2]=0;yc=qc}else{yc=lc}za=+((c[h+($a<<2)>>2]|0)>>>0);$a=rc+1&127;if(($a|0)==(yc|0)){u=yc+1&127;c[h+(u+ -1<<2)>>2]=0;zc=u}else{zc=yc}pa=+(r|0);Ac=pa*(za*1.0e9+ +((c[h+($a<<2)>>2]|0)>>>0));$a=sc+53|0;u=$a-k|0;if((u|0)<(j|0)){Bc=(u|0)<0?0:u;Cc=1}else{Bc=j;Cc=0}if((Bc|0)<53){za=+bc(+(+$m(1.0,105-Bc|0)),+Ac);Dc=+ub(+Ac,+(+$m(1.0,53-Bc|0)));Ec=za;Fc=Dc;Gc=za+(Ac-Dc)}else{Ec=0.0;Fc=0.0;Gc=Ac}sa=rc+2&127;do{if((sa|0)==(zc|0)){Hc=Fc}else{ra=c[h+(sa<<2)>>2]|0;do{if(ra>>>0<5e8){if((ra|0)==0){if((rc+3&127|0)==(zc|0)){Ic=Fc;break}}Ic=pa*.25+Fc}else{if(ra>>>0>5e8){Ic=pa*.75+Fc;break}if((rc+3&127|0)==(zc|0)){Ic=pa*.5+Fc;break}else{Ic=pa*.75+Fc;break}}}while(0);if((53-Bc|0)<=1){Hc=Ic;break}if(+ub(+Ic,1.0)!=0.0){Hc=Ic;break}Hc=Ic+1.0}}while(0);pa=Gc+Hc-Ec;do{if(($a&2147483647|0)>(-2-o|0)){if(!(+U(+pa)>=9007199254740992.0)){Jc=Cc;Kc=sc;Lc=pa}else{Jc=(Cc|0)!=0&(Bc|0)==(u|0)?0:Cc;Kc=sc+1|0;Lc=pa*.5}if((Kc+50|0)<=(p|0)){if(!((Jc|0)!=0&Hc!=0.0)){Mc=Kc;Nc=Lc;break}}c[(ac()|0)>>2]=34;Mc=Kc;Nc=Lc}else{Mc=sc;Nc=pa}}while(0);l=+an(Nc,Mc);i=g;return+l}else{if((c[m>>2]|0)!=0){c[e>>2]=(c[e>>2]|0)+ -1}c[(ac()|0)>>2]=22;Zm(b,0);l=0.0;i=g;return+l}}}while(0);do{if((v|0)==23){b=(c[m>>2]|0)==0;if(!b){c[e>>2]=(c[e>>2]|0)+ -1}if(t>>>0<4|(f|0)==0|b){break}else{Oc=t}do{c[e>>2]=(c[e>>2]|0)+ -1;Oc=Oc+ -1|0;}while(Oc>>>0>3)}}while(0);l=+(r|0)*z;i=g;return+l}function Ym(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=i;f=a+4|0;g=c[f>>2]|0;h=a+100|0;if(g>>>0<(c[h>>2]|0)>>>0){c[f>>2]=g+1;j=d[g]|0}else{j=_m(a)|0}do{if((j|0)==43|(j|0)==45){g=(j|0)==45|0;k=c[f>>2]|0;if(k>>>0<(c[h>>2]|0)>>>0){c[f>>2]=k+1;l=d[k]|0}else{l=_m(a)|0}if((l+ -48|0)>>>0<10|(b|0)==0){m=l;n=g;break}if((c[h>>2]|0)==0){m=l;n=g;break}c[f>>2]=(c[f>>2]|0)+ -1;m=l;n=g}else{m=j;n=0}}while(0);if((m+ -48|0)>>>0>9){if((c[h>>2]|0)==0){o=0;p=-2147483648;J=p;i=e;return o|0}c[f>>2]=(c[f>>2]|0)+ -1;o=0;p=-2147483648;J=p;i=e;return o|0}else{q=m;r=0}while(1){s=q+ -48+r|0;m=c[f>>2]|0;if(m>>>0<(c[h>>2]|0)>>>0){c[f>>2]=m+1;t=d[m]|0}else{t=_m(a)|0}if(!((t+ -48|0)>>>0<10&(s|0)<214748364)){break}q=t;r=s*10|0}r=((s|0)<0)<<31>>31;if((t+ -48|0)>>>0<10){q=s;m=r;j=t;while(1){l=xn(q|0,m|0,10,0)|0;b=J;g=ln(j|0,((j|0)<0)<<31>>31|0,-48,-1)|0;k=ln(g|0,J|0,l|0,b|0)|0;b=J;l=c[f>>2]|0;if(l>>>0<(c[h>>2]|0)>>>0){c[f>>2]=l+1;u=d[l]|0}else{u=_m(a)|0}if((u+ -48|0)>>>0<10&((b|0)<21474836|(b|0)==21474836&k>>>0<2061584302)){j=u;m=b;q=k}else{v=k;w=b;x=u;break}}}else{v=s;w=r;x=t}if((x+ -48|0)>>>0<10){do{x=c[f>>2]|0;if(x>>>0<(c[h>>2]|0)>>>0){c[f>>2]=x+1;y=d[x]|0}else{y=_m(a)|0}}while((y+ -48|0)>>>0<10)}if((c[h>>2]|0)!=0){c[f>>2]=(c[f>>2]|0)+ -1}f=(n|0)!=0;n=kn(0,0,v|0,w|0)|0;o=f?n:v;p=f?J:w;J=p;i=e;return o|0}function Zm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a+104>>2]=b;e=c[a+8>>2]|0;f=c[a+4>>2]|0;g=e-f|0;c[a+108>>2]=g;if((b|0)!=0&(g|0)>(b|0)){c[a+100>>2]=f+b;i=d;return}else{c[a+100>>2]=e;i=d;return}}function _m(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=b+104|0;g=c[f>>2]|0;if((g|0)==0){h=3}else{if((c[b+108>>2]|0)<(g|0)){h=3}}do{if((h|0)==3){g=cn(b)|0;if((g|0)<0){break}j=c[f>>2]|0;k=c[b+8>>2]|0;do{if((j|0)==0){h=8}else{l=c[b+4>>2]|0;m=j-(c[b+108>>2]|0)+ -1|0;if((k-l|0)<=(m|0)){h=8;break}c[b+100>>2]=l+m}}while(0);if((h|0)==8){c[b+100>>2]=k}j=c[b+4>>2]|0;if((k|0)!=0){m=b+108|0;c[m>>2]=k+1-j+(c[m>>2]|0)}m=j+ -1|0;if((d[m]|0|0)==(g|0)){n=g;i=e;return n|0}a[m]=g;n=g;i=e;return n|0}}while(0);c[b+100>>2]=0;n=-1;i=e;return n|0}function $m(a,b){a=+a;b=b|0;var d=0,e=0.0,f=0,g=0,j=0.0;d=i;do{if((b|0)>1023){e=a*8.98846567431158e+307;f=b+ -1023|0;if((f|0)<=1023){g=f;j=e;break}f=b+ -2046|0;g=(f|0)>1023?1023:f;j=e*8.98846567431158e+307}else{if(!((b|0)<-1022)){g=b;j=a;break}e=a*2.2250738585072014e-308;f=b+1022|0;if(!((f|0)<-1022)){g=f;j=e;break}f=b+2044|0;g=(f|0)<-1022?-1022:f;j=e*2.2250738585072014e-308}}while(0);b=pn(g+1023|0,0,52)|0;g=J;c[k>>2]=b;c[k+4>>2]=g;a=j*+h[k>>3];i=d;return+a}function an(a,b){a=+a;b=b|0;var c=0,d=0.0;c=i;d=+$m(a,b);i=c;return+d}function bn(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=b+74|0;f=a[e]|0;a[e]=f+255|f;f=b+20|0;e=b+44|0;if((c[f>>2]|0)>>>0>(c[e>>2]|0)>>>0){jc[c[b+36>>2]&31](b,0,0)|0}c[b+16>>2]=0;c[b+28>>2]=0;c[f>>2]=0;f=b;g=c[f>>2]|0;if((g&20|0)==0){h=c[e>>2]|0;c[b+8>>2]=h;c[b+4>>2]=h;j=0;i=d;return j|0}if((g&4|0)==0){j=-1;i=d;return j|0}c[f>>2]=g|32;j=-1;i=d;return j|0}function cn(a){a=a|0;var b=0,e=0,f=0,g=0;b=i;i=i+8|0;e=b;if((c[a+8>>2]|0)==0){if((bn(a)|0)==0){f=3}else{g=-1}}else{f=3}do{if((f|0)==3){if((jc[c[a+32>>2]&31](a,e,1)|0)!=1){g=-1;break}g=d[e]|0}}while(0);i=b;return g|0}function dn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0.0,j=0,k=0;d=i;i=i+112|0;e=d;f=e+0|0;g=f+112|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));f=e+4|0;c[f>>2]=a;g=e+8|0;c[g>>2]=-1;c[e+44>>2]=a;c[e+76>>2]=-1;Zm(e,0);h=+Xm(e,2,1);j=(c[f>>2]|0)-(c[g>>2]|0)+(c[e+108>>2]|0)|0;if((b|0)==0){i=d;return+h}if((j|0)==0){k=a}else{k=a+j|0}c[b>>2]=k;i=d;return+h}function en(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;a:do{if((d|0)==0){f=0}else{g=d;h=b;j=c;while(1){k=a[h]|0;l=a[j]|0;if(!(k<<24>>24==l<<24>>24)){break}m=g+ -1|0;if((m|0)==0){f=0;break a}else{g=m;h=h+1|0;j=j+1|0}}f=(k&255)-(l&255)|0}}while(0);i=e;return f|0}function fn(){c[510]=p;c[536]=p;c[3274]=p;c[3504]=p}function gn(a){a=a|0;var b=0;b=(fa(c[a>>2]|0,31010991)|0)+1735287159&2147483647;c[a>>2]=b;return b|0}function hn(){return gn(o)|0}function jn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function kn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return(J=e,a-c>>>0|0)|0}function ln(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return(J=b+d+(e>>>0<a>>>0|0)>>>0,e|0)|0}function mn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return Na(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function nn(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b]=a[c]|0}b=e}else{mn(b,c,d)|0}return b|0}function on(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function pn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){J=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}J=a<<c-32;return 0}function qn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){J=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}J=0;return b>>>c-32|0}function rn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){J=b>>c;return a>>>c|(b&(1<<c)-1)<<32-c}J=(b|0)<0?-1:0;return b>>c-32|0}function sn(b){b=b|0;var c=0;c=a[n+(b>>>24)|0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)|0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)|0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)|0]|0)+24|0}function tn(b){b=b|0;var c=0;c=a[m+(b&255)|0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)|0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)|0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)|0]|0)+24|0}function un(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=fa(d,c)|0;f=a>>>16;a=(e>>>16)+(fa(d,f)|0)|0;d=b>>>16;b=fa(d,c)|0;return(J=(a>>>16)+(fa(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function vn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=kn(e^a,f^b,e,f)|0;b=J;a=g^e;e=h^f;f=kn((An(i,b,kn(g^c,h^d,g,h)|0,J,0)|0)^a,J^e,a,e)|0;return(J=J,f)|0}function wn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+8|0;g=f|0;h=b>>31|((b|0)<0?-1:0)<<1;j=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;k=e>>31|((e|0)<0?-1:0)<<1;l=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;m=kn(h^a,j^b,h,j)|0;b=J;An(m,b,kn(k^d,l^e,k,l)|0,J,g)|0;l=kn(c[g>>2]^h,c[g+4>>2]^j,h,j)|0;j=J;i=f;return(J=j,l)|0}function xn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=un(e,a)|0;f=J;return(J=(fa(b,a)|0)+(fa(d,e)|0)+f|f&0,c|0|0)|0}function yn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=An(a,b,c,d,0)|0;return(J=J,e)|0}function zn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+8|0;g=f|0;An(a,b,d,e,g)|0;i=f;return(J=c[g+4>>2]|0,c[g>>2]|0)|0}function An(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0;g=a;h=b;i=h;j=d;k=e;l=k;if((i|0)==0){m=(f|0)!=0;if((l|0)==0){if(m){c[f>>2]=(g>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return(J=n,o)|0}else{if(!m){n=0;o=0;return(J=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return(J=n,o)|0}}m=(l|0)==0;do{if((j|0)==0){if(m){if((f|0)!=0){c[f>>2]=(i>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return(J=n,o)|0}if((g|0)==0){if((f|0)!=0){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(l>>>0)}n=0;o=(i>>>0)/(l>>>0)>>>0;return(J=n,o)|0}p=l-1|0;if((p&l|0)==0){if((f|0)!=0){c[f>>2]=a|0;c[f+4>>2]=p&i|b&0}n=0;o=i>>>((tn(l|0)|0)>>>0);return(J=n,o)|0}p=(sn(l|0)|0)-(sn(i|0)|0)|0;if(p>>>0<=30){q=p+1|0;r=31-p|0;s=q;t=i<<r|g>>>(q>>>0);u=i>>>(q>>>0);v=0;w=g<<r;break}if((f|0)==0){n=0;o=0;return(J=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(J=n,o)|0}else{if(!m){r=(sn(l|0)|0)-(sn(i|0)|0)|0;if(r>>>0<=31){q=r+1|0;p=31-r|0;x=r-31>>31;s=q;t=g>>>(q>>>0)&x|i<<p;u=i>>>(q>>>0)&x;v=0;w=g<<p;break}if((f|0)==0){n=0;o=0;return(J=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(J=n,o)|0}p=j-1|0;if((p&j|0)!=0){x=(sn(j|0)|0)+33-(sn(i|0)|0)|0;q=64-x|0;r=32-x|0;y=r>>31;z=x-32|0;A=z>>31;s=x;t=r-1>>31&i>>>(z>>>0)|(i<<r|g>>>(x>>>0))&A;u=A&i>>>(x>>>0);v=g<<q&y;w=(i<<q|g>>>(z>>>0))&y|g<<r&x-33>>31;break}if((f|0)!=0){c[f>>2]=p&g;c[f+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return(J=n,o)|0}else{p=tn(j|0)|0;n=i>>>(p>>>0)|0;o=i<<32-p|g>>>(p>>>0)|0;return(J=n,o)|0}}}while(0);if((s|0)==0){B=w;C=v;D=u;E=t;F=0;G=0}else{g=d|0|0;d=k|e&0;e=ln(g,d,-1,-1)|0;k=J;i=w;w=v;v=u;u=t;t=s;s=0;while(1){H=w>>>31|i<<1;I=s|w<<1;j=u<<1|i>>>31|0;a=u>>>31|v<<1|0;kn(e,k,j,a)|0;b=J;h=b>>31|((b|0)<0?-1:0)<<1;K=h&1;L=kn(j,a,h&g,(((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1)&d)|0;M=J;b=t-1|0;if((b|0)==0){break}else{i=H;w=I;v=M;u=L;t=b;s=K}}B=H;C=I;D=M;E=L;F=0;G=K}K=C;C=0;if((f|0)!=0){c[f>>2]=E;c[f+4>>2]=D}n=(K|0)>>>31|(B|C)<<1|(C<<1|K>>>31)&0|F;o=(K<<1|0>>>31)&-2|G;return(J=n,o)|0}function Bn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return jc[a&31](b|0,c|0,d|0)|0}function Cn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;kc[a&63](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function Dn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;lc[a&3](b|0,c|0,d|0,e|0,f|0)}function En(a,b){a=a|0;b=b|0;mc[a&255](b|0)}function Fn(a,b,c){a=a|0;b=b|0;c=c|0;nc[a&63](b|0,c|0)}function Gn(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;oc[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function Hn(a,b){a=a|0;b=b|0;return pc[a&127](b|0)|0}function In(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=+h;qc[a&3](b|0,c|0,d|0,e|0,f|0,g|0,+h)}function Jn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;rc[a&3](b|0,c|0,d|0)}function Kn(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;sc[a&7](b|0,c|0,d|0,e|0,f|0,+g)}function Ln(a){a=a|0;tc[a&0]()}function Mn(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;return uc[a&15](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)|0}function Nn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return vc[a&7](b|0,c|0,d|0,e|0)|0}function On(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;wc[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)}function Pn(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;xc[a&31](b|0,c|0,d|0,e|0,f|0,g|0)}function Qn(a,b,c){a=a|0;b=b|0;c=c|0;return yc[a&31](b|0,c|0)|0}function Rn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return zc[a&15](b|0,c|0,d|0,e|0,f|0)|0}function Sn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Ac[a&15](b|0,c|0,d|0,e|0)}function Tn(a,b,c){a=a|0;b=b|0;c=c|0;ga(0);return 0}function Un(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;ga(1)}function Vn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ga(2)}function Wn(a){a=a|0;ga(3)}function Xn(a,b){a=a|0;b=b|0;ga(4)}function Yn(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;ga(5)}function Zn(a){a=a|0;ga(6);return 0}function _n(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;ga(7)}function $n(a,b,c){a=a|0;b=b|0;c=c|0;ga(8)}function ao(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;ga(9)}function bo(){ga(10)}function co(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;ga(11);return 0}function eo(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ga(12);return 0}function fo(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;ga(13)}function go(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ga(14)}function ho(a,b){a=a|0;b=b|0;ga(15);return 0}function io(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ga(16);return 0}function jo(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ga(17)}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nvar jc=[Tn,Ve,_e,cf,hf,nf,xd,rf,Ld,je,ke,ag,fg,Ij,Nj,sk,uk,xk,dk,ik,kk,nk,zm,Tn,Tn,Tn,Tn,Tn,Tn,Tn,Tn,Tn];var kc=[Un,ig,kg,mg,og,qg,sg,ug,wg,yg,Ag,Cg,Hg,Jg,Lg,Ng,Pg,Rg,Tg,Vg,Xg,Zg,$g,nh,ph,Bh,Dh,Mh,Nh,Oh,Ph,Qh,Zh,_h,$h,ai,bi,zj,Fj,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un,Un];var lc=[Vn,Gm,Fm,Em];var mc=[Wn,Xc,cd,dd,ed,Ff,Ef,Hf,Gf,fd,gd,td,ud,Ad,Bd,Hd,Id,Od,Pd,$d,_d,ee,de,ge,pe,oe,Te,Se,ff,ef,uf,tf,wf,vf,Af,zf,Cf,Bf,Mf,Lf,Of,Nf,Uf,Tf,Pe,Vf,Sf,Wf,Yf,Xf,ak,cg,bg,hg,gg,Gg,Fg,ih,hh,wh,vh,Kh,Jh,Xh,Wh,hi,gi,ki,ji,oi,ni,zi,yi,Ki,Ji,Vi,Ui,ej,dj,oj,nj,vj,uj,Bj,Aj,Hj,Gj,Mj,Lj,Vj,Uj,qk,pk,Qj,Hk,ml,ll,ol,nl,Zf,$j,ck,zk,Pk,_k,jl,kl,rm,qm,tm,wm,um,vm,xm,ym,Um,Tm,sd,bk,Wl,gj,Lm,bm,am,$l,_l,Zl,Yl,ve,He,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn,Wn];var nc=[Xn,Ue,vd,Cd,Jd,Qd,gf,ri,si,ti,ui,wi,xi,Ci,Di,Ei,Fi,Hi,Ii,Ni,Oi,Pi,Qi,Si,Ti,Yi,Zi,_i,$i,bj,cj,Kj,Pj,tl,vl,xl,ul,wl,yl,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn,Xn];var oc=[Yn,Rh,ci,Yn];var pc=[Zn,Ye,Ze,jd,af,wd,mf,of,pf,lf,Dd,Ed,Kd,$e,Rd,Sd,ae,fe,Qf,Lh,zl,Bl,Dl,Jl,Ll,Fl,Hl,Yh,Al,Cl,El,Kl,Ml,Gl,Il,pi,qi,vi,Ai,Bi,Gi,Li,Mi,Ri,Wi,Xi,aj,Lk,Mk,Ok,pl,rl,ql,sl,Dk,Ek,Gk,Vk,Wk,Zk,el,fl,il,sm,Vm,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn,Zn];var qc=[_n,wj,Cj,_n];var rc=[$n,ie,Rf,$n];var sc=[ao,qh,th,Eh,Gh,ao,ao,ao];var tc=[bo];var uc=[co,Ik,Jk,Ak,Bk,Qk,Sk,$k,bl,co,co,co,co,co,co,co];var vc=[eo,wk,ek,fk,gk,mk,eo,eo];var wc=[fo,ii,li,fj,jj,pj,rj,fo];var xc=[go,hd,jf,We,jh,kh,oh,uh,xh,yh,Ch,Hh,Jj,Oj,Jm,Im,Hm,go,go,go,go,go,go,go,go,go,go,go,go,go,go,go];var yc=[ho,kd,ld,qf,yd,Fd,sf,bf,Md,Td,df,rk,tk,vk,hk,jk,lk,ho,ho,ho,ho,ho,ho,ho,ho,ho,ho,ho,ho,ho,ho,ho];var zc=[io,_f,dg,yk,Kk,Nk,ok,Ck,Fk,Uk,Xk,dl,gl,io,io,io];var Ac=[jo,id,kf,Xe,$f,eg,Am,Bm,Cm,jo,jo,jo,jo,jo,jo,jo];return{_i64Subtract:kn,_free:Lm,_main:_c,_rand_r:gn,_realloc:Mm,_i64Add:ln,_memmove:nn,_memset:jn,_malloc:Km,_memcpy:mn,_strlen:on,_rand:hn,_bitshift64Shl:pn,__GLOBAL__I_a:Vd,runPostSets:fn,stackAlloc:Bc,stackSave:Cc,stackRestore:Dc,setThrew:Ec,setTempRet0:Hc,setTempRet1:Ic,setTempRet2:Jc,setTempRet3:Kc,setTempRet4:Lc,setTempRet5:Mc,setTempRet6:Nc,setTempRet7:Oc,setTempRet8:Pc,setTempRet9:Qc,dynCall_iiii:Bn,dynCall_viiiiiii:Cn,dynCall_viiiii:Dn,dynCall_vi:En,dynCall_vii:Fn,dynCall_viiiiiiiii:Gn,dynCall_ii:Hn,dynCall_viiiiiid:In,dynCall_viii:Jn,dynCall_viiiiid:Kn,dynCall_v:Ln,dynCall_iiiiiiiii:Mn,dynCall_iiiii:Nn,dynCall_viiiiiiii:On,dynCall_viiiiii:Pn,dynCall_iii:Qn,dynCall_iiiiii:Rn,dynCall_viiii:Sn}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"invoke_iiii\": invoke_iiii, \"invoke_viiiiiii\": invoke_viiiiiii, \"invoke_viiiii\": invoke_viiiii, \"invoke_vi\": invoke_vi, \"invoke_vii\": invoke_vii, \"invoke_viiiiiiiii\": invoke_viiiiiiiii, \"invoke_ii\": invoke_ii, \"invoke_viiiiiid\": invoke_viiiiiid, \"invoke_viii\": invoke_viii, \"invoke_viiiiid\": invoke_viiiiid, \"invoke_v\": invoke_v, \"invoke_iiiiiiiii\": invoke_iiiiiiiii, \"invoke_iiiii\": invoke_iiiii, \"invoke_viiiiiiii\": invoke_viiiiiiii, \"invoke_viiiiii\": invoke_viiiiii, \"invoke_iii\": invoke_iii, \"invoke_iiiiii\": invoke_iiiiii, \"invoke_viiii\": invoke_viiii, \"_fabs\": _fabs, \"_vsscanf\": _vsscanf, \"__ZSt9terminatev\": __ZSt9terminatev, \"___cxa_guard_acquire\": ___cxa_guard_acquire, \"__reallyNegative\": __reallyNegative, \"__ZSt18uncaught_exceptionv\": __ZSt18uncaught_exceptionv, \"___ctype_toupper_loc\": ___ctype_toupper_loc, \"__addDays\": __addDays, \"_sbrk\": _sbrk, \"___cxa_begin_catch\": ___cxa_begin_catch, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"_sysconf\": _sysconf, \"_fileno\": _fileno, \"_fread\": _fread, \"_write\": _write, \"__isLeapYear\": __isLeapYear, \"__ZNSt9exceptionD2Ev\": __ZNSt9exceptionD2Ev, \"___cxa_does_inherit\": ___cxa_does_inherit, \"__exit\": __exit, \"___cxa_rethrow\": ___cxa_rethrow, \"_catclose\": _catclose, \"_llvm_lifetime_end\": _llvm_lifetime_end, \"_send\": _send, \"___cxa_is_number_type\": ___cxa_is_number_type, \"___cxa_free_exception\": ___cxa_free_exception, \"___cxa_find_matching_catch\": ___cxa_find_matching_catch, \"_isxdigit_l\": _isxdigit_l, \"___cxa_guard_release\": ___cxa_guard_release, \"_strtol\": _strtol, \"___setErrNo\": ___setErrNo, \"_newlocale\": _newlocale, \"_isdigit_l\": _isdigit_l, \"___resumeException\": ___resumeException, \"_freelocale\": _freelocale, \"_sprintf\": _sprintf, \"_vasprintf\": _vasprintf, \"_vsnprintf\": _vsnprintf, \"_strtoull_l\": _strtoull_l, \"_read\": _read, \"_fwrite\": _fwrite, \"_time\": _time, \"_pthread_mutex_lock\": _pthread_mutex_lock, \"_catopen\": _catopen, \"_exit\": _exit, \"___ctype_b_loc\": ___ctype_b_loc, \"_fmod\": _fmod, \"___cxa_allocate_exception\": ___cxa_allocate_exception, \"_atoi\": _atoi, \"_strtoll\": _strtoll, \"_pwrite\": _pwrite, \"_uselocale\": _uselocale, \"_snprintf\": _snprintf, \"__scanString\": __scanString, \"___cxa_end_catch\": ___cxa_end_catch, \"_strtoull\": _strtoull, \"_strftime\": _strftime, \"_isxdigit\": _isxdigit, \"__parseInt\": __parseInt, \"_pthread_cond_broadcast\": _pthread_cond_broadcast, \"_recv\": _recv, \"_fgetc\": _fgetc, \"__parseInt64\": __parseInt64, \"__getFloat\": __getFloat, \"_abort\": _abort, \"_isspace\": _isspace, \"_pthread_cond_wait\": _pthread_cond_wait, \"_llvm_lifetime_start\": _llvm_lifetime_start, \"_ungetc\": _ungetc, \"_fflush\": _fflush, \"_strftime_l\": _strftime_l, \"_sscanf\": _sscanf, \"_catgets\": _catgets, \"_asprintf\": _asprintf, \"_strtoll_l\": _strtoll_l, \"__arraySum\": __arraySum, \"___ctype_tolower_loc\": ___ctype_tolower_loc, \"_pthread_mutex_unlock\": _pthread_mutex_unlock, \"_pread\": _pread, \"_mkport\": _mkport, \"___errno_location\": ___errno_location, \"_copysign\": _copysign, \"___cxa_throw\": ___cxa_throw, \"_isdigit\": _isdigit, \"_strerror\": _strerror, \"__formatString\": __formatString, \"_atexit\": _atexit, \"_strerror_r\": _strerror_r, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"cttz_i8\": cttz_i8, \"ctlz_i8\": ctlz_i8, \"___rand_seed\": ___rand_seed, \"NaN\": NaN, \"Infinity\": Infinity, \"__ZTISt9exception\": __ZTISt9exception, \"___dso_handle\": ___dso_handle, \"_stderr\": _stderr, \"_stdin\": _stdin, \"_stdout\": _stdout }, buffer);\nvar _i64Subtract = Module[\"_i64Subtract\"] = asm[\"_i64Subtract\"];\nvar _free = Module[\"_free\"] = asm[\"_free\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _rand_r = Module[\"_rand_r\"] = asm[\"_rand_r\"];\nvar _realloc = Module[\"_realloc\"] = asm[\"_realloc\"];\nvar _i64Add = Module[\"_i64Add\"] = asm[\"_i64Add\"];\nvar _memmove = Module[\"_memmove\"] = asm[\"_memmove\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar _malloc = Module[\"_malloc\"] = asm[\"_malloc\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _rand = Module[\"_rand\"] = asm[\"_rand\"];\nvar _bitshift64Shl = Module[\"_bitshift64Shl\"] = asm[\"_bitshift64Shl\"];\nvar __GLOBAL__I_a = Module[\"__GLOBAL__I_a\"] = asm[\"__GLOBAL__I_a\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\nvar dynCall_iiii = Module[\"dynCall_iiii\"] = asm[\"dynCall_iiii\"];\nvar dynCall_viiiiiii = Module[\"dynCall_viiiiiii\"] = asm[\"dynCall_viiiiiii\"];\nvar dynCall_viiiii = Module[\"dynCall_viiiii\"] = asm[\"dynCall_viiiii\"];\nvar dynCall_vi = Module[\"dynCall_vi\"] = asm[\"dynCall_vi\"];\nvar dynCall_vii = Module[\"dynCall_vii\"] = asm[\"dynCall_vii\"];\nvar dynCall_viiiiiiiii = Module[\"dynCall_viiiiiiiii\"] = asm[\"dynCall_viiiiiiiii\"];\nvar dynCall_ii = Module[\"dynCall_ii\"] = asm[\"dynCall_ii\"];\nvar dynCall_viiiiiid = Module[\"dynCall_viiiiiid\"] = asm[\"dynCall_viiiiiid\"];\nvar dynCall_viii = Module[\"dynCall_viii\"] = asm[\"dynCall_viii\"];\nvar dynCall_viiiiid = Module[\"dynCall_viiiiid\"] = asm[\"dynCall_viiiiid\"];\nvar dynCall_v = Module[\"dynCall_v\"] = asm[\"dynCall_v\"];\nvar dynCall_iiiiiiiii = Module[\"dynCall_iiiiiiiii\"] = asm[\"dynCall_iiiiiiiii\"];\nvar dynCall_iiiii = Module[\"dynCall_iiiii\"] = asm[\"dynCall_iiiii\"];\nvar dynCall_viiiiiiii = Module[\"dynCall_viiiiiiii\"] = asm[\"dynCall_viiiiiiii\"];\nvar dynCall_viiiiii = Module[\"dynCall_viiiiii\"] = asm[\"dynCall_viiiiii\"];\nvar dynCall_iii = Module[\"dynCall_iii\"] = asm[\"dynCall_iii\"];\nvar dynCall_iiiiii = Module[\"dynCall_iiiiii\"] = asm[\"dynCall_iiiiii\"];\nvar dynCall_viiii = Module[\"dynCall_viiii\"] = asm[\"dynCall_viiii\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// TODO: strip out parts of this we do not need\n\n//======= begin closure i64 code =======\n\n// Copyright 2009 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Defines a Long class for representing a 64-bit two's-complement\n * integer value, which faithfully simulates the behavior of a Java \"long\". This\n * implementation is derived from LongLib in GWT.\n *\n */\n\nvar i64Math = (function() { // Emscripten wrapper\n var goog = { math: {} };\n\n\n /**\n * Constructs a 64-bit two's-complement integer, given its low and high 32-bit\n * values as *signed* integers. See the from* functions below for more\n * convenient ways of constructing Longs.\n *\n * The internal representation of a long is the two given signed, 32-bit values.\n * We use 32-bit pieces because these are the size of integers on which\n * Javascript performs bit-operations. For operations like addition and\n * multiplication, we split each number into 16-bit pieces, which can easily be\n * multiplied within Javascript's floating-point representation without overflow\n * or change in sign.\n *\n * In the algorithms below, we frequently reduce the negative case to the\n * positive case by negating the input(s) and then post-processing the result.\n * Note that we must ALWAYS check specially whether those values are MIN_VALUE\n * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n * a positive number, it overflows back into a negative). Not handling this\n * case would often result in infinite recursion.\n *\n * @param {number} low The low (signed) 32 bits of the long.\n * @param {number} high The high (signed) 32 bits of the long.\n * @constructor\n */\n goog.math.Long = function(low, high) {\n /**\n * @type {number}\n * @private\n */\n this.low_ = low | 0; // force into 32 signed bits.\n\n /**\n * @type {number}\n * @private\n */\n this.high_ = high | 0; // force into 32 signed bits.\n };\n\n\n // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n // from* methods on which they depend.\n\n\n /**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @private\n */\n goog.math.Long.IntCache_ = {};\n\n\n /**\n * Returns a Long representing the given (32-bit) integer value.\n * @param {number} value The 32-bit integer in question.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromInt = function(value) {\n if (-128 <= value && value < 128) {\n var cachedObj = goog.math.Long.IntCache_[value];\n if (cachedObj) {\n return cachedObj;\n }\n }\n\n var obj = new goog.math.Long(value | 0, value < 0 ? -1 : 0);\n if (-128 <= value && value < 128) {\n goog.math.Long.IntCache_[value] = obj;\n }\n return obj;\n };\n\n\n /**\n * Returns a Long representing the given value, provided that it is a finite\n * number. Otherwise, zero is returned.\n * @param {number} value The number in question.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromNumber = function(value) {\n if (isNaN(value) || !isFinite(value)) {\n return goog.math.Long.ZERO;\n } else if (value <= -goog.math.Long.TWO_PWR_63_DBL_) {\n return goog.math.Long.MIN_VALUE;\n } else if (value + 1 >= goog.math.Long.TWO_PWR_63_DBL_) {\n return goog.math.Long.MAX_VALUE;\n } else if (value < 0) {\n return goog.math.Long.fromNumber(-value).negate();\n } else {\n return new goog.math.Long(\n (value % goog.math.Long.TWO_PWR_32_DBL_) | 0,\n (value / goog.math.Long.TWO_PWR_32_DBL_) | 0);\n }\n };\n\n\n /**\n * Returns a Long representing the 64-bit integer that comes by concatenating\n * the given high and low bits. Each is assumed to use 32 bits.\n * @param {number} lowBits The low 32-bits.\n * @param {number} highBits The high 32-bits.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromBits = function(lowBits, highBits) {\n return new goog.math.Long(lowBits, highBits);\n };\n\n\n /**\n * Returns a Long representation of the given string, written using the given\n * radix.\n * @param {string} str The textual representation of the Long.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromString = function(str, opt_radix) {\n if (str.length == 0) {\n throw Error('number format error: empty string');\n }\n\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (str.charAt(0) == '-') {\n return goog.math.Long.fromString(str.substring(1), radix).negate();\n } else if (str.indexOf('-') >= 0) {\n throw Error('number format error: interior \"-\" character: ' + str);\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 8));\n\n var result = goog.math.Long.ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = goog.math.Long.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(goog.math.Long.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(goog.math.Long.fromNumber(value));\n }\n }\n return result;\n };\n\n\n // NOTE: the compiler should inline these constant values below and then remove\n // these variables, so there should be no runtime penalty for these.\n\n\n /**\n * Number used repeated below in calculations. This must appear before the\n * first call to any from* function below.\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_16_DBL_ = 1 << 16;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_24_DBL_ = 1 << 24;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_32_DBL_ =\n goog.math.Long.TWO_PWR_16_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_31_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ / 2;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_48_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_64_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_32_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_63_DBL_ =\n goog.math.Long.TWO_PWR_64_DBL_ / 2;\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.ZERO = goog.math.Long.fromInt(0);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.ONE = goog.math.Long.fromInt(1);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.NEG_ONE = goog.math.Long.fromInt(-1);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.MAX_VALUE =\n goog.math.Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.MIN_VALUE = goog.math.Long.fromBits(0, 0x80000000 | 0);\n\n\n /**\n * @type {!goog.math.Long}\n * @private\n */\n goog.math.Long.TWO_PWR_24_ = goog.math.Long.fromInt(1 << 24);\n\n\n /** @return {number} The value, assuming it is a 32-bit integer. */\n goog.math.Long.prototype.toInt = function() {\n return this.low_;\n };\n\n\n /** @return {number} The closest floating-point representation to this value. */\n goog.math.Long.prototype.toNumber = function() {\n return this.high_ * goog.math.Long.TWO_PWR_32_DBL_ +\n this.getLowBitsUnsigned();\n };\n\n\n /**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n */\n goog.math.Long.prototype.toString = function(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (this.isZero()) {\n return '0';\n }\n\n if (this.isNegative()) {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = goog.math.Long.fromNumber(radix);\n var div = this.div(radixLong);\n var rem = div.multiply(radixLong).subtract(this);\n return div.toString(radix) + rem.toInt().toString(radix);\n } else {\n return '-' + this.negate().toString(radix);\n }\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 6));\n\n var rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower);\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();\n var digits = intval.toString(radix);\n\n rem = remDiv;\n if (rem.isZero()) {\n return digits + result;\n } else {\n while (digits.length < 6) {\n digits = '0' + digits;\n }\n result = '' + digits + result;\n }\n }\n };\n\n\n /** @return {number} The high 32-bits as a signed value. */\n goog.math.Long.prototype.getHighBits = function() {\n return this.high_;\n };\n\n\n /** @return {number} The low 32-bits as a signed value. */\n goog.math.Long.prototype.getLowBits = function() {\n return this.low_;\n };\n\n\n /** @return {number} The low 32-bits as an unsigned value. */\n goog.math.Long.prototype.getLowBitsUnsigned = function() {\n return (this.low_ >= 0) ?\n this.low_ : goog.math.Long.TWO_PWR_32_DBL_ + this.low_;\n };\n\n\n /**\n * @return {number} Returns the number of bits needed to represent the absolute\n * value of this Long.\n */\n goog.math.Long.prototype.getNumBitsAbs = function() {\n if (this.isNegative()) {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return 64;\n } else {\n return this.negate().getNumBitsAbs();\n }\n } else {\n var val = this.high_ != 0 ? this.high_ : this.low_;\n for (var bit = 31; bit > 0; bit--) {\n if ((val & (1 << bit)) != 0) {\n break;\n }\n }\n return this.high_ != 0 ? bit + 33 : bit + 1;\n }\n };\n\n\n /** @return {boolean} Whether this value is zero. */\n goog.math.Long.prototype.isZero = function() {\n return this.high_ == 0 && this.low_ == 0;\n };\n\n\n /** @return {boolean} Whether this value is negative. */\n goog.math.Long.prototype.isNegative = function() {\n return this.high_ < 0;\n };\n\n\n /** @return {boolean} Whether this value is odd. */\n goog.math.Long.prototype.isOdd = function() {\n return (this.low_ & 1) == 1;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long equals the other.\n */\n goog.math.Long.prototype.equals = function(other) {\n return (this.high_ == other.high_) && (this.low_ == other.low_);\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long does not equal the other.\n */\n goog.math.Long.prototype.notEquals = function(other) {\n return (this.high_ != other.high_) || (this.low_ != other.low_);\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than the other.\n */\n goog.math.Long.prototype.lessThan = function(other) {\n return this.compare(other) < 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than or equal to the other.\n */\n goog.math.Long.prototype.lessThanOrEqual = function(other) {\n return this.compare(other) <= 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than the other.\n */\n goog.math.Long.prototype.greaterThan = function(other) {\n return this.compare(other) > 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than or equal to the other.\n */\n goog.math.Long.prototype.greaterThanOrEqual = function(other) {\n return this.compare(other) >= 0;\n };\n\n\n /**\n * Compares this Long with the given one.\n * @param {goog.math.Long} other Long to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n * if the given one is greater.\n */\n goog.math.Long.prototype.compare = function(other) {\n if (this.equals(other)) {\n return 0;\n }\n\n var thisNeg = this.isNegative();\n var otherNeg = other.isNegative();\n if (thisNeg && !otherNeg) {\n return -1;\n }\n if (!thisNeg && otherNeg) {\n return 1;\n }\n\n // at this point, the signs are the same, so subtraction will not overflow\n if (this.subtract(other).isNegative()) {\n return -1;\n } else {\n return 1;\n }\n };\n\n\n /** @return {!goog.math.Long} The negation of this value. */\n goog.math.Long.prototype.negate = function() {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.MIN_VALUE;\n } else {\n return this.not().add(goog.math.Long.ONE);\n }\n };\n\n\n /**\n * Returns the sum of this and the given Long.\n * @param {goog.math.Long} other Long to add to this one.\n * @return {!goog.math.Long} The sum of this and the given Long.\n */\n goog.math.Long.prototype.add = function(other) {\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n };\n\n\n /**\n * Returns the difference of this and the given Long.\n * @param {goog.math.Long} other Long to subtract from this.\n * @return {!goog.math.Long} The difference of this and the given Long.\n */\n goog.math.Long.prototype.subtract = function(other) {\n return this.add(other.negate());\n };\n\n\n /**\n * Returns the product of this and the given long.\n * @param {goog.math.Long} other Long to multiply with this.\n * @return {!goog.math.Long} The product of this and the other.\n */\n goog.math.Long.prototype.multiply = function(other) {\n if (this.isZero()) {\n return goog.math.Long.ZERO;\n } else if (other.isZero()) {\n return goog.math.Long.ZERO;\n }\n\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return other.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return this.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().multiply(other.negate());\n } else {\n return this.negate().multiply(other).negate();\n }\n } else if (other.isNegative()) {\n return this.multiply(other.negate()).negate();\n }\n\n // If both longs are small, use float multiplication\n if (this.lessThan(goog.math.Long.TWO_PWR_24_) &&\n other.lessThan(goog.math.Long.TWO_PWR_24_)) {\n return goog.math.Long.fromNumber(this.toNumber() * other.toNumber());\n }\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n };\n\n\n /**\n * Returns this Long divided by the given one.\n * @param {goog.math.Long} other Long by which to divide.\n * @return {!goog.math.Long} This Long divided by the given one.\n */\n goog.math.Long.prototype.div = function(other) {\n if (other.isZero()) {\n throw Error('division by zero');\n } else if (this.isZero()) {\n return goog.math.Long.ZERO;\n }\n\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n if (other.equals(goog.math.Long.ONE) ||\n other.equals(goog.math.Long.NEG_ONE)) {\n return goog.math.Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.ONE;\n } else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shiftRight(1);\n var approx = halfThis.div(other).shiftLeft(1);\n if (approx.equals(goog.math.Long.ZERO)) {\n return other.isNegative() ? goog.math.Long.ONE : goog.math.Long.NEG_ONE;\n } else {\n var rem = this.subtract(other.multiply(approx));\n var result = approx.add(rem.div(other));\n return result;\n }\n }\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().div(other.negate());\n } else {\n return this.negate().div(other).negate();\n }\n } else if (other.isNegative()) {\n return this.div(other.negate()).negate();\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n var res = goog.math.Long.ZERO;\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n var approxRes = goog.math.Long.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = goog.math.Long.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) {\n approxRes = goog.math.Long.ONE;\n }\n\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return res;\n };\n\n\n /**\n * Returns this Long modulo the given one.\n * @param {goog.math.Long} other Long by which to mod.\n * @return {!goog.math.Long} This Long modulo the given one.\n */\n goog.math.Long.prototype.modulo = function(other) {\n return this.subtract(this.div(other).multiply(other));\n };\n\n\n /** @return {!goog.math.Long} The bitwise-NOT of this value. */\n goog.math.Long.prototype.not = function() {\n return goog.math.Long.fromBits(~this.low_, ~this.high_);\n };\n\n\n /**\n * Returns the bitwise-AND of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to AND.\n * @return {!goog.math.Long} The bitwise-AND of this and the other.\n */\n goog.math.Long.prototype.and = function(other) {\n return goog.math.Long.fromBits(this.low_ & other.low_,\n this.high_ & other.high_);\n };\n\n\n /**\n * Returns the bitwise-OR of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to OR.\n * @return {!goog.math.Long} The bitwise-OR of this and the other.\n */\n goog.math.Long.prototype.or = function(other) {\n return goog.math.Long.fromBits(this.low_ | other.low_,\n this.high_ | other.high_);\n };\n\n\n /**\n * Returns the bitwise-XOR of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to XOR.\n * @return {!goog.math.Long} The bitwise-XOR of this and the other.\n */\n goog.math.Long.prototype.xor = function(other) {\n return goog.math.Long.fromBits(this.low_ ^ other.low_,\n this.high_ ^ other.high_);\n };\n\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the left by the given amount.\n */\n goog.math.Long.prototype.shiftLeft = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var low = this.low_;\n if (numBits < 32) {\n var high = this.high_;\n return goog.math.Long.fromBits(\n low << numBits,\n (high << numBits) | (low >>> (32 - numBits)));\n } else {\n return goog.math.Long.fromBits(0, low << (numBits - 32));\n }\n }\n };\n\n\n /**\n * Returns this Long with bits shifted to the right by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the right by the given amount.\n */\n goog.math.Long.prototype.shiftRight = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return goog.math.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >> numBits);\n } else {\n return goog.math.Long.fromBits(\n high >> (numBits - 32),\n high >= 0 ? 0 : -1);\n }\n }\n };\n\n\n /**\n * Returns this Long with bits shifted to the right by the given amount, with\n * the new top bits matching the current sign bit.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the right by the given amount, with\n * zeros placed into the new leading bits.\n */\n goog.math.Long.prototype.shiftRightUnsigned = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return goog.math.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >>> numBits);\n } else if (numBits == 32) {\n return goog.math.Long.fromBits(high, 0);\n } else {\n return goog.math.Long.fromBits(high >>> (numBits - 32), 0);\n }\n }\n };\n\n //======= begin jsbn =======\n\n var navigator = { appName: 'Modern Browser' }; // polyfill a little\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // http://www-cs-students.stanford.edu/~tjw/jsbn/\n\n /*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. \n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n if(j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<<dbits)-1);\n BigInteger.prototype.DV = (1<<dbits);\n\n var BI_FP = 52;\n BigInteger.prototype.FV = Math.pow(2,BI_FP);\n BigInteger.prototype.F1 = BI_FP-dbits;\n BigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n // Digit conversions\n var BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n var BI_RC = new Array();\n var rr,vv;\n rr = \"0\".charCodeAt(0);\n for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\n rr = \"a\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n rr = \"A\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\n function int2char(n) { return BI_RM.charAt(n); }\n function intAt(s,i) {\n var c = BI_RC[s.charCodeAt(i)];\n return (c==null)?-1:c;\n }\n\n // (protected) copy this to r\n function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n this[this.t++] = (x>>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<<sh;\n sh += k;\n if(sh >= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n }\n this.clamp();\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) clamp off excess high words\n function bnpClamp() {\n var c = this.s&this.DM;\n while(this.t > 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }\n\n // (protected) r = this - a\n function bnpSubTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]-a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3;\t\t// y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // jsbn2 stuff\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }\n\n // (protected) r = this + a\n function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.addTo = bnpAddTo;\n\n //======= end jsbn =======\n\n // Emscripten wrapper\n var Wrapper = {\n abs: function(l, h) {\n var x = new goog.math.Long(l, h);\n var ret;\n if (x.isNegative()) {\n ret = x.negate();\n } else {\n ret = x;\n }\n HEAP32[tempDoublePtr>>2] = ret.low_;\n HEAP32[tempDoublePtr+4>>2] = ret.high_;\n },\n ensureTemps: function() {\n if (Wrapper.ensuredTemps) return;\n Wrapper.ensuredTemps = true;\n Wrapper.two32 = new BigInteger();\n Wrapper.two32.fromString('4294967296', 10);\n Wrapper.two64 = new BigInteger();\n Wrapper.two64.fromString('18446744073709551616', 10);\n Wrapper.temp1 = new BigInteger();\n Wrapper.temp2 = new BigInteger();\n },\n lh2bignum: function(l, h) {\n var a = new BigInteger();\n a.fromString(h.toString(), 10);\n var b = new BigInteger();\n a.multiplyTo(Wrapper.two32, b);\n var c = new BigInteger();\n c.fromString(l.toString(), 10);\n var d = new BigInteger();\n c.addTo(b, d);\n return d;\n },\n stringify: function(l, h, unsigned) {\n var ret = new goog.math.Long(l, h).toString();\n if (unsigned && ret[0] == '-') {\n // unsign slowly using jsbn bignums\n Wrapper.ensureTemps();\n var bignum = new BigInteger();\n bignum.fromString(ret, 10);\n ret = new BigInteger();\n Wrapper.two64.addTo(bignum, ret);\n ret = ret.toString(10);\n }\n return ret;\n },\n fromString: function(str, base, min, max, unsigned) {\n Wrapper.ensureTemps();\n var bignum = new BigInteger();\n bignum.fromString(str, base);\n var bigmin = new BigInteger();\n bigmin.fromString(min, 10);\n var bigmax = new BigInteger();\n bigmax.fromString(max, 10);\n if (unsigned && bignum.compareTo(BigInteger.ZERO) < 0) {\n var temp = new BigInteger();\n bignum.addTo(Wrapper.two64, temp);\n bignum = temp;\n }\n var error = false;\n if (bignum.compareTo(bigmin) < 0) {\n bignum = bigmin;\n error = true;\n } else if (bignum.compareTo(bigmax) > 0) {\n bignum = bigmax;\n error = true;\n }\n var ret = goog.math.Long.fromString(bignum.toString()); // min-max checks should have clamped this to a range goog.math.Long can handle well\n HEAP32[tempDoublePtr>>2] = ret.low_;\n HEAP32[tempDoublePtr+4>>2] = ret.high_;\n if (error) throw 'range error';\n }\n };\n return Wrapper;\n})();\n\n//======= end closure i64 code =======\n\n\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "container.cpp", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\nvar __ZTVN10__cxxabiv117__class_type_infoE = 15392;\nvar __ZTVN10__cxxabiv120__si_class_type_infoE = 15432;\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(16259);\n/* global initializers */ __ATINIT__.push({ func: function() { __GLOBAL__I_a() } }, { func: function() { __GLOBAL__I_a18() } });\n\n\n/* memory initializer */ allocate([], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n/* memory initializer */ allocate([144,14,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,2,0,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,119,69,69,0,0,0,0,0,0,0,0,80,60,0,0,112,14,0,0,192,20,0,0,0,0,0,0,0,0,0,0,248,14,0,0,3,0,0,0,4,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,6,0,0,0,7,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,119,69,69,0,80,60,0,0,224,14,0,0,192,20,0,0,0,0,0,0,117,110,115,117,112,112,111,114,116,101,100,32,108,111,99,97,108,101,32,102,111,114,32,115,116,97,110,100,97,114,100,32,105,110,112,117,116,0,0,0,0,0,0,0,144,15,0,0,5,0,0,0,6,0,0,0,3,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,8,0,0,0,9,0,0,0,6,0,0,0,10,0,0,0,11,0,0,0,5,0,0,0,7,0,0,0,6,0,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,99,69,69,0,0,0,0,0,0,0,0,80,60,0,0,112,15,0,0,128,20,0,0,0,0,0,0,0,0,0,0,248,15,0,0,7,0,0,0,8,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,12,0,0,0,9,0,0,0,6,0,0,0,13,0,0,0,14,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,99,69,69,0,80,60,0,0,224,15,0,0,128,20,0,0,0,0,0,0,78,83,116,51,95,95,49,49,52,95,95,115,104,97,114,101,100,95,99,111,117,110,116,69,0,0,0,0,0,0,0,0,40,60,0,0,8,16,0,0,0,0,0,0,112,16,0,0,9,0,0,0,10,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,216,16,0,0,11,0,0,0,12,0,0,0,16,0,0,0,0,0,0,0,83,116,49,49,108,111,103,105,99,95,101,114,114,111,114,0,80,60,0,0,96,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,16,0,0,9,0,0,0,13,0,0,0,15,0,0,0,0,0,0,0,83,116,49,50,108,101,110,103,116,104,95,101,114,114,111,114,0,0,0,0,0,0,0,0,80,60,0,0,152,16,0,0,112,16,0,0,0,0,0,0,83,116,49,51,114,117,110,116,105,109,101,95,101,114,114,111,114,0,0,0,0,0,0,0,80,60,0,0,192,16,0,0,0,0,0,0,0,0,0,0,58,32,0,0,0,0,0,0,0,0,0,0,32,17,0,0,14,0,0,0,15,0,0,0,16,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,50,115,121,115,116,101,109,95,101,114,114,111,114,69,0,0,80,60,0,0,8,17,0,0,216,16,0,0,0,0,0,0,78,83,116,51,95,95,49,49,52,101,114,114,111,114,95,99,97,116,101,103,111,114,121,69,0,0,0,0,0,0,0,0,40,60,0,0,48,17,0,0,78,83,116,51,95,95,49,49,50,95,95,100,111,95,109,101,115,115,97,103,101,69,0,0,80,60,0,0,88,17,0,0,80,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,115,105,99,95,115,116,114,105,110,103,0,0,0,0,0,0,0,0,128,20,0,0,16,0,0,0,17,0,0,0,5,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,12,0,0,0,9,0,0,0,6,0,0,0,10,0,0,0,11,0,0,0,5,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,192,20,0,0,18,0,0,0,19,0,0,0,6,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,4,0,0,0,4,0,0,0,8,0,0,0,0,0,0,0,248,20,0,0,20,0,0,0,21,0,0,0,248,255,255,255,248,255,255,255,248,20,0,0,22,0,0,0,23,0,0,0,8,0,0,0,0,0,0,0,64,21,0,0,24,0,0,0,25,0,0,0,248,255,255,255,248,255,255,255,64,21,0,0,26,0,0,0,27,0,0,0,4,0,0,0,0,0,0,0,136,21,0,0,28,0,0,0,29,0,0,0,252,255,255,255,252,255,255,255,136,21,0,0,30,0,0,0,31,0,0,0,4,0,0,0,0,0,0,0,208,21,0,0,32,0,0,0,33,0,0,0,252,255,255,255,252,255,255,255,208,21,0,0,34,0,0,0,35,0,0,0,105,111,115,116,114,101,97,109,0,0,0,0,0,0,0,0,117,110,115,112,101,99,105,102,105,101,100,32,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,32,101,114,114,111,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,19,0,0,36,0,0,0,37,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,192,19,0,0,38,0,0,0,39,0,0,0,105,111,115,95,98,97,115,101,58,58,99,108,101,97,114,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,55,102,97,105,108,117,114,101,69,0,0,0,0,0,0,0,80,60,0,0,120,19,0,0,32,17,0,0,0,0,0,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,69,0,0,0,0,0,0,0,40,60,0,0,168,19,0,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,0,0,0,0,0,80,60,0,0,200,19,0,0,192,19,0,0,0,0,0,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,0,0,0,0,0,80,60,0,0,8,20,0,0,192,19,0,0,0,0,0,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,0,0,0,0,0,0,40,60,0,0,72,20,0,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,0,0,0,0,0,0,40,60,0,0,136,20,0,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,176,60,0,0,200,20,0,0,0,0,0,0,1,0,0,0,248,19,0,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,176,60,0,0,16,21,0,0,0,0,0,0,1,0,0,0,56,20,0,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,176,60,0,0,88,21,0,0,0,0,0,0,1,0,0,0,248,19,0,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,176,60,0,0,160,21,0,0,0,0,0,0,1,0,0,0,56,20,0,0,3,244,255,255,0,0,0,0,48,22,0,0,40,0,0,0,41,0,0,0,17,0,0,0,1,0,0,0,9,0,0,0,10,0,0,0,2,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,57,95,95,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,69,0,0,0,80,60,0,0,16,22,0,0,112,17,0,0,0,0,0,0,0,0,0,0,88,36,0,0,42,0,0,0,43,0,0,0,44,0,0,0,1,0,0,0,3,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,36,0,0,45,0,0,0,46,0,0,0,44,0,0,0,2,0,0,0,4,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,41,0,0,47,0,0,0,48,0,0,0,44,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,65,66,67,68,69,70,120,88,43,45,112,80,105,73,110,78,0,0,0,0,0,0,0,0,37,112,0,0,0,0,0,0,0,0,0,0,200,41,0,0,49,0,0,0,50,0,0,0,44,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,42,0,0,51,0,0,0,52,0,0,0,44,0,0,0,3,0,0,0,4,0,0,0,23,0,0,0,5,0,0,0,24,0,0,0,1,0,0,0,2,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,43,0,0,53,0,0,0,54,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,25,0,0,0,9,0,0,0,26,0,0,0,3,0,0,0,4,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,0,0,0,0,37,112,0,0,0,0,0,0,0,0,0,0,72,38,0,0,55,0,0,0,56,0,0,0,44,0,0,0,18,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,1,0,0,0,248,255,255,255,72,38,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,58,37,77,58,37,83,37,109,47,37,100,47,37,121,37,89,45,37,109,45,37,100,37,73,58,37,77,58,37,83,32,37,112,0,0,0,0,0,37,72,58,37,77,0,0,0,37,72,58,37,77,58,37,83,0,0,0,0,232,38,0,0,57,0,0,0,58,0,0,0,44,0,0,0,26,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,2,0,0,0,248,255,255,255,232,38,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,37,0,0,0,89,0,0,0,45,0,0,0,37,0,0,0,109,0,0,0,45,0,0,0,37,0,0,0,100,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,120,39,0,0,59,0,0,0,60,0,0,0,44,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,39,0,0,61,0,0,0,62,0,0,0,44,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,36,0,0,63,0,0,0,64,0,0,0,44,0,0,0,34,0,0,0,35,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,36,0,0,0,11,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,37,0,0,65,0,0,0,66,0,0,0,44,0,0,0,37,0,0,0,38,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,39,0,0,0,17,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,37,0,0,67,0,0,0,68,0,0,0,44,0,0,0,40,0,0,0,41,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,42,0,0,0,23,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,37,0,0,69,0,0,0,70,0,0,0,44,0,0,0,43,0,0,0,44,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,45,0,0,0,29,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,43,0,0,71,0,0,0,72,0,0,0,44,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,0,0,0,0,0,0,37,76,102,0,0,0,0,0,109,111,110,101,121,95,103,101,116,32,101,114,114,111,114,0,0,0,0,0,64,44,0,0,73,0,0,0,74,0,0,0,44,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,0,0,0,0,0,0,0,0,0,0,208,44,0,0,75,0,0,0,76,0,0,0,44,0,0,0,1,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,46,48,76,102,0,0,0,0,0,0,0,96,45,0,0,77,0,0,0,78,0,0,0,44,0,0,0,2,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,40,0,0,79,0,0,0,80,0,0,0,44,0,0,0,13,0,0,0,11,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,40,0,0,81,0,0,0,82,0,0,0,44,0,0,0,14,0,0,0,12,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,118,101,99,116,111,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,48,36,0,0,83,0,0,0,84,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,33,0,0,85,0,0,0,86,0,0,0,44,0,0,0,9,0,0,0,15,0,0,0,10,0,0,0,16,0,0,0,11,0,0,0,1,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,33,0,0,87,0,0,0,88,0,0,0,44,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,46,0,0,0,47,0,0,0,5,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,35,0,0,89,0,0,0,90,0,0,0,44,0,0,0,49,0,0,0,50,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,0,0,0,0,8,36,0,0,91,0,0,0,92,0,0,0,44,0,0,0,51,0,0,0,52,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,116,114,117,101,0,0,0,0,116,0,0,0,114,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,102,97,108,115,101,0,0,0,102,0,0,0,97,0,0,0,108,0,0,0,115,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,109,47,37,100,47,37,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,58,37,77,58,37,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,97,32,37,98,32,37,100,32,37,72,58,37,77,58,37,83,32,37,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,97,0,0,0,32,0,0,0,37,0,0,0,98,0,0,0,32,0,0,0,37,0,0,0,100,0,0,0,32,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,73,58,37,77,58,37,83,32,37,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,108,111,99,97,108,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,0,0,0,0,0,0,0,64,32,0,0,93,0,0,0,94,0,0,0,44,0,0,0,0,0,0,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,102,97,99,101,116,69,0,0,0,80,60,0,0,40,32,0,0,40,16,0,0,0,0,0,0,0,0,0,0,208,32,0,0,93,0,0,0,95,0,0,0,44,0,0,0,18,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,12,0,0,0,19,0,0,0,13,0,0,0,20,0,0,0,14,0,0,0,5,0,0,0,21,0,0,0,6,0,0,0,0,0,0,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,119,69,69,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,48,99,116,121,112,101,95,98,97,115,101,69,0,0,0,0,40,60,0,0,176,32,0,0,176,60,0,0,152,32,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,32,0,0,2,0,0,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,99,69,69,0,0,0,0,0,0,0,176,60,0,0,240,32,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,32,0,0,2,0,0,0,0,0,0,0,160,33,0,0,93,0,0,0,96,0,0,0,44,0,0,0,3,0,0,0,4,0,0,0,7,0,0,0,53,0,0,0,54,0,0,0,8,0,0,0,55,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,99,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,50,99,111,100,101,99,118,116,95,98,97,115,101,69,0,0,40,60,0,0,128,33,0,0,176,60,0,0,88,33,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,152,33,0,0,2,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,119,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,0,176,60,0,0,192,33,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,152,33,0,0,2,0,0,0,0,0,0,0,96,34,0,0,93,0,0,0,97,0,0,0,44,0,0,0,5,0,0,0,6,0,0,0,9,0,0,0,56,0,0,0,57,0,0,0,10,0,0,0,58,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,115,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,176,60,0,0,56,34,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,152,33,0,0,2,0,0,0,0,0,0,0,216,34,0,0,93,0,0,0,98,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,59,0,0,0,60,0,0,0,12,0,0,0,61,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,105,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,176,60,0,0,176,34,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,152,33,0,0,2,0,0,0,0,0,0,0,80,35,0,0,93,0,0,0,99,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,59,0,0,0,60,0,0,0,12,0,0,0,61,0,0,0,78,83,116,51,95,95,49,49,54,95,95,110,97,114,114,111,119,95,116,111,95,117,116,102,56,73,76,106,51,50,69,69,69,0,0,0,0,0,0,0,80,60,0,0,40,35,0,0,216,34,0,0,0,0,0,0,0,0,0,0,184,35,0,0,93,0,0,0,100,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,59,0,0,0,60,0,0,0,12,0,0,0,61,0,0,0,78,83,116,51,95,95,49,49,55,95,95,119,105,100,101,110,95,102,114,111,109,95,117,116,102,56,73,76,106,51,50,69,69,69,0,0,0,0,0,0,80,60,0,0,144,35,0,0,216,34,0,0,0,0,0,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,99,69,69,0,0,0,0,80,60,0,0,200,35,0,0,64,32,0,0,0,0,0,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,119,69,69,0,0,0,0,80,60,0,0,240,35,0,0,64,32,0,0,0,0,0,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,95,95,105,109,112,69,0,0,0,80,60,0,0,24,36,0,0,64,32,0,0,0,0,0,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,99,69,69,0,0,0,0,0,80,60,0,0,64,36,0,0,64,32,0,0,0,0,0,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,119,69,69,0,0,0,0,0,80,60,0,0,104,36,0,0,64,32,0,0,0,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,48,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,95,98,97,115,101,69,0,0,0,0,40,60,0,0,176,36,0,0,176,60,0,0,144,36,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,36,0,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,49,69,69,69,0,0,0,0,0,176,60,0,0,240,36,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,36,0,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,48,69,69,69,0,0,0,0,0,176,60,0,0,48,37,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,36,0,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,49,69,69,69,0,0,0,0,0,176,60,0,0,112,37,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,36,0,0,2,0,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,57,116,105,109,101,95,98,97,115,101,69,0,0,0,0,0,0,40,60,0,0,248,37,0,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,99,69,69,0,0,0,0,0,0,0,40,60,0,0,24,38,0,0,176,60,0,0,176,37,0,0,0,0,0,0,3,0,0,0,64,32,0,0,2,0,0,0,16,38,0,0,2,0,0,0,64,38,0,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,119,69,69,0,0,0,0,0,0,0,40,60,0,0,184,38,0,0,176,60,0,0,112,38,0,0,0,0,0,0,3,0,0,0,64,32,0,0,2,0,0,0,16,38,0,0,2,0,0,0,224,38,0,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,49,48,95,95,116,105,109,101,95,112,117,116,69,0,0,0,0,40,60,0,0,88,39,0,0,176,60,0,0,16,39,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,112,39,0,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,176,60,0,0,152,39,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,112,39,0,0,0,8,0,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,99,69,69,0,0,0,0,78,83,116,51,95,95,49,49,51,109,101,115,115,97,103,101,115,95,98,97,115,101,69,0,40,60,0,0,24,40,0,0,176,60,0,0,0,40,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,48,40,0,0,2,0,0,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,119,69,69,0,0,0,0,176,60,0,0,88,40,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,48,40,0,0,2,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,99,69,69,0,0,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,103,101,116,95,98,97,115,101,69,0,0,0,0,0,0,0,0,40,60,0,0,240,40,0,0,176,60,0,0,216,40,0,0,0,0,0,0,1,0,0,0,16,41,0,0,0,0,0,0,176,60,0,0,144,40,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,24,41,0,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,119,69,69,0,0,0,176,60,0,0,152,41,0,0,0,0,0,0,1,0,0,0,16,41,0,0,0,0,0,0,176,60,0,0,80,41,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,176,41,0,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,99,69,69,0,0,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,112,117,116,95,98,97,115,101,69,0,0,0,0,0,0,0,0,40,60,0,0,72,42,0,0,176,60,0,0,48,42,0,0,0,0,0,0,1,0,0,0,104,42,0,0,0,0,0,0,176,60,0,0,232,41,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,112,42,0,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,119,69,69,0,0,0,176,60,0,0,240,42,0,0,0,0,0,0,1,0,0,0,104,42,0,0,0,0,0,0,176,60,0,0,168,42,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,8,43,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,99,69,69,0,0,0,0,0,0,0,0,40,60,0,0,136,43,0,0,176,60,0,0,64,43,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,168,43,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,119,69,69,0,0,0,0,0,0,0,0,40,60,0,0,24,44,0,0,176,60,0,0,208,43,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,56,44,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,99,69,69,0,0,0,0,0,0,0,0,40,60,0,0,168,44,0,0,176,60,0,0,96,44,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,200,44,0,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,119,69,69,0,0,0,0,0,0,0,0,40,60,0,0,56,45,0,0,176,60,0,0,240,44,0,0,0,0,0,0,2,0,0,0,64,32,0,0,2,0,0,0,88,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,77,0,0,0,0,0,0,80,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,114,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,99,0,0,0,104,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,105,0,0,0,108,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,117,0,0,0,115,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,116,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,111,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+3628);\n/* memory initializer */ allocate([74,97,110,117,97,114,121,0,70,101,98,114,117,97,114,121,0,0,0,0,0,0,0,0,77,97,114,99,104,0,0,0,65,112,114,105,108,0,0,0,77,97,121,0,0,0,0,0,74,117,110,101,0,0,0,0,74,117,108,121,0,0,0,0,65,117,103,117,115,116,0,0,83,101,112,116,101,109,98,101,114,0,0,0,0,0,0,0,79,99,116,111,98,101,114,0,78,111,118,101,109,98,101,114,0,0,0,0,0,0,0,0,68,101,99,101,109,98,101,114,0,0,0,0,0,0,0,0,74,97,110,0,0,0,0,0,70,101,98,0,0,0,0,0,77,97,114,0,0,0,0,0,65,112,114,0,0,0,0,0,74,117,110,0,0,0,0,0,74,117,108,0,0,0,0,0,65,117,103,0,0,0,0,0,83,101,112,0,0,0,0,0,79,99,116,0,0,0,0,0,78,111,118,0,0,0,0,0,68,101,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,110,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,114,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,117,0,0,0,114,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,117,110,100,97,121,0,0,77,111,110,100,97,121,0,0,84,117,101,115,100,97,121,0,87,101,100,110,101,115,100,97,121,0,0,0,0,0,0,0,84,104,117,114,115,100,97,121,0,0,0,0,0,0,0,0,70,114,105,100,97,121,0,0,83,97,116,117,114,100,97,121,0,0,0,0,0,0,0,0,83,117,110,0,0,0,0,0,77,111,110,0,0,0,0,0,84,117,101,0,0,0,0,0,87,101,100,0,0,0,0,0,84,104,117,0,0,0,0,0,70,114,105,0,0,0,0,0,83,97,116,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,59,0,0,101,0,0,0,102,0,0,0,62,0,0,0,0,0,0,0,115,116,100,58,58,98,97,100,95,99,97,115,116,0,0,0,83,116,57,116,121,112,101,95,105,110,102,111,0,0,0,0,40,60,0,0,120,59,0,0,83,116,56,98,97,100,95,99,97,115,116,0,0,0,0,0,80,60,0,0,144,59,0,0,0,0,0,0,0,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,0,0,0,0,80,60,0,0,176,59,0,0,136,59,0,0,0,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,0,0,0,80,60,0,0,232,59,0,0,216,59,0,0,0,0,0,0,0,0,0,0,16,60,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,22,0,0,0,13,0,0,0,1,0,0,0,5,0,0,0,0,0,0,0,152,60,0,0,103,0,0,0,107,0,0,0,105,0,0,0,106,0,0,0,22,0,0,0,14,0,0,0,2,0,0,0,6,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,80,60,0,0,112,60,0,0,16,60,0,0,0,0,0,0,0,0,0,0,248,60,0,0,103,0,0,0,108,0,0,0,105,0,0,0,106,0,0,0,22,0,0,0,15,0,0,0,3,0,0,0,7,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,49,95,95,118,109,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,80,60,0,0,208,60,0,0,16,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,63,0,0,109,0,0,0,110,0,0,0,63,0,0,0,0,0,0,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,0,83,116,57,98,97,100,95,97,108,108,111,99,0,0,0,0,80,60,0,0,40,63,0,0,0,0,0,0,0,0,0,0,105,110,102,105,110,105,116,121,0,0,0,0,0,0,0,0,110,97,110,0,0,0,0,0,95,112,137,0,255,9,47,15,10,0,0,0,100,0,0,0,232,3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+13888);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n \n function _atexit(func, arg) {\n __ATEXIT__.unshift({ func: func, arg: arg });\n }var ___cxa_atexit=_atexit;\n\n function _llvm_lifetime_end() {}\n\n \n \n Module[\"_memset\"] = _memset;var _llvm_memset_p0i8_i32=_memset;\n\n \n Module[\"_i64Subtract\"] = _i64Subtract;\n\n \n Module[\"_i64Add\"] = _i64Add;\n\n \n function __ZSt18uncaught_exceptionv() { // std::uncaught_exception()\n return !!__ZSt18uncaught_exceptionv.uncaught_exception;\n }\n \n \n \n function ___cxa_is_number_type(type) {\n var isNumber = false;\n try { if (type == __ZTIi) isNumber = true } catch(e){}\n try { if (type == __ZTIj) isNumber = true } catch(e){}\n try { if (type == __ZTIl) isNumber = true } catch(e){}\n try { if (type == __ZTIm) isNumber = true } catch(e){}\n try { if (type == __ZTIx) isNumber = true } catch(e){}\n try { if (type == __ZTIy) isNumber = true } catch(e){}\n try { if (type == __ZTIf) isNumber = true } catch(e){}\n try { if (type == __ZTId) isNumber = true } catch(e){}\n try { if (type == __ZTIe) isNumber = true } catch(e){}\n try { if (type == __ZTIc) isNumber = true } catch(e){}\n try { if (type == __ZTIa) isNumber = true } catch(e){}\n try { if (type == __ZTIh) isNumber = true } catch(e){}\n try { if (type == __ZTIs) isNumber = true } catch(e){}\n try { if (type == __ZTIt) isNumber = true } catch(e){}\n return isNumber;\n }function ___cxa_does_inherit(definiteType, possibilityType, possibility) {\n if (possibility == 0) return false;\n if (possibilityType == 0 || possibilityType == definiteType)\n return true;\n var possibility_type_info;\n if (___cxa_is_number_type(possibilityType)) {\n possibility_type_info = possibilityType;\n } else {\n var possibility_type_infoAddr = HEAP32[((possibilityType)>>2)] - 8;\n possibility_type_info = HEAP32[((possibility_type_infoAddr)>>2)];\n }\n switch (possibility_type_info) {\n case 0: // possibility is a pointer\n // See if definite type is a pointer\n var definite_type_infoAddr = HEAP32[((definiteType)>>2)] - 8;\n var definite_type_info = HEAP32[((definite_type_infoAddr)>>2)];\n if (definite_type_info == 0) {\n // Also a pointer; compare base types of pointers\n var defPointerBaseAddr = definiteType+8;\n var defPointerBaseType = HEAP32[((defPointerBaseAddr)>>2)];\n var possPointerBaseAddr = possibilityType+8;\n var possPointerBaseType = HEAP32[((possPointerBaseAddr)>>2)];\n return ___cxa_does_inherit(defPointerBaseType, possPointerBaseType, possibility);\n } else\n return false; // one pointer and one non-pointer\n case 1: // class with no base class\n return false;\n case 2: // class with base class\n var parentTypeAddr = possibilityType + 8;\n var parentType = HEAP32[((parentTypeAddr)>>2)];\n return ___cxa_does_inherit(definiteType, parentType, possibility);\n default:\n return false; // some unencountered type\n }\n }\n \n \n \n var ___cxa_last_thrown_exception=0;function ___resumeException(ptr) {\n if (!___cxa_last_thrown_exception) { ___cxa_last_thrown_exception = ptr; }\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n \n var ___cxa_exception_header_size=8;function ___cxa_find_matching_catch(thrown, throwntype) {\n if (thrown == -1) thrown = ___cxa_last_thrown_exception;\n header = thrown - ___cxa_exception_header_size;\n if (throwntype == -1) throwntype = HEAP32[((header)>>2)];\n var typeArray = Array.prototype.slice.call(arguments, 2);\n \n // If throwntype is a pointer, this means a pointer has been\n // thrown. When a pointer is thrown, actually what's thrown\n // is a pointer to the pointer. We'll dereference it.\n if (throwntype != 0 && !___cxa_is_number_type(throwntype)) {\n var throwntypeInfoAddr= HEAP32[((throwntype)>>2)] - 8;\n var throwntypeInfo= HEAP32[((throwntypeInfoAddr)>>2)];\n if (throwntypeInfo == 0)\n thrown = HEAP32[((thrown)>>2)];\n }\n // The different catch blocks are denoted by different types.\n // Due to inheritance, those types may not precisely match the\n // type of the thrown object. Find one which matches, and\n // return the type of the catch block which should be called.\n for (var i = 0; i < typeArray.length; i++) {\n if (___cxa_does_inherit(typeArray[i], throwntype, thrown))\n return ((asm[\"setTempRet0\"](typeArray[i]),thrown)|0);\n }\n // Shouldn't happen unless we have bogus data in typeArray\n // or encounter a type for which emscripten doesn't have suitable\n // typeinfo defined. Best-efforts match just in case.\n return ((asm[\"setTempRet0\"](throwntype),thrown)|0);\n }function ___cxa_throw(ptr, type, destructor) {\n if (!___cxa_throw.initialized) {\n try {\n HEAP32[((__ZTVN10__cxxabiv119__pointer_type_infoE)>>2)]=0; // Workaround for libcxxabi integration bug\n } catch(e){}\n try {\n HEAP32[((__ZTVN10__cxxabiv117__class_type_infoE)>>2)]=1; // Workaround for libcxxabi integration bug\n } catch(e){}\n try {\n HEAP32[((__ZTVN10__cxxabiv120__si_class_type_infoE)>>2)]=2; // Workaround for libcxxabi integration bug\n } catch(e){}\n ___cxa_throw.initialized = true;\n }\n var header = ptr - ___cxa_exception_header_size;\n HEAP32[((header)>>2)]=type;\n HEAP32[(((header)+(4))>>2)]=destructor;\n ___cxa_last_thrown_exception = ptr;\n if (!(\"uncaught_exception\" in __ZSt18uncaught_exceptionv)) {\n __ZSt18uncaught_exceptionv.uncaught_exception = 1;\n } else {\n __ZSt18uncaught_exceptionv.uncaught_exception++;\n }\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n\n function _pthread_mutex_lock() {}\n\n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }\n\n \n \n \n function _isspace(chr) {\n return (chr == 32) || (chr >= 9 && chr <= 13);\n }\n function __parseInt64(str, endptr, base, min, max, unsign) {\n var isNegative = false;\n // Skip space.\n while (_isspace(HEAP8[(str)])) str++;\n \n // Check for a plus/minus sign.\n if (HEAP8[(str)] == 45) {\n str++;\n isNegative = true;\n } else if (HEAP8[(str)] == 43) {\n str++;\n }\n \n // Find base.\n var ok = false;\n var finalBase = base;\n if (!finalBase) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n finalBase = 16;\n str += 2;\n } else {\n finalBase = 8;\n ok = true; // we saw an initial zero, perhaps the entire thing is just \"0\"\n }\n }\n } else if (finalBase==16) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n str += 2;\n }\n }\n }\n if (!finalBase) finalBase = 10;\n var start = str;\n \n // Get digits.\n var chr;\n while ((chr = HEAP8[(str)]) != 0) {\n var digit = parseInt(String.fromCharCode(chr), finalBase);\n if (isNaN(digit)) {\n break;\n } else {\n str++;\n ok = true;\n }\n }\n \n if (!ok) {\n ___setErrNo(ERRNO_CODES.EINVAL);\n return ((asm[\"setTempRet0\"](0),0)|0);\n }\n \n // Set end pointer.\n if (endptr) {\n HEAP32[((endptr)>>2)]=str;\n }\n \n try {\n var numberString = isNegative ? '-'+Pointer_stringify(start, str - start) : Pointer_stringify(start, str - start);\n i64Math.fromString(numberString, finalBase, min, max, unsign);\n } catch(e) {\n ___setErrNo(ERRNO_CODES.ERANGE); // not quite correct\n }\n \n return ((asm[\"setTempRet0\"](((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)),((HEAP32[((tempDoublePtr)>>2)])|0))|0);\n }function _strtoull(str, endptr, base) {\n return __parseInt64(str, endptr, base, 0, '18446744073709551615', true); // ULONG_MAX.\n }function _strtoull_l(str, endptr, base) {\n return _strtoull(str, endptr, base); // no locale support yet\n }\n\n var _log=Math_log;\n\n \n \n \n \n function _mkport() { throw 'TODO' }var SOCKFS={mount:function (mount) {\n return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createSocket:function (family, type, protocol) {\n var streaming = type == 1;\n if (protocol) {\n assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp\n }\n \n // create our internal socket structure\n var sock = {\n family: family,\n type: type,\n protocol: protocol,\n server: null,\n peers: {},\n pending: [],\n recv_queue: [],\n sock_ops: SOCKFS.websocket_sock_ops\n };\n \n // create the filesystem node to store the socket structure\n var name = SOCKFS.nextname();\n var node = FS.createNode(SOCKFS.root, name, 49152, 0);\n node.sock = sock;\n \n // and the wrapping stream that enables library functions such\n // as read and write to indirectly interact with the socket\n var stream = FS.createStream({\n path: name,\n node: node,\n flags: FS.modeStringToFlags('r+'),\n seekable: false,\n stream_ops: SOCKFS.stream_ops\n });\n \n // map the new stream to the socket structure (sockets have a 1:1\n // relationship with a stream)\n sock.stream = stream;\n \n return sock;\n },getSocket:function (fd) {\n var stream = FS.getStream(fd);\n if (!stream || !FS.isSocket(stream.node.mode)) {\n return null;\n }\n return stream.node.sock;\n },stream_ops:{poll:function (stream) {\n var sock = stream.node.sock;\n return sock.sock_ops.poll(sock);\n },ioctl:function (stream, request, varargs) {\n var sock = stream.node.sock;\n return sock.sock_ops.ioctl(sock, request, varargs);\n },read:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n var msg = sock.sock_ops.recvmsg(sock, length);\n if (!msg) {\n // socket is closed\n return 0;\n }\n buffer.set(msg.buffer, offset);\n return msg.buffer.length;\n },write:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n return sock.sock_ops.sendmsg(sock, buffer, offset, length);\n },close:function (stream) {\n var sock = stream.node.sock;\n sock.sock_ops.close(sock);\n }},nextname:function () {\n if (!SOCKFS.nextname.current) {\n SOCKFS.nextname.current = 0;\n }\n return 'socket[' + (SOCKFS.nextname.current++) + ']';\n },websocket_sock_ops:{createPeer:function (sock, addr, port) {\n var ws;\n \n if (typeof addr === 'object') {\n ws = addr;\n addr = null;\n port = null;\n }\n \n if (ws) {\n // for sockets that've already connected (e.g. we're the server)\n // we can inspect the _socket property for the address\n if (ws._socket) {\n addr = ws._socket.remoteAddress;\n port = ws._socket.remotePort;\n }\n // if we're just now initializing a connection to the remote,\n // inspect the url property\n else {\n var result = /ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);\n if (!result) {\n throw new Error('WebSocket URL must be in the format ws(s)://address:port');\n }\n addr = result[1];\n port = parseInt(result[2], 10);\n }\n } else {\n // create the actual websocket object and connect\n try {\n var url = 'ws://' + addr + ':' + port;\n // the node ws library API is slightly different than the browser's\n var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];\n // If node we use the ws library.\n var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];\n ws = new WebSocket(url, opts);\n ws.binaryType = 'arraybuffer';\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);\n }\n }\n \n \n var peer = {\n addr: addr,\n port: port,\n socket: ws,\n dgram_send_queue: []\n };\n \n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);\n \n // if this is a bound dgram socket, send the port number first to allow\n // us to override the ephemeral port reported to us by remotePort on the\n // remote end.\n if (sock.type === 2 && typeof sock.sport !== 'undefined') {\n peer.dgram_send_queue.push(new Uint8Array([\n 255, 255, 255, 255,\n 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),\n ((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)\n ]));\n }\n \n return peer;\n },getPeer:function (sock, addr, port) {\n return sock.peers[addr + ':' + port];\n },addPeer:function (sock, peer) {\n sock.peers[peer.addr + ':' + peer.port] = peer;\n },removePeer:function (sock, peer) {\n delete sock.peers[peer.addr + ':' + peer.port];\n },handlePeerEvents:function (sock, peer) {\n var first = true;\n \n var handleOpen = function () {\n try {\n var queued = peer.dgram_send_queue.shift();\n while (queued) {\n peer.socket.send(queued);\n queued = peer.dgram_send_queue.shift();\n }\n } catch (e) {\n // not much we can do here in the way of proper error handling as we've already\n // lied and said this data was sent. shut it down.\n peer.socket.close();\n }\n };\n \n function handleMessage(data) {\n assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer\n data = new Uint8Array(data); // make a typed array view on the array buffer\n \n \n // if this is the port message, override the peer's port with it\n var wasfirst = first;\n first = false;\n if (wasfirst &&\n data.length === 10 &&\n data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&\n data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {\n // update the peer's port and it's key in the peer map\n var newport = ((data[8] << 8) | data[9]);\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n peer.port = newport;\n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n return;\n }\n \n sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });\n };\n \n if (ENVIRONMENT_IS_NODE) {\n peer.socket.on('open', handleOpen);\n peer.socket.on('message', function(data, flags) {\n if (!flags.binary) {\n return;\n }\n handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer\n });\n peer.socket.on('error', function() {\n // don't throw\n });\n } else {\n peer.socket.onopen = handleOpen;\n peer.socket.onmessage = function peer_socket_onmessage(event) {\n handleMessage(event.data);\n };\n }\n },poll:function (sock) {\n if (sock.type === 1 && sock.server) {\n // listen sockets should only say they're available for reading\n // if there are pending clients.\n return sock.pending.length ? (64 | 1) : 0;\n }\n \n var mask = 0;\n var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets\n SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :\n null;\n \n if (sock.recv_queue.length ||\n !dest || // connection-less sockets are always ready to read\n (dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed\n mask |= (64 | 1);\n }\n \n if (!dest || // connection-less sockets are always ready to write\n (dest && dest.socket.readyState === dest.socket.OPEN)) {\n mask |= 4;\n }\n \n if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) {\n mask |= 16;\n }\n \n return mask;\n },ioctl:function (sock, request, arg) {\n switch (request) {\n case 21531:\n var bytes = 0;\n if (sock.recv_queue.length) {\n bytes = sock.recv_queue[0].data.length;\n }\n HEAP32[((arg)>>2)]=bytes;\n return 0;\n default:\n return ERRNO_CODES.EINVAL;\n }\n },close:function (sock) {\n // if we've spawned a listen server, close it\n if (sock.server) {\n try {\n sock.server.close();\n } catch (e) {\n }\n sock.server = null;\n }\n // close any peer connections\n var peers = Object.keys(sock.peers);\n for (var i = 0; i < peers.length; i++) {\n var peer = sock.peers[peers[i]];\n try {\n peer.socket.close();\n } catch (e) {\n }\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n }\n return 0;\n },bind:function (sock, addr, port) {\n if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound\n }\n sock.saddr = addr;\n sock.sport = port || _mkport();\n // in order to emulate dgram sockets, we need to launch a listen server when\n // binding on a connection-less socket\n // note: this is only required on the server side\n if (sock.type === 2) {\n // close the existing server if it exists\n if (sock.server) {\n sock.server.close();\n sock.server = null;\n }\n // swallow error operation not supported error that occurs when binding in the\n // browser where this isn't supported\n try {\n sock.sock_ops.listen(sock, 0);\n } catch (e) {\n if (!(e instanceof FS.ErrnoError)) throw e;\n if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;\n }\n }\n },connect:function (sock, addr, port) {\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);\n }\n \n // TODO autobind\n // if (!sock.addr && sock.type == 2) {\n // }\n \n // early out if we're already connected / in the middle of connecting\n if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n if (dest) {\n if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EALREADY);\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EISCONN);\n }\n }\n }\n \n // add the socket to our peer list and set our\n // destination address / port to match\n var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n sock.daddr = peer.addr;\n sock.dport = peer.port;\n \n // always \"fail\" in non-blocking mode\n throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);\n },listen:function (sock, backlog) {\n if (!ENVIRONMENT_IS_NODE) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening\n }\n var WebSocketServer = require('ws').Server;\n var host = sock.saddr;\n sock.server = new WebSocketServer({\n host: host,\n port: sock.sport\n // TODO support backlog\n });\n \n sock.server.on('connection', function(ws) {\n if (sock.type === 1) {\n var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);\n \n // create a peer on the new socket\n var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);\n newsock.daddr = peer.addr;\n newsock.dport = peer.port;\n \n // push to queue for accept to pick up\n sock.pending.push(newsock);\n } else {\n // create a peer on the listen socket so calling sendto\n // with the listen socket and an address will resolve\n // to the correct client\n SOCKFS.websocket_sock_ops.createPeer(sock, ws);\n }\n });\n sock.server.on('closed', function() {\n sock.server = null;\n });\n sock.server.on('error', function() {\n // don't throw\n });\n },accept:function (listensock) {\n if (!listensock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var newsock = listensock.pending.shift();\n newsock.stream.flags = listensock.stream.flags;\n return newsock;\n },getname:function (sock, peer) {\n var addr, port;\n if (peer) {\n if (sock.daddr === undefined || sock.dport === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n addr = sock.daddr;\n port = sock.dport;\n } else {\n // TODO saddr and sport will be set for bind()'d UDP sockets, but what\n // should we be returning for TCP sockets that've been connect()'d?\n addr = sock.saddr || 0;\n port = sock.sport || 0;\n }\n return { addr: addr, port: port };\n },sendmsg:function (sock, buffer, offset, length, addr, port) {\n if (sock.type === 2) {\n // connection-less sockets will honor the message address,\n // and otherwise fall back to the bound destination address\n if (addr === undefined || port === undefined) {\n addr = sock.daddr;\n port = sock.dport;\n }\n // if there was no address to fall back to, error out\n if (addr === undefined || port === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);\n }\n } else {\n // connection-based sockets will only use the bound\n addr = sock.daddr;\n port = sock.dport;\n }\n \n // find the peer for the destination address\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);\n \n // early out if not connected with a connection-based socket\n if (sock.type === 1) {\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n } else if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // create a copy of the incoming data to send, as the WebSocket API\n // doesn't work entirely with an ArrayBufferView, it'll just send\n // the entire underlying buffer\n var data;\n if (buffer instanceof Array || buffer instanceof ArrayBuffer) {\n data = buffer.slice(offset, offset + length);\n } else { // ArrayBufferView\n data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);\n }\n \n // if we're emulating a connection-less dgram socket and don't have\n // a cached connection, queue the buffer to send upon connect and\n // lie, saying the data was sent now.\n if (sock.type === 2) {\n if (!dest || dest.socket.readyState !== dest.socket.OPEN) {\n // if we're not connected, open a new connection\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n }\n dest.dgram_send_queue.push(data);\n return length;\n }\n }\n \n try {\n // send the actual data\n dest.socket.send(data);\n return length;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n },recvmsg:function (sock, length) {\n // http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html\n if (sock.type === 1 && sock.server) {\n // tcp servers should not be recv()'ing on the listen socket\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n \n var queued = sock.recv_queue.shift();\n if (!queued) {\n if (sock.type === 1) {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n \n if (!dest) {\n // if we have a destination address but are not connected, error out\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n // return null if the socket has closed\n return null;\n }\n else {\n // else, our socket is in a valid state but truly has nothing available\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // queued.data will be an ArrayBuffer if it's unadulterated, but if it's\n // requeued TCP data it'll be an ArrayBufferView\n var queuedLength = queued.data.byteLength || queued.data.length;\n var queuedOffset = queued.data.byteOffset || 0;\n var queuedBuffer = queued.data.buffer || queued.data;\n var bytesRead = Math.min(length, queuedLength);\n var res = {\n buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),\n addr: queued.addr,\n port: queued.port\n };\n \n \n // push back any unread data for TCP connections\n if (sock.type === 1 && bytesRead < queuedLength) {\n var bytesRemaining = queuedLength - bytesRead;\n queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);\n sock.recv_queue.unshift(queued);\n }\n \n return res;\n }}};function _send(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _write(fd, buf, len);\n }\n \n function _pwrite(fildes, buf, nbyte, offset) {\n // ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _write(fildes, buf, nbyte) {\n // ssize_t write(int fildes, const void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }\n \n function _fileno(stream) {\n // int fileno(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) return -1;\n return stream.fd;\n }function _fwrite(ptr, size, nitems, stream) {\n // size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html\n var bytesToWrite = nitems * size;\n if (bytesToWrite == 0) return 0;\n var fd = _fileno(stream);\n var bytesWritten = _write(fd, ptr, bytesToWrite);\n if (bytesWritten == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return 0;\n } else {\n return Math.floor(bytesWritten / size);\n }\n }\n\n \n function _strtoll(str, endptr, base) {\n return __parseInt64(str, endptr, base, '-9223372036854775808', '9223372036854775807'); // LLONG_MIN, LLONG_MAX.\n }function _strtoll_l(str, endptr, base) {\n return _strtoll(str, endptr, base); // no locale support yet\n }\n\n\n function _sysconf(name) {\n // long sysconf(int name);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html\n switch(name) {\n case 30: return PAGE_SIZE;\n case 132:\n case 133:\n case 12:\n case 137:\n case 138:\n case 15:\n case 235:\n case 16:\n case 17:\n case 18:\n case 19:\n case 20:\n case 149:\n case 13:\n case 10:\n case 236:\n case 153:\n case 9:\n case 21:\n case 22:\n case 159:\n case 154:\n case 14:\n case 77:\n case 78:\n case 139:\n case 80:\n case 81:\n case 79:\n case 82:\n case 68:\n case 67:\n case 164:\n case 11:\n case 29:\n case 47:\n case 48:\n case 95:\n case 52:\n case 51:\n case 46:\n return 200809;\n case 27:\n case 246:\n case 127:\n case 128:\n case 23:\n case 24:\n case 160:\n case 161:\n case 181:\n case 182:\n case 242:\n case 183:\n case 184:\n case 243:\n case 244:\n case 245:\n case 165:\n case 178:\n case 179:\n case 49:\n case 50:\n case 168:\n case 169:\n case 175:\n case 170:\n case 171:\n case 172:\n case 97:\n case 76:\n case 32:\n case 173:\n case 35:\n return -1;\n case 176:\n case 177:\n case 7:\n case 155:\n case 8:\n case 157:\n case 125:\n case 126:\n case 92:\n case 93:\n case 129:\n case 130:\n case 131:\n case 94:\n case 91:\n return 1;\n case 74:\n case 60:\n case 69:\n case 70:\n case 4:\n return 1024;\n case 31:\n case 42:\n case 72:\n return 32;\n case 87:\n case 26:\n case 33:\n return 2147483647;\n case 34:\n case 1:\n return 47839;\n case 38:\n case 36:\n return 99;\n case 43:\n case 37:\n return 2048;\n case 0: return 2097152;\n case 3: return 65536;\n case 28: return 32768;\n case 44: return 32767;\n case 75: return 16384;\n case 39: return 1000;\n case 89: return 700;\n case 71: return 256;\n case 40: return 255;\n case 2: return 100;\n case 180: return 64;\n case 25: return 20;\n case 5: return 16;\n case 6: return 6;\n case 73: return 4;\n case 84: return 1;\n }\n ___setErrNo(ERRNO_CODES.EINVAL);\n return -1;\n }\n\n\n function _pthread_cond_broadcast() {\n return 0;\n }\n\n \n \n function __exit(status) {\n // void _exit(int status);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html\n Module['exit'](status);\n }function _exit(status) {\n __exit(status);\n }function __ZSt9terminatev() {\n _exit(-1234);\n }\n\n function _pthread_mutex_unlock() {}\n\n \n function _isxdigit(chr) {\n return (chr >= 48 && chr <= 57) ||\n (chr >= 97 && chr <= 102) ||\n (chr >= 65 && chr <= 70);\n }function _isxdigit_l(chr) {\n return _isxdigit(chr); // no locale support yet\n }\n\n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;\n\n function _sbrk(bytes) {\n // Implement a Linux-like 'memory area' for our 'process'.\n // Changes the size of the memory area by |bytes|; returns the\n // address of the previous top ('break') of the memory area\n // We control the \"dynamic\" memory - DYNAMIC_BASE to DYNAMICTOP\n var self = _sbrk;\n if (!self.called) {\n DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned\n self.called = true;\n assert(Runtime.dynamicAlloc);\n self.alloc = Runtime.dynamicAlloc;\n Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };\n }\n var ret = DYNAMICTOP;\n if (bytes != 0) self.alloc(bytes);\n return ret; // Previous break location.\n }\n\n\n \n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;function _newlocale(mask, locale, base) {\n return _malloc(4);\n }\n\n \n Module[\"_memmove\"] = _memmove;\n\n function ___errno_location() {\n return ___errno_state;\n }\n\n var _BItoD=true;\n\n function _catclose(catd) {\n // int catclose (nl_catd catd)\n return 0;\n }\n\n function _llvm_lifetime_start() {}\n\n function _abort() {\n Module['abort']();\n }\n\n function _fmod(x, y) {\n return x % y;\n }\n\n function ___cxa_guard_release() {}\n\n function _ungetc(c, stream) {\n // int ungetc(int c, FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/ungetc.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) {\n return -1;\n }\n if (c === -1) {\n // do nothing for EOF character\n return c;\n }\n c = unSign(c & 0xFF);\n stream.ungotten.push(c);\n stream.eof = false;\n return c;\n }\n\n function _uselocale(locale) {\n return 0;\n }\n\n \n \n \n \n Module[\"_strlen\"] = _strlen;\n \n function __reallyNegative(x) {\n return x < 0 || (x === 0 && (1/x) === -Infinity);\n }function __formatString(format, varargs) {\n var textIndex = format;\n var argIndex = 0;\n function getNextArg(type) {\n // NOTE: Explicitly ignoring type safety. Otherwise this fails:\n // int x = 4; printf(\"%c\\n\", (char)x);\n var ret;\n if (type === 'double') {\n ret = (HEAP32[((tempDoublePtr)>>2)]=HEAP32[(((varargs)+(argIndex))>>2)],HEAP32[(((tempDoublePtr)+(4))>>2)]=HEAP32[(((varargs)+((argIndex)+(4)))>>2)],(+(HEAPF64[(tempDoublePtr)>>3])));\n } else if (type == 'i64') {\n ret = [HEAP32[(((varargs)+(argIndex))>>2)],\n HEAP32[(((varargs)+(argIndex+4))>>2)]];\n \n } else {\n type = 'i32'; // varargs are always i32, i64, or double\n ret = HEAP32[(((varargs)+(argIndex))>>2)];\n }\n argIndex += Runtime.getNativeFieldSize(type);\n return ret;\n }\n \n var ret = [];\n var curr, next, currArg;\n while(1) {\n var startTextIndex = textIndex;\n curr = HEAP8[(textIndex)];\n if (curr === 0) break;\n next = HEAP8[((textIndex+1)|0)];\n if (curr == 37) {\n // Handle flags.\n var flagAlwaysSigned = false;\n var flagLeftAlign = false;\n var flagAlternative = false;\n var flagZeroPad = false;\n var flagPadSign = false;\n flagsLoop: while (1) {\n switch (next) {\n case 43:\n flagAlwaysSigned = true;\n break;\n case 45:\n flagLeftAlign = true;\n break;\n case 35:\n flagAlternative = true;\n break;\n case 48:\n if (flagZeroPad) {\n break flagsLoop;\n } else {\n flagZeroPad = true;\n break;\n }\n case 32:\n flagPadSign = true;\n break;\n default:\n break flagsLoop;\n }\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n \n // Handle width.\n var width = 0;\n if (next == 42) {\n width = getNextArg('i32');\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n } else {\n while (next >= 48 && next <= 57) {\n width = width * 10 + (next - 48);\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n }\n \n // Handle precision.\n var precisionSet = false, precision = -1;\n if (next == 46) {\n precision = 0;\n precisionSet = true;\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n if (next == 42) {\n precision = getNextArg('i32');\n textIndex++;\n } else {\n while(1) {\n var precisionChr = HEAP8[((textIndex+1)|0)];\n if (precisionChr < 48 ||\n precisionChr > 57) break;\n precision = precision * 10 + (precisionChr - 48);\n textIndex++;\n }\n }\n next = HEAP8[((textIndex+1)|0)];\n }\n if (precision < 0) {\n precision = 6; // Standard default.\n precisionSet = false;\n }\n \n // Handle integer sizes. WARNING: These assume a 32-bit architecture!\n var argSize;\n switch (String.fromCharCode(next)) {\n case 'h':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 104) {\n textIndex++;\n argSize = 1; // char (actually i32 in varargs)\n } else {\n argSize = 2; // short (actually i32 in varargs)\n }\n break;\n case 'l':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 108) {\n textIndex++;\n argSize = 8; // long long\n } else {\n argSize = 4; // long\n }\n break;\n case 'L': // long long\n case 'q': // int64_t\n case 'j': // intmax_t\n argSize = 8;\n break;\n case 'z': // size_t\n case 't': // ptrdiff_t\n case 'I': // signed ptrdiff_t or unsigned size_t\n argSize = 4;\n break;\n default:\n argSize = null;\n }\n if (argSize) textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n \n // Handle type specifier.\n switch (String.fromCharCode(next)) {\n case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {\n // Integer.\n var signed = next == 100 || next == 105;\n argSize = argSize || 4;\n var currArg = getNextArg('i' + (argSize * 8));\n var origArg = currArg;\n var argText;\n // Flatten i64-1 [low, high] into a (slightly rounded) double\n if (argSize == 8) {\n currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);\n }\n // Truncate to requested size.\n if (argSize <= 4) {\n var limit = Math.pow(256, argSize) - 1;\n currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);\n }\n // Format the number.\n var currAbsArg = Math.abs(currArg);\n var prefix = '';\n if (next == 100 || next == 105) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else\n argText = reSign(currArg, 8 * argSize, 1).toString(10);\n } else if (next == 117) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else\n argText = unSign(currArg, 8 * argSize, 1).toString(10);\n currArg = Math.abs(currArg);\n } else if (next == 111) {\n argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);\n } else if (next == 120 || next == 88) {\n prefix = (flagAlternative && currArg != 0) ? '0x' : '';\n if (argSize == 8 && i64Math) {\n if (origArg[1]) {\n argText = (origArg[1]>>>0).toString(16);\n var lower = (origArg[0]>>>0).toString(16);\n while (lower.length < 8) lower = '0' + lower;\n argText += lower;\n } else {\n argText = (origArg[0]>>>0).toString(16);\n }\n } else\n if (currArg < 0) {\n // Represent negative numbers in hex as 2's complement.\n currArg = -currArg;\n argText = (currAbsArg - 1).toString(16);\n var buffer = [];\n for (var i = 0; i < argText.length; i++) {\n buffer.push((0xF - parseInt(argText[i], 16)).toString(16));\n }\n argText = buffer.join('');\n while (argText.length < argSize * 2) argText = 'f' + argText;\n } else {\n argText = currAbsArg.toString(16);\n }\n if (next == 88) {\n prefix = prefix.toUpperCase();\n argText = argText.toUpperCase();\n }\n } else if (next == 112) {\n if (currAbsArg === 0) {\n argText = '(nil)';\n } else {\n prefix = '0x';\n argText = currAbsArg.toString(16);\n }\n }\n if (precisionSet) {\n while (argText.length < precision) {\n argText = '0' + argText;\n }\n }\n \n // Add sign if needed\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n prefix = '+' + prefix;\n } else if (flagPadSign) {\n prefix = ' ' + prefix;\n }\n }\n \n // Move sign to prefix so we zero-pad after the sign\n if (argText.charAt(0) == '-') {\n prefix = '-' + prefix;\n argText = argText.substr(1);\n }\n \n // Add padding.\n while (prefix.length + argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad) {\n argText = '0' + argText;\n } else {\n prefix = ' ' + prefix;\n }\n }\n }\n \n // Insert the result into the buffer.\n argText = prefix + argText;\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {\n // Float.\n var currArg = getNextArg('double');\n var argText;\n if (isNaN(currArg)) {\n argText = 'nan';\n flagZeroPad = false;\n } else if (!isFinite(currArg)) {\n argText = (currArg < 0 ? '-' : '') + 'inf';\n flagZeroPad = false;\n } else {\n var isGeneral = false;\n var effectivePrecision = Math.min(precision, 20);\n \n // Convert g/G to f/F or e/E, as per:\n // http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html\n if (next == 103 || next == 71) {\n isGeneral = true;\n precision = precision || 1;\n var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);\n if (precision > exponent && exponent >= -4) {\n next = ((next == 103) ? 'f' : 'F').charCodeAt(0);\n precision -= exponent + 1;\n } else {\n next = ((next == 103) ? 'e' : 'E').charCodeAt(0);\n precision--;\n }\n effectivePrecision = Math.min(precision, 20);\n }\n \n if (next == 101 || next == 69) {\n argText = currArg.toExponential(effectivePrecision);\n // Make sure the exponent has at least 2 digits.\n if (/[eE][-+]\\d$/.test(argText)) {\n argText = argText.slice(0, -1) + '0' + argText.slice(-1);\n }\n } else if (next == 102 || next == 70) {\n argText = currArg.toFixed(effectivePrecision);\n if (currArg === 0 && __reallyNegative(currArg)) {\n argText = '-' + argText;\n }\n }\n \n var parts = argText.split('e');\n if (isGeneral && !flagAlternative) {\n // Discard trailing zeros and periods.\n while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&\n (parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {\n parts[0] = parts[0].slice(0, -1);\n }\n } else {\n // Make sure we have a period in alternative mode.\n if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';\n // Zero pad until required precision.\n while (precision > effectivePrecision++) parts[0] += '0';\n }\n argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');\n \n // Capitalize 'E' if needed.\n if (next == 69) argText = argText.toUpperCase();\n \n // Add sign.\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n argText = '+' + argText;\n } else if (flagPadSign) {\n argText = ' ' + argText;\n }\n }\n }\n \n // Add padding.\n while (argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {\n argText = argText[0] + '0' + argText.slice(1);\n } else {\n argText = (flagZeroPad ? '0' : ' ') + argText;\n }\n }\n }\n \n // Adjust case.\n if (next < 97) argText = argText.toUpperCase();\n \n // Insert the result into the buffer.\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 's': {\n // String.\n var arg = getNextArg('i8*');\n var argLength = arg ? _strlen(arg) : '(null)'.length;\n if (precisionSet) argLength = Math.min(argLength, precision);\n if (!flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n if (arg) {\n for (var i = 0; i < argLength; i++) {\n ret.push(HEAPU8[((arg++)|0)]);\n }\n } else {\n ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));\n }\n if (flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n break;\n }\n case 'c': {\n // Character.\n if (flagLeftAlign) ret.push(getNextArg('i8'));\n while (--width > 0) {\n ret.push(32);\n }\n if (!flagLeftAlign) ret.push(getNextArg('i8'));\n break;\n }\n case 'n': {\n // Write the length written so far to the next parameter.\n var ptr = getNextArg('i32*');\n HEAP32[((ptr)>>2)]=ret.length;\n break;\n }\n case '%': {\n // Literal percent sign.\n ret.push(curr);\n break;\n }\n default: {\n // Unknown specifiers remain untouched.\n for (var i = startTextIndex; i < textIndex + 2; i++) {\n ret.push(HEAP8[(i)]);\n }\n }\n }\n textIndex += 2;\n // TODO: Support a/A (hex float) and m (last error) specifiers.\n // TODO: Support %1${specifier} for arg selection.\n } else {\n ret.push(curr);\n textIndex += 1;\n }\n }\n return ret;\n }function _snprintf(s, n, format, varargs) {\n // int snprintf(char *restrict s, size_t n, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var result = __formatString(format, varargs);\n var limit = (n === undefined) ? result.length\n : Math.min(result.length, Math.max(n - 1, 0));\n if (s < 0) {\n s = -s;\n var buf = _malloc(limit+1);\n HEAP32[((s)>>2)]=buf;\n s = buf;\n }\n for (var i = 0; i < limit; i++) {\n HEAP8[(((s)+(i))|0)]=result[i];\n }\n if (limit < n || (n === undefined)) HEAP8[(((s)+(i))|0)]=0;\n return result.length;\n }function _vsnprintf(s, n, format, va_arg) {\n return _snprintf(s, n, format, HEAP32[((va_arg)>>2)]);\n }\n\n \n \n \n function __getFloat(text) {\n return /^[+-]?[0-9]*\\.?[0-9]+([eE][+-]?[0-9]+)?/.exec(text);\n }function __scanString(format, get, unget, varargs) {\n if (!__scanString.whiteSpace) {\n __scanString.whiteSpace = {};\n __scanString.whiteSpace[32] = 1;\n __scanString.whiteSpace[9] = 1;\n __scanString.whiteSpace[10] = 1;\n __scanString.whiteSpace[11] = 1;\n __scanString.whiteSpace[12] = 1;\n __scanString.whiteSpace[13] = 1;\n }\n // Supports %x, %4x, %d.%d, %lld, %s, %f, %lf.\n // TODO: Support all format specifiers.\n format = Pointer_stringify(format);\n var soFar = 0;\n if (format.indexOf('%n') >= 0) {\n // need to track soFar\n var _get = get;\n get = function get() {\n soFar++;\n return _get();\n }\n var _unget = unget;\n unget = function unget() {\n soFar--;\n return _unget();\n }\n }\n var formatIndex = 0;\n var argsi = 0;\n var fields = 0;\n var argIndex = 0;\n var next;\n \n mainLoop:\n for (var formatIndex = 0; formatIndex < format.length;) {\n if (format[formatIndex] === '%' && format[formatIndex+1] == 'n') {\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n HEAP32[((argPtr)>>2)]=soFar;\n formatIndex += 2;\n continue;\n }\n \n if (format[formatIndex] === '%') {\n var nextC = format.indexOf('c', formatIndex+1);\n if (nextC > 0) {\n var maxx = 1;\n if (nextC > formatIndex+1) {\n var sub = format.substring(formatIndex+1, nextC);\n maxx = parseInt(sub);\n if (maxx != sub) maxx = 0;\n }\n if (maxx) {\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n fields++;\n for (var i = 0; i < maxx; i++) {\n next = get();\n HEAP8[((argPtr++)|0)]=next;\n if (next === 0) return i > 0 ? fields : fields-1; // we failed to read the full length of this field\n }\n formatIndex += nextC - formatIndex + 1;\n continue;\n }\n }\n }\n \n // handle %[...]\n if (format[formatIndex] === '%' && format.indexOf('[', formatIndex+1) > 0) {\n var match = /\\%([0-9]*)\\[(\\^)?(\\]?[^\\]]*)\\]/.exec(format.substring(formatIndex));\n if (match) {\n var maxNumCharacters = parseInt(match[1]) || Infinity;\n var negateScanList = (match[2] === '^');\n var scanList = match[3];\n \n // expand \"middle\" dashs into character sets\n var middleDashMatch;\n while ((middleDashMatch = /([^\\-])\\-([^\\-])/.exec(scanList))) {\n var rangeStartCharCode = middleDashMatch[1].charCodeAt(0);\n var rangeEndCharCode = middleDashMatch[2].charCodeAt(0);\n for (var expanded = ''; rangeStartCharCode <= rangeEndCharCode; expanded += String.fromCharCode(rangeStartCharCode++));\n scanList = scanList.replace(middleDashMatch[1] + '-' + middleDashMatch[2], expanded);\n }\n \n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n fields++;\n \n for (var i = 0; i < maxNumCharacters; i++) {\n next = get();\n if (negateScanList) {\n if (scanList.indexOf(String.fromCharCode(next)) < 0) {\n HEAP8[((argPtr++)|0)]=next;\n } else {\n unget();\n break;\n }\n } else {\n if (scanList.indexOf(String.fromCharCode(next)) >= 0) {\n HEAP8[((argPtr++)|0)]=next;\n } else {\n unget();\n break;\n }\n }\n }\n \n // write out null-terminating character\n HEAP8[((argPtr++)|0)]=0;\n formatIndex += match[0].length;\n \n continue;\n }\n } \n // remove whitespace\n while (1) {\n next = get();\n if (next == 0) return fields;\n if (!(next in __scanString.whiteSpace)) break;\n }\n unget();\n \n if (format[formatIndex] === '%') {\n formatIndex++;\n var suppressAssignment = false;\n if (format[formatIndex] == '*') {\n suppressAssignment = true;\n formatIndex++;\n }\n var maxSpecifierStart = formatIndex;\n while (format[formatIndex].charCodeAt(0) >= 48 &&\n format[formatIndex].charCodeAt(0) <= 57) {\n formatIndex++;\n }\n var max_;\n if (formatIndex != maxSpecifierStart) {\n max_ = parseInt(format.slice(maxSpecifierStart, formatIndex), 10);\n }\n var long_ = false;\n var half = false;\n var longLong = false;\n if (format[formatIndex] == 'l') {\n long_ = true;\n formatIndex++;\n if (format[formatIndex] == 'l') {\n longLong = true;\n formatIndex++;\n }\n } else if (format[formatIndex] == 'h') {\n half = true;\n formatIndex++;\n }\n var type = format[formatIndex];\n formatIndex++;\n var curr = 0;\n var buffer = [];\n // Read characters according to the format. floats are trickier, they may be in an unfloat state in the middle, then be a valid float later\n if (type == 'f' || type == 'e' || type == 'g' ||\n type == 'F' || type == 'E' || type == 'G') {\n next = get();\n while (next > 0 && (!(next in __scanString.whiteSpace))) {\n buffer.push(String.fromCharCode(next));\n next = get();\n }\n var m = __getFloat(buffer.join(''));\n var last = m ? m[0].length : 0;\n for (var i = 0; i < buffer.length - last + 1; i++) {\n unget();\n }\n buffer.length = last;\n } else {\n next = get();\n var first = true;\n \n // Strip the optional 0x prefix for %x.\n if ((type == 'x' || type == 'X') && (next == 48)) {\n var peek = get();\n if (peek == 120 || peek == 88) {\n next = get();\n } else {\n unget();\n }\n }\n \n while ((curr < max_ || isNaN(max_)) && next > 0) {\n if (!(next in __scanString.whiteSpace) && // stop on whitespace\n (type == 's' ||\n ((type === 'd' || type == 'u' || type == 'i') && ((next >= 48 && next <= 57) ||\n (first && next == 45))) ||\n ((type === 'x' || type === 'X') && (next >= 48 && next <= 57 ||\n next >= 97 && next <= 102 ||\n next >= 65 && next <= 70))) &&\n (formatIndex >= format.length || next !== format[formatIndex].charCodeAt(0))) { // Stop when we read something that is coming up\n buffer.push(String.fromCharCode(next));\n next = get();\n curr++;\n first = false;\n } else {\n break;\n }\n }\n unget();\n }\n if (buffer.length === 0) return 0; // Failure.\n if (suppressAssignment) continue;\n \n var text = buffer.join('');\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n switch (type) {\n case 'd': case 'u': case 'i':\n if (half) {\n HEAP16[((argPtr)>>1)]=parseInt(text, 10);\n } else if (longLong) {\n (tempI64 = [parseInt(text, 10)>>>0,(tempDouble=parseInt(text, 10),(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((argPtr)>>2)]=tempI64[0],HEAP32[(((argPtr)+(4))>>2)]=tempI64[1]);\n } else {\n HEAP32[((argPtr)>>2)]=parseInt(text, 10);\n }\n break;\n case 'X':\n case 'x':\n HEAP32[((argPtr)>>2)]=parseInt(text, 16);\n break;\n case 'F':\n case 'f':\n case 'E':\n case 'e':\n case 'G':\n case 'g':\n case 'E':\n // fallthrough intended\n if (long_) {\n HEAPF64[((argPtr)>>3)]=parseFloat(text);\n } else {\n HEAPF32[((argPtr)>>2)]=parseFloat(text);\n }\n break;\n case 's':\n var array = intArrayFromString(text);\n for (var j = 0; j < array.length; j++) {\n HEAP8[(((argPtr)+(j))|0)]=array[j];\n }\n break;\n }\n fields++;\n } else if (format[formatIndex].charCodeAt(0) in __scanString.whiteSpace) {\n next = get();\n while (next in __scanString.whiteSpace) {\n if (next <= 0) break mainLoop; // End of input.\n next = get();\n }\n unget(next);\n formatIndex++;\n } else {\n // Not a specifier.\n next = get();\n if (format[formatIndex].charCodeAt(0) !== next) {\n unget(next);\n break mainLoop;\n }\n formatIndex++;\n }\n }\n return fields;\n }function _sscanf(s, format, varargs) {\n // int sscanf(const char *restrict s, const char *restrict format, ... );\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/scanf.html\n var index = 0;\n function get() { return HEAP8[(((s)+(index++))|0)]; };\n function unget() { index--; };\n return __scanString(format, get, unget, varargs);\n }function _vsscanf(s, format, va_arg) {\n return _sscanf(s, format, HEAP32[((va_arg)>>2)]);\n }\n\n\n\n \n \n \n function _recv(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _read(fd, buf, len);\n }\n \n function _pread(fildes, buf, nbyte, offset) {\n // ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.read(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _read(fildes, buf, nbyte) {\n // ssize_t read(int fildes, void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.read(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _fread(ptr, size, nitems, stream) {\n // size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fread.html\n var bytesToRead = nitems * size;\n if (bytesToRead == 0) {\n return 0;\n }\n var bytesRead = 0;\n var streamObj = FS.getStreamFromPtr(stream);\n if (!streamObj) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return 0;\n }\n while (streamObj.ungotten.length && bytesToRead > 0) {\n HEAP8[((ptr++)|0)]=streamObj.ungotten.pop();\n bytesToRead--;\n bytesRead++;\n }\n var err = _read(streamObj.fd, ptr, bytesToRead);\n if (err == -1) {\n if (streamObj) streamObj.error = true;\n return 0;\n }\n bytesRead += err;\n if (bytesRead < bytesToRead) streamObj.eof = true;\n return Math.floor(bytesRead / size);\n }function _fgetc(stream) {\n // int fgetc(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fgetc.html\n var streamObj = FS.getStreamFromPtr(stream);\n if (!streamObj) return -1;\n if (streamObj.eof || streamObj.error) return -1;\n var ret = _fread(_fgetc.ret, 1, 1, stream);\n if (ret == 0) {\n return -1;\n } else if (ret == -1) {\n streamObj.error = true;\n return -1;\n } else {\n return HEAPU8[((_fgetc.ret)|0)];\n }\n }\n\n var _llvm_memmove_p0i8_p0i8_i32=_memmove;\n\n \n function _strerror_r(errnum, strerrbuf, buflen) {\n if (errnum in ERRNO_MESSAGES) {\n if (ERRNO_MESSAGES[errnum].length > buflen - 1) {\n return ___setErrNo(ERRNO_CODES.ERANGE);\n } else {\n var msg = ERRNO_MESSAGES[errnum];\n writeAsciiToMemory(msg, strerrbuf);\n return 0;\n }\n } else {\n return ___setErrNo(ERRNO_CODES.EINVAL);\n }\n }function _strerror(errnum) {\n if (!_strerror.buffer) _strerror.buffer = _malloc(256);\n _strerror_r(errnum, _strerror.buffer, 256);\n return _strerror.buffer;\n }\n\n \n \n function __isLeapYear(year) {\n return year%4 === 0 && (year%100 !== 0 || year%400 === 0);\n }\n \n function __arraySum(array, index) {\n var sum = 0;\n for (var i = 0; i <= index; sum += array[i++]);\n return sum;\n }\n \n \n var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];\n \n var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date, days) {\n var newDate = new Date(date.getTime());\n while(days > 0) {\n var leap = __isLeapYear(newDate.getFullYear());\n var currentMonth = newDate.getMonth();\n var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth];\n \n if (days > daysInCurrentMonth-newDate.getDate()) {\n // we spill over to next month\n days -= (daysInCurrentMonth-newDate.getDate()+1);\n newDate.setDate(1);\n if (currentMonth < 11) {\n newDate.setMonth(currentMonth+1)\n } else {\n newDate.setMonth(0);\n newDate.setFullYear(newDate.getFullYear()+1);\n }\n } else {\n // we stay in current month \n newDate.setDate(newDate.getDate()+days);\n return newDate;\n }\n }\n \n return newDate;\n }function _strftime(s, maxsize, format, tm) {\n // size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html\n \n var date = {\n tm_sec: HEAP32[((tm)>>2)],\n tm_min: HEAP32[(((tm)+(4))>>2)],\n tm_hour: HEAP32[(((tm)+(8))>>2)],\n tm_mday: HEAP32[(((tm)+(12))>>2)],\n tm_mon: HEAP32[(((tm)+(16))>>2)],\n tm_year: HEAP32[(((tm)+(20))>>2)],\n tm_wday: HEAP32[(((tm)+(24))>>2)],\n tm_yday: HEAP32[(((tm)+(28))>>2)],\n tm_isdst: HEAP32[(((tm)+(32))>>2)]\n };\n \n var pattern = Pointer_stringify(format);\n \n // expand format\n var EXPANSION_RULES_1 = {\n '%c': '%a %b %d %H:%M:%S %Y', // Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013\n '%D': '%m/%d/%y', // Equivalent to %m / %d / %y\n '%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d\n '%h': '%b', // Equivalent to %b\n '%r': '%I:%M:%S %p', // Replaced by the time in a.m. and p.m. notation\n '%R': '%H:%M', // Replaced by the time in 24-hour notation\n '%T': '%H:%M:%S', // Replaced by the time\n '%x': '%m/%d/%y', // Replaced by the locale's appropriate date representation\n '%X': '%H:%M:%S', // Replaced by the locale's appropriate date representation\n };\n for (var rule in EXPANSION_RULES_1) {\n pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_1[rule]);\n }\n \n var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n var MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n \n function leadingSomething(value, digits, character) {\n var str = typeof value === 'number' ? value.toString() : (value || '');\n while (str.length < digits) {\n str = character[0]+str;\n }\n return str;\n };\n \n function leadingNulls(value, digits) {\n return leadingSomething(value, digits, '0');\n };\n \n function compareByDay(date1, date2) {\n function sgn(value) {\n return value < 0 ? -1 : (value > 0 ? 1 : 0);\n };\n \n var compare;\n if ((compare = sgn(date1.getFullYear()-date2.getFullYear())) === 0) {\n if ((compare = sgn(date1.getMonth()-date2.getMonth())) === 0) {\n compare = sgn(date1.getDate()-date2.getDate());\n }\n }\n return compare;\n };\n \n function getFirstWeekStartDate(janFourth) {\n switch (janFourth.getDay()) {\n case 0: // Sunday\n return new Date(janFourth.getFullYear()-1, 11, 29);\n case 1: // Monday\n return janFourth;\n case 2: // Tuesday\n return new Date(janFourth.getFullYear(), 0, 3);\n case 3: // Wednesday\n return new Date(janFourth.getFullYear(), 0, 2);\n case 4: // Thursday\n return new Date(janFourth.getFullYear(), 0, 1);\n case 5: // Friday\n return new Date(janFourth.getFullYear()-1, 11, 31);\n case 6: // Saturday\n return new Date(janFourth.getFullYear()-1, 11, 30);\n }\n };\n \n function getWeekBasedYear(date) {\n var thisDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);\n \n var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);\n var janFourthNextYear = new Date(thisDate.getFullYear()+1, 0, 4);\n \n var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);\n var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);\n \n if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) {\n // this date is after the start of the first week of this year\n if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) {\n return thisDate.getFullYear()+1;\n } else {\n return thisDate.getFullYear();\n }\n } else { \n return thisDate.getFullYear()-1;\n }\n };\n \n var EXPANSION_RULES_2 = {\n '%a': function(date) {\n return WEEKDAYS[date.tm_wday].substring(0,3);\n },\n '%A': function(date) {\n return WEEKDAYS[date.tm_wday];\n },\n '%b': function(date) {\n return MONTHS[date.tm_mon].substring(0,3);\n },\n '%B': function(date) {\n return MONTHS[date.tm_mon];\n },\n '%C': function(date) {\n var year = date.tm_year+1900;\n return leadingNulls(Math.floor(year/100),2);\n },\n '%d': function(date) {\n return leadingNulls(date.tm_mday, 2);\n },\n '%e': function(date) {\n return leadingSomething(date.tm_mday, 2, ' ');\n },\n '%g': function(date) {\n // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. \n // In this system, weeks begin on a Monday and week 1 of the year is the week that includes \n // January 4th, which is also the week that includes the first Thursday of the year, and \n // is also the first week that contains at least four days in the year. \n // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of \n // the last week of the preceding year; thus, for Saturday 2nd January 1999, \n // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th, \n // or 31st is a Monday, it and any following days are part of week 1 of the following year. \n // Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.\n \n return getWeekBasedYear(date).toString().substring(2);\n },\n '%G': function(date) {\n return getWeekBasedYear(date);\n },\n '%H': function(date) {\n return leadingNulls(date.tm_hour, 2);\n },\n '%I': function(date) {\n return leadingNulls(date.tm_hour < 13 ? date.tm_hour : date.tm_hour-12, 2);\n },\n '%j': function(date) {\n // Day of the year (001-366)\n return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date.tm_mon-1), 3);\n },\n '%m': function(date) {\n return leadingNulls(date.tm_mon+1, 2);\n },\n '%M': function(date) {\n return leadingNulls(date.tm_min, 2);\n },\n '%n': function() {\n return '\\n';\n },\n '%p': function(date) {\n if (date.tm_hour > 0 && date.tm_hour < 13) {\n return 'AM';\n } else {\n return 'PM';\n }\n },\n '%S': function(date) {\n return leadingNulls(date.tm_sec, 2);\n },\n '%t': function() {\n return '\\t';\n },\n '%u': function(date) {\n var day = new Date(date.tm_year+1900, date.tm_mon+1, date.tm_mday, 0, 0, 0, 0);\n return day.getDay() || 7;\n },\n '%U': function(date) {\n // Replaced by the week number of the year as a decimal number [00,53]. \n // The first Sunday of January is the first day of week 1; \n // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]\n var janFirst = new Date(date.tm_year+1900, 0, 1);\n var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7-janFirst.getDay());\n var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);\n \n // is target date after the first Sunday?\n if (compareByDay(firstSunday, endDate) < 0) {\n // calculate difference in days between first Sunday and endDate\n var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;\n var firstSundayUntilEndJanuary = 31-firstSunday.getDate();\n var days = firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();\n return leadingNulls(Math.ceil(days/7), 2);\n }\n \n return compareByDay(firstSunday, janFirst) === 0 ? '01': '00';\n },\n '%V': function(date) {\n // Replaced by the week number of the year (Monday as the first day of the week) \n // as a decimal number [01,53]. If the week containing 1 January has four \n // or more days in the new year, then it is considered week 1. \n // Otherwise, it is the last week of the previous year, and the next week is week 1. \n // Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]\n var janFourthThisYear = new Date(date.tm_year+1900, 0, 4);\n var janFourthNextYear = new Date(date.tm_year+1901, 0, 4);\n \n var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);\n var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);\n \n var endDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);\n \n if (compareByDay(endDate, firstWeekStartThisYear) < 0) {\n // if given date is before this years first week, then it belongs to the 53rd week of last year\n return '53';\n } \n \n if (compareByDay(firstWeekStartNextYear, endDate) <= 0) {\n // if given date is after next years first week, then it belongs to the 01th week of next year\n return '01';\n }\n \n // given date is in between CW 01..53 of this calendar year\n var daysDifference;\n if (firstWeekStartThisYear.getFullYear() < date.tm_year+1900) {\n // first CW of this year starts last year\n daysDifference = date.tm_yday+32-firstWeekStartThisYear.getDate()\n } else {\n // first CW of this year starts this year\n daysDifference = date.tm_yday+1-firstWeekStartThisYear.getDate();\n }\n return leadingNulls(Math.ceil(daysDifference/7), 2);\n },\n '%w': function(date) {\n var day = new Date(date.tm_year+1900, date.tm_mon+1, date.tm_mday, 0, 0, 0, 0);\n return day.getDay();\n },\n '%W': function(date) {\n // Replaced by the week number of the year as a decimal number [00,53]. \n // The first Monday of January is the first day of week 1; \n // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]\n var janFirst = new Date(date.tm_year, 0, 1);\n var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7-janFirst.getDay()+1);\n var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);\n \n // is target date after the first Monday?\n if (compareByDay(firstMonday, endDate) < 0) {\n var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;\n var firstMondayUntilEndJanuary = 31-firstMonday.getDate();\n var days = firstMondayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();\n return leadingNulls(Math.ceil(days/7), 2);\n }\n return compareByDay(firstMonday, janFirst) === 0 ? '01': '00';\n },\n '%y': function(date) {\n // Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]\n return (date.tm_year+1900).toString().substring(2);\n },\n '%Y': function(date) {\n // Replaced by the year as a decimal number (for example, 1997). [ tm_year]\n return date.tm_year+1900;\n },\n '%z': function(date) {\n // Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ),\n // or by no characters if no timezone is determinable. \n // For example, \"-0430\" means 4 hours 30 minutes behind UTC (west of Greenwich). \n // If tm_isdst is zero, the standard time offset is used. \n // If tm_isdst is greater than zero, the daylight savings time offset is used. \n // If tm_isdst is negative, no characters are returned. \n // FIXME: we cannot determine time zone (or can we?)\n return '';\n },\n '%Z': function(date) {\n // Replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. [ tm_isdst]\n // FIXME: we cannot determine time zone (or can we?)\n return '';\n },\n '%%': function() {\n return '%';\n }\n };\n for (var rule in EXPANSION_RULES_2) {\n if (pattern.indexOf(rule) >= 0) {\n pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_2[rule](date));\n }\n }\n \n var bytes = intArrayFromString(pattern, false);\n if (bytes.length > maxsize) {\n return 0;\n } \n \n writeArrayToMemory(bytes, s);\n return bytes.length-1;\n }function _strftime_l(s, maxsize, format, tm) {\n return _strftime(s, maxsize, format, tm); // no locale support yet\n }\n\n var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;\n\n\n function _pthread_cond_wait() {\n return 0;\n }\n\n \n function _isdigit(chr) {\n return chr >= 48 && chr <= 57;\n }function _isdigit_l(chr) {\n return _isdigit(chr); // no locale support yet\n }\n\n var _fabs=Math_abs;\n\n var _floor=Math_floor;\n\n var _getc=_fgetc;\n\n var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n function ___ctype_b_loc() {\n // http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/baselib---ctype-b-loc.html\n var me = ___ctype_b_loc;\n if (!me.ret) {\n var values = [\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,8195,8194,8194,8194,8194,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,24577,49156,49156,49156,\n 49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,55304,55304,55304,55304,55304,55304,55304,55304,\n 55304,55304,49156,49156,49156,49156,49156,49156,49156,54536,54536,54536,54536,54536,54536,50440,50440,50440,50440,50440,\n 50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,49156,49156,49156,49156,49156,\n 49156,54792,54792,54792,54792,54792,54792,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,\n 50696,50696,50696,50696,50696,50696,50696,49156,49156,49156,49156,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n ];\n var i16size = 2;\n var arr = _malloc(values.length * i16size);\n for (var i = 0; i < values.length; i++) {\n HEAP16[(((arr)+(i * i16size))>>1)]=values[i];\n }\n me.ret = allocate([arr + 128 * i16size], 'i16*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n \n function _free() {\n }\n Module[\"_free\"] = _free;function _freelocale(locale) {\n _free(locale);\n }\n\n function ___cxa_allocate_exception(size) {\n var ptr = _malloc(size + ___cxa_exception_header_size);\n return ptr + ___cxa_exception_header_size;\n }\n\n var _fmodl=_fmod;\n\n function _catopen(name, oflag) {\n // nl_catd catopen (const char *name, int oflag)\n return -1;\n }\n\n function _catgets(catd, set_id, msg_id, s) {\n // char *catgets (nl_catd catd, int set_id, int msg_id, const char *s)\n return s;\n }\n\n \n \n function _sprintf(s, format, varargs) {\n // int sprintf(char *restrict s, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n return _snprintf(s, undefined, format, varargs);\n }function _asprintf(s, format, varargs) {\n return _sprintf(-s, format, varargs);\n }function _vasprintf(s, format, va_arg) {\n return _asprintf(s, format, HEAP32[((va_arg)>>2)]);\n }\n\n var ctlz_i8 = allocate([8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], \"i8\", ALLOC_STATIC); \n Module[\"_llvm_ctlz_i32\"] = _llvm_ctlz_i32;\n\n function _time(ptr) {\n var ret = Math.floor(Date.now()/1000);\n if (ptr) {\n HEAP32[((ptr)>>2)]=ret;\n }\n return ret;\n }\n\n function _copysign(a, b) {\n return __reallyNegative(a) === __reallyNegative(b) ? a : -a;\n }\n\n function ___ctype_toupper_loc() {\n // http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-toupper-loc.html\n var me = ___ctype_toupper_loc;\n if (!me.ret) {\n var values = [\n 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,\n 158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,\n 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,\n 218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,\n 248,249,250,251,252,253,254,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,\n 73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,\n 81,82,83,84,85,86,87,88,89,90,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,\n 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,\n 175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,\n 205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,\n 235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255\n ];\n var i32size = 4;\n var arr = _malloc(values.length * i32size);\n for (var i = 0; i < values.length; i++) {\n HEAP32[(((arr)+(i * i32size))>>2)]=values[i];\n }\n me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function ___cxa_guard_acquire(variable) {\n if (!HEAP8[(variable)]) { // ignore SAFE_HEAP stuff because llvm mixes i64 and i8 here\n HEAP8[(variable)]=1;\n return 1;\n }\n return 0;\n }\n\n function ___ctype_tolower_loc() {\n // http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-tolower-loc.html\n var me = ___ctype_tolower_loc;\n if (!me.ret) {\n var values = [\n 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,\n 158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,\n 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,\n 218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,\n 248,249,250,251,252,253,254,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,97,98,99,100,101,102,103,\n 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,96,97,98,99,100,101,102,103,\n 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,\n 134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,\n 164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,\n 194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,\n 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,\n 254,255\n ];\n var i32size = 4;\n var arr = _malloc(values.length * i32size);\n for (var i = 0; i < values.length; i++) {\n HEAP32[(((arr)+(i * i32size))>>2)]=values[i];\n }\n me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n \n var ___cxa_caught_exceptions=[];function ___cxa_begin_catch(ptr) {\n __ZSt18uncaught_exceptionv.uncaught_exception--;\n ___cxa_caught_exceptions.push(___cxa_last_thrown_exception);\n return ptr;\n }\n\n \n Module[\"_bitshift64Shl\"] = _bitshift64Shl;\n\n\n function __ZNSt9exceptionD2Ev() {}\n\n var _copysignl=_copysign;\n\n var __ZTISt9exception=allocate([allocate([1,0,0,0,0,0,0], \"i8\", ALLOC_STATIC)+8, 0], \"i32\", ALLOC_STATIC);\n\n var ___dso_handle=allocate(1, \"i32*\", ALLOC_STATIC);\n\n\n\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\n__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });\n_fgetc.ret = allocate([0], \"i8\", ALLOC_STATIC);\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n var cttz_i8 = allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0], \"i8\", ALLOC_DYNAMIC);\n\nvar Math_min = Math.min;\nfunction invoke_iiii(index,a1,a2,a3) {\n try {\n return Module[\"dynCall_iiii\"](index,a1,a2,a3);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {\n try {\n Module[\"dynCall_viiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiii(index,a1,a2,a3,a4,a5) {\n try {\n Module[\"dynCall_viiiii\"](index,a1,a2,a3,a4,a5);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_vi(index,a1) {\n try {\n Module[\"dynCall_vi\"](index,a1);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_vii(index,a1,a2) {\n try {\n Module[\"dynCall_vii\"](index,a1,a2);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {\n try {\n Module[\"dynCall_viiiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_ii(index,a1) {\n try {\n return Module[\"dynCall_ii\"](index,a1);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiid(index,a1,a2,a3,a4,a5,a6,a7) {\n try {\n Module[\"dynCall_viiiiiid\"](index,a1,a2,a3,a4,a5,a6,a7);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viii(index,a1,a2,a3) {\n try {\n Module[\"dynCall_viii\"](index,a1,a2,a3);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiid(index,a1,a2,a3,a4,a5,a6) {\n try {\n Module[\"dynCall_viiiiid\"](index,a1,a2,a3,a4,a5,a6);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_v(index) {\n try {\n Module[\"dynCall_v\"](index);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {\n try {\n return Module[\"dynCall_iiiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiii(index,a1,a2,a3,a4) {\n try {\n return Module[\"dynCall_iiiii\"](index,a1,a2,a3,a4);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {\n try {\n Module[\"dynCall_viiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {\n try {\n Module[\"dynCall_viiiiii\"](index,a1,a2,a3,a4,a5,a6);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iii(index,a1,a2) {\n try {\n return Module[\"dynCall_iii\"](index,a1,a2);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiiii(index,a1,a2,a3,a4,a5) {\n try {\n return Module[\"dynCall_iiiiii\"](index,a1,a2,a3,a4,a5);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiii(index,a1,a2,a3,a4) {\n try {\n Module[\"dynCall_viiii\"](index,a1,a2,a3,a4);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=env.ctlz_i8|0;var o=env.__ZTISt9exception|0;var p=env.___dso_handle|0;var q=env._stderr|0;var r=env._stdin|0;var s=env._stdout|0;var t=0;var u=0;var v=0;var w=0;var x=+env.NaN,y=+env.Infinity;var z=0,A=0,B=0,C=0,D=0.0,E=0,F=0,G=0,H=0.0;var I=0;var J=0;var K=0;var L=0;var M=0;var N=0;var O=0;var P=0;var Q=0;var R=0;var S=global.Math.floor;var T=global.Math.abs;var U=global.Math.sqrt;var V=global.Math.pow;var W=global.Math.cos;var X=global.Math.sin;var Y=global.Math.tan;var Z=global.Math.acos;var _=global.Math.asin;var $=global.Math.atan;var aa=global.Math.atan2;var ba=global.Math.exp;var ca=global.Math.log;var da=global.Math.ceil;var ea=global.Math.imul;var fa=env.abort;var ga=env.assert;var ha=env.asmPrintInt;var ia=env.asmPrintFloat;var ja=env.min;var ka=env.invoke_iiii;var la=env.invoke_viiiiiii;var ma=env.invoke_viiiii;var na=env.invoke_vi;var oa=env.invoke_vii;var pa=env.invoke_viiiiiiiii;var qa=env.invoke_ii;var ra=env.invoke_viiiiiid;var sa=env.invoke_viii;var ta=env.invoke_viiiiid;var ua=env.invoke_v;var va=env.invoke_iiiiiiiii;var wa=env.invoke_iiiii;var xa=env.invoke_viiiiiiii;var ya=env.invoke_viiiiii;var za=env.invoke_iii;var Aa=env.invoke_iiiiii;var Ba=env.invoke_viiii;var Ca=env._fabs;var Da=env._pthread_cond_wait;var Ea=env._llvm_lifetime_start;var Fa=env._sprintf;var Ga=env._send;var Ha=env._strtoll_l;var Ia=env._vsscanf;var Ja=env.___ctype_b_loc;var Ka=env.__ZSt9terminatev;var La=env._fmod;var Ma=env.___cxa_guard_acquire;var Na=env._isspace;var Oa=env.__reallyNegative;var Pa=env.___cxa_is_number_type;var Qa=env._ungetc;var Ra=env._fread;var Sa=env.__getFloat;var Ta=env.___cxa_allocate_exception;var Ua=env.__ZSt18uncaught_exceptionv;var Va=env._floor;var Wa=env._isxdigit_l;var Xa=env._strtoll;var Ya=env._fflush;var Za=env.___cxa_guard_release;var _a=env.__addDays;var $a=env._pwrite;var ab=env._strerror_r;var bb=env._strftime_l;var cb=env._pthread_mutex_lock;var db=env._sscanf;var eb=env._sbrk;var fb=env._uselocale;var gb=env._catgets;var hb=env._newlocale;var ib=env._snprintf;var jb=env.___cxa_begin_catch;var kb=env._emscripten_memcpy_big;var lb=env._asprintf;var mb=env.__scanString;var nb=env.___resumeException;var ob=env.___cxa_find_matching_catch;var pb=env.__exit;var qb=env._strtoull;var rb=env._strftime;var sb=env._strtoull_l;var tb=env._freelocale;var ub=env.__arraySum;var vb=env.__formatString;var wb=env.___ctype_tolower_loc;var xb=env._isdigit_l;var yb=env._fileno;var zb=env._pthread_mutex_unlock;var Ab=env._pread;var Bb=env._isxdigit;var Cb=env.___ctype_toupper_loc;var Db=env._log;var Eb=env._vasprintf;var Fb=env._write;var Gb=env.__isLeapYear;var Hb=env.___errno_location;var Ib=env._recv;var Jb=env._vsnprintf;var Kb=env.__ZNSt9exceptionD2Ev;var Lb=env._copysign;var Mb=env._fgetc;var Nb=env._mkport;var Ob=env.___cxa_does_inherit;var Pb=env._sysconf;var Qb=env._pthread_cond_broadcast;var Rb=env.__parseInt64;var Sb=env._abort;var Tb=env._catclose;var Ub=env._fwrite;var Vb=env.___cxa_throw;var Wb=env._isdigit;var Xb=env._strerror;var Yb=env._llvm_lifetime_end;var Zb=env._atexit;var _b=env._catopen;var $b=env._exit;var ac=env._time;var bc=env._read;var cc=env.___setErrNo;var dc=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction wc(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function xc(){return i|0}function yc(a){a=a|0;i=a}function zc(a,b){a=a|0;b=b|0;if((t|0)==0){t=a;u=b}}function Ac(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function Bc(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function Cc(a){a=a|0;I=a}function Dc(a){a=a|0;J=a}function Ec(a){a=a|0;K=a}function Fc(a){a=a|0;L=a}function Gc(a){a=a|0;M=a}function Hc(a){a=a|0;N=a}function Ic(a){a=a|0;O=a}function Jc(a){a=a|0;P=a}function Kc(a){a=a|0;Q=a}function Lc(a){a=a|0;R=a}function Mc(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a>>2]|0;if((d|0)==0){i=b;return}e=a+4|0;a=c[e>>2]|0;if((a|0)!=(d|0)){c[e>>2]=a+(~((a+ -8+(0-d)|0)>>>3)<<3)}Om(d);i=b;return}function Nc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0;c=i;i=i+8|0;d=c;e=a;f=b-e|0;g=f>>3;do{if((g|0)==0){j=0;k=0}else{if(g>>>0>536870911){Oj(0)}l=Mm(f)|0;if((a|0)==(b|0)){j=l;k=l;break}m=b+ -8+(0-e)|0;n=a;o=l;while(1){if((o|0)!=0){h[o>>3]=+h[n>>3]}p=n+8|0;if((p|0)==(b|0)){break}else{n=p;o=o+8|0}}j=l+((m>>>3)+1<<3)|0;k=l}}while(0);md(k,j,d);a:do{if((k|0)!=(j|0)){d=k;while(1){b=d+8|0;if((b|0)==(j|0)){break a}if(+h[d>>3]==+h[b>>3]){break}else{d=b}}if((d|0)==(j|0)){break}l=d;m=d+8|0;while(1){b=m;do{b=b+8|0;if((b|0)==(j|0)){break a}q=+h[b>>3];}while(+h[l>>3]==q);a=l+8|0;h[a>>3]=q;l=a;m=b}}}while(0);if((k|0)==0){i=c;return}Om(k);i=c;return}function Oc(a){a=a|0;jb(a|0)|0;Ka()}function Pc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0;c=i;i=i+8|0;d=c;e=a;f=b-e|0;g=f>>3;do{if((g|0)==0){j=0;k=0}else{if(g>>>0>536870911){Oj(0)}l=Mm(f)|0;if((a|0)==(b|0)){j=l;k=l;break}m=b+ -8+(0-e)|0;n=a;o=l;while(1){if((o|0)!=0){h[o>>3]=+h[n>>3]}p=n+8|0;if((p|0)==(b|0)){break}else{n=p;o=o+8|0}}j=l;k=l+((m>>>3)+1<<3)|0}}while(0);md(j,k,d);a:do{if((j|0)!=(k|0)){d=j+8|0;if((d|0)==(k|0)){break}q=+h[j>>3];b=j;a=d;while(1){r=+h[a>>3];if(q==r){break}d=a+8|0;if((d|0)==(k|0)){break a}else{e=a;a=d;b=e;q=r}}if((b|0)==(k|0)){break}a=b+16|0;if((a|0)==(k|0)){break}q=+h[b>>3];m=b;l=a;while(1){r=+h[l>>3];if(q==r){s=q;t=m}else{a=m+8|0;h[a>>3]=r;s=r;t=a}a=l+8|0;if((a|0)==(k|0)){break}else{q=s;m=t;l=a}}}}while(0);if((j|0)==0){i=c;return}Om(j);i=c;return}function Qc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0;e=i;i=i+120|0;f=e;g=e+8|0;j=e+16|0;k=e+24|0;l=e+32|0;m=e+40|0;n=e+48|0;o=e+56|0;p=e+64|0;q=e+72|0;r=e+80|0;s=e+88|0;t=e+112|0;u=d;v=u-b>>3;w=s;x=s;c[x+0>>2]=0;c[x+4>>2]=0;c[x+8>>2]=0;c[x+12>>2]=0;c[x+16>>2]=0;c[x+20>>2]=0;do{if((v|0)==0){y=s+16|0;z=s+8|0;A=s+4|0;B=0;C=0;D=0;E=0;F=0}else{x=s+8|0;G=s+4|0;H=s+16|0;I=s+20|0;hd(s,v);J=c[I>>2]|0;K=c[H>>2]|0;L=c[G>>2]|0;M=c[x>>2]|0;N=J+K|0;O=L+(N>>>9<<2)|0;if((M|0)==(L|0)){P=v;Q=O;R=0}else{P=v;Q=O;R=(c[O>>2]|0)+((N&511)<<3)|0}while(1){if((R|0)!=0){h[R>>3]=0.0}N=P+ -1|0;O=R+8|0;if((O-(c[Q>>2]|0)|0)==4096){S=Q+4|0;T=c[S>>2]|0;U=S}else{T=O;U=Q}if((N|0)==0){break}else{P=N;Q=U;R=T}}c[I>>2]=J+v;N=L+(K>>>9<<2)|0;if((M|0)==(L|0)){y=H;z=x;A=G;B=N;C=K;D=L;E=M;F=0;break}y=H;z=x;A=G;B=N;C=K;D=L;E=M;F=(c[N>>2]|0)+((K&511)<<3)|0}}while(0);if((b|0)==(d|0)){V=E;W=D;X=C}else{C=b;b=F;D=B;B=F;while(1){F=(c[D>>2]|0)+4096-B>>3;E=C;v=u-E>>3;if((v|0)>(F|0)){Y=C+(F<<3)|0;Z=F}else{Y=d;Z=v}gn(B|0,C|0,Y-E|0)|0;do{if((Z|0)==0){_=b;$=D;aa=B}else{E=(b-(c[D>>2]|0)>>3)+Z|0;if((E|0)>0){v=D+(((E|0)/512|0)<<2)|0;F=(c[v>>2]|0)+(((E|0)%512|0)<<3)|0;_=F;$=v;aa=F;break}else{F=511-E|0;E=D+(((F|0)/-512|0)<<2)|0;v=(c[E>>2]|0)+(511-((F|0)%512|0)<<3)|0;_=v;$=E;aa=v;break}}}while(0);if((Y|0)==(d|0)){break}else{C=Y;b=_;D=$;B=aa}}V=c[z>>2]|0;W=c[A>>2]|0;X=c[y>>2]|0}aa=W+(X>>>9<<2)|0;if((V|0)==(W|0)){ba=0;ca=0}else{ba=0;ca=(c[aa>>2]|0)+((X&511)<<3)|0}B=s+20|0;s=X+(c[B>>2]|0)|0;X=W+(s>>>9<<2)|0;if((V|0)==(W|0)){da=0;ea=0}else{da=0;ea=(c[X>>2]|0)+((s&511)<<3)|0}s=n;W=m;c[W>>2]=ba|aa;c[W+4>>2]=ca;ca=n;c[ca>>2]=da|X;c[ca+4>>2]=ea;ea=l;ca=m;c[ea+0>>2]=c[ca+0>>2];c[ea+4>>2]=c[ca+4>>2];ca=k;ea=s;c[ca+0>>2]=c[ea+0>>2];c[ca+4>>2]=c[ea+4>>2];cd(l,k,o);o=c[A>>2]|0;A=c[y>>2]|0;y=o+(A>>>9<<2)|0;if((c[z>>2]|0)==(o|0)){fa=o+((A+(c[B>>2]|0)|0)>>>9<<2)|0;ga=0;ha=0;ia=0;ja=0;ka=p;la=q;ma=r;na=p;oa=q;pa=y;qa=ga|pa;ra=p;sa=ra;c[sa>>2]=qa;ta=ra+4|0;ua=ta;c[ua>>2]=ha;va=fa;wa=ia|va;xa=q;ya=xa;c[ya>>2]=wa;za=xa+4|0;Aa=za;c[Aa>>2]=ja;Ba=j;Ca=j;Da=na;c[Ca+0>>2]=c[Da+0>>2];c[Ca+4>>2]=c[Da+4>>2];Ea=g;Fa=g;Ga=oa;c[Fa+0>>2]=c[Ga+0>>2];c[Fa+4>>2]=c[Ga+4>>2];Ha=f;Ia=f;Ja=r;a[Ia+0|0]=a[Ja+0|0]|0;bd(t,j,g,f);Ka=f;La=g;Ma=j;gd(w);i=e;return}else{z=A+(c[B>>2]|0)|0;B=o+(z>>>9<<2)|0;fa=B;ga=0;ha=(c[y>>2]|0)+((A&511)<<3)|0;ia=0;ja=(c[B>>2]|0)+((z&511)<<3)|0;ka=p;la=q;ma=r;na=p;oa=q;pa=y;qa=ga|pa;ra=p;sa=ra;c[sa>>2]=qa;ta=ra+4|0;ua=ta;c[ua>>2]=ha;va=fa;wa=ia|va;xa=q;ya=xa;c[ya>>2]=wa;za=xa+4|0;Aa=za;c[Aa>>2]=ja;Ba=j;Ca=j;Da=na;c[Ca+0>>2]=c[Da+0>>2];c[Ca+4>>2]=c[Da+4>>2];Ea=g;Fa=g;Ga=oa;c[Fa+0>>2]=c[Ga+0>>2];c[Fa+4>>2]=c[Ga+4>>2];Ha=f;Ia=f;Ja=r;a[Ia+0|0]=a[Ja+0|0]|0;bd(t,j,g,f);Ka=f;La=g;Ma=j;gd(w);i=e;return}}function Rc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0;d=i;i=i+64|0;e=d;f=d+8|0;g=d+16|0;j=d+24|0;k=d+32|0;l=d+40|0;m=d+48|0;n=m;o=m;c[n>>2]=o;p=m+4|0;c[p>>2]=o;q=m+8|0;c[q>>2]=0;if((a|0)==(b|0)){r=0;s=o}else{m=a;a=0;t=o;while(1){u=Mm(16)|0;v=u;h[u+8>>3]=+h[m>>3];c[t+4>>2]=v;c[u>>2]=c[n>>2];c[n>>2]=v;c[u+4>>2]=o;w=a+1|0;c[q>>2]=w;u=m+8|0;if((u|0)==(b|0)){break}else{t=v;a=w;m=u}}r=w;s=c[p>>2]|0}c[g>>2]=s;c[j>>2]=o;s=f;w=g;c[s+0>>2]=c[w+0>>2];w=e;s=j;c[w+0>>2]=c[s+0>>2];ad(k,f,e,r,l);l=c[p>>2]|0;if((l|0)!=(o|0)){r=l;while(1){l=c[r+4>>2]|0;a:do{if((l|0)==(o|0)){x=o}else{y=+h[r+8>>3];e=l;while(1){if(!(y==+h[e+8>>3])){x=e;break a}f=c[e+4>>2]|0;if((f|0)==(o|0)){x=o;break}else{e=f}}}}while(0);if((l|0)==(x|0)){z=l}else{e=(c[x>>2]|0)+4|0;f=l;c[(c[f>>2]|0)+4>>2]=c[e>>2];c[c[e>>2]>>2]=c[f>>2];f=l;while(1){e=c[f+4>>2]|0;c[q>>2]=(c[q>>2]|0)+ -1;Om(f);if((e|0)==(x|0)){z=x;break}else{f=e}}}if((z|0)==(o|0)){break}else{r=z}}}if((c[q>>2]|0)==0){i=d;return}z=c[p>>2]|0;p=(c[n>>2]|0)+4|0;n=z;c[(c[n>>2]|0)+4>>2]=c[p>>2];c[c[p>>2]>>2]=c[n>>2];c[q>>2]=0;if((z|0)==(o|0)){i=d;return}else{A=z}while(1){z=c[A+4>>2]|0;Om(A);if((z|0)==(o|0)){break}else{A=z}}i=d;return}function Sc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;d=i;i=i+40|0;e=d;f=d+8|0;g=d+16|0;j=d+24|0;k=j;l=j+4|0;c[l>>2]=0;m=j+8|0;c[m>>2]=0;n=j+4|0;o=j;c[o>>2]=n;if((a|0)==(b|0)){p=0;Yc(k,p);i=d;return}j=g;q=a;do{c[j>>2]=n;a=e;r=g;c[a+0>>2]=c[r+0>>2];r=$c(k,e,f,q)|0;if((c[r>>2]|0)==0){a=Mm(24)|0;h[a+16>>3]=+h[q>>3];s=c[f>>2]|0;t=a;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=s;c[r>>2]=t;s=c[c[o>>2]>>2]|0;if((s|0)==0){u=t}else{c[o>>2]=s;u=c[r>>2]|0}_c(c[l>>2]|0,u);c[m>>2]=(c[m>>2]|0)+1}q=q+8|0;}while((q|0)!=(b|0));p=c[l>>2]|0;Yc(k,p);i=d;return}function Tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;d=i;i=i+40|0;e=d;f=d+8|0;g=d+16|0;j=d+24|0;k=j;l=j+4|0;c[l>>2]=0;m=j+8|0;c[m>>2]=0;n=j+4|0;o=n;p=j;c[p>>2]=o;if((a|0)==(b|0)){q=c[l>>2]|0;r=q;Yc(k,r);i=d;return}j=g;s=a;do{c[j>>2]=o;a=e;t=g;c[a+0>>2]=c[t+0>>2];t=Zc(k,e,f,s)|0;a=Mm(24)|0;h[a+16>>3]=+h[s>>3];u=c[f>>2]|0;v=a;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=u;c[t>>2]=v;u=c[c[p>>2]>>2]|0;if((u|0)==0){w=v}else{c[p>>2]=u;w=c[t>>2]|0}_c(c[l>>2]|0,w);c[m>>2]=(c[m>>2]|0)+1;s=s+8|0;}while((s|0)!=(b|0));b=c[p>>2]|0;if((b|0)==(o|0)){q=c[l>>2]|0;r=q;Yc(k,r);i=d;return}o=n;n=b;a:while(1){b=n+4|0;s=n;w=n+16|0;while(1){x=c[b>>2]|0;if((x|0)==0){f=s;while(1){e=c[f+8>>2]|0;if((c[e>>2]|0)==(f|0)){y=e;break}else{f=e}}}else{f=x;while(1){e=c[f>>2]|0;if((e|0)==0){y=f;break}else{f=e}}}f=y;if((y|0)==(o|0)){z=24;break a}if(!(+h[w>>3]==+h[y+16>>3])){break}e=c[y+4>>2]|0;if((e|0)==0){g=y;while(1){j=c[g+8>>2]|0;if((c[j>>2]|0)==(g|0)){A=j;break}else{g=j}}}else{g=e;while(1){j=c[g>>2]|0;if((j|0)==0){A=g;break}else{g=j}}}if((c[p>>2]|0)==(f|0)){c[p>>2]=A}c[m>>2]=(c[m>>2]|0)+ -1;Xc(c[l>>2]|0,y);Om(y)}if((x|0)==0){w=s;while(1){b=c[w+8>>2]|0;if((c[b>>2]|0)==(w|0)){B=b;break}else{w=b}}}else{w=x;while(1){s=c[w>>2]|0;if((s|0)==0){B=w;break}else{w=s}}}if((B|0)==(o|0)){z=24;break}else{n=B}}if((z|0)==24){q=c[l>>2]|0;r=q;Yc(k,r);i=d;return}}function Uc(a){a=a|0;var b=0,d=0,e=0.0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;b=i;i=i+8|0;d=b;e=+(a|0);f=~~+S(+(19931568.569324173/(e*(+ca(+e)/.6931471805599453))));g=a<<1;j=c[2]|0;k=c[12>>2]|0;if((k|0)!=(j|0)){c[12>>2]=k+(~((k+ -8+(0-j)|0)>>>3)<<3)}j=(a|0)==0;do{if(j){l=0+(a<<3)|0;m=0+(g<<3)|0;n=0}else{if(g>>>0>536870911){Oj(0)}k=Mm(a<<4)|0;o=g;p=k;while(1){if((p|0)!=0){h[p>>3]=0.0}q=o+ -1|0;if((q|0)==0){break}else{o=q;p=p+8|0}}p=k+(g<<3)|0;o=k+(a<<3)|0;if(j){l=o;m=p;n=k;break}else{r=k;s=0.0}while(1){q=r+8|0;h[r>>3]=s;if((q|0)==(o|0)){l=o;m=p;n=k;break}else{s=s+1.0;r=q}}}}while(0);if((g|0)!=(a|0)){g=l;s=0.0;while(1){l=g+8|0;h[g>>3]=s;if((l|0)==(m|0)){break}else{s=s+1.0;g=l}}}Vc(n,m);if((f|0)>0){g=a<<4;a=g>>3;l=a>>>0>536870911?-1:a<<3;r=n;j=f;while(1){k=j+ -1|0;p=Nm(l)|0;o=p;fn(p|0,r|0,g|0)|0;q=o+(a<<3)|0;md(o,q,d);a:do{if((o|0)==(q|0)){t=o;u=20}else{v=o;while(1){w=v+8|0;if((w|0)==(q|0)){break a}if(+h[v>>3]==+h[w>>3]){t=v;u=20;break}else{v=w}}}}while(0);b:do{if((u|0)==20){u=0;if((t|0)==(q|0)){break}o=t;v=t+8|0;while(1){w=v;do{w=w+8|0;if((w|0)==(q|0)){break b}x=+h[w>>3];}while(+h[o>>3]==x);y=o+8|0;h[y>>3]=x;o=y;v=w}}}while(0);if((p|0)!=0){Pm(p)}if((k|0)>0){j=k}else{z=f;break}}while(1){j=z+ -1|0;Nc(n,m,j);if((j|0)>0){z=j}else{A=f;break}}while(1){z=A+ -1|0;Pc(n,m,z);if((z|0)>0){A=z}else{B=f;break}}while(1){A=B+ -1|0;Qc(n,m,A);if((A|0)>0){B=A}else{C=f;break}}while(1){B=C+ -1|0;Rc(n,m,B);if((B|0)>0){C=B}else{D=f;break}}while(1){C=D+ -1|0;Sc(n,m,C);if((C|0)>0){D=C}else{E=f;break}}do{E=E+ -1|0;Tc(n,m,E);}while((E|0)>0)}if((n|0)==0){i=b;return}Om(n);i=b;return}function Vc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,j=0,k=0,l=0,m=0.0;c=i;i=i+8|0;d=c;e=b-a|0;if((e|0)<=8){i=c;return}qd(d);f=b+ -8|0;if(f>>>0>a>>>0){b=a;a=e>>3;while(1){e=a+ -1|0;do{if((e|0)!=0){if((a|0)==0){g=pd(d)|0}else{j=32-(jn(a|0)|0)|0;k=(((-1>>>(33-j|0)&a|0)==0)<<31>>31)+j|0;j=(k>>>0)/((((k&31|0)!=0)+(k>>>5)|0)>>>0)|0;if((j|0)==0){l=0}else{l=-1>>>(32-j|0)}while(1){j=(pd(d)|0)&l;if(j>>>0<a>>>0){g=j;break}}}if((g|0)==0){break}j=b+(g<<3)|0;m=+h[b>>3];h[b>>3]=+h[j>>3];h[j>>3]=m}}while(0);j=b+8|0;if(j>>>0<f>>>0){b=j;a=e}else{break}}}od(d);i=c;return}function Wc(){var a=0;a=i;Uc(1e5);i=a;return 0}function Xc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;e=i;f=d;g=c[f>>2]|0;do{if((g|0)==0){h=0;j=d}else{k=c[d+4>>2]|0;if((k|0)==0){h=g;j=d;break}else{l=k}while(1){k=c[l>>2]|0;if((k|0)==0){h=0;j=l;break}else{l=k}}}}while(0);l=j;g=j+4|0;k=c[((h|0)==0?g:l)>>2]|0;h=(k|0)==0;m=j+8|0;if(!h){c[k+8>>2]=c[m>>2]}n=c[m>>2]|0;o=n;do{if((c[o>>2]|0)==(j|0)){c[o>>2]=k;if((j|0)==(b|0)){p=k;q=0;break}p=b;q=c[(c[m>>2]|0)+4>>2]|0}else{c[n+4>>2]=k;p=b;q=c[c[m>>2]>>2]|0}}while(0);b=j+12|0;n=(a[b]|0)==0;if((j|0)==(d|0)){r=p}else{o=d+8|0;s=c[o>>2]|0;c[m>>2]=s;if((c[c[o>>2]>>2]|0)==(d|0)){c[s>>2]=j}else{c[s+4>>2]=j}s=c[f>>2]|0;c[l>>2]=s;c[s+8>>2]=j;s=c[d+4>>2]|0;c[g>>2]=s;if((s|0)!=0){c[s+8>>2]=j}a[b]=a[d+12|0]|0;r=(p|0)==(d|0)?j:p}if(n|(r|0)==0){i=e;return}if(h){t=r;u=q}else{a[k+12|0]=1;i=e;return}while(1){k=u+8|0;q=c[k>>2]|0;r=q;h=u+12|0;n=(a[h]|0)!=0;if((c[r>>2]|0)==(u|0)){if(n){v=t;w=u}else{a[h]=1;a[q+12|0]=0;p=u+4|0;j=c[p>>2]|0;c[r>>2]=j;if((j|0)!=0){c[j+8>>2]=q}j=q+8|0;c[k>>2]=c[j>>2];k=c[j>>2]|0;r=k;if((c[r>>2]|0)==(q|0)){c[r>>2]=u}else{c[k+4>>2]=u}c[p>>2]=q;c[j>>2]=u;j=c[p>>2]|0;v=(t|0)==(j|0)?u:t;w=c[j>>2]|0}x=c[w>>2]|0;y=(x|0)==0;if(!y){if((a[x+12|0]|0)==0){z=66;break}}j=c[w+4>>2]|0;if((j|0)!=0){if((a[j+12|0]|0)==0){z=65;break}}a[w+12|0]=0;j=c[w+8>>2]|0;A=j+12|0;if((a[A]|0)==0|(j|0)==(v|0)){z=62;break}p=c[j+8>>2]|0;k=p;B=v;C=(c[k>>2]|0)==(j|0)?p+4|0:k}else{if(n){D=t;E=u}else{a[h]=1;a[q+12|0]=0;h=q+4|0;n=c[h>>2]|0;k=n;p=c[k>>2]|0;c[h>>2]=p;if((p|0)!=0){c[p+8>>2]=q}p=q+8|0;c[n+8>>2]=c[p>>2];h=c[p>>2]|0;j=h;if((c[j>>2]|0)==(q|0)){c[j>>2]=n}else{c[h+4>>2]=n}c[k>>2]=q;c[p>>2]=n;n=c[u>>2]|0;D=(t|0)==(n|0)?u:t;E=c[n+4>>2]|0}F=E;G=c[F>>2]|0;if((G|0)!=0){if((a[G+12|0]|0)==0){z=36;break}}n=c[E+4>>2]|0;if((n|0)!=0){if((a[n+12|0]|0)==0){H=n;z=37;break}}a[E+12|0]=0;n=c[E+8>>2]|0;if((n|0)==(D|0)){I=D;z=34;break}if((a[n+12|0]|0)==0){I=n;z=34;break}p=c[n+8>>2]|0;q=p;B=D;C=(c[q>>2]|0)==(n|0)?p+4|0:q}t=B;u=c[C>>2]|0}if((z|0)==34){a[I+12|0]=1;i=e;return}else if((z|0)==36){I=c[E+4>>2]|0;if((I|0)==0){z=38}else{H=I;z=37}}else if((z|0)==62){a[A]=1;i=e;return}else if((z|0)==65){if(y){z=67}else{z=66}}if((z|0)==37){if((a[H+12|0]|0)==0){J=H;K=E;z=44}else{z=38}}else if((z|0)==66){if((a[x+12|0]|0)==0){L=x;M=w;z=73}else{z=67}}if((z|0)==38){a[G+12|0]=1;a[E+12|0]=0;x=G+4|0;H=c[x>>2]|0;c[F>>2]=H;if((H|0)!=0){c[H+8>>2]=E}H=E+8|0;c[G+8>>2]=c[H>>2];F=c[H>>2]|0;y=F;if((c[y>>2]|0)==(E|0)){c[y>>2]=G}else{c[F+4>>2]=G}c[x>>2]=E;c[H>>2]=G;J=c[x>>2]|0;K=G;z=44}else if((z|0)==67){G=w+4|0;x=c[G>>2]|0;a[x+12|0]=1;a[w+12|0]=0;H=x;E=c[H>>2]|0;c[G>>2]=E;if((E|0)!=0){c[E+8>>2]=w}E=w+8|0;c[x+8>>2]=c[E>>2];G=c[E>>2]|0;F=G;if((c[F>>2]|0)==(w|0)){c[F>>2]=x}else{c[G+4>>2]=x}c[H>>2]=w;c[E>>2]=x;L=c[H>>2]|0;M=x;z=73}if((z|0)==44){x=c[K+8>>2]|0;H=x+12|0;a[K+12|0]=a[H]|0;a[H]=1;a[J+12|0]=1;J=x+4|0;H=c[J>>2]|0;K=H;E=c[K>>2]|0;c[J>>2]=E;if((E|0)!=0){c[E+8>>2]=x}E=x+8|0;c[H+8>>2]=c[E>>2];J=c[E>>2]|0;w=J;if((c[w>>2]|0)==(x|0)){c[w>>2]=H}else{c[J+4>>2]=H}c[K>>2]=x;c[E>>2]=H;i=e;return}else if((z|0)==73){z=c[M+8>>2]|0;H=z+12|0;a[M+12|0]=a[H]|0;a[H]=1;a[L+12|0]=1;L=z;H=c[L>>2]|0;M=H+4|0;E=c[M>>2]|0;c[L>>2]=E;if((E|0)!=0){c[E+8>>2]=z}E=z+8|0;c[H+8>>2]=c[E>>2];L=c[E>>2]|0;x=L;if((c[x>>2]|0)==(z|0)){c[x>>2]=H}else{c[L+4>>2]=H}c[M>>2]=z;c[E>>2]=H;i=e;return}}function Yc(a,b){a=a|0;b=b|0;var d=0;d=i;if((b|0)==0){i=d;return}else{Yc(a,c[b>>2]|0);Yc(a,c[b+4>>2]|0);Om(b);i=d;return}}function Zc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=i;g=a+4|0;j=c[b>>2]|0;do{if((j|0)!=(g|0)){k=+h[e>>3];if(!(+h[j+16>>3]<k)){break}b=c[a+4>>2]|0;if((b|0)==0){c[d>>2]=g;l=g;i=f;return l|0}else{m=b}while(1){if(+h[m+16>>3]<k){n=m+4|0;b=c[n>>2]|0;if((b|0)==0){o=22;break}else{m=b;continue}}else{p=m;b=c[p>>2]|0;if((b|0)==0){o=24;break}else{m=b;continue}}}if((o|0)==22){c[d>>2]=m;l=n;i=f;return l|0}else if((o|0)==24){c[d>>2]=m;l=p;i=f;return l|0}}}while(0);p=c[j>>2]|0;do{if((j|0)==(c[a>>2]|0)){q=j}else{if((p|0)==0){m=j;while(1){n=c[m+8>>2]|0;if((c[n>>2]|0)==(m|0)){m=n}else{r=n;break}}}else{m=p;while(1){n=c[m+4>>2]|0;if((n|0)==0){r=m;break}else{m=n}}}k=+h[e>>3];if(!(k<+h[r+16>>3])){q=r;break}m=c[a+4>>2]|0;if((m|0)==0){c[d>>2]=g;l=g;i=f;return l|0}else{s=m}while(1){if(k<+h[s+16>>3]){t=s;m=c[t>>2]|0;if((m|0)==0){o=15;break}else{s=m;continue}}else{u=s+4|0;m=c[u>>2]|0;if((m|0)==0){o=17;break}else{s=m;continue}}}if((o|0)==15){c[d>>2]=s;l=t;i=f;return l|0}else if((o|0)==17){c[d>>2]=s;l=u;i=f;return l|0}}}while(0);if((p|0)==0){c[d>>2]=j;l=j;i=f;return l|0}else{c[d>>2]=q;l=q+4|0;i=f;return l|0}return 0}function _c(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;f=(d|0)==(b|0);a[d+12|0]=f&1;if(f){i=e;return}else{g=d}while(1){h=g+8|0;j=c[h>>2]|0;d=j+12|0;if((a[d]|0)!=0){k=37;break}l=j+8|0;m=c[l>>2]|0;f=c[m>>2]|0;if((f|0)==(j|0)){n=c[m+4>>2]|0;if((n|0)==0){k=7;break}o=n+12|0;if((a[o]|0)!=0){k=7;break}a[d]=1;a[m+12|0]=(m|0)==(b|0)|0;a[o]=1}else{if((f|0)==0){k=24;break}o=f+12|0;if((a[o]|0)!=0){k=24;break}a[d]=1;a[m+12|0]=(m|0)==(b|0)|0;a[o]=1}if((m|0)==(b|0)){k=37;break}else{g=m}}if((k|0)==7){if((c[j>>2]|0)==(g|0)){p=j;q=m;r=j}else{b=j+4|0;o=c[b>>2]|0;d=o;f=c[d>>2]|0;c[b>>2]=f;if((f|0)==0){s=m}else{c[f+8>>2]=j;s=c[l>>2]|0}f=o+8|0;c[f>>2]=s;s=c[l>>2]|0;b=s;if((c[b>>2]|0)==(j|0)){c[b>>2]=o}else{c[s+4>>2]=o}c[d>>2]=j;c[l>>2]=o;d=c[f>>2]|0;p=c[d>>2]|0;q=d;r=o}a[r+12|0]=1;a[q+12|0]=0;r=p+4|0;o=c[r>>2]|0;c[q>>2]=o;if((o|0)!=0){c[o+8>>2]=q}o=q+8|0;c[p+8>>2]=c[o>>2];d=c[o>>2]|0;f=d;if((c[f>>2]|0)==(q|0)){c[f>>2]=p}else{c[d+4>>2]=p}c[r>>2]=q;c[o>>2]=p;i=e;return}else if((k|0)==24){p=j;if((c[p>>2]|0)==(g|0)){o=g+4|0;q=c[o>>2]|0;c[p>>2]=q;if((q|0)==0){t=m}else{c[q+8>>2]=j;t=c[l>>2]|0}c[h>>2]=t;t=c[l>>2]|0;q=t;if((c[q>>2]|0)==(j|0)){c[q>>2]=g}else{c[t+4>>2]=g}c[o>>2]=j;c[l>>2]=g;u=c[h>>2]|0;v=g}else{u=m;v=j}a[v+12|0]=1;a[u+12|0]=0;v=u+4|0;j=c[v>>2]|0;m=j;g=c[m>>2]|0;c[v>>2]=g;if((g|0)!=0){c[g+8>>2]=u}g=u+8|0;c[j+8>>2]=c[g>>2];v=c[g>>2]|0;h=v;if((c[h>>2]|0)==(u|0)){c[h>>2]=j}else{c[v+4>>2]=j}c[m>>2]=u;c[g>>2]=j;i=e;return}else if((k|0)==37){i=e;return}}function $c(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0.0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=i;g=a+4|0;j=c[b>>2]|0;do{if((j|0)!=(g|0)){k=+h[e>>3];l=+h[j+16>>3];if(k<l){break}if(!(l<k)){c[d>>2]=j;m=d;i=f;return m|0}b=j+4|0;n=c[b>>2]|0;o=(n|0)==0;if(o){p=j;while(1){q=c[p+8>>2]|0;if((c[q>>2]|0)==(p|0)){r=q;break}else{p=q}}}else{p=n;while(1){q=c[p>>2]|0;if((q|0)==0){r=p;break}else{p=q}}}p=g;do{if((r|0)!=(p|0)){if(k<+h[r+16>>3]){break}n=c[a+4>>2]|0;if((n|0)==0){c[d>>2]=p;m=g;i=f;return m|0}else{s=n}while(1){l=+h[s+16>>3];if(k<l){t=s;n=c[t>>2]|0;if((n|0)==0){u=34;break}else{s=n;continue}}if(!(l<k)){u=38;break}v=s+4|0;n=c[v>>2]|0;if((n|0)==0){u=37;break}else{s=n}}if((u|0)==34){c[d>>2]=s;m=t;i=f;return m|0}else if((u|0)==37){c[d>>2]=s;m=v;i=f;return m|0}else if((u|0)==38){c[d>>2]=s;m=d;i=f;return m|0}}}while(0);if(o){c[d>>2]=j;m=b;i=f;return m|0}else{c[d>>2]=r;m=r;i=f;return m|0}}}while(0);r=c[j>>2]|0;do{if((j|0)==(c[a>>2]|0)){w=j}else{if((r|0)==0){s=j;while(1){v=c[s+8>>2]|0;if((c[v>>2]|0)==(s|0)){s=v}else{x=v;break}}}else{s=r;while(1){b=c[s+4>>2]|0;if((b|0)==0){x=s;break}else{s=b}}}k=+h[e>>3];if(+h[x+16>>3]<k){w=x;break}s=c[a+4>>2]|0;if((s|0)==0){c[d>>2]=g;m=g;i=f;return m|0}else{y=s}while(1){l=+h[y+16>>3];if(k<l){z=y;s=c[z>>2]|0;if((s|0)==0){u=15;break}else{y=s;continue}}if(!(l<k)){u=19;break}A=y+4|0;s=c[A>>2]|0;if((s|0)==0){u=18;break}else{y=s}}if((u|0)==15){c[d>>2]=y;m=z;i=f;return m|0}else if((u|0)==18){c[d>>2]=y;m=A;i=f;return m|0}else if((u|0)==19){c[d>>2]=y;m=d;i=f;return m|0}}}while(0);if((r|0)==0){c[d>>2]=j;m=j;i=f;return m|0}else{c[d>>2]=w;m=w+4|0;i=f;return m|0}return 0}function ad(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0;g=i;i=i+80|0;j=g;k=g+8|0;l=g+16|0;m=g+24|0;n=g+32|0;o=g+40|0;p=g+48|0;q=g+56|0;r=g+64|0;s=g+72|0;if((e|0)==2){t=d;u=c[c[t>>2]>>2]|0;c[t>>2]=u;t=c[b>>2]|0;if(+h[u+8>>3]<+h[t+8>>3]){v=u+4|0;w=u;c[(c[w>>2]|0)+4>>2]=c[v>>2];c[c[v>>2]>>2]=c[w>>2];x=t;c[(c[x>>2]|0)+4>>2]=u;c[w>>2]=c[x>>2];c[x>>2]=u;c[v>>2]=t;c[a>>2]=u;i=g;return}else{c[a>>2]=t;i=g;return}}else if((e|0)==1|(e|0)==0){c[a>>2]=c[b>>2];i=g;return}else{t=e>>>1;u=b;b=c[u>>2]|0;if((t|0)==0){y=b}else{v=t;x=b;while(1){w=c[x+4>>2]|0;z=v+ -1|0;if((z|0)>0){x=w;v=z}else{y=w;break}}}c[o>>2]=b;c[p>>2]=y;b=m;v=o;c[b+0>>2]=c[v+0>>2];v=l;b=p;c[v+0>>2]=c[b+0>>2];ad(n,m,l,t,f);l=c[n>>2]|0;c[u>>2]=l;c[r>>2]=y;y=d;d=c[y>>2]|0;c[s>>2]=d;n=e-t|0;t=k;e=r;c[t+0>>2]=c[e+0>>2];e=j;t=s;c[e+0>>2]=c[t+0>>2];ad(q,k,j,n,f);f=c[q>>2]|0;A=+h[l+8>>3];if(+h[f+8>>3]<A){q=c[f+4>>2]|0;a:do{if((q|0)==(d|0)){B=d}else{n=q;while(1){if(!(+h[n+8>>3]<A)){B=n;break a}j=c[n+4>>2]|0;if((j|0)==(d|0)){B=d;break}else{n=j}}}}while(0);q=c[B>>2]|0;n=q+4|0;j=f;c[(c[j>>2]|0)+4>>2]=c[n>>2];c[c[n>>2]>>2]=c[j>>2];k=c[l+4>>2]|0;t=l;c[(c[t>>2]|0)+4>>2]=f;c[j>>2]=c[t>>2];c[t>>2]=q;c[n>>2]=l;C=B;D=f;E=k}else{C=f;D=l;E=c[l+4>>2]|0}c[u>>2]=E;b:do{if((E|0)!=(C|0)){l=C;f=C;k=d;B=E;while(1){n=f+8|0;if((f|0)==(k|0)){break b}else{F=B}while(1){G=+h[F+8>>3];if(+h[n>>3]<G){break}q=c[F+4>>2]|0;c[u>>2]=q;if((q|0)==(l|0)){break b}else{F=q}}n=c[f+4>>2]|0;c:do{if((n|0)==(k|0)){H=k}else{q=n;while(1){if(!(+h[q+8>>3]<G)){H=q;break c}t=c[q+4>>2]|0;if((t|0)==(k|0)){H=k;break}else{q=t}}}}while(0);n=c[H>>2]|0;q=n+4|0;t=f;c[(c[t>>2]|0)+4>>2]=c[q>>2];c[c[q>>2]>>2]=c[t>>2];j=c[F+4>>2]|0;e=(l|0)==(f|0)?H:l;s=F;c[(c[s>>2]|0)+4>>2]=f;c[t>>2]=c[s>>2];c[s>>2]=n;c[q>>2]=F;c[u>>2]=j;if((j|0)==(e|0)){break b}l=e;f=H;k=c[y>>2]|0;B=j}}}while(0);c[a>>2]=D;i=g;return}}function bd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0,J=0;e=i;f=b;g=f;j=c[g>>2]|0;k=c[g+4>>2]|0;g=d;l=c[g>>2]|0;m=c[g+4>>2]|0;g=k;n=m;a:do{if((g|0)==(n|0)){o=l;p=m}else{q=j;r=c[q>>2]|0;s=j;t=k;u=g;v=q;while(1){q=u+8|0;if((q-r|0)==4096){w=v+4|0;x=c[w>>2]|0;y=x;z=x;A=w}else{y=r;z=q;A=v}if((z|0)==(n|0)){o=l;p=m;break a}if(+h[u>>3]==+h[z>>3]){o=s;p=t;break a}r=y;s=A;t=z;u=z;v=A}}}while(0);A=f;c[A>>2]=o;c[A+4>>2]=p;A=b+4|0;z=p;p=c[d+4>>2]|0;d=o;do{if((z|0)!=(p|0)){o=z+8|0;y=c[d>>2]|0;if((o-y|0)==4096){m=d+4|0;l=c[m>>2]|0;B=l;C=m;D=l}else{B=o;C=d;D=y}y=b;o=d;l=d;m=z;n=D;g=B;k=C;while(1){j=g+8|0;if((j-n|0)==4096){v=k+4|0;u=c[v>>2]|0;E=u;F=u;G=v}else{E=n;F=j;G=k}if((F|0)==(p|0)){break}H=+h[F>>3];if(+h[m>>3]==H){n=E;g=F;k=G;m=m;l=l;o=o;continue}j=m+8|0;c[A>>2]=j;if((j-(c[o>>2]|0)|0)==4096){v=o+4|0;c[y>>2]=v;u=c[v>>2]|0;c[A>>2]=u;I=u;J=v}else{I=j;J=o}h[I>>3]=H;o=J;l=J;m=I;n=c[G>>2]|0;g=F;k=G}k=m+8|0;c[A>>2]=k;if((k-(c[l>>2]|0)|0)!=4096){break}k=l+4|0;c[y>>2]=k;c[A>>2]=c[k>>2]}}while(0);A=f;f=c[A+4>>2]|0;G=a;c[G>>2]=c[A>>2];c[G+4>>2]=f;i=e;return}function cd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0.0,ab=0.0,bb=0.0,cb=0.0,db=0.0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0.0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0.0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0.0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0.0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0.0,oc=0,pc=0,qc=0,rc=0,sc=0.0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec=0,Fc=0,Gc=0,Hc=0,Ic=0,Jc=0,Kc=0.0,Lc=0,Mc=0,Nc=0,Oc=0;e=i;i=i+168|0;f=e;g=e+8|0;j=e+16|0;k=e+24|0;l=e+32|0;m=e+40|0;n=e+48|0;o=e+56|0;p=e+64|0;q=e+72|0;r=e+80|0;s=e+88|0;t=e+96|0;u=e+104|0;v=e+112|0;w=e+120|0;x=e+128|0;y=e+136|0;z=e+144|0;A=e+152|0;B=e+160|0;C=B;D=i;i=i+8|0;E=D;F=i;i=i+8|0;G=F;H=i;i=i+8|0;I=H;J=i;i=i+8|0;K=J;L=i;i=i+8|0;M=L;N=i;i=i+8|0;O=N;P=i;i=i+8|0;Q=P;R=i;i=i+8|0;S=R;T=i;i=i+8|0;U=T;V=i;i=i+8|0;W=V;X=i;i=i+8|0;Y=X;Z=i;i=i+8|0;_=Z;$=i;i=i+8|0;aa=$;ba=i;i=i+8|0;ca=ba;da=i;i=i+8|0;ea=da;fa=i;i=i+8|0;ga=fa;ha=i;i=i+8|0;ia=ha;ja=i;i=i+8|0;ka=ja;la=i;i=i+8|0;ma=la;na=b+4|0;oa=c[na>>2]|0;pa=c[a+4>>2]|0;if((oa|0)==(pa|0)){i=e;return}qa=b;ra=a;sa=b;b=W+4|0;ta=V;ua=S+4|0;va=R;wa=ca+4|0;xa=ba;ya=ka+4|0;za=ja;Aa=c[qa>>2]|0;Ba=oa;Ca=oa;Da=oa;Ea=pa;Fa=oa;Ga=c[a>>2]|0;a=pa;pa=oa;a:while(1){oa=pa;Ha=a;Ia=(oa-(c[Aa>>2]|0)>>3)+(Aa-Ga<<7)-(Ha-(c[Ga>>2]|0)>>3)|0;switch(Ia|0){case 2:{Ja=4;break a;break};case 3:{Ja=8;break a;break};case 4:{Ja=21;break a;break};case 5:{Ja=41;break a;break};case 1:case 0:{Ja=155;break a;break};default:{}}Ka=ra;La=c[Ka>>2]|0;Ma=c[Ka+4>>2]|0;if((Ia|0)<31){Ja=54;break}Ka=La;Na=Ma;Oa=sa;Pa=c[Oa>>2]|0;Qa=c[Oa+4>>2]|0;if((Qa|0)==(c[Pa>>2]|0)){Oa=Pa+ -4|0;Ra=Oa;Sa=(c[Oa>>2]|0)+4096|0}else{Ra=Pa;Sa=Qa}Qa=Sa+ -8|0;Oa=(Ia|0)>999;do{if((Ia+1|0)>>>0<3){Ta=Na;Ua=Ka}else{Va=(Ma-(c[Ka>>2]|0)>>3)+((Ia|0)/2|0)|0;if((Va|0)>0){Wa=Ka+(((Va|0)/512|0)<<2)|0;Ta=(c[Wa>>2]|0)+(((Va|0)%512|0)<<3)|0;Ua=Wa;break}else{Wa=511-Va|0;Va=Ka+(((Wa|0)/-512|0)<<2)|0;Ta=(c[Va>>2]|0)+(511-((Wa|0)%512|0)<<3)|0;Ua=Va;break}}}while(0);do{if(Oa){Va=(Ia|0)/4|0;Wa=P;c[Wa>>2]=La;c[Wa+4>>2]=Ma;Wa=R;c[Wa>>2]=La;c[Wa+4>>2]=Ma;Wa=(Ia+3|0)>>>0<7;do{if(!Wa){Xa=(Ma-(c[Ka>>2]|0)>>3)+Va|0;if((Xa|0)>0){Ya=Ka+(((Xa|0)/512|0)<<2)|0;c[va>>2]=Ya;c[ua>>2]=(c[Ya>>2]|0)+(((Xa|0)%512|0)<<3);break}else{Ya=511-Xa|0;Xa=Ka+(((Ya|0)/-512|0)<<2)|0;c[va>>2]=Xa;c[ua>>2]=(c[Xa>>2]|0)+(511-((Ya|0)%512|0)<<3);break}}}while(0);Ya=Ua;Xa=Ta;Za=T;c[Za>>2]=Ya;c[Za+4>>2]=Xa;Za=V;c[Za>>2]=Ya;c[Za+4>>2]=Xa;do{if(!Wa){Za=(Xa-(c[Ua>>2]|0)>>3)+Va|0;if((Za|0)>0){Ya=Ua+(((Za|0)/512|0)<<2)|0;c[ta>>2]=Ya;c[b>>2]=(c[Ya>>2]|0)+(((Za|0)%512|0)<<3);break}else{Ya=511-Za|0;Za=Ua+(((Ya|0)/-512|0)<<2)|0;c[ta>>2]=Za;c[b>>2]=(c[Za>>2]|0)+(511-((Ya|0)%512|0)<<3);break}}}while(0);Va=X;c[Va>>2]=Ra;c[Va+4>>2]=Qa;Va=t;Xa=Q;c[Va+0>>2]=c[Xa+0>>2];c[Va+4>>2]=c[Xa+4>>2];Xa=s;Va=S;c[Xa+0>>2]=c[Va+0>>2];c[Xa+4>>2]=c[Va+4>>2];Va=r;Xa=U;c[Va+0>>2]=c[Xa+0>>2];c[Va+4>>2]=c[Xa+4>>2];Xa=q;Va=W;c[Xa+0>>2]=c[Va+0>>2];c[Xa+4>>2]=c[Va+4>>2];Va=p;Xa=Y;c[Va+0>>2]=c[Xa+0>>2];c[Va+4>>2]=c[Xa+4>>2];Xa=dd(t,s,r,q,p,0)|0;_a=Xa}else{$a=+h[Ta>>3];ab=+h[Na>>3];bb=+h[Qa>>3];Xa=bb<$a;if(!($a<ab)){if(!Xa){_a=0;break}h[Ta>>3]=bb;h[Qa>>3]=$a;cb=+h[Ta>>3];db=+h[Na>>3];if(!(cb<db)){_a=1;break}h[Na>>3]=cb;h[Ta>>3]=db;_a=2;break}if(Xa){h[Na>>3]=bb;h[Qa>>3]=ab;_a=1;break}h[Na>>3]=$a;h[Ta>>3]=ab;$a=+h[Qa>>3];if(!($a<ab)){_a=1;break}h[Ta>>3]=$a;h[Qa>>3]=ab;_a=2}}while(0);Na=ra;Ka=c[Na>>2]|0;Ia=c[Na+4>>2]|0;ab=+h[Ia>>3];$a=+h[Ta>>3];do{if(ab<$a){eb=Qa;fb=Ra;gb=_a;Ja=112}else{Na=c[Ra>>2]|0;Oa=Qa;Xa=Ra;while(1){if((Oa|0)==(Na|0)){Va=Xa+ -4|0;Wa=c[Va>>2]|0;hb=Wa;ib=Va;jb=Wa+4096|0}else{hb=Na;ib=Xa;jb=Oa}kb=jb+ -8|0;if((Ia|0)==(kb|0)){break}lb=+h[kb>>3];if(lb<$a){Ja=111;break}else{Na=hb;Oa=kb;Xa=ib}}if((Ja|0)==111){Ja=0;h[Ia>>3]=lb;h[kb>>3]=ab;eb=kb;fb=ib;gb=_a+1|0;Ja=112;break}Xa=Ia+8|0;Oa=c[Ka>>2]|0;if((Xa-Oa|0)==4096){Na=Ka+4|0;Wa=c[Na>>2]|0;mb=Wa;nb=Wa;ob=Na}else{mb=Oa;nb=Xa;ob=Ka}Xa=sa;Oa=c[Xa>>2]|0;Na=c[Xa+4>>2]|0;Xa=c[Oa>>2]|0;if((Na|0)==(Xa|0)){Wa=Oa+ -4|0;Va=c[Wa>>2]|0;pb=Va;qb=Wa;rb=Va+4096|0}else{pb=Xa;qb=Oa;rb=Na}Na=rb+ -8|0;bb=+h[a>>3];db=+h[Na>>3];do{if(bb<db){sb=nb;tb=ob}else{Xa=nb;Va=ob;Wa=mb;b:while(1){ub=Xa;while(1){if((ub|0)==(Na|0)){Ja=155;break a}vb=+h[ub>>3];if(bb<vb){break b}Ya=ub+8|0;if((Ya-Wa|0)==4096){break}else{ub=Ya}}Ya=Va+4|0;Za=c[Ya>>2]|0;Xa=Za;Va=Ya;Wa=Za}h[ub>>3]=db;h[Na>>3]=vb;Xa=ub+8|0;if((Xa-Wa|0)!=4096){sb=Xa;tb=Va;break}Xa=Va+4|0;sb=c[Xa>>2]|0;tb=Xa}}while(0);if((sb|0)==(Na|0)){Ja=155;break a}else{wb=sb;xb=tb;yb=Na;zb=qb;Ab=pb}c:while(1){Xa=wb;Za=yb;Ya=zb;Bb=Ab;d:while(1){db=+h[a>>3];Cb=Xa;while(1){Db=+h[Cb>>3];if(db<Db){Eb=Bb;Fb=Za;Gb=Ya;break}Hb=Cb+8|0;if((Hb-(c[xb>>2]|0)|0)==4096){Ib=Za;Jb=Ya;Kb=Bb;break d}else{Cb=Hb}}while(1){if((Fb|0)==(Eb|0)){Hb=Gb+ -4|0;Lb=c[Hb>>2]|0;Mb=Lb;Nb=Hb;Ob=Lb+4096|0}else{Mb=Eb;Nb=Gb;Ob=Fb}Pb=Ob+ -8|0;Qb=+h[Pb>>3];if(db<Qb){Eb=Mb;Fb=Pb;Gb=Nb}else{break}}if(!(xb>>>0<Nb>>>0)){if((xb|0)!=(Nb|0)|Cb>>>0>=Pb>>>0){break c}}h[Cb>>3]=Qb;h[Pb>>3]=Db;Lb=Cb+8|0;if((Lb-(c[xb>>2]|0)|0)==4096){Ib=Pb;Jb=Nb;Kb=Mb;break}else{Xa=Lb;Za=Pb;Ya=Nb;Bb=Mb}}Bb=xb+4|0;wb=c[Bb>>2]|0;xb=Bb;yb=Ib;zb=Jb;Ab=Kb}Na=ra;c[Na>>2]=xb;c[Na+4>>2]=Cb;Rb=Oa;Sb=Ba;Tb=Ca;Ub=Da;Vb=Cb;Wb=Fa;Xb=Cb;Yb=pa;Zb=xb}}while(0);e:do{if((Ja|0)==112){Ja=0;Qa=Ia+8|0;Na=c[Ka>>2]|0;if((Qa-Na|0)==4096){Bb=Ka+4|0;Ya=c[Bb>>2]|0;_b=Ya;$b=Ya;ac=Bb}else{_b=Na;$b=Qa;ac=Ka}if(ac>>>0<fb>>>0){bc=Ta;cc=$b;dc=ac;ec=eb;fc=fb;gc=_b;hc=gb;Ja=116}else{if((ac|0)==(fb|0)&$b>>>0<eb>>>0){bc=Ta;cc=$b;dc=ac;ec=eb;fc=fb;gc=_b;hc=gb;Ja=116}else{ic=Ta;jc=$b;kc=ac;lc=gb}}f:do{if((Ja|0)==116){while(1){Ja=0;ab=+h[bc>>3];Qa=cc;Na=dc;Bb=gc;g:while(1){mc=Qa;while(1){nc=+h[mc>>3];if(!(nc<ab)){break g}Ya=mc+8|0;if((Ya-Bb|0)==4096){break}else{mc=Ya}}Ya=Na+4|0;Za=c[Ya>>2]|0;Qa=Za;Na=Ya;Bb=Za}Qa=c[fc>>2]|0;Za=ec;Ya=fc;while(1){if((Za|0)==(Qa|0)){Xa=Ya+ -4|0;Va=c[Xa>>2]|0;oc=Va;pc=Xa;qc=Va+4096|0}else{oc=Qa;pc=Ya;qc=Za}rc=qc+ -8|0;sc=+h[rc>>3];if(sc<ab){break}else{Qa=oc;Za=rc;Ya=pc}}if(pc>>>0<Na>>>0){ic=bc;jc=mc;kc=Na;lc=hc;break f}if((pc|0)==(Na|0)&rc>>>0<mc>>>0){ic=bc;jc=mc;kc=Na;lc=hc;break f}h[mc>>3]=sc;h[rc>>3]=nc;Ya=hc+1|0;Za=(bc|0)==(mc|0)?rc:bc;Qa=mc+8|0;if((Qa-Bb|0)!=4096){bc=Za;cc=Qa;dc=Na;ec=rc;fc=pc;gc=Bb;hc=Ya;Ja=116;continue}Qa=Na+4|0;Va=c[Qa>>2]|0;bc=Za;cc=Va;dc=Qa;ec=rc;fc=pc;gc=Va;hc=Ya;Ja=116}}}while(0);do{if((jc|0)==(ic|0)){tc=lc}else{ab=+h[ic>>3];$a=+h[jc>>3];if(!(ab<$a)){tc=lc;break}h[jc>>3]=ab;h[ic>>3]=$a;tc=lc+1|0}}while(0);do{if((tc|0)==0){Oa=ra;Ya=c[Oa>>2]|0;Va=c[Oa+4>>2]|0;Oa=Z;c[Oa>>2]=Ya;c[Oa+4>>2]=Va;Va=kc;Oa=jc;Qa=$;c[Qa>>2]=Va;c[Qa+4>>2]=Oa;Qa=o;Za=_;c[Qa+0>>2]=c[Za+0>>2];c[Qa+4>>2]=c[Za+4>>2];Za=n;Qa=aa;c[Za+0>>2]=c[Qa+0>>2];c[Za+4>>2]=c[Qa+4>>2];Qa=fd(o,n,0)|0;Za=ba;c[Za>>2]=Va;c[Za+4>>2]=Oa;Za=Oa-(c[kc>>2]|0)|0;Xa=Za>>3;Wa=Xa+1|0;Lb=Ya;if((Za|0)>-8){Za=kc+(((Wa|0)/512|0)<<2)|0;c[xa>>2]=Za;uc=(c[Za>>2]|0)+(((Wa|0)%512|0)<<3)|0}else{Wa=510-Xa|0;Xa=kc+(((Wa|0)/-512|0)<<2)|0;c[xa>>2]=Xa;uc=(c[Xa>>2]|0)+(511-((Wa|0)%512|0)<<3)|0}c[wa>>2]=uc;Wa=sa;Xa=c[Wa>>2]|0;Za=c[Wa+4>>2]|0;Wa=da;c[Wa>>2]=Xa;c[Wa+4>>2]=Za;Za=m;Wa=ca;c[Za+0>>2]=c[Wa+0>>2];c[Za+4>>2]=c[Wa+4>>2];Wa=l;Za=ea;c[Wa+0>>2]=c[Za+0>>2];c[Wa+4>>2]=c[Za+4>>2];Za=fd(m,l,0)|0;Wa=Xa;if(Za){if(Qa){Ja=155;break a}Za=sa;c[Za>>2]=Va;c[Za+4>>2]=Oa;Rb=kc;Sb=jc;Tb=jc;Ub=jc;Vb=Ea;Wb=jc;Xb=a;Yb=jc;Zb=Lb;break e}if(!Qa){vc=Wa;wc=Lb;break}Lb=jc+8|0;if((Lb-(c[kc>>2]|0)|0)==4096){Qa=kc+4|0;xc=c[Qa>>2]|0;yc=Qa}else{xc=Lb;yc=kc}Lb=ra;c[Lb>>2]=yc;c[Lb+4>>2]=xc;Rb=Wa;Sb=Ba;Tb=Ca;Ub=Da;Vb=xc;Wb=Fa;Xb=xc;Yb=pa;Zb=yc;break e}else{vc=Pa;wc=Ka}}while(0);if((jc|0)==(a|0)){zc=0}else{zc=(jc-(c[kc>>2]|0)>>3)+(kc-wc<<7)-(Ha-(c[wc>>2]|0)>>3)|0}if((pa|0)==(jc|0)){Ac=0}else{Ac=(oa-(c[vc>>2]|0)>>3)+(vc-kc<<7)-(jc-(c[kc>>2]|0)>>3)|0}if((zc|0)<(Ac|0)){Wa=ra;Lb=c[Wa+4>>2]|0;Qa=fa;c[Qa>>2]=c[Wa>>2];c[Qa+4>>2]=Lb;Lb=ha;c[Lb>>2]=kc;c[Lb+4>>2]=jc;Lb=k;Qa=ga;c[Lb+0>>2]=c[Qa+0>>2];c[Lb+4>>2]=c[Qa+4>>2];Qa=j;Lb=ia;c[Qa+0>>2]=c[Lb+0>>2];c[Qa+4>>2]=c[Lb+4>>2];cd(k,j,d);Lb=jc+8|0;if((Lb-(c[kc>>2]|0)|0)==4096){Qa=kc+4|0;Bc=c[Qa>>2]|0;Cc=Qa}else{Bc=Lb;Cc=kc}Lb=ra;c[Lb>>2]=Cc;c[Lb+4>>2]=Bc;Rb=vc;Sb=Ba;Tb=Ca;Ub=Da;Vb=Bc;Wb=Fa;Xb=Bc;Yb=pa;Zb=Cc;break}Lb=kc;Qa=jc;Wa=ja;c[Wa>>2]=Lb;c[Wa+4>>2]=Qa;Wa=Qa-(c[kc>>2]|0)|0;Oa=Wa>>3;Za=Oa+1|0;if((Wa|0)>-8){Wa=kc+(((Za|0)/512|0)<<2)|0;c[za>>2]=Wa;Dc=(c[Wa>>2]|0)+(((Za|0)%512|0)<<3)|0}else{Za=510-Oa|0;Oa=kc+(((Za|0)/-512|0)<<2)|0;c[za>>2]=Oa;Dc=(c[Oa>>2]|0)+(511-((Za|0)%512|0)<<3)|0}c[ya>>2]=Dc;Za=sa;Oa=c[Za+4>>2]|0;Wa=la;c[Wa>>2]=c[Za>>2];c[Wa+4>>2]=Oa;Oa=g;Wa=ka;c[Oa+0>>2]=c[Wa+0>>2];c[Oa+4>>2]=c[Wa+4>>2];Wa=f;Oa=ma;c[Wa+0>>2]=c[Oa+0>>2];c[Wa+4>>2]=c[Oa+4>>2];cd(g,f,d);Oa=sa;c[Oa>>2]=Lb;c[Oa+4>>2]=Qa;Rb=kc;Sb=jc;Tb=jc;Ub=jc;Vb=Ea;Wb=jc;Xb=a;Yb=jc;Zb=wc}}while(0);if((Yb|0)==(Xb|0)){Ja=155;break}else{Aa=Rb;Ba=Sb;Ca=Tb;Da=Ub;Ea=Vb;Fa=Wb;Ga=Zb;a=Xb;pa=Yb}}if((Ja|0)==4){if((Fa|0)==(c[Aa>>2]|0)){Yb=Aa+ -4|0;c[qa>>2]=Yb;pa=(c[Yb>>2]|0)+4096|0;c[na>>2]=pa;Ec=pa}else{Ec=Fa}Fa=Ec+ -8|0;c[na>>2]=Fa;nc=+h[Fa>>3];sc=+h[Ea>>3];if(!(nc<sc)){i=e;return}h[Ea>>3]=nc;h[Fa>>3]=sc;i=e;return}else if((Ja|0)==8){Fa=ra;Ea=c[Fa+4>>2]|0;Ec=c[Fa>>2]|0;Fa=Ea-(c[Ec>>2]|0)|0;pa=Fa>>3;Yb=pa+1|0;if((Fa|0)>-8){Fc=(c[Ec+(((Yb|0)/512|0)<<2)>>2]|0)+(((Yb|0)%512|0)<<3)|0}else{Yb=510-pa|0;Fc=(c[Ec+(((Yb|0)/-512|0)<<2)>>2]|0)+(511-((Yb|0)%512|0)<<3)|0}if((Da|0)==(c[Aa>>2]|0)){Yb=Aa+ -4|0;c[qa>>2]=Yb;Ec=(c[Yb>>2]|0)+4096|0;c[na>>2]=Ec;Gc=Ec}else{Gc=Da}c[na>>2]=Gc+ -8;Gc=Ea;Ea=c[sa+4>>2]|0;sc=+h[Fc>>3];nc=+h[Gc>>3];Db=+h[Ea>>3];Da=Db<sc;if(!(sc<nc)){if(!Da){i=e;return}h[Fc>>3]=Db;h[Ea>>3]=sc;Qb=+h[Fc>>3];vb=+h[Gc>>3];if(!(Qb<vb)){i=e;return}h[Gc>>3]=Qb;h[Fc>>3]=vb;i=e;return}if(Da){h[Gc>>3]=Db;h[Ea>>3]=nc;i=e;return}h[Gc>>3]=sc;h[Fc>>3]=nc;sc=+h[Ea>>3];if(!(sc<nc)){i=e;return}h[Fc>>3]=sc;h[Ea>>3]=nc;i=e;return}else if((Ja|0)==21){Ea=ra;Fc=c[Ea+4>>2]|0;Gc=c[Ea>>2]|0;Ea=Fc-(c[Gc>>2]|0)|0;Da=Ea>>3;Ec=Da+1|0;if((Ea|0)>-8){Hc=(c[Gc+(((Ec|0)/512|0)<<2)>>2]|0)+(((Ec|0)%512|0)<<3)|0}else{Ec=510-Da|0;Hc=(c[Gc+(((Ec|0)/-512|0)<<2)>>2]|0)+(511-((Ec|0)%512|0)<<3)|0}Ec=Da+2|0;if((Ec|0)>0){Ic=(c[Gc+(((Ec|0)/512|0)<<2)>>2]|0)+(((Ec|0)%512|0)<<3)|0}else{Ec=509-Da|0;Ic=(c[Gc+(((Ec|0)/-512|0)<<2)>>2]|0)+(511-((Ec|0)%512|0)<<3)|0}if((Ca|0)==(c[Aa>>2]|0)){Ec=Aa+ -4|0;c[qa>>2]=Ec;Gc=(c[Ec>>2]|0)+4096|0;c[na>>2]=Gc;Jc=Gc}else{Jc=Ca}c[na>>2]=Jc+ -8;Jc=Fc;Fc=c[sa+4>>2]|0;nc=+h[Hc>>3];sc=+h[Jc>>3];Db=+h[Ic>>3];Ca=Db<nc;do{if(nc<sc){if(Ca){h[Jc>>3]=Db;h[Ic>>3]=sc;Kc=sc;break}h[Jc>>3]=nc;h[Hc>>3]=sc;vb=+h[Ic>>3];if(!(vb<sc)){Kc=vb;break}h[Hc>>3]=vb;h[Ic>>3]=sc;Kc=sc}else{if(!Ca){Kc=Db;break}h[Hc>>3]=Db;h[Ic>>3]=nc;vb=+h[Hc>>3];Qb=+h[Jc>>3];if(!(vb<Qb)){Kc=nc;break}h[Jc>>3]=vb;h[Hc>>3]=Qb;Kc=+h[Ic>>3]}}while(0);nc=+h[Fc>>3];if(!(nc<Kc)){i=e;return}h[Ic>>3]=nc;h[Fc>>3]=Kc;Kc=+h[Ic>>3];nc=+h[Hc>>3];if(!(Kc<nc)){i=e;return}h[Hc>>3]=Kc;h[Ic>>3]=nc;nc=+h[Hc>>3];Kc=+h[Jc>>3];if(!(nc<Kc)){i=e;return}h[Jc>>3]=nc;h[Hc>>3]=Kc;i=e;return}else if((Ja|0)==41){Hc=ra;ra=c[Hc>>2]|0;Jc=c[Hc+4>>2]|0;Hc=B;c[Hc>>2]=ra;c[Hc+4>>2]=Jc;Hc=D;c[Hc>>2]=ra;c[Hc+4>>2]=Jc;Hc=ra;B=D;D=Jc-(c[Hc>>2]|0)|0;Ic=D>>3;Fc=Ic+1|0;if((D|0)>-8){D=Hc+(((Fc|0)/512|0)<<2)|0;c[B>>2]=D;Lc=(c[D>>2]|0)+(((Fc|0)%512|0)<<3)|0}else{Fc=510-Ic|0;Ic=Hc+(((Fc|0)/-512|0)<<2)|0;c[B>>2]=Ic;Lc=(c[Ic>>2]|0)+(511-((Fc|0)%512|0)<<3)|0}c[E+4>>2]=Lc;Lc=F;c[Lc>>2]=ra;c[Lc+4>>2]=Jc;Lc=F;F=Jc-(c[Hc>>2]|0)>>3;Fc=F+2|0;if((Fc|0)>0){Ic=Hc+(((Fc|0)/512|0)<<2)|0;c[Lc>>2]=Ic;Mc=(c[Ic>>2]|0)+(((Fc|0)%512|0)<<3)|0}else{Fc=509-F|0;F=Hc+(((Fc|0)/-512|0)<<2)|0;c[Lc>>2]=F;Mc=(c[F>>2]|0)+(511-((Fc|0)%512|0)<<3)|0}c[G+4>>2]=Mc;Mc=H;c[Mc>>2]=ra;c[Mc+4>>2]=Jc;Mc=H;H=Jc-(c[Hc>>2]|0)>>3;Jc=H+3|0;if((Jc|0)>0){ra=Hc+(((Jc|0)/512|0)<<2)|0;c[Mc>>2]=ra;Nc=(c[ra>>2]|0)+(((Jc|0)%512|0)<<3)|0}else{Jc=508-H|0;H=Hc+(((Jc|0)/-512|0)<<2)|0;c[Mc>>2]=H;Nc=(c[H>>2]|0)+(511-((Jc|0)%512|0)<<3)|0}c[I+4>>2]=Nc;if((Ba|0)==(c[Aa>>2]|0)){Nc=Aa+ -4|0;c[qa>>2]=Nc;qa=(c[Nc>>2]|0)+4096|0;c[na>>2]=qa;Oc=qa}else{Oc=Ba}c[na>>2]=Oc+ -8;Oc=sa;na=c[Oc+4>>2]|0;Ba=J;c[Ba>>2]=c[Oc>>2];c[Ba+4>>2]=na;na=A;Ba=C;c[na+0>>2]=c[Ba+0>>2];c[na+4>>2]=c[Ba+4>>2];Ba=z;na=E;c[Ba+0>>2]=c[na+0>>2];c[Ba+4>>2]=c[na+4>>2];na=y;Ba=G;c[na+0>>2]=c[Ba+0>>2];c[na+4>>2]=c[Ba+4>>2];Ba=x;na=I;c[Ba+0>>2]=c[na+0>>2];c[Ba+4>>2]=c[na+4>>2];na=w;Ba=K;c[na+0>>2]=c[Ba+0>>2];c[na+4>>2]=c[Ba+4>>2];dd(A,z,y,x,w,0)|0;i=e;return}else if((Ja|0)==54){w=L;c[w>>2]=La;c[w+4>>2]=Ma;Ma=sa;sa=c[Ma+4>>2]|0;w=N;c[w>>2]=c[Ma>>2];c[w+4>>2]=sa;sa=v;w=M;c[sa+0>>2]=c[w+0>>2];c[sa+4>>2]=c[w+4>>2];w=u;sa=O;c[w+0>>2]=c[sa+0>>2];c[w+4>>2]=c[sa+4>>2];ed(v,u,0);i=e;return}else if((Ja|0)==155){i=e;return}}function dd(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0,w=0;g=i;j=c[a+4>>2]|0;k=c[b+4>>2]|0;l=c[d+4>>2]|0;m=c[e+4>>2]|0;n=+h[k>>3];o=+h[j>>3];p=+h[l>>3];q=p<n;do{if(n<o){if(q){h[j>>3]=p;h[l>>3]=o;r=1;s=o;break}h[j>>3]=n;h[k>>3]=o;t=+h[l>>3];if(!(t<o)){r=1;s=t;break}h[k>>3]=t;h[l>>3]=o;r=2;s=o}else{if(!q){r=0;s=p;break}h[k>>3]=p;h[l>>3]=n;t=+h[k>>3];u=+h[j>>3];if(!(t<u)){r=1;s=n;break}h[j>>3]=t;h[k>>3]=u;r=2;s=+h[l>>3]}}while(0);n=+h[m>>3];do{if(n<s){h[l>>3]=n;h[m>>3]=s;p=+h[l>>3];o=+h[k>>3];if(!(p<o)){v=r+1|0;break}h[k>>3]=p;h[l>>3]=o;o=+h[k>>3];p=+h[j>>3];if(!(o<p)){v=r+2|0;break}h[j>>3]=o;h[k>>3]=p;v=r+3|0}else{v=r}}while(0);r=c[f+4>>2]|0;f=c[e+4>>2]|0;s=+h[r>>3];n=+h[f>>3];if(!(s<n)){w=v;i=g;return w|0}h[f>>3]=s;h[r>>3]=n;r=c[d+4>>2]|0;n=+h[f>>3];s=+h[r>>3];if(!(n<s)){w=v+1|0;i=g;return w|0}h[r>>3]=n;h[f>>3]=s;f=c[b+4>>2]|0;s=+h[r>>3];n=+h[f>>3];if(!(s<n)){w=v+2|0;i=g;return w|0}h[f>>3]=s;h[r>>3]=n;r=c[a+4>>2]|0;n=+h[f>>3];s=+h[r>>3];if(!(n<s)){w=v+3|0;i=g;return w|0}h[r>>3]=n;h[f>>3]=s;w=v+4|0;i=g;return w|0}function ed(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0;d=i;e=a;f=c[e+4>>2]|0;g=c[e>>2]|0;e=f-(c[g>>2]|0)|0;j=e>>3;k=j+2|0;if((k|0)>0){l=g+(((k|0)/512|0)<<2)|0;m=c[l>>2]|0;n=m;o=m+(((k|0)%512|0)<<3)|0;p=l}else{l=509-j|0;k=g+(((l|0)/-512|0)<<2)|0;m=c[k>>2]|0;n=m;o=m+(511-((l|0)%512|0)<<3)|0;p=k}k=j+1|0;if((e|0)>-8){q=(c[g+(((k|0)/512|0)<<2)>>2]|0)+(((k|0)%512|0)<<3)|0}else{k=510-j|0;q=(c[g+(((k|0)/-512|0)<<2)>>2]|0)+(511-((k|0)%512|0)<<3)|0}k=o;g=f;r=+h[q>>3];s=+h[g>>3];t=+h[o>>3];f=t<r;do{if(r<s){if(f){h[g>>3]=t;h[o>>3]=s;break}h[g>>3]=r;h[q>>3]=s;u=+h[o>>3];if(!(u<s)){break}h[q>>3]=u;h[o>>3]=s}else{if(!f){break}h[q>>3]=t;h[o>>3]=r;u=+h[q>>3];v=+h[g>>3];if(!(u<v)){break}h[g>>3]=u;h[q>>3]=v}}while(0);q=k-n|0;n=q>>3;k=n+1|0;if((q|0)>-8){q=p+(((k|0)/512|0)<<2)|0;g=c[q>>2]|0;w=g+(((k|0)%512|0)<<3)|0;x=q;y=g}else{g=510-n|0;n=p+(((g|0)/-512|0)<<2)|0;q=c[n>>2]|0;w=q+(511-((g|0)%512|0)<<3)|0;x=n;y=q}q=c[b+4>>2]|0;b=c[a+4>>2]|0;a=o;o=p;p=w;w=x;x=y;a:while(1){y=a;n=o;g=p;while(1){if((g|0)==(q|0)){break a}r=+h[g>>3];t=+h[y>>3];if(r<t){s=t;k=g;f=y;j=n;while(1){h[k>>3]=s;if((f|0)==(b|0)){z=b;break}if((f|0)==(c[j>>2]|0)){e=j+ -4|0;A=e;B=(c[e>>2]|0)+4096|0}else{A=j;B=f}e=B+ -8|0;t=+h[e>>3];if(r<t){l=f;s=t;f=e;j=A;k=l}else{z=f;break}}h[z>>3]=r}f=g+8|0;if((f-x|0)==4096){break}else{k=g;n=w;g=f;y=k}}y=w+4|0;n=c[y>>2]|0;k=w;a=g;p=n;w=y;x=n;o=k}i=d;return}function fd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0;d=i;i=i+56|0;e=d;f=d+8|0;g=d+16|0;j=d+24|0;k=d+32|0;l=d+40|0;m=d+48|0;n=m;o=i;i=i+8|0;p=o;q=i;i=i+8|0;r=q;s=i;i=i+8|0;t=b+4|0;u=c[t>>2]|0;v=c[a+4>>2]|0;if((u|0)==(v|0)){w=1;i=d;return w|0}x=b;y=c[x>>2]|0;z=c[a>>2]|0;A=c[y>>2]|0;switch((u-A>>3)+(y-z<<7)-(v-(c[z>>2]|0)>>3)|0){case 4:{z=a;B=c[z+4>>2]|0;C=c[z>>2]|0;z=B-(c[C>>2]|0)|0;D=z>>3;E=D+1|0;if((z|0)>-8){F=(c[C+(((E|0)/512|0)<<2)>>2]|0)+(((E|0)%512|0)<<3)|0}else{E=510-D|0;F=(c[C+(((E|0)/-512|0)<<2)>>2]|0)+(511-((E|0)%512|0)<<3)|0}E=D+2|0;if((E|0)>0){G=(c[C+(((E|0)/512|0)<<2)>>2]|0)+(((E|0)%512|0)<<3)|0}else{E=509-D|0;G=(c[C+(((E|0)/-512|0)<<2)>>2]|0)+(511-((E|0)%512|0)<<3)|0}if((u|0)==(A|0)){E=y+ -4|0;c[x>>2]=E;C=(c[E>>2]|0)+4096|0;c[t>>2]=C;H=C}else{H=u}c[t>>2]=H+ -8;H=B;B=c[b+4>>2]|0;I=+h[F>>3];J=+h[H>>3];K=+h[G>>3];C=K<I;do{if(I<J){if(C){h[H>>3]=K;h[G>>3]=J;L=J;break}h[H>>3]=I;h[F>>3]=J;M=+h[G>>3];if(!(M<J)){L=M;break}h[F>>3]=M;h[G>>3]=J;L=J}else{if(!C){L=K;break}h[F>>3]=K;h[G>>3]=I;M=+h[F>>3];N=+h[H>>3];if(!(M<N)){L=I;break}h[H>>3]=M;h[F>>3]=N;L=+h[G>>3]}}while(0);I=+h[B>>3];if(!(I<L)){w=1;i=d;return w|0}h[G>>3]=I;h[B>>3]=L;L=+h[G>>3];I=+h[F>>3];if(!(L<I)){w=1;i=d;return w|0}h[F>>3]=L;h[G>>3]=I;I=+h[F>>3];L=+h[H>>3];if(!(I<L)){w=1;i=d;return w|0}h[H>>3]=I;h[F>>3]=L;w=1;i=d;return w|0};case 2:{if((u|0)==(A|0)){F=y+ -4|0;c[x>>2]=F;H=(c[F>>2]|0)+4096|0;c[t>>2]=H;O=H}else{O=u}H=O+ -8|0;c[t>>2]=H;L=+h[H>>3];I=+h[v>>3];if(!(L<I)){w=1;i=d;return w|0}h[v>>3]=L;h[H>>3]=I;w=1;i=d;return w|0};case 3:{H=a;O=c[H+4>>2]|0;F=c[H>>2]|0;H=O-(c[F>>2]|0)|0;G=H>>3;B=G+1|0;if((H|0)>-8){P=(c[F+(((B|0)/512|0)<<2)>>2]|0)+(((B|0)%512|0)<<3)|0}else{B=510-G|0;P=(c[F+(((B|0)/-512|0)<<2)>>2]|0)+(511-((B|0)%512|0)<<3)|0}if((u|0)==(A|0)){B=y+ -4|0;c[x>>2]=B;F=(c[B>>2]|0)+4096|0;c[t>>2]=F;Q=F}else{Q=u}c[t>>2]=Q+ -8;Q=O;O=c[b+4>>2]|0;I=+h[P>>3];L=+h[Q>>3];K=+h[O>>3];F=K<I;if(!(I<L)){if(!F){w=1;i=d;return w|0}h[P>>3]=K;h[O>>3]=I;J=+h[P>>3];N=+h[Q>>3];if(!(J<N)){w=1;i=d;return w|0}h[Q>>3]=J;h[P>>3]=N;w=1;i=d;return w|0}if(F){h[Q>>3]=K;h[O>>3]=L;w=1;i=d;return w|0}h[Q>>3]=I;h[P>>3]=L;I=+h[O>>3];if(!(I<L)){w=1;i=d;return w|0}h[P>>3]=I;h[O>>3]=L;w=1;i=d;return w|0};case 1:case 0:{w=1;i=d;return w|0};case 5:{O=a;P=c[O>>2]|0;Q=c[O+4>>2]|0;O=l;c[O>>2]=P;c[O+4>>2]=Q;O=m;c[O>>2]=P;c[O+4>>2]=Q;O=P;F=m;m=Q-(c[O>>2]|0)|0;B=m>>3;G=B+1|0;if((m|0)>-8){m=O+(((G|0)/512|0)<<2)|0;c[F>>2]=m;R=(c[m>>2]|0)+(((G|0)%512|0)<<3)|0}else{G=510-B|0;B=O+(((G|0)/-512|0)<<2)|0;c[F>>2]=B;R=(c[B>>2]|0)+(511-((G|0)%512|0)<<3)|0}c[n+4>>2]=R;R=o;c[R>>2]=P;c[R+4>>2]=Q;R=o;o=Q-(c[O>>2]|0)>>3;G=o+2|0;if((G|0)>0){B=O+(((G|0)/512|0)<<2)|0;c[R>>2]=B;S=(c[B>>2]|0)+(((G|0)%512|0)<<3)|0}else{G=509-o|0;o=O+(((G|0)/-512|0)<<2)|0;c[R>>2]=o;S=(c[o>>2]|0)+(511-((G|0)%512|0)<<3)|0}c[p+4>>2]=S;S=q;c[S>>2]=P;c[S+4>>2]=Q;S=q;q=Q-(c[O>>2]|0)>>3;Q=q+3|0;if((Q|0)>0){P=O+(((Q|0)/512|0)<<2)|0;c[S>>2]=P;T=(c[P>>2]|0)+(((Q|0)%512|0)<<3)|0}else{Q=508-q|0;q=O+(((Q|0)/-512|0)<<2)|0;c[S>>2]=q;T=(c[q>>2]|0)+(511-((Q|0)%512|0)<<3)|0}c[r+4>>2]=T;if((u|0)==(A|0)){A=y+ -4|0;c[x>>2]=A;x=(c[A>>2]|0)+4096|0;c[t>>2]=x;U=x}else{U=u}c[t>>2]=U+ -8;U=b;b=c[U+4>>2]|0;t=s;c[t>>2]=c[U>>2];c[t+4>>2]=b;b=k;t=l;c[b+0>>2]=c[t+0>>2];c[b+4>>2]=c[t+4>>2];t=j;b=n;c[t+0>>2]=c[b+0>>2];c[t+4>>2]=c[b+4>>2];b=g;t=p;c[b+0>>2]=c[t+0>>2];c[b+4>>2]=c[t+4>>2];t=f;b=r;c[t+0>>2]=c[b+0>>2];c[t+4>>2]=c[b+4>>2];b=e;t=s;c[b+0>>2]=c[t+0>>2];c[b+4>>2]=c[t+4>>2];dd(k,j,g,f,e,0)|0;w=1;i=d;return w|0};default:{e=a;a=c[e+4>>2]|0;f=c[e>>2]|0;e=a-(c[f>>2]|0)|0;g=e>>3;j=g+2|0;if((j|0)>0){k=f+(((j|0)/512|0)<<2)|0;t=c[k>>2]|0;V=t;W=t+(((j|0)%512|0)<<3)|0;X=k}else{k=509-g|0;j=f+(((k|0)/-512|0)<<2)|0;t=c[j>>2]|0;V=t;W=t+(511-((k|0)%512|0)<<3)|0;X=j}j=g+1|0;if((e|0)>-8){Y=(c[f+(((j|0)/512|0)<<2)>>2]|0)+(((j|0)%512|0)<<3)|0}else{j=510-g|0;Y=(c[f+(((j|0)/-512|0)<<2)>>2]|0)+(511-((j|0)%512|0)<<3)|0}j=W;f=a;L=+h[Y>>3];I=+h[f>>3];K=+h[W>>3];a=K<L;do{if(L<I){if(a){h[f>>3]=K;h[W>>3]=I;break}h[f>>3]=L;h[Y>>3]=I;N=+h[W>>3];if(!(N<I)){break}h[Y>>3]=N;h[W>>3]=I}else{if(!a){break}h[Y>>3]=K;h[W>>3]=L;N=+h[Y>>3];J=+h[f>>3];if(!(N<J)){break}h[f>>3]=N;h[Y>>3]=J}}while(0);Y=j-V|0;V=Y>>3;j=V+1|0;if((Y|0)>-8){Y=X+(((j|0)/512|0)<<2)|0;f=c[Y>>2]|0;Z=W;_=X;$=f+(((j|0)%512|0)<<3)|0;aa=Y;ba=f;ca=0}else{f=510-V|0;V=X+(((f|0)/-512|0)<<2)|0;Y=c[V>>2]|0;Z=W;_=X;$=Y+(511-((f|0)%512|0)<<3)|0;aa=V;ba=Y;ca=0}a:while(1){Y=Z;V=_;da=$;f=ca;while(1){if((da|0)==(u|0)){w=1;ea=82;break a}L=+h[da>>3];K=+h[Y>>3];if(L<K){I=K;X=da;W=Y;j=V;while(1){h[X>>3]=I;if((W|0)==(v|0)){fa=v;break}if((W|0)==(c[j>>2]|0)){a=j+ -4|0;ga=a;ha=(c[a>>2]|0)+4096|0}else{ga=j;ha=W}a=ha+ -8|0;K=+h[a>>3];if(L<K){g=W;I=K;W=a;j=ga;X=g}else{fa=W;break}}h[fa>>3]=L;W=f+1|0;if((W|0)==8){break a}else{ia=W}}else{ia=f}W=da+8|0;if((W-ba|0)==4096){break}else{X=da;V=aa;da=W;f=ia;Y=X}}Y=aa+4|0;f=c[Y>>2]|0;V=aa;Z=da;$=f;aa=Y;ba=f;ca=ia;_=V}if((ea|0)==82){i=d;return w|0}ea=da+8|0;if((ea-ba|0)==4096){ja=c[aa+4>>2]|0}else{ja=ea}w=(ja|0)==(u|0);i=d;return w|0}}return 0}function gd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;b=i;d=a+4|0;e=c[d>>2]|0;f=a+16|0;g=c[f>>2]|0;h=e+(g>>>9<<2)|0;j=a+8|0;k=c[j>>2]|0;if((k|0)==(e|0)){l=a+20|0;m=0;n=0}else{o=a+20|0;p=(c[o>>2]|0)+g|0;l=o;m=(c[h>>2]|0)+((g&511)<<3)|0;n=(c[e+(p>>>9<<2)>>2]|0)+((p&511)<<3)|0}p=m;m=h;a:while(1){h=p;do{if((h|0)==(n|0)){break a}h=h+8|0;}while((h-(c[m>>2]|0)|0)!=4096);h=m+4|0;p=c[h>>2]|0;m=h}c[l>>2]=0;l=k-e>>2;if(l>>>0>2){k=e;while(1){Om(c[k>>2]|0);e=(c[d>>2]|0)+4|0;c[d>>2]=e;m=(c[j>>2]|0)-e>>2;if(m>>>0>2){k=e}else{q=m;break}}}else{q=l}if((q|0)==1){c[f>>2]=256}else if((q|0)==2){c[f>>2]=512}f=c[d>>2]|0;q=c[j>>2]|0;do{if((f|0)!=(q|0)){l=f;do{Om(c[l>>2]|0);l=l+4|0;}while((l|0)!=(q|0));l=c[d>>2]|0;k=c[j>>2]|0;if((k|0)==(l|0)){break}c[j>>2]=k+(~((k+ -4+(0-l)|0)>>>2)<<2)}}while(0);j=c[a>>2]|0;if((j|0)==0){i=b;return}Om(j);i=b;return}function hd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0;d=i;i=i+32|0;e=d;f=d+8|0;g=a;h=a+8|0;j=c[h>>2]|0;k=a+4|0;l=c[k>>2]|0;m=((j|0)==(l|0))+b|0;b=((m&511|0)!=0)+(m>>>9)|0;m=a+16|0;n=c[m>>2]|0;o=n>>>9;p=b>>>0<o>>>0?b:o;q=b-p|0;if((b|0)==(p|0)){c[m>>2]=n-(b<<9);if((b|0)==0){i=d;return}n=a+12|0;r=a;s=l;t=j;u=b;while(1){v=c[s>>2]|0;w=s+4|0;c[k>>2]=w;do{if((t|0)==(c[n>>2]|0)){x=c[r>>2]|0;if(w>>>0>x>>>0){y=w;z=((y-x>>2)+1|0)/-2|0;A=t-y|0;gn(s+(z+1<<2)|0,w|0,A|0)|0;y=s+((A>>2)+1+z<<2)|0;c[h>>2]=y;c[k>>2]=(c[k>>2]|0)+(z<<2);B=y;C=15;break}y=t-x>>1;z=(y|0)==0?1:y;y=Mm(z<<2)|0;A=y+(z>>>2<<2)|0;D=y+(z<<2)|0;if((w|0)==(t|0)){E=x;F=A}else{x=A;z=w;do{if((x|0)==0){G=0}else{c[x>>2]=c[z>>2];G=x}x=G+4|0;z=z+4|0;}while((z|0)!=(t|0));E=c[r>>2]|0;F=x}c[r>>2]=y;c[k>>2]=A;c[h>>2]=F;c[n>>2]=D;if((E|0)==0){H=F;C=14;break}Om(E);H=c[h>>2]|0;C=14}else{H=t;C=14}}while(0);if((C|0)==14){C=0;if((H|0)==0){I=0}else{B=H;C=15}}if((C|0)==15){C=0;c[B>>2]=v;I=c[h>>2]|0}w=I+4|0;c[h>>2]=w;z=u+ -1|0;if((z|0)==0){break}s=c[k>>2]|0;t=w;u=z}i=d;return}u=a+12|0;t=c[u>>2]|0;s=a;I=t-(c[s>>2]|0)|0;B=j-l>>2;if(!(q>>>0>((I>>2)-B|0)>>>0)){l=t;t=j;j=q;while(1){if((l|0)==(t|0)){C=19;break}H=Mm(4096)|0;if((t|0)==0){J=0}else{c[t>>2]=H;J=c[h>>2]|0}H=J+4|0;c[h>>2]=H;E=j+ -1|0;if((E|0)==0){K=H;C=20;break}l=c[u>>2]|0;t=H;j=E}do{if((C|0)==19){if((j|0)==0){K=l;C=20;break}t=~o;J=~b;E=t>>>0>J>>>0?t:J;J=j;do{c[e>>2]=Mm(4096)|0;id(g,e);J=J+ -1|0;L=c[h>>2]|0;M=(c[m>>2]|0)+512+(((L-(c[k>>2]|0)|0)==4)<<31>>31)|0;c[m>>2]=M;}while((J|0)!=0);N=j+ -1-E|0;O=M;P=L}}while(0);if((C|0)==20){N=p;O=c[m>>2]|0;P=K}c[m>>2]=O-(N<<9);if((N|0)==0){i=d;return}else{Q=P;R=N}do{N=c[k>>2]|0;P=c[N>>2]|0;O=N+4|0;c[k>>2]=O;do{if((Q|0)==(c[u>>2]|0)){K=c[s>>2]|0;if(O>>>0>K>>>0){L=O;M=((L-K>>2)+1|0)/-2|0;j=Q-L|0;gn(N+(M+1<<2)|0,O|0,j|0)|0;L=N+((j>>2)+1+M<<2)|0;c[h>>2]=L;c[k>>2]=(c[k>>2]|0)+(M<<2);S=L;C=41;break}L=Q-K>>1;M=(L|0)==0?1:L;L=Mm(M<<2)|0;j=L+(M>>>2<<2)|0;e=L+(M<<2)|0;if((O|0)==(Q|0)){T=K;U=j}else{K=j;M=O;do{if((K|0)==0){V=0}else{c[K>>2]=c[M>>2];V=K}K=V+4|0;M=M+4|0;}while((M|0)!=(Q|0));T=c[s>>2]|0;U=K}c[s>>2]=L;c[k>>2]=j;c[h>>2]=U;c[u>>2]=e;if((T|0)==0){W=U;C=40;break}Om(T);W=c[h>>2]|0;C=40}else{W=Q;C=40}}while(0);if((C|0)==40){C=0;if((W|0)==0){X=0}else{S=W;C=41}}if((C|0)==41){C=0;c[S>>2]=P;X=c[h>>2]|0}Q=X+4|0;c[h>>2]=Q;R=R+ -1|0;}while((R|0)!=0);i=d;return}R=p<<9;Q=I>>1;I=q+B|0;X=Q>>>0<I>>>0?I:Q;Q=f+12|0;c[Q>>2]=0;c[f+16>>2]=a+12;if((X|0)==0){Y=0}else{Y=Mm(X<<2)|0}a=f;c[a>>2]=Y;I=Y+(B-p<<2)|0;B=f+8|0;c[B>>2]=I;S=f+4|0;c[S>>2]=I;c[Q>>2]=Y+(X<<2);X=I;I=q;do{q=Mm(4096)|0;do{if((X|0)==(c[Q>>2]|0)){Y=c[S>>2]|0;W=c[a>>2]|0;if(Y>>>0>W>>>0){T=Y;U=((T-W>>2)+1|0)/-2|0;V=Y+(U<<2)|0;O=X-T|0;gn(V|0,Y|0,O|0)|0;T=Y+(U+(O>>2)<<2)|0;c[B>>2]=T;c[S>>2]=V;Z=T;break}T=X-W>>1;V=(T|0)==0?1:T;T=Mm(V<<2)|0;O=T+(V>>>2<<2)|0;U=T+(V<<2)|0;if((Y|0)==(X|0)){_=O;$=W}else{W=O;V=Y;do{if((W|0)==0){aa=0}else{c[W>>2]=c[V>>2];aa=W}W=aa+4|0;V=V+4|0;}while((V|0)!=(X|0));_=W;$=c[a>>2]|0}c[a>>2]=T;c[S>>2]=O;c[B>>2]=_;c[Q>>2]=U;if(($|0)==0){Z=_;break}Om($);Z=_}else{Z=X}}while(0);if((Z|0)==0){ba=0}else{c[Z>>2]=q;ba=c[B>>2]|0}X=ba+4|0;c[B>>2]=X;I=I+ -1|0;}while((I|0)!=0);if((p|0)!=0){I=X;X=c[k>>2]|0;ba=p;do{if((I|0)==(c[Q>>2]|0)){p=c[S>>2]|0;Z=c[a>>2]|0;do{if(p>>>0>Z>>>0){_=p;$=((_-Z>>2)+1|0)/-2|0;aa=p+($<<2)|0;P=I-_|0;gn(aa|0,p|0,P|0)|0;_=p+($+(P>>2)<<2)|0;c[B>>2]=_;c[S>>2]=aa;ca=_}else{_=I-Z>>1;aa=(_|0)==0?1:_;_=Mm(aa<<2)|0;P=_+(aa>>>2<<2)|0;$=_+(aa<<2)|0;if((p|0)==(I|0)){da=P;ea=Z}else{aa=P;V=p;do{if((aa|0)==0){fa=0}else{c[aa>>2]=c[V>>2];fa=aa}aa=fa+4|0;V=V+4|0;}while((V|0)!=(I|0));da=aa;ea=c[a>>2]|0}c[a>>2]=_;c[S>>2]=P;c[B>>2]=da;c[Q>>2]=$;if((ea|0)==0){ca=da;break}Om(ea);ca=da}}while(0);if((ca|0)==0){ga=0}else{ha=ca;C=72}}else{ha=I;C=72}if((C|0)==72){C=0;c[ha>>2]=c[X>>2];ga=c[B>>2]|0}I=ga+4|0;c[B>>2]=I;X=(c[k>>2]|0)+4|0;c[k>>2]=X;ba=ba+ -1|0;}while((ba|0)!=0)}ba=c[h>>2]|0;while(1){if((ba|0)==(c[k>>2]|0)){break}X=ba+ -4|0;jd(f,X);ba=X}f=c[s>>2]|0;c[s>>2]=c[a>>2];c[a>>2]=f;c[k>>2]=c[S>>2];c[S>>2]=ba;S=c[h>>2]|0;c[h>>2]=c[B>>2];c[B>>2]=S;h=c[u>>2]|0;c[u>>2]=c[Q>>2];c[Q>>2]=h;c[m>>2]=(c[m>>2]|0)-R;if((S|0)!=(ba|0)){c[B>>2]=S+(~((S+ -4+(0-ba)|0)>>>2)<<2)}if((f|0)==0){i=d;return}Om(f);i=d;return}function id(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;e=a+4|0;f=c[e>>2]|0;g=a;do{if((f|0)==(c[g>>2]|0)){h=a+8|0;j=c[h>>2]|0;k=a+12|0;l=c[k>>2]|0;m=l;if(j>>>0<l>>>0){l=j;n=((m-l>>2)+1|0)/2|0;o=l-f|0;l=j+(n-(o>>2)<<2)|0;gn(l|0,f|0,o|0)|0;c[e>>2]=l;c[h>>2]=(c[h>>2]|0)+(n<<2);p=l;break}l=m-f>>1;m=(l|0)==0?1:l;l=Mm(m<<2)|0;n=l+((m+3|0)>>>2<<2)|0;o=l+(m<<2)|0;if((f|0)==(j|0)){q=f;r=n}else{m=n;s=f;do{if((m|0)==0){t=0}else{c[m>>2]=c[s>>2];t=m}m=t+4|0;s=s+4|0;}while((s|0)!=(j|0));q=c[g>>2]|0;r=m}c[g>>2]=l;c[e>>2]=n;c[h>>2]=r;c[k>>2]=o;if((q|0)==0){p=n;break}Om(q);p=c[e>>2]|0}else{p=f}}while(0);c[p+ -4>>2]=c[b>>2];c[e>>2]=(c[e>>2]|0)+ -4;i=d;return}function jd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;e=a+4|0;f=c[e>>2]|0;g=a;do{if((f|0)==(c[g>>2]|0)){h=a+8|0;j=c[h>>2]|0;k=a+12|0;l=c[k>>2]|0;m=l;if(j>>>0<l>>>0){l=j;n=((m-l>>2)+1|0)/2|0;o=l-f|0;l=j+(n-(o>>2)<<2)|0;gn(l|0,f|0,o|0)|0;c[e>>2]=l;c[h>>2]=(c[h>>2]|0)+(n<<2);p=l;break}l=m-f>>1;m=(l|0)==0?1:l;l=Mm(m<<2)|0;n=l+((m+3|0)>>>2<<2)|0;o=l+(m<<2)|0;if((f|0)==(j|0)){q=f;r=n}else{m=n;s=f;do{if((m|0)==0){t=0}else{c[m>>2]=c[s>>2];t=m}m=t+4|0;s=s+4|0;}while((s|0)!=(j|0));q=c[g>>2]|0;r=m}c[g>>2]=l;c[e>>2]=n;c[h>>2]=r;c[k>>2]=o;if((q|0)==0){p=n;break}Om(q);p=c[e>>2]|0}else{p=f}}while(0);c[p+ -4>>2]=c[b>>2];c[e>>2]=(c[e>>2]|0)+ -4;i=d;return}function kd(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,j=0.0,k=0.0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0,r=0;f=i;g=+h[b>>3];j=+h[a>>3];k=+h[c>>3];l=k<g;do{if(g<j){if(l){h[a>>3]=k;h[c>>3]=j;m=1;n=j;break}h[a>>3]=g;h[b>>3]=j;o=+h[c>>3];if(!(o<j)){m=1;n=o;break}h[b>>3]=o;h[c>>3]=j;m=2;n=j}else{if(!l){m=0;n=k;break}h[b>>3]=k;h[c>>3]=g;o=+h[b>>3];p=+h[a>>3];if(!(o<p)){m=1;n=g;break}h[a>>3]=o;h[b>>3]=p;m=2;n=+h[c>>3]}}while(0);g=+h[d>>3];do{if(g<n){h[c>>3]=g;h[d>>3]=n;k=+h[c>>3];j=+h[b>>3];if(!(k<j)){q=m+1|0;break}h[b>>3]=k;h[c>>3]=j;j=+h[b>>3];k=+h[a>>3];if(j<k){h[a>>3]=j;h[b>>3]=k;q=m+3|0;break}else{q=m+2|0;break}}else{q=m}}while(0);n=+h[e>>3];g=+h[d>>3];if(!(n<g)){r=q;i=f;return r|0}h[d>>3]=n;h[e>>3]=g;g=+h[d>>3];n=+h[c>>3];if(!(g<n)){r=q+1|0;i=f;return r|0}h[c>>3]=g;h[d>>3]=n;n=+h[c>>3];g=+h[b>>3];if(!(n<g)){r=q+2|0;i=f;return r|0}h[b>>3]=n;h[c>>3]=g;g=+h[b>>3];n=+h[a>>3];if(!(g<n)){r=q+3|0;i=f;return r|0}h[a>>3]=g;h[b>>3]=n;r=q+4|0;i=f;return r|0}function ld(){var a=0;a=i;c[2]=0;c[12>>2]=0;c[16>>2]=0;Zb(111,8,p|0)|0;i=a;return}function md(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,C=0.0,D=0,E=0,F=0,G=0.0,H=0,I=0,J=0.0,K=0,L=0,M=0,N=0.0,O=0,P=0,Q=0.0,R=0,S=0,T=0,U=0,V=0,W=0.0,X=0.0,Y=0.0,Z=0,_=0,$=0;d=i;e=a;a=b;a:while(1){b=a;f=a+ -8|0;g=e;b:while(1){j=g;k=b-j|0;l=k>>3;switch(l|0){case 5:{m=26;break a;break};case 3:{m=6;break a;break};case 1:case 0:{m=84;break a;break};case 2:{m=4;break a;break};case 4:{m=14;break a;break};default:{}}if((k|0)<248){m=28;break a}n=(l|0)/2|0;o=g+(n<<3)|0;do{if((k|0)>7992){p=(l|0)/4|0;q=kd(g,g+(p<<3)|0,o,g+(p+n<<3)|0,f,0)|0}else{r=+h[o>>3];s=+h[g>>3];t=+h[f>>3];p=t<r;if(!(r<s)){if(!p){q=0;break}h[o>>3]=t;h[f>>3]=r;u=+h[o>>3];v=+h[g>>3];if(!(u<v)){q=1;break}h[g>>3]=u;h[o>>3]=v;q=2;break}if(p){h[g>>3]=t;h[f>>3]=s;q=1;break}h[g>>3]=r;h[o>>3]=s;r=+h[f>>3];if(!(r<s)){q=1;break}h[o>>3]=r;h[f>>3]=s;q=2}}while(0);s=+h[g>>3];r=+h[o>>3];do{if(s<r){w=f;x=q}else{n=f;while(1){y=n+ -8|0;if((g|0)==(y|0)){break}z=+h[y>>3];if(z<r){m=67;break}else{n=y}}if((m|0)==67){m=0;h[g>>3]=z;h[y>>3]=s;w=y;x=q+1|0;break}n=g+8|0;t=+h[f>>3];if(s<t){A=n}else{if((n|0)==(f|0)){m=84;break a}else{B=n}while(1){C=+h[B>>3];D=B+8|0;if(s<C){break}if((D|0)==(f|0)){m=84;break a}else{B=D}}h[B>>3]=t;h[f>>3]=C;A=D}if((A|0)==(f|0)){m=84;break a}else{E=A;F=f}while(1){v=+h[g>>3];n=E;while(1){G=+h[n>>3];H=n+8|0;if(v<G){I=F;break}else{n=H}}do{I=I+ -8|0;J=+h[I>>3];}while(v<J);if(!(n>>>0<I>>>0)){g=n;continue b}h[n>>3]=J;h[I>>3]=G;E=H;F=I}}}while(0);l=g+8|0;c:do{if(l>>>0<w>>>0){k=l;p=w;K=o;L=x;while(1){s=+h[K>>3];M=k;while(1){N=+h[M>>3];O=M+8|0;if(N<s){M=O}else{P=p;break}}do{P=P+ -8|0;Q=+h[P>>3];}while(!(Q<s));if(M>>>0>P>>>0){R=M;S=K;T=L;break c}h[M>>3]=Q;h[P>>3]=N;k=O;p=P;K=(K|0)==(M|0)?P:K;L=L+1|0}}else{R=l;S=o;T=x}}while(0);do{if((R|0)==(S|0)){U=T}else{s=+h[S>>3];r=+h[R>>3];if(!(s<r)){U=T;break}h[R>>3]=s;h[S>>3]=r;U=T+1|0}}while(0);if((U|0)==0){V=nd(g,R,0)|0;o=R+8|0;if(nd(o,a,0)|0){m=79;break}if(V){g=o;continue}}o=R;if((o-j|0)>=(b-o|0)){m=83;break}md(g,R,c);g=R+8|0}if((m|0)==79){m=0;if(V){m=84;break}else{e=g;a=R;continue}}else if((m|0)==83){m=0;md(R+8|0,a,c);e=g;a=R;continue}}if((m|0)==4){N=+h[f>>3];Q=+h[g>>3];if(!(N<Q)){i=d;return}h[g>>3]=N;h[f>>3]=Q;i=d;return}else if((m|0)==6){R=g+8|0;Q=+h[R>>3];N=+h[g>>3];G=+h[f>>3];e=G<Q;if(!(Q<N)){if(!e){i=d;return}h[R>>3]=G;h[f>>3]=Q;J=+h[R>>3];C=+h[g>>3];if(!(J<C)){i=d;return}h[g>>3]=J;h[R>>3]=C;i=d;return}if(e){h[g>>3]=G;h[f>>3]=N;i=d;return}h[g>>3]=Q;h[R>>3]=N;Q=+h[f>>3];if(!(Q<N)){i=d;return}h[R>>3]=Q;h[f>>3]=N;i=d;return}else if((m|0)==14){R=g+8|0;e=g+16|0;N=+h[R>>3];Q=+h[g>>3];G=+h[e>>3];c=G<N;do{if(N<Q){if(c){h[g>>3]=G;h[e>>3]=Q;W=Q;break}h[g>>3]=N;h[R>>3]=Q;if(!(G<Q)){W=G;break}h[R>>3]=G;h[e>>3]=Q;W=Q}else{if(!c){W=G;break}h[R>>3]=G;h[e>>3]=N;if(!(G<Q)){W=N;break}h[g>>3]=G;h[R>>3]=Q;W=N}}while(0);N=+h[f>>3];if(!(N<W)){i=d;return}h[e>>3]=N;h[f>>3]=W;W=+h[e>>3];N=+h[R>>3];if(!(W<N)){i=d;return}h[R>>3]=W;h[e>>3]=N;N=+h[g>>3];if(!(W<N)){i=d;return}h[g>>3]=W;h[R>>3]=N;i=d;return}else if((m|0)==26){kd(g,g+8|0,g+16|0,g+24|0,f,0)|0;i=d;return}else if((m|0)==28){f=g+16|0;R=g+8|0;N=+h[R>>3];W=+h[g>>3];Q=+h[f>>3];e=Q<N;do{if(N<W){if(e){h[g>>3]=Q;h[f>>3]=W;X=W;break}h[g>>3]=N;h[R>>3]=W;if(!(Q<W)){X=Q;break}h[R>>3]=Q;h[f>>3]=W;X=W}else{if(!e){X=Q;break}h[R>>3]=Q;h[f>>3]=N;if(!(Q<W)){X=N;break}h[g>>3]=Q;h[R>>3]=W;X=N}}while(0);R=g+24|0;if((R|0)==(a|0)){i=d;return}else{Y=X;Z=R;_=f}while(1){X=+h[Z>>3];if(X<Y){N=Y;f=Z;R=_;while(1){h[f>>3]=N;if((R|0)==(g|0)){$=g;break}e=R+ -8|0;W=+h[e>>3];if(X<W){c=R;N=W;R=e;f=c}else{$=R;break}}h[$>>3]=X}R=Z+8|0;if((R|0)==(a|0)){break}f=Z;Y=+h[Z>>3];Z=R;_=f}i=d;return}else if((m|0)==84){i=d;return}}function nd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0,f=0.0,g=0,j=0,k=0.0,l=0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0;c=i;switch(b-a>>3|0){case 2:{d=b+ -8|0;e=+h[d>>3];f=+h[a>>3];if(!(e<f)){g=1;i=c;return g|0}h[a>>3]=e;h[d>>3]=f;g=1;i=c;return g|0};case 3:{d=a+8|0;j=b+ -8|0;f=+h[d>>3];e=+h[a>>3];k=+h[j>>3];l=k<f;if(!(f<e)){if(!l){g=1;i=c;return g|0}h[d>>3]=k;h[j>>3]=f;m=+h[d>>3];n=+h[a>>3];if(!(m<n)){g=1;i=c;return g|0}h[a>>3]=m;h[d>>3]=n;g=1;i=c;return g|0}if(l){h[a>>3]=k;h[j>>3]=e;g=1;i=c;return g|0}h[a>>3]=f;h[d>>3]=e;f=+h[j>>3];if(!(f<e)){g=1;i=c;return g|0}h[d>>3]=f;h[j>>3]=e;g=1;i=c;return g|0};case 4:{j=a+8|0;d=a+16|0;l=b+ -8|0;e=+h[j>>3];f=+h[a>>3];k=+h[d>>3];o=k<e;do{if(e<f){if(o){h[a>>3]=k;h[d>>3]=f;p=f;break}h[a>>3]=e;h[j>>3]=f;if(!(k<f)){p=k;break}h[j>>3]=k;h[d>>3]=f;p=f}else{if(!o){p=k;break}h[j>>3]=k;h[d>>3]=e;if(!(k<f)){p=e;break}h[a>>3]=k;h[j>>3]=f;p=e}}while(0);e=+h[l>>3];if(!(e<p)){g=1;i=c;return g|0}h[d>>3]=e;h[l>>3]=p;p=+h[d>>3];e=+h[j>>3];if(!(p<e)){g=1;i=c;return g|0}h[j>>3]=p;h[d>>3]=e;e=+h[a>>3];if(!(p<e)){g=1;i=c;return g|0}h[a>>3]=p;h[j>>3]=e;g=1;i=c;return g|0};case 5:{kd(a,a+8|0,a+16|0,a+24|0,b+ -8|0,0)|0;g=1;i=c;return g|0};case 1:case 0:{g=1;i=c;return g|0};default:{j=a+16|0;d=a+8|0;e=+h[d>>3];p=+h[a>>3];f=+h[j>>3];l=f<e;do{if(e<p){if(l){h[a>>3]=f;h[j>>3]=p;q=p;break}h[a>>3]=e;h[d>>3]=p;if(!(f<p)){q=f;break}h[d>>3]=f;h[j>>3]=p;q=p}else{if(!l){q=f;break}h[d>>3]=f;h[j>>3]=e;if(!(f<p)){q=e;break}h[a>>3]=f;h[d>>3]=p;q=e}}while(0);d=a+24|0;if((d|0)==(b|0)){g=1;i=c;return g|0}else{r=q;s=0;t=d;u=j}while(1){q=+h[t>>3];if(q<r){e=r;j=t;d=u;while(1){h[j>>3]=e;if((d|0)==(a|0)){v=a;break}l=d+ -8|0;p=+h[l>>3];if(q<p){o=d;e=p;d=l;j=o}else{v=d;break}}h[v>>3]=q;d=s+1|0;if((d|0)==8){break}else{w=d}}else{w=s}d=t+8|0;if((d|0)==(b|0)){g=1;x=41;break}j=t;r=+h[t>>3];s=w;t=d;u=j}if((x|0)==41){i=c;return g|0}g=(t+8|0)==(b|0);i=c;return g|0}}return 0}function od(a){a=a|0;var b=0;a=i;b=(c[6]|0)+ -1|0;c[6]=b;if((b|0)!=0){i=a;return}zb(32)|0;i=a;return}function pd(b){b=b|0;var d=0,e=0,f=0,g=0;b=i;do{if((a[2560]|0)==0){if((Ma(2560)|0)==0){break}c[14]=5489;d=5489;e=1;do{d=(ea(d>>>30^d,1812433253)|0)+e|0;c[56+(e<<2)>>2]=d;e=e+1|0;}while((e|0)!=624);c[2552>>2]=0;Za(2560)}}while(0);e=c[2552>>2]|0;d=((e+1|0)>>>0)%624|0;f=56+(e<<2)|0;g=c[56+(d<<2)>>2]|0;c[f>>2]=0-(g&1)&-1727483681^c[56+((((e+397|0)>>>0)%624|0)<<2)>>2]^(g&2147483646|c[f>>2]&-2147483648)>>>1;f=c[56+(c[2552>>2]<<2)>>2]|0;g=f>>>11^f;c[2552>>2]=d;d=g<<7&-1658038656^g;g=d<<15&-272236544^d;i=b;return g>>>18^g|0}function qd(a){a=a|0;a=i;cb(32)|0;c[6]=1;i=a;return}function rd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;b=i;i=i+32|0;d=b;e=b+8|0;f=b+16|0;g=b+24|0;h=c[r>>2]|0;Nd(3280,h,3336);c[642]=4708;c[2576>>2]=4728;c[2572>>2]=0;Qe(2576|0,3280);c[2648>>2]=0;c[2652>>2]=-1;j=c[s>>2]|0;c[846]=4576;Uj(3388|0);c[3392>>2]=0;c[3396>>2]=0;c[3400>>2]=0;c[3404>>2]=0;c[3408>>2]=0;c[3412>>2]=0;c[846]=3896;c[3416>>2]=j;Vj(g,3388|0);k=Xj(g,7368)|0;l=k;Wj(g);c[3420>>2]=l;c[3424>>2]=3344;a[3428|0]=(kc[c[(c[k>>2]|0)+28>>2]&63](l)|0)&1;c[664]=4788;c[2660>>2]=4808;Qe(2660|0,3384);c[2732>>2]=0;c[2736>>2]=-1;l=c[q>>2]|0;c[858]=4576;Uj(3436|0);c[3440>>2]=0;c[3444>>2]=0;c[3448>>2]=0;c[3452>>2]=0;c[3456>>2]=0;c[3460>>2]=0;c[858]=3896;c[3464>>2]=l;Vj(f,3436|0);k=Xj(f,7368)|0;g=k;Wj(f);c[3468>>2]=g;c[3472>>2]=3352;a[3476|0]=(kc[c[(c[k>>2]|0)+28>>2]&63](g)|0)&1;c[686]=4788;c[2748>>2]=4808;Qe(2748|0,3432);c[2820>>2]=0;c[2824>>2]=-1;g=c[(c[(c[686]|0)+ -12>>2]|0)+2768>>2]|0;c[708]=4788;c[2836>>2]=4808;Qe(2836|0,g);c[2908>>2]=0;c[2912>>2]=-1;c[(c[(c[642]|0)+ -12>>2]|0)+2640>>2]=2656;g=(c[(c[686]|0)+ -12>>2]|0)+2748|0;c[g>>2]=c[g>>2]|8192;c[(c[(c[686]|0)+ -12>>2]|0)+2816>>2]=2656;zd(3480,h,3360|0);c[730]=4748;c[2928>>2]=4768;c[2924>>2]=0;Qe(2928|0,3480);c[3e3>>2]=0;c[3004>>2]=-1;c[884]=4640;Uj(3540|0);c[3544>>2]=0;c[3548>>2]=0;c[3552>>2]=0;c[3556>>2]=0;c[3560>>2]=0;c[3564>>2]=0;c[884]=3640;c[3568>>2]=j;Vj(e,3540|0);j=Xj(e,7376)|0;h=j;Wj(e);c[3572>>2]=h;c[3576>>2]=3368;a[3580|0]=(kc[c[(c[j>>2]|0)+28>>2]&63](h)|0)&1;c[752]=4828;c[3012>>2]=4848;Qe(3012|0,3536);c[3084>>2]=0;c[3088>>2]=-1;c[896]=4640;Uj(3588|0);c[3592>>2]=0;c[3596>>2]=0;c[3600>>2]=0;c[3604>>2]=0;c[3608>>2]=0;c[3612>>2]=0;c[896]=3640;c[3616>>2]=l;Vj(d,3588|0);l=Xj(d,7376)|0;h=l;Wj(d);c[3620>>2]=h;c[3624>>2]=3376;a[3628|0]=(kc[c[(c[l>>2]|0)+28>>2]&63](h)|0)&1;c[774]=4828;c[3100>>2]=4848;Qe(3100|0,3584);c[3172>>2]=0;c[3176>>2]=-1;h=c[(c[(c[774]|0)+ -12>>2]|0)+3120>>2]|0;c[796]=4828;c[3188>>2]=4848;Qe(3188|0,h);c[3260>>2]=0;c[3264>>2]=-1;c[(c[(c[730]|0)+ -12>>2]|0)+2992>>2]=3008;h=(c[(c[774]|0)+ -12>>2]|0)+3100|0;c[h>>2]=c[h>>2]|8192;c[(c[(c[774]|0)+ -12>>2]|0)+3168>>2]=3008;i=b;return}function sd(a){a=a|0;a=i;wf(2656)|0;wf(2832)|0;Bf(3008)|0;Bf(3184)|0;i=a;return}function td(a){a=a|0;var b=0;b=i;c[a>>2]=4640;Wj(a+4|0);i=b;return}function ud(a){a=a|0;var b=0;b=i;c[a>>2]=4640;Wj(a+4|0);Om(a);i=b;return}function vd(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;kc[c[(c[b>>2]|0)+24>>2]&63](b)|0;f=Xj(d,7376)|0;d=f;c[b+36>>2]=d;a[b+44|0]=(kc[c[(c[f>>2]|0)+28>>2]&63](d)|0)&1;i=e;return}function wd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;i=i+16|0;d=b;e=b+8|0;f=a+36|0;g=a+40|0;h=d;j=d+8|0;k=d;d=a+32|0;while(1){a=c[f>>2]|0;l=uc[c[(c[a>>2]|0)+20>>2]&15](a,c[g>>2]|0,h,j,e)|0;a=(c[e>>2]|0)-k|0;if((Ub(h|0,1,a|0,c[d>>2]|0)|0)!=(a|0)){m=-1;n=5;break}if((l|0)==2){m=-1;n=5;break}else if((l|0)!=1){n=4;break}}if((n|0)==4){m=((Ya(c[d>>2]|0)|0)!=0)<<31>>31;i=b;return m|0}else if((n|0)==5){i=b;return m|0}return 0}function xd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;if((a[b+44|0]|0)!=0){g=Ub(d|0,4,e|0,c[b+32>>2]|0)|0;i=f;return g|0}h=b;if((e|0)>0){j=d;k=0}else{g=0;i=f;return g|0}while(1){if((tc[c[(c[h>>2]|0)+52>>2]&15](b,c[j>>2]|0)|0)==-1){g=k;l=6;break}d=k+1|0;if((d|0)<(e|0)){j=j+4|0;k=d}else{g=d;l=6;break}}if((l|0)==6){i=f;return g|0}return 0}function yd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=(d|0)==-1;a:do{if(!k){c[g>>2]=d;if((a[b+44|0]|0)!=0){if((Ub(g|0,4,1,c[b+32>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}m=f;c[h>>2]=m;n=g+4|0;o=b+36|0;p=b+40|0;q=f+8|0;r=f;s=b+32|0;t=g;while(1){u=c[o>>2]|0;v=pc[c[(c[u>>2]|0)+12>>2]&15](u,c[p>>2]|0,t,n,j,m,q,h)|0;if((c[j>>2]|0)==(t|0)){l=-1;w=12;break}if((v|0)==3){w=7;break}u=(v|0)==1;if(!(v>>>0<2)){l=-1;w=12;break}v=(c[h>>2]|0)-r|0;if((Ub(m|0,1,v|0,c[s>>2]|0)|0)!=(v|0)){l=-1;w=12;break}if(u){t=u?c[j>>2]|0:t}else{break a}}if((w|0)==7){if((Ub(t|0,1,1,c[s>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}else if((w|0)==12){i=e;return l|0}}}while(0);l=k?0:d;i=e;return l|0}function zd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+8|0;g=f;h=b;c[h>>2]=4640;j=b+4|0;Uj(j);k=b+8|0;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[h>>2]=3752;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=-1;a[b+52|0]=0;Vj(g,j);j=Xj(g,7376)|0;e=j;d=b+36|0;c[d>>2]=e;h=b+44|0;c[h>>2]=kc[c[(c[j>>2]|0)+24>>2]&63](e)|0;e=c[d>>2]|0;a[b+53|0]=(kc[c[(c[e>>2]|0)+28>>2]&63](e)|0)&1;if((c[h>>2]|0)>8){fj(3848)}else{Wj(g);i=f;return}}function Ad(a){a=a|0;var b=0;b=i;c[a>>2]=4640;Wj(a+4|0);i=b;return}function Bd(a){a=a|0;var b=0;b=i;c[a>>2]=4640;Wj(a+4|0);Om(a);i=b;return}function Cd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;f=Xj(d,7376)|0;d=f;g=b+36|0;c[g>>2]=d;h=b+44|0;c[h>>2]=kc[c[(c[f>>2]|0)+24>>2]&63](d)|0;d=c[g>>2]|0;a[b+53|0]=(kc[c[(c[d>>2]|0)+28>>2]&63](d)|0)&1;if((c[h>>2]|0)>8){fj(3848)}else{i=e;return}}function Dd(a){a=a|0;var b=0,c=0;b=i;c=Gd(a,0)|0;i=b;return c|0}function Ed(a){a=a|0;var b=0,c=0;b=i;c=Gd(a,1)|0;i=b;return c|0}function Fd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;l=(a[k]|0)!=0;if((d|0)==-1){if(l){m=-1;i=e;return m|0}n=c[b+48>>2]|0;a[k]=(n|0)!=-1|0;m=n;i=e;return m|0}n=b+48|0;a:do{if(l){c[h>>2]=c[n>>2];o=c[b+36>>2]|0;p=f;q=pc[c[(c[o>>2]|0)+12>>2]&15](o,c[b+40>>2]|0,h,h+4|0,j,p,f+8|0,g)|0;if((q|0)==3){a[p]=c[n>>2];c[g>>2]=f+1}else if((q|0)==1|(q|0)==2){m=-1;i=e;return m|0}q=b+32|0;while(1){o=c[g>>2]|0;if(!(o>>>0>p>>>0)){break a}r=o+ -1|0;c[g>>2]=r;if((Qa(a[r]|0,c[q>>2]|0)|0)==-1){m=-1;break}}i=e;return m|0}}while(0);c[n>>2]=d;a[k]=1;m=d;i=e;return m|0}function Gd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;if((a[k]|0)!=0){l=b+48|0;m=c[l>>2]|0;if(!d){n=m;i=e;return n|0}c[l>>2]=-1;a[k]=0;n=m;i=e;return n|0}m=c[b+44>>2]|0;k=(m|0)>1?m:1;a:do{if((k|0)>0){m=b+32|0;l=0;while(1){o=Mb(c[m>>2]|0)|0;if((o|0)==-1){n=-1;break}a[f+l|0]=o;l=l+1|0;if((l|0)>=(k|0)){break a}}i=e;return n|0}}while(0);b:do{if((a[b+53|0]|0)==0){l=b+40|0;m=b+36|0;o=f;p=g+4|0;q=b+32|0;r=k;while(1){s=c[l>>2]|0;t=s;u=c[t>>2]|0;v=c[t+4>>2]|0;t=c[m>>2]|0;w=f+r|0;x=pc[c[(c[t>>2]|0)+16>>2]&15](t,s,o,w,h,g,p,j)|0;if((x|0)==2){n=-1;y=22;break}else if((x|0)==3){y=14;break}else if((x|0)!=1){z=r;break b}x=c[l>>2]|0;c[x>>2]=u;c[x+4>>2]=v;if((r|0)==8){n=-1;y=22;break}v=Mb(c[q>>2]|0)|0;if((v|0)==-1){n=-1;y=22;break}a[w]=v;r=r+1|0}if((y|0)==14){c[g>>2]=a[o]|0;z=r;break}else if((y|0)==22){i=e;return n|0}}else{c[g>>2]=a[f]|0;z=k}}while(0);if(d){d=c[g>>2]|0;c[b+48>>2]=d;n=d;i=e;return n|0}d=b+32|0;b=z;while(1){if((b|0)<=0){break}z=b+ -1|0;if((Qa(a[f+z|0]|0,c[d>>2]|0)|0)==-1){n=-1;y=22;break}else{b=z}}if((y|0)==22){i=e;return n|0}n=c[g>>2]|0;i=e;return n|0}function Hd(a){a=a|0;var b=0;b=i;c[a>>2]=4576;Wj(a+4|0);i=b;return}function Id(a){a=a|0;var b=0;b=i;c[a>>2]=4576;Wj(a+4|0);Om(a);i=b;return}function Jd(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;kc[c[(c[b>>2]|0)+24>>2]&63](b)|0;f=Xj(d,7368)|0;d=f;c[b+36>>2]=d;a[b+44|0]=(kc[c[(c[f>>2]|0)+28>>2]&63](d)|0)&1;i=e;return}function Kd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;i=i+16|0;d=b;e=b+8|0;f=a+36|0;g=a+40|0;h=d;j=d+8|0;k=d;d=a+32|0;while(1){a=c[f>>2]|0;l=uc[c[(c[a>>2]|0)+20>>2]&15](a,c[g>>2]|0,h,j,e)|0;a=(c[e>>2]|0)-k|0;if((Ub(h|0,1,a|0,c[d>>2]|0)|0)!=(a|0)){m=-1;n=5;break}if((l|0)==2){m=-1;n=5;break}else if((l|0)!=1){n=4;break}}if((n|0)==4){m=((Ya(c[d>>2]|0)|0)!=0)<<31>>31;i=b;return m|0}else if((n|0)==5){i=b;return m|0}return 0}function Ld(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;if((a[b+44|0]|0)!=0){h=Ub(e|0,1,f|0,c[b+32>>2]|0)|0;i=g;return h|0}j=b;if((f|0)>0){k=e;l=0}else{h=0;i=g;return h|0}while(1){if((tc[c[(c[j>>2]|0)+52>>2]&15](b,d[k]|0)|0)==-1){h=l;m=6;break}e=l+1|0;if((e|0)<(f|0)){k=k+1|0;l=e}else{h=e;m=6;break}}if((m|0)==6){i=g;return h|0}return 0}function Md(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=(d|0)==-1;a:do{if(!k){a[g]=d;if((a[b+44|0]|0)!=0){if((Ub(g|0,1,1,c[b+32>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}m=f;c[h>>2]=m;n=g+1|0;o=b+36|0;p=b+40|0;q=f+8|0;r=f;s=b+32|0;t=g;while(1){u=c[o>>2]|0;v=pc[c[(c[u>>2]|0)+12>>2]&15](u,c[p>>2]|0,t,n,j,m,q,h)|0;if((c[j>>2]|0)==(t|0)){l=-1;w=12;break}if((v|0)==3){w=7;break}u=(v|0)==1;if(!(v>>>0<2)){l=-1;w=12;break}v=(c[h>>2]|0)-r|0;if((Ub(m|0,1,v|0,c[s>>2]|0)|0)!=(v|0)){l=-1;w=12;break}if(u){t=u?c[j>>2]|0:t}else{break a}}if((w|0)==7){if((Ub(t|0,1,1,c[s>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}else if((w|0)==12){i=e;return l|0}}}while(0);l=k?0:d;i=e;return l|0}function Nd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+8|0;g=f;h=b;c[h>>2]=4576;j=b+4|0;Uj(j);k=b+8|0;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[h>>2]=4008;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=-1;a[b+52|0]=0;Vj(g,j);j=Xj(g,7368)|0;e=j;d=b+36|0;c[d>>2]=e;h=b+44|0;c[h>>2]=kc[c[(c[j>>2]|0)+24>>2]&63](e)|0;e=c[d>>2]|0;a[b+53|0]=(kc[c[(c[e>>2]|0)+28>>2]&63](e)|0)&1;if((c[h>>2]|0)>8){fj(3848)}else{Wj(g);i=f;return}}function Od(a){a=a|0;var b=0;b=i;c[a>>2]=4576;Wj(a+4|0);i=b;return}function Pd(a){a=a|0;var b=0;b=i;c[a>>2]=4576;Wj(a+4|0);Om(a);i=b;return}function Qd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;f=Xj(d,7368)|0;d=f;g=b+36|0;c[g>>2]=d;h=b+44|0;c[h>>2]=kc[c[(c[f>>2]|0)+24>>2]&63](d)|0;d=c[g>>2]|0;a[b+53|0]=(kc[c[(c[d>>2]|0)+28>>2]&63](d)|0)&1;if((c[h>>2]|0)>8){fj(3848)}else{i=e;return}}function Rd(a){a=a|0;var b=0,c=0;b=i;c=Ud(a,0)|0;i=b;return c|0}function Sd(a){a=a|0;var b=0,c=0;b=i;c=Ud(a,1)|0;i=b;return c|0}function Td(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;l=(a[k]|0)!=0;if((d|0)==-1){if(l){m=-1;i=e;return m|0}n=c[b+48>>2]|0;a[k]=(n|0)!=-1|0;m=n;i=e;return m|0}n=b+48|0;a:do{if(l){a[h]=c[n>>2];o=c[b+36>>2]|0;p=f;q=pc[c[(c[o>>2]|0)+12>>2]&15](o,c[b+40>>2]|0,h,h+1|0,j,p,f+8|0,g)|0;if((q|0)==3){a[p]=c[n>>2];c[g>>2]=f+1}else if((q|0)==1|(q|0)==2){m=-1;i=e;return m|0}q=b+32|0;while(1){o=c[g>>2]|0;if(!(o>>>0>p>>>0)){break a}r=o+ -1|0;c[g>>2]=r;if((Qa(a[r]|0,c[q>>2]|0)|0)==-1){m=-1;break}}i=e;return m|0}}while(0);c[n>>2]=d;a[k]=1;m=d;i=e;return m|0}function Ud(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;f=i;i=i+32|0;g=f;h=f+8|0;j=f+16|0;k=f+24|0;l=b+52|0;if((a[l]|0)!=0){m=b+48|0;n=c[m>>2]|0;if(!e){o=n;i=f;return o|0}c[m>>2]=-1;a[l]=0;o=n;i=f;return o|0}n=c[b+44>>2]|0;l=(n|0)>1?n:1;a:do{if((l|0)>0){n=b+32|0;m=0;while(1){p=Mb(c[n>>2]|0)|0;if((p|0)==-1){o=-1;break}a[g+m|0]=p;m=m+1|0;if((m|0)>=(l|0)){break a}}i=f;return o|0}}while(0);b:do{if((a[b+53|0]|0)==0){m=b+40|0;n=b+36|0;p=g;q=h+1|0;r=b+32|0;s=l;while(1){t=c[m>>2]|0;u=t;v=c[u>>2]|0;w=c[u+4>>2]|0;u=c[n>>2]|0;x=g+s|0;y=pc[c[(c[u>>2]|0)+16>>2]&15](u,t,p,x,j,h,q,k)|0;if((y|0)==3){z=14;break}else if((y|0)==2){o=-1;z=23;break}else if((y|0)!=1){A=s;break b}y=c[m>>2]|0;c[y>>2]=v;c[y+4>>2]=w;if((s|0)==8){o=-1;z=23;break}w=Mb(c[r>>2]|0)|0;if((w|0)==-1){o=-1;z=23;break}a[x]=w;s=s+1|0}if((z|0)==14){a[h]=a[p]|0;A=s;break}else if((z|0)==23){i=f;return o|0}}else{a[h]=a[g]|0;A=l}}while(0);do{if(e){l=a[h]|0;c[b+48>>2]=l&255;B=l}else{l=b+32|0;k=A;while(1){if((k|0)<=0){z=21;break}j=k+ -1|0;if((Qa(d[g+j|0]|0,c[l>>2]|0)|0)==-1){o=-1;z=23;break}else{k=j}}if((z|0)==21){B=a[h]|0;break}else if((z|0)==23){i=f;return o|0}}}while(0);o=B&255;i=f;return o|0}function Vd(){var a=0;a=i;rd(0);Zb(112,3272,p|0)|0;i=a;return}function Wd(a){a=a|0;i=i;return}function Xd(a){a=a|0;var b=0;b=a+4|0;c[b>>2]=(c[b>>2]|0)+1;i=i;return}function Yd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;e=c[d>>2]|0;c[d>>2]=e+ -1;if((e|0)!=0){f=0;i=b;return f|0}hc[c[(c[a>>2]|0)+8>>2]&127](a);f=1;i=b;return f|0}function Zd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a>>2]=4152;e=hn(b|0)|0;f=Nm(e+13|0)|0;c[f+4>>2]=e;c[f>>2]=e;g=f+12|0;c[a+4>>2]=g;c[f+8>>2]=0;fn(g|0,b|0,e+1|0)|0;i=d;return}function _d(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=4152;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Pm((c[d>>2]|0)+ -12|0)}Kb(a|0);Om(a);i=b;return}function $d(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=4152;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)>=0){g=a;Kb(g|0);i=b;return}Pm((c[d>>2]|0)+ -12|0);g=a;Kb(g|0);i=b;return}function ae(a){a=a|0;i=i;return c[a+4>>2]|0}function be(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;c[b>>2]=4176;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=hn(f|0)|0;g=Nm(d+13|0)|0;c[g+4>>2]=d;c[g>>2]=d;h=g+12|0;c[b+4>>2]=h;c[g+8>>2]=0;fn(h|0,f|0,d+1|0)|0;i=e;return}function ce(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a>>2]=4176;e=hn(b|0)|0;f=Nm(e+13|0)|0;c[f+4>>2]=e;c[f>>2]=e;g=f+12|0;c[a+4>>2]=g;c[f+8>>2]=0;fn(g|0,b|0,e+1|0)|0;i=d;return}function de(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=4176;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Pm((c[d>>2]|0)+ -12|0)}Kb(a|0);Om(a);i=b;return}function ee(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=4176;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)>=0){g=a;Kb(g|0);i=b;return}Pm((c[d>>2]|0)+ -12|0);g=a;Kb(g|0);i=b;return}function fe(a){a=a|0;i=i;return c[a+4>>2]|0}function ge(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=4152;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Pm((c[d>>2]|0)+ -12|0)}Kb(a|0);Om(a);i=b;return}function he(a){a=a|0;i=i;return}function ie(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=d;c[a+4>>2]=b;i=i;return}function je(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+8|0;f=e;mc[c[(c[a>>2]|0)+12>>2]&3](f,a,b);if((c[f+4>>2]|0)!=(c[d+4>>2]|0)){g=0;i=e;return g|0}g=(c[f>>2]|0)==(c[d>>2]|0);i=e;return g|0}function ke(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b+4>>2]|0)!=(a|0)){f=0;i=e;return f|0}f=(c[b>>2]|0)==(d|0);i=e;return f|0}function le(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;d=i;f=Xb(e|0)|0;e=hn(f|0)|0;if(e>>>0>4294967279){re(0)}if(e>>>0<11){a[b]=e<<1;g=b+1|0;fn(g|0,f|0,e|0)|0;h=g+e|0;a[h]=0;i=d;return}else{j=e+16&-16;k=Mm(j)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=e;g=k;fn(g|0,f|0,e|0)|0;h=g+e|0;a[h]=0;i=d;return}}function me(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+16|0;g=f;h=d;j=c[h>>2]|0;k=e;do{if((j|0)!=0){l=a[k]|0;if((l&1)==0){m=(l&255)>>>1}else{m=c[e+4>>2]|0}if((m|0)==0){n=j}else{Be(e,4328,2)|0;n=c[h>>2]|0}l=c[d+4>>2]|0;mc[c[(c[l>>2]|0)+24>>2]&3](g,l,n);l=g;o=a[l]|0;if((o&1)==0){p=g+1|0;q=(o&255)>>>1}else{p=c[g+8>>2]|0;q=c[g+4>>2]|0}Be(e,p,q)|0;if((a[l]&1)==0){break}Om(c[g+8>>2]|0)}}while(0);g=b;c[g+0>>2]=c[k+0>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;i=f;return}function ne(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;g=f;h=f+16|0;j=hn(e|0)|0;if(j>>>0>4294967279){re(0)}if(j>>>0<11){a[h]=j<<1;k=h+1|0}else{l=j+16&-16;m=Mm(l)|0;c[h+8>>2]=m;c[h>>2]=l|1;c[h+4>>2]=j;k=m}fn(k|0,e|0,j|0)|0;a[k+j|0]=0;me(g,d,h);be(b,g);if(!((a[g]&1)==0)){Om(c[g+8>>2]|0)}if(!((a[h]&1)==0)){Om(c[h+8>>2]|0)}c[b>>2]=4344;h=d;d=c[h+4>>2]|0;g=b+8|0;c[g>>2]=c[h>>2];c[g+4>>2]=d;i=f;return}function oe(a){a=a|0;var b=0;b=i;ee(a);Om(a);i=b;return}function pe(a){a=a|0;var b=0;b=i;ee(a);i=b;return}function qe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;cb(4480)|0;if((c[a>>2]|0)==1){do{Da(4504,4480)|0;}while((c[a>>2]|0)==1)}if((c[a>>2]|0)==0){c[a>>2]=1;zb(4480)|0;hc[d&127](b);cb(4480)|0;c[a>>2]=-1;zb(4480)|0;Qb(4504)|0;i=e;return}else{zb(4480)|0;i=e;return}}function re(a){a=a|0;a=Ta(8)|0;Zd(a,4552);c[a>>2]=4232;Vb(a|0,4272,9)}function se(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;f=d;if((a[f]&1)==0){g=b;c[g+0>>2]=c[f+0>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];i=e;return}f=c[d+8>>2]|0;g=c[d+4>>2]|0;if(g>>>0>4294967279){re(0)}if(g>>>0<11){a[b]=g<<1;h=b+1|0}else{d=g+16&-16;j=Mm(d)|0;c[b+8>>2]=j;c[b>>2]=d|1;c[b+4>>2]=g;h=j}fn(h|0,f|0,g|0)|0;a[h+g|0]=0;i=e;return}function te(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;if(e>>>0>4294967279){re(0)}if(e>>>0<11){a[b]=e<<1;g=b+1|0}else{h=e+16&-16;j=Mm(h)|0;c[b+8>>2]=j;c[b>>2]=h|1;c[b+4>>2]=e;g=j}fn(g|0,d|0,e|0)|0;a[g+e|0]=0;i=f;return}function ue(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;if(d>>>0>4294967279){re(0)}if(d>>>0<11){a[b]=d<<1;g=b+1|0}else{h=d+16&-16;j=Mm(h)|0;c[b+8>>2]=j;c[b>>2]=h|1;c[b+4>>2]=d;g=j}cn(g|0,e|0,d|0)|0;a[g+d|0]=0;i=f;return}function ve(b){b=b|0;var d=0;d=i;if((a[b]&1)==0){i=d;return}Om(c[b+8>>2]|0);i=d;return}function we(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;f=hn(d|0)|0;g=b;h=a[g]|0;if((h&1)==0){j=h;k=10}else{h=c[b>>2]|0;j=h&255;k=(h&-2)+ -1|0}h=(j&1)==0;if(k>>>0<f>>>0){if(h){l=(j&255)>>>1}else{l=c[b+4>>2]|0}Ce(b,k,f-k|0,l,0,l,f,d);i=e;return b|0}if(h){m=b+1|0}else{m=c[b+8>>2]|0}gn(m|0,d|0,f|0)|0;a[m+f|0]=0;if((a[g]&1)==0){a[g]=f<<1;i=e;return b|0}else{c[b+4>>2]=f;i=e;return b|0}return 0}function xe(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;g=b;h=a[g]|0;j=(h&1)==0;if(j){k=(h&255)>>>1}else{k=c[b+4>>2]|0}if(k>>>0<d>>>0){ye(b,d-k|0,e)|0;i=f;return}if(j){a[b+d+1|0]=0;a[g]=d<<1;i=f;return}else{a[(c[b+8>>2]|0)+d|0]=0;c[b+4>>2]=d;i=f;return}}function ye(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;if((d|0)==0){i=f;return b|0}g=b;h=a[g]|0;if((h&1)==0){j=h;k=10}else{h=c[b>>2]|0;j=h&255;k=(h&-2)+ -1|0}if((j&1)==0){l=(j&255)>>>1}else{l=c[b+4>>2]|0}if((k-l|0)>>>0<d>>>0){De(b,k,d-k+l|0,l,l,0,0);m=a[g]|0}else{m=j}if((m&1)==0){n=b+1|0}else{n=c[b+8>>2]|0}cn(n+l|0,e|0,d|0)|0;e=l+d|0;if((a[g]&1)==0){a[g]=e<<1}else{c[b+4>>2]=e}a[n+e|0]=0;i=f;return b|0}function ze(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;if(d>>>0>4294967279){re(0)}f=b;g=a[f]|0;if((g&1)==0){h=g;j=10}else{g=c[b>>2]|0;h=g&255;j=(g&-2)+ -1|0}if((h&1)==0){k=(h&255)>>>1}else{k=c[b+4>>2]|0}g=k>>>0>d>>>0?k:d;if(g>>>0<11){l=10}else{l=(g+16&-16)+ -1|0}if((l|0)==(j|0)){i=e;return}do{if((l|0)==10){m=b+1|0;n=0;o=c[b+8>>2]|0;p=1}else{g=l+1|0;if(l>>>0>j>>>0){q=Mm(g)|0}else{q=Mm(g)|0}if((h&1)==0){m=q;n=1;o=b+1|0;p=0;break}else{m=q;n=1;o=c[b+8>>2]|0;p=1;break}}}while(0);if((h&1)==0){r=(h&255)>>>1}else{r=c[b+4>>2]|0}fn(m|0,o|0,r+1|0)|0;if(p){Om(o)}if(n){c[b>>2]=l+1|1;c[b+4>>2]=k;c[b+8>>2]=m;i=e;return}else{a[f]=k<<1;i=e;return}}function Ae(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b;g=a[f]|0;h=(g&1)!=0;if(h){j=(c[b>>2]&-2)+ -1|0;k=c[b+4>>2]|0}else{j=10;k=(g&255)>>>1}if((k|0)==(j|0)){De(b,j,1,j,j,0,0);if((a[f]&1)==0){l=7}else{l=8}}else{if(h){l=8}else{l=7}}if((l|0)==7){a[f]=(k<<1)+2;m=b+1|0;n=k+1|0;o=m+k|0;a[o]=d;p=m+n|0;a[p]=0;i=e;return}else if((l|0)==8){l=c[b+8>>2]|0;f=k+1|0;c[b+4>>2]=f;m=l;n=f;o=m+k|0;a[o]=d;p=m+n|0;a[p]=0;i=e;return}}function Be(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;g=b;h=a[g]|0;if((h&1)==0){j=10;k=h}else{h=c[b>>2]|0;j=(h&-2)+ -1|0;k=h&255}if((k&1)==0){l=(k&255)>>>1}else{l=c[b+4>>2]|0}if((j-l|0)>>>0<e>>>0){Ce(b,j,e-j+l|0,l,l,0,e,d);i=f;return b|0}if((e|0)==0){i=f;return b|0}if((k&1)==0){m=b+1|0}else{m=c[b+8>>2]|0}fn(m+l|0,d|0,e|0)|0;d=l+e|0;if((a[g]&1)==0){a[g]=d<<1}else{c[b+4>>2]=d}a[m+d|0]=0;i=f;return b|0}function Ce(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;l=i;if((-18-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){m=b+1|0}else{m=c[b+8>>2]|0}do{if(d>>>0<2147483623){n=e+d|0;o=d<<1;p=n>>>0<o>>>0?o:n;if(p>>>0<11){q=11;break}q=p+16&-16}else{q=-17}}while(0);e=Mm(q)|0;if((g|0)!=0){fn(e|0,m|0,g|0)|0}if((j|0)!=0){fn(e+g|0,k|0,j|0)|0}k=f-h|0;if((k|0)!=(g|0)){fn(e+(j+g)|0,m+(h+g)|0,k-g|0)|0}if((d|0)==10){r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+u|0;a[w]=0;i=l;return}Om(m);r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+u|0;a[w]=0;i=l;return}function De(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;if((-17-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){l=b+1|0}else{l=c[b+8>>2]|0}do{if(d>>>0<2147483623){m=e+d|0;n=d<<1;o=m>>>0<n>>>0?n:m;if(o>>>0<11){p=11;break}p=o+16&-16}else{p=-17}}while(0);e=Mm(p)|0;if((g|0)!=0){fn(e|0,l|0,g|0)|0}o=f-h|0;if((o|0)!=(g|0)){fn(e+(j+g)|0,l+(h+g)|0,o-g|0)|0}if((d|0)==10){q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}Om(l);q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}function Ee(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;if(e>>>0>1073741807){re(0)}if(e>>>0<2){a[b]=e<<1;g=b+4|0;im(g,d,e)|0;h=g+(e<<2)|0;c[h>>2]=0;i=f;return}else{j=e+4&-4;k=Mm(j<<2)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=e;g=k;im(g,d,e)|0;h=g+(e<<2)|0;c[h>>2]=0;i=f;return}}function Fe(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;if(d>>>0>1073741807){re(0)}if(d>>>0<2){a[b]=d<<1;g=b+4|0;km(g,e,d)|0;h=g+(d<<2)|0;c[h>>2]=0;i=f;return}else{j=d+4&-4;k=Mm(j<<2)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=d;g=k;km(g,e,d)|0;h=g+(d<<2)|0;c[h>>2]=0;i=f;return}}function Ge(b){b=b|0;var d=0;d=i;if((a[b]&1)==0){i=d;return}Om(c[b+8>>2]|0);i=d;return}function He(a,b){a=a|0;b=b|0;var c=0,d=0;c=i;d=Ie(a,b,hm(b)|0)|0;i=c;return d|0}function Ie(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;g=b;h=a[g]|0;if((h&1)==0){j=1;k=h}else{h=c[b>>2]|0;j=(h&-2)+ -1|0;k=h&255}h=(k&1)==0;if(j>>>0<e>>>0){if(h){l=(k&255)>>>1}else{l=c[b+4>>2]|0}Le(b,j,e-j|0,l,0,l,e,d);i=f;return b|0}if(h){m=b+4|0}else{m=c[b+8>>2]|0}jm(m,d,e)|0;c[m+(e<<2)>>2]=0;if((a[g]&1)==0){a[g]=e<<1;i=f;return b|0}else{c[b+4>>2]=e;i=f;return b|0}return 0}function Je(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;if(d>>>0>1073741807){re(0)}f=b;g=a[f]|0;if((g&1)==0){h=g;j=1}else{g=c[b>>2]|0;h=g&255;j=(g&-2)+ -1|0}if((h&1)==0){k=(h&255)>>>1}else{k=c[b+4>>2]|0}g=k>>>0>d>>>0?k:d;if(g>>>0<2){l=1}else{l=(g+4&-4)+ -1|0}if((l|0)==(j|0)){i=e;return}do{if((l|0)==1){m=b+4|0;n=0;o=c[b+8>>2]|0;p=1}else{g=(l<<2)+4|0;if(l>>>0>j>>>0){q=Mm(g)|0}else{q=Mm(g)|0}g=q;if((h&1)==0){m=g;n=1;o=b+4|0;p=0;break}else{m=g;n=1;o=c[b+8>>2]|0;p=1;break}}}while(0);if((h&1)==0){r=(h&255)>>>1}else{r=c[b+4>>2]|0}im(m,o,r+1|0)|0;if(p){Om(o)}if(n){c[b>>2]=l+1|1;c[b+4>>2]=k;c[b+8>>2]=m;i=e;return}else{a[f]=k<<1;i=e;return}}function Ke(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b;g=a[f]|0;h=(g&1)!=0;if(h){j=(c[b>>2]&-2)+ -1|0;k=c[b+4>>2]|0}else{j=1;k=(g&255)>>>1}if((k|0)==(j|0)){Me(b,j,1,j,j,0,0);if((a[f]&1)==0){l=7}else{l=8}}else{if(h){l=8}else{l=7}}if((l|0)==7){a[f]=(k<<1)+2;m=b+4|0;n=k+1|0;o=m+(k<<2)|0;c[o>>2]=d;p=m+(n<<2)|0;c[p>>2]=0;i=e;return}else if((l|0)==8){l=c[b+8>>2]|0;f=k+1|0;c[b+4>>2]=f;m=l;n=f;o=m+(k<<2)|0;c[o>>2]=d;p=m+(n<<2)|0;c[p>>2]=0;i=e;return}}function Le(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;l=i;if((1073741806-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){m=b+4|0}else{m=c[b+8>>2]|0}do{if(d>>>0<536870887){n=e+d|0;o=d<<1;p=n>>>0<o>>>0?o:n;if(p>>>0<2){q=2;break}q=p+4&-4}else{q=1073741807}}while(0);e=Mm(q<<2)|0;if((g|0)!=0){im(e,m,g)|0}if((j|0)!=0){im(e+(g<<2)|0,k,j)|0}k=f-h|0;if((k|0)!=(g|0)){im(e+(j+g<<2)|0,m+(h+g<<2)|0,k-g|0)|0}if((d|0)==1){r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+(u<<2)|0;c[w>>2]=0;i=l;return}Om(m);r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+(u<<2)|0;c[w>>2]=0;i=l;return}function Me(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;if((1073741807-d|0)>>>0<e>>>0){re(0)}if((a[b]&1)==0){l=b+4|0}else{l=c[b+8>>2]|0}do{if(d>>>0<536870887){m=e+d|0;n=d<<1;o=m>>>0<n>>>0?n:m;if(o>>>0<2){p=2;break}p=o+4&-4}else{p=1073741807}}while(0);e=Mm(p<<2)|0;if((g|0)!=0){im(e,l,g)|0}o=f-h|0;if((o|0)!=(g|0)){im(e+(j+g<<2)|0,l+(h+g<<2)|0,o-g|0)|0}if((d|0)==1){q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}Om(l);q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}function Ne(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e;g=e+8|0;h=(c[b+24>>2]|0)==0;if(h){c[b+16>>2]=d|1}else{c[b+16>>2]=d}if(((h&1|d)&c[b+20>>2]|0)==0){i=e;return}e=Ta(16)|0;do{if((a[4920]|0)==0){if((Ma(4920)|0)==0){break}c[1228]=5616;Zb(40,4912,p|0)|0;Za(4920)}}while(0);b=e;d=g;c[d>>2]=1;c[d+4>>2]=4912;d=f;h=g;c[d+0>>2]=c[h+0>>2];c[d+4>>2]=c[h+4>>2];ne(b,f,4968);c[e>>2]=4936;Vb(e|0,5016,36)}function Oe(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=4960;d=c[a+40>>2]|0;e=a+32|0;f=a+36|0;if((d|0)!=0){g=d;do{g=g+ -1|0;mc[c[(c[e>>2]|0)+(g<<2)>>2]&3](0,a,c[(c[f>>2]|0)+(g<<2)>>2]|0);}while((g|0)!=0)}Wj(a+28|0);Im(c[e>>2]|0);Im(c[f>>2]|0);Im(c[a+48>>2]|0);Im(c[a+60>>2]|0);i=b;return}function Pe(a,b){a=a|0;b=b|0;var c=0;c=i;Vj(a,b+28|0);i=c;return}function Qe(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;c[a+24>>2]=b;c[a+16>>2]=(b|0)==0;c[a+20>>2]=0;c[a+4>>2]=4098;c[a+12>>2]=0;c[a+8>>2]=6;b=a+28|0;e=a+32|0;a=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(a|0));Uj(b);i=d;return}function Re(a){a=a|0;var b=0;b=i;c[a>>2]=4576;Wj(a+4|0);Om(a);i=b;return}function Se(a){a=a|0;var b=0;b=i;c[a>>2]=4576;Wj(a+4|0);i=b;return}function Te(a,b){a=a|0;b=b|0;i=i;return}function Ue(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return a|0}function Ve(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;g=a;c[g>>2]=0;c[g+4>>2]=0;g=a+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=i;return}function We(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a;c[e>>2]=0;c[e+4>>2]=0;e=a+8|0;c[e>>2]=-1;c[e+4>>2]=-1;i=i;return}function Xe(a){a=a|0;i=i;return 0}function Ye(a){a=a|0;i=i;return 0}function Ze(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;g=b;if((e|0)<=0){h=0;i=f;return h|0}j=b+12|0;k=b+16|0;l=d;d=0;while(1){m=c[j>>2]|0;if(m>>>0<(c[k>>2]|0)>>>0){c[j>>2]=m+1;n=a[m]|0}else{m=kc[c[(c[g>>2]|0)+40>>2]&63](b)|0;if((m|0)==-1){h=d;o=8;break}n=m&255}a[l]=n;m=d+1|0;if((m|0)<(e|0)){l=l+1|0;d=m}else{h=m;o=8;break}}if((o|0)==8){i=f;return h|0}return 0}function _e(a){a=a|0;i=i;return-1}function $e(a){a=a|0;var b=0,e=0,f=0;b=i;if((kc[c[(c[a>>2]|0)+36>>2]&63](a)|0)==-1){e=-1;i=b;return e|0}f=a+12|0;a=c[f>>2]|0;c[f>>2]=a+1;e=d[a]|0;i=b;return e|0}function af(a,b){a=a|0;b=b|0;i=i;return-1}function bf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;h=b;if((f|0)<=0){j=0;i=g;return j|0}k=b+24|0;l=b+28|0;m=e;e=0;while(1){n=c[k>>2]|0;if(n>>>0<(c[l>>2]|0)>>>0){o=a[m]|0;c[k>>2]=n+1;a[n]=o}else{if((tc[c[(c[h>>2]|0)+52>>2]&15](b,d[m]|0)|0)==-1){j=e;p=7;break}}o=e+1|0;if((o|0)<(f|0)){m=m+1|0;e=o}else{j=o;p=7;break}}if((p|0)==7){i=g;return j|0}return 0}function cf(a,b){a=a|0;b=b|0;i=i;return-1}function df(a){a=a|0;var b=0;b=i;c[a>>2]=4640;Wj(a+4|0);Om(a);i=b;return}function ef(a){a=a|0;var b=0;b=i;c[a>>2]=4640;Wj(a+4|0);i=b;return}function ff(a,b){a=a|0;b=b|0;i=i;return}function gf(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return a|0}function hf(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;g=a;c[g>>2]=0;c[g+4>>2]=0;g=a+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=i;return}function jf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a;c[e>>2]=0;c[e+4>>2]=0;e=a+8|0;c[e>>2]=-1;c[e+4>>2]=-1;i=i;return}function kf(a){a=a|0;i=i;return 0}function lf(a){a=a|0;i=i;return 0}function mf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=a;if((d|0)<=0){g=0;i=e;return g|0}h=a+12|0;j=a+16|0;k=b;b=0;while(1){l=c[h>>2]|0;if(l>>>0<(c[j>>2]|0)>>>0){c[h>>2]=l+4;m=c[l>>2]|0}else{l=kc[c[(c[f>>2]|0)+40>>2]&63](a)|0;if((l|0)==-1){g=b;n=8;break}else{m=l}}c[k>>2]=m;l=b+1|0;if((l|0)>=(d|0)){g=l;n=8;break}k=k+4|0;b=l}if((n|0)==8){i=e;return g|0}return 0}function nf(a){a=a|0;i=i;return-1}function of(a){a=a|0;var b=0,d=0,e=0;b=i;if((kc[c[(c[a>>2]|0)+36>>2]&63](a)|0)==-1){d=-1;i=b;return d|0}e=a+12|0;a=c[e>>2]|0;c[e>>2]=a+4;d=c[a>>2]|0;i=b;return d|0}function pf(a,b){a=a|0;b=b|0;i=i;return-1}function qf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=a;if((d|0)<=0){g=0;i=e;return g|0}h=a+24|0;j=a+28|0;k=b;b=0;while(1){l=c[h>>2]|0;if(l>>>0<(c[j>>2]|0)>>>0){m=c[k>>2]|0;c[h>>2]=l+4;c[l>>2]=m}else{if((tc[c[(c[f>>2]|0)+52>>2]&15](a,c[k>>2]|0)|0)==-1){g=b;n=8;break}}m=b+1|0;if((m|0)>=(d|0)){g=m;n=8;break}k=k+4|0;b=m}if((n|0)==8){i=e;return g|0}return 0}function rf(a,b){a=a|0;b=b|0;i=i;return-1}function sf(a){a=a|0;var b=0;b=i;Oe(a+8|0);Om(a);i=b;return}function tf(a){a=a|0;var b=0;b=i;Oe(a+8|0);i=b;return}function uf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Oe(d+(e+8)|0);Om(d+e|0);i=b;return}function vf(a){a=a|0;var b=0;b=i;Oe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+8)|0);i=b;return}function wf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+8|0;e=d;f=b;g=c[(c[f>>2]|0)+ -12>>2]|0;h=b;if((c[h+(g+24)>>2]|0)==0){i=d;return b|0}j=e;a[j]=0;c[e+4>>2]=b;do{if((c[h+(g+16)>>2]|0)==0){k=c[h+(g+72)>>2]|0;if((k|0)==0){l=g}else{wf(k)|0;l=c[(c[f>>2]|0)+ -12>>2]|0}a[j]=1;k=c[h+(l+24)>>2]|0;if(!((kc[c[(c[k>>2]|0)+24>>2]&63](k)|0)==-1)){break}k=c[(c[f>>2]|0)+ -12>>2]|0;Ne(h+k|0,c[h+(k+16)>>2]|1)}}while(0);Gf(e);i=d;return b|0}function xf(a){a=a|0;var b=0;b=i;Oe(a+8|0);Om(a);i=b;return}function yf(a){a=a|0;var b=0;b=i;Oe(a+8|0);i=b;return}function zf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Oe(d+(e+8)|0);Om(d+e|0);i=b;return}function Af(a){a=a|0;var b=0;b=i;Oe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+8)|0);i=b;return}function Bf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+8|0;e=d;f=b;g=c[(c[f>>2]|0)+ -12>>2]|0;h=b;if((c[h+(g+24)>>2]|0)==0){i=d;return b|0}j=e;a[j]=0;c[e+4>>2]=b;do{if((c[h+(g+16)>>2]|0)==0){k=c[h+(g+72)>>2]|0;if((k|0)==0){l=g}else{Bf(k)|0;l=c[(c[f>>2]|0)+ -12>>2]|0}a[j]=1;k=c[h+(l+24)>>2]|0;if(!((kc[c[(c[k>>2]|0)+24>>2]&63](k)|0)==-1)){break}k=c[(c[f>>2]|0)+ -12>>2]|0;Ne(h+k|0,c[h+(k+16)>>2]|1)}}while(0);Lf(e);i=d;return b|0}function Cf(a){a=a|0;var b=0;b=i;Oe(a+4|0);Om(a);i=b;return}function Df(a){a=a|0;var b=0;b=i;Oe(a+4|0);i=b;return}function Ef(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Oe(d+(e+4)|0);Om(d+e|0);i=b;return}function Ff(a){a=a|0;var b=0;b=i;Oe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+4)|0);i=b;return}function Gf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;a=c[d>>2]|0;e=c[(c[a>>2]|0)+ -12>>2]|0;f=a;if((c[f+(e+24)>>2]|0)==0){i=b;return}if((c[f+(e+16)>>2]|0)!=0){i=b;return}if((c[f+(e+4)>>2]&8192|0)==0){i=b;return}if(Ua()|0){i=b;return}e=c[d>>2]|0;f=c[e+((c[(c[e>>2]|0)+ -12>>2]|0)+24)>>2]|0;if(!((kc[c[(c[f>>2]|0)+24>>2]&63](f)|0)==-1)){i=b;return}f=c[d>>2]|0;d=c[(c[f>>2]|0)+ -12>>2]|0;e=f;Ne(e+d|0,c[e+(d+16)>>2]|1);i=b;return}function Hf(a){a=a|0;var b=0;b=i;Oe(a+4|0);Om(a);i=b;return}function If(a){a=a|0;var b=0;b=i;Oe(a+4|0);i=b;return}function Jf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Oe(d+(e+4)|0);Om(d+e|0);i=b;return}function Kf(a){a=a|0;var b=0;b=i;Oe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+4)|0);i=b;return}function Lf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;a=c[d>>2]|0;e=c[(c[a>>2]|0)+ -12>>2]|0;f=a;if((c[f+(e+24)>>2]|0)==0){i=b;return}if((c[f+(e+16)>>2]|0)!=0){i=b;return}if((c[f+(e+4)>>2]&8192|0)==0){i=b;return}if(Ua()|0){i=b;return}e=c[d>>2]|0;f=c[e+((c[(c[e>>2]|0)+ -12>>2]|0)+24)>>2]|0;if(!((kc[c[(c[f>>2]|0)+24>>2]&63](f)|0)==-1)){i=b;return}f=c[d>>2]|0;d=c[(c[f>>2]|0)+ -12>>2]|0;e=f;Ne(e+d|0,c[e+(d+16)>>2]|1);i=b;return}function Mf(a){a=a|0;i=i;return 4856}function Nf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=i;if((c|0)==1){te(a,4872,35);i=d;return}else{le(a,b,c);i=d;return}}function Of(a){a=a|0;i=i;return}function Pf(a){a=a|0;var b=0;b=i;pe(a);Om(a);i=b;return}function Qf(a){a=a|0;var b=0;b=i;pe(a);i=b;return}function Rf(a){a=a|0;var b=0;b=i;Oe(a);Om(a);i=b;return}function Sf(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Tf(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Uf(a){a=a|0;i=i;return}function Vf(a){a=a|0;i=i;return}function Wf(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;a:do{if((e|0)==(f|0)){g=c;h=6}else{j=e;k=c;while(1){if((k|0)==(d|0)){l=-1;break a}m=a[k]|0;n=a[j]|0;if(m<<24>>24<n<<24>>24){l=-1;break a}if(n<<24>>24<m<<24>>24){l=1;break a}m=k+1|0;n=j+1|0;if((n|0)==(f|0)){g=m;h=6;break}else{j=n;k=m}}}}while(0);if((h|0)==6){l=(g|0)!=(d|0)|0}i=b;return l|0}function Xf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;d=i;g=e;h=f-g|0;if(h>>>0>4294967279){re(b)}if(h>>>0<11){a[b]=h<<1;j=b+1|0}else{k=h+16&-16;l=Mm(k)|0;c[b+8>>2]=l;c[b>>2]=k|1;c[b+4>>2]=h;j=l}if((e|0)==(f|0)){m=j;a[m]=0;i=d;return}else{n=e;o=j}while(1){a[o]=a[n]|0;e=n+1|0;if((e|0)==(f|0)){break}else{o=o+1|0;n=e}}m=j+(f+(0-g))|0;a[m]=0;i=d;return}function Yf(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;b=i;if((c|0)==(d|0)){e=0;i=b;return e|0}else{f=0;g=c}while(1){c=(a[g]|0)+(f<<4)|0;h=c&-268435456;j=(h>>>24|h)^c;c=g+1|0;if((c|0)==(d|0)){e=j;break}else{g=c;f=j}}i=b;return e|0}function Zf(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function _f(a){a=a|0;i=i;return}function $f(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;a=i;a:do{if((e|0)==(f|0)){g=b;h=6}else{j=e;k=b;while(1){if((k|0)==(d|0)){l=-1;break a}m=c[k>>2]|0;n=c[j>>2]|0;if((m|0)<(n|0)){l=-1;break a}if((n|0)<(m|0)){l=1;break a}m=k+4|0;n=j+4|0;if((n|0)==(f|0)){g=m;h=6;break}else{j=n;k=m}}}}while(0);if((h|0)==6){l=(g|0)!=(d|0)|0}i=a;return l|0}function ag(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;d=i;g=e;h=f-g|0;j=h>>2;if(j>>>0>1073741807){re(b)}if(j>>>0<2){a[b]=h>>>1;k=b+4|0}else{h=j+4&-4;l=Mm(h<<2)|0;c[b+8>>2]=l;c[b>>2]=h|1;c[b+4>>2]=j;k=l}if((e|0)==(f|0)){m=k;c[m>>2]=0;i=d;return}l=f+ -4+(0-g)|0;g=e;e=k;while(1){c[e>>2]=c[g>>2];j=g+4|0;if((j|0)==(f|0)){break}else{e=e+4|0;g=j}}m=k+((l>>>2)+1<<2)|0;c[m>>2]=0;i=d;return}function bg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;a=i;if((b|0)==(d|0)){e=0;i=a;return e|0}else{f=0;g=b}while(1){b=(c[g>>2]|0)+(f<<4)|0;h=b&-268435456;j=(h>>>24|h)^b;b=g+4|0;if((b|0)==(d|0)){e=j;break}else{g=b;f=j}}i=a;return e|0}function cg(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function dg(a){a=a|0;i=i;return}function eg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+136|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=k+40|0;q=k+56|0;r=k+64|0;s=k+72|0;t=k+80|0;u=k+88|0;v=k+96|0;w=k+104|0;x=k+128|0;if((c[g+4>>2]&1|0)==0){c[q>>2]=-1;y=c[(c[d>>2]|0)+16>>2]|0;z=e;c[s>>2]=c[z>>2];c[t>>2]=c[f>>2];A=n;B=s;c[A+0>>2]=c[B+0>>2];B=m;A=t;c[B+0>>2]=c[A+0>>2];fc[y&63](r,d,n,m,g,h,q);m=c[r>>2]|0;c[z>>2]=m;z=c[q>>2]|0;if((z|0)==0){a[j]=0}else if((z|0)==1){a[j]=1}else{a[j]=1;c[h>>2]=4}c[b>>2]=m;i=k;return}Pe(u,g);m=u;u=c[m>>2]|0;if(!((c[1826]|0)==-1)){c[p>>2]=7304;c[p+4>>2]=113;c[p+8>>2]=0;qe(7304,p,114)}p=(c[7308>>2]|0)+ -1|0;z=c[u+8>>2]|0;if(!((c[u+12>>2]|0)-z>>2>>>0>p>>>0)){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}u=c[z+(p<<2)>>2]|0;if((u|0)==0){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}C=u;Yd(c[m>>2]|0)|0;Pe(v,g);g=v;v=c[g>>2]|0;if(!((c[1862]|0)==-1)){c[o>>2]=7448;c[o+4>>2]=113;c[o+8>>2]=0;qe(7448,o,114)}o=(c[7452>>2]|0)+ -1|0;m=c[v+8>>2]|0;if(!((c[v+12>>2]|0)-m>>2>>>0>o>>>0)){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}v=c[m+(o<<2)>>2]|0;if((v|0)==0){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}E=v;Yd(c[g>>2]|0)|0;g=w;F=v;ic[c[(c[F>>2]|0)+24>>2]&63](g,E);ic[c[(c[F>>2]|0)+28>>2]&63](w+12|0,E);c[x>>2]=c[f>>2];f=w+24|0;E=l;F=x;c[E+0>>2]=c[F+0>>2];F=fg(e,l,g,f,C,h,1)|0;a[j]=(F|0)==(g|0)|0;c[b>>2]=c[e>>2];ve(w+12|0);ve(w);i=k;return}function fg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;l=i;i=i+104|0;m=(g-f|0)/12|0;n=l;do{if(m>>>0>100){o=Hm(m)|0;if((o|0)!=0){p=o;q=o;break}Tm()}else{p=0;q=n}}while(0);n=(f|0)==(g|0);if(n){r=0;s=m}else{o=f;t=0;u=m;m=q;while(1){v=a[o]|0;if((v&1)==0){w=(v&255)>>>1}else{w=c[o+4>>2]|0}if((w|0)==0){a[m]=2;x=t+1|0;y=u+ -1|0}else{a[m]=1;x=t;y=u}v=o+12|0;if((v|0)==(g|0)){r=x;s=y;break}else{o=v;t=x;u=y;m=m+1|0}}}m=b;b=e;e=h;y=0;u=r;r=s;a:while(1){s=c[m>>2]|0;do{if((s|0)==0){z=0}else{if((c[s+12>>2]|0)!=(c[s+16>>2]|0)){z=s;break}if((kc[c[(c[s>>2]|0)+36>>2]&63](s)|0)==-1){c[m>>2]=0;z=0;break}else{z=c[m>>2]|0;break}}}while(0);s=(z|0)==0;x=c[b>>2]|0;do{if((x|0)==0){A=0}else{if((c[x+12>>2]|0)!=(c[x+16>>2]|0)){A=x;break}if(!((kc[c[(c[x>>2]|0)+36>>2]&63](x)|0)==-1)){A=x;break}c[b>>2]=0;A=0}}while(0);B=(A|0)==0;C=c[m>>2]|0;if(!((s^B)&(r|0)!=0)){break}x=c[C+12>>2]|0;if((x|0)==(c[C+16>>2]|0)){D=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{D=d[x]|0}x=D&255;if(k){E=x}else{E=tc[c[(c[e>>2]|0)+12>>2]&15](h,x)|0}x=y+1|0;if(n){y=x;r=r;u=u;continue}b:do{if(k){t=0;o=f;w=u;v=r;F=q;while(1){do{if((a[F]|0)==1){G=a[o]|0;H=(G&1)==0;if(H){I=o+1|0}else{I=c[o+8>>2]|0}if(!(E<<24>>24==(a[I+y|0]|0))){a[F]=0;J=t;K=w;L=v+ -1|0;break}if(H){M=(G&255)>>>1}else{M=c[o+4>>2]|0}if((M|0)!=(x|0)){J=1;K=w;L=v;break}a[F]=2;J=1;K=w+1|0;L=v+ -1|0}else{J=t;K=w;L=v}}while(0);G=o+12|0;if((G|0)==(g|0)){N=J;O=K;P=L;break b}t=J;o=G;w=K;v=L;F=F+1|0}}else{F=0;v=f;w=u;o=r;t=q;while(1){do{if((a[t]|0)==1){G=v;if((a[G]&1)==0){Q=v+1|0}else{Q=c[v+8>>2]|0}if(!(E<<24>>24==(tc[c[(c[e>>2]|0)+12>>2]&15](h,a[Q+y|0]|0)|0)<<24>>24)){a[t]=0;R=F;S=w;T=o+ -1|0;break}H=a[G]|0;if((H&1)==0){U=(H&255)>>>1}else{U=c[v+4>>2]|0}if((U|0)!=(x|0)){R=1;S=w;T=o;break}a[t]=2;R=1;S=w+1|0;T=o+ -1|0}else{R=F;S=w;T=o}}while(0);H=v+12|0;if((H|0)==(g|0)){N=R;O=S;P=T;break b}F=R;v=H;w=S;o=T;t=t+1|0}}}while(0);if(!N){y=x;u=O;r=P;continue}s=c[m>>2]|0;t=s+12|0;o=c[t>>2]|0;if((o|0)==(c[s+16>>2]|0)){kc[c[(c[s>>2]|0)+40>>2]&63](s)|0}else{c[t>>2]=o+1}if((P+O|0)>>>0<2){y=x;u=O;r=P;continue}else{V=f;W=O;X=q}while(1){do{if((a[X]|0)==2){o=a[V]|0;if((o&1)==0){Y=(o&255)>>>1}else{Y=c[V+4>>2]|0}if((Y|0)==(x|0)){Z=W;break}a[X]=0;Z=W+ -1|0}else{Z=W}}while(0);o=V+12|0;if((o|0)==(g|0)){y=x;u=Z;r=P;continue a}else{V=o;W=Z;X=X+1|0}}}do{if((C|0)==0){_=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){_=C;break}if((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1){c[m>>2]=0;_=0;break}else{_=c[m>>2]|0;break}}}while(0);m=(_|0)==0;do{if(B){$=78}else{if((c[A+12>>2]|0)!=(c[A+16>>2]|0)){if(m){break}else{$=80;break}}if((kc[c[(c[A>>2]|0)+36>>2]&63](A)|0)==-1){c[b>>2]=0;$=78;break}else{if(m){break}else{$=80;break}}}}while(0);if(($|0)==78){if(m){$=80}}if(($|0)==80){c[j>>2]=c[j>>2]|2}c:do{if(n){$=85}else{if((a[q]|0)==2){aa=f;break}else{ba=f;ca=q}while(1){m=ba+12|0;b=ca+1|0;if((m|0)==(g|0)){$=85;break c}if((a[b]|0)==2){aa=m;break}else{ca=b;ba=m}}}}while(0);if(($|0)==85){c[j>>2]=c[j>>2]|4;aa=g}if((p|0)==0){i=l;return aa|0}Im(p);i=l;return aa|0}function gg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];hg(a,0,k,j,f,g,h);i=b;return}function hg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==8){u=16}else if((t|0)==0){u=0}else if((t|0)==64){u=8}else{u=10}t=l;Zg(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((kc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}xe(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}xe(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{Q=d[I]|0}if((zg(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){kc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Sl(H,c[p>>2]|0,j,u)|0;jj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}function ig(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];jg(a,0,k,j,f,g,h);i=b;return}function jg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;Zg(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((kc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;J=(D&1)==0;if(J){K=(D&255)>>>1}else{K=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(K|0)){if(J){L=(D&255)>>>1;M=(D&255)>>>1}else{D=c[z>>2]|0;L=D;M=D}xe(o,M<<1,0);if((a[h]&1)==0){N=10}else{N=(c[g>>2]&-2)+ -1|0}xe(o,N,0);if((a[h]&1)==0){O=v}else{O=c[w>>2]|0}c[p>>2]=O+L;P=O}else{P=B}D=C+12|0;J=c[D>>2]|0;Q=C+16|0;if((J|0)==(c[Q>>2]|0)){R=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{R=d[J]|0}if((zg(R&255,u,P,p,s,A,n,l,r,t)|0)!=0){G=F;H=P;break}J=c[D>>2]|0;if((J|0)==(c[Q>>2]|0)){kc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=P;continue}else{c[D>>2]=J+1;m=C;B=P;continue}}P=a[n]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[n+4>>2]|0}do{if((S|0)!=0){P=c[r>>2]|0;if((P-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=P+4;c[P>>2]=B}}while(0);s=Rl(H,c[p>>2]|0,j,u)|0;u=k;c[u>>2]=s;c[u+4>>2]=I;jj(n,l,c[r>>2]|0,j);do{if((C|0)==0){T=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){T=C;break}if(!((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){T=C;break}c[y>>2]=0;T=0}}while(0);y=(T|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}function kg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];lg(a,0,k,j,f,g,h);i=b;return}function lg(e,f,g,h,j,k,l){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;f=i;i=i+256|0;m=f;n=f+32|0;o=f+40|0;p=f+56|0;q=f+72|0;r=f+80|0;s=f+240|0;t=f+248|0;u=c[j+4>>2]&74;if((u|0)==64){v=8}else if((u|0)==8){v=16}else if((u|0)==0){v=0}else{v=10}u=m;Zg(o,j,u,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;xe(p,10,0);if((a[j]&1)==0){m=p+1|0;w=m;x=p+8|0;y=m}else{m=p+8|0;w=p+1|0;x=m;y=c[m>>2]|0}c[q>>2]=y;m=r;c[s>>2]=m;c[t>>2]=0;z=g;g=h;h=p;A=p+4|0;B=a[n]|0;n=c[z>>2]|0;C=y;a:while(1){do{if((n|0)==0){D=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){D=n;break}if(!((kc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){D=n;break}c[z>>2]=0;D=0}}while(0);y=(D|0)==0;E=c[g>>2]|0;do{if((E|0)==0){F=18}else{if((c[E+12>>2]|0)!=(c[E+16>>2]|0)){if(y){G=E;break}else{H=E;I=C;break a}}if((kc[c[(c[E>>2]|0)+36>>2]&63](E)|0)==-1){c[g>>2]=0;F=18;break}else{if(y){G=E;break}else{H=E;I=C;break a}}}}while(0);if((F|0)==18){F=0;if(y){H=0;I=C;break}else{G=0}}E=a[j]|0;J=(E&1)==0;if(J){K=(E&255)>>>1}else{K=c[A>>2]|0}if(((c[q>>2]|0)-C|0)==(K|0)){if(J){L=(E&255)>>>1;M=(E&255)>>>1}else{E=c[A>>2]|0;L=E;M=E}xe(p,M<<1,0);if((a[j]&1)==0){N=10}else{N=(c[h>>2]&-2)+ -1|0}xe(p,N,0);if((a[j]&1)==0){O=w}else{O=c[x>>2]|0}c[q>>2]=O+L;P=O}else{P=C}E=D+12|0;J=c[E>>2]|0;Q=D+16|0;if((J|0)==(c[Q>>2]|0)){R=kc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{R=d[J]|0}if((zg(R&255,v,P,q,t,B,o,m,s,u)|0)!=0){H=G;I=P;break}J=c[E>>2]|0;if((J|0)==(c[Q>>2]|0)){kc[c[(c[D>>2]|0)+40>>2]&63](D)|0;n=D;C=P;continue}else{c[E>>2]=J+1;n=D;C=P;continue}}P=a[o]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[o+4>>2]|0}do{if((S|0)!=0){P=c[s>>2]|0;if((P-r|0)>=160){break}C=c[t>>2]|0;c[s>>2]=P+4;c[P>>2]=C}}while(0);b[l>>1]=Ql(I,c[q>>2]|0,k,v)|0;jj(o,m,c[s>>2]|0,k);do{if((D|0)==0){T=0}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){T=D;break}if(!((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1)){T=D;break}c[z>>2]=0;T=0}}while(0);z=(T|0)==0;do{if((H|0)==0){F=54}else{if((c[H+12>>2]|0)!=(c[H+16>>2]|0)){if(!z){break}U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}if((kc[c[(c[H>>2]|0)+36>>2]&63](H)|0)==-1){c[g>>2]=0;F=54;break}if(!(z^(H|0)==0)){break}U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}}while(0);do{if((F|0)==54){if(z){break}U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}}while(0);c[k>>2]=c[k>>2]|2;U=e;c[U>>2]=T;ve(p);ve(o);i=f;return}function mg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];ng(a,0,k,j,f,g,h);i=b;return}function ng(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==8){u=16}else if((t|0)==64){u=8}else if((t|0)==0){u=0}else{u=10}t=l;Zg(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((kc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}xe(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}xe(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{Q=d[I]|0}if((zg(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){kc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Pl(H,c[p>>2]|0,j,u)|0;jj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}function og(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];pg(a,0,k,j,f,g,h);i=b;return}function pg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==8){u=16}else if((t|0)==0){u=0}else{u=10}t=l;Zg(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((kc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}xe(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}xe(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{Q=d[I]|0}if((zg(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){kc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Ol(H,c[p>>2]|0,j,u)|0;jj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;ve(o);ve(n);i=e;return}function qg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];rg(a,0,k,j,f,g,h);i=b;return}function rg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;Zg(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((kc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;J=(D&1)==0;if(J){K=(D&255)>>>1}else{K=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(K|0)){if(J){L=(D&255)>>>1;M=(D&255)>>>1}else{D=c[z>>2]|0;L=D;M=D}xe(o,M<<1,0);if((a[h]&1)==0){N=10}else{N=(c[g>>2]&-2)+ -1|0}xe(o,N,0);if((a[h]&1)==0){O=v}else{O=c[w>>2]|0}c[p>>2]=O+L;P=O}else{P=B}D=C+12|0;J=c[D>>2]|0;Q=C+16|0;if((J|0)==(c[Q>>2]|0)){R=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{R=d[J]|0}if((zg(R&255,u,P,p,s,A,n,l,r,t)|0)!=0){G=F;H=P;break}J=c[D>>2]|0;if((J|0)==(c[Q>>2]|0)){kc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=P;continue}else{c[D>>2]=J+1;m=C;B=P;continue}}P=a[n]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[n+4>>2]|0}do{if((S|0)!=0){P=c[r>>2]|0;if((P-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=P+4;c[P>>2]=B}}while(0);s=Nl(H,c[p>>2]|0,j,u)|0;u=k;c[u>>2]=s;c[u+4>>2]=I;jj(n,l,c[r>>2]|0,j);do{if((C|0)==0){T=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){T=C;break}if(!((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){T=C;break}c[y>>2]=0;T=0}}while(0);y=(T|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;U=b;c[U>>2]=T;ve(o);ve(n);i=e;return}function sg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];tg(a,0,k,j,f,g,h);i=b;return}function tg(b,e,f,h,j,k,l){b=b|0;e=e|0;f=f|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;_g(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;xe(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=h;h=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((kc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}xe(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[h>>2]&-2)+ -1|0}xe(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=kc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=d[L]|0}if(($g(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){kc[c[(c[F>>2]|0)+40>>2]&63](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);g[l>>2]=+Ml(K,c[q>>2]|0,k);jj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((kc[c[(c[F>>2]|0)+36>>2]&63](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}if((kc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}function ug(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];vg(a,0,k,j,f,g,h);i=b;return}function vg(b,e,f,g,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;_g(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;xe(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=g;g=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((kc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}xe(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[g>>2]&-2)+ -1|0}xe(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=kc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=d[L]|0}if(($g(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){kc[c[(c[F>>2]|0)+40>>2]&63](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);h[l>>3]=+Ll(K,c[q>>2]|0,k);jj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((kc[c[(c[F>>2]|0)+36>>2]&63](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}if((kc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}function wg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];xg(a,0,k,j,f,g,h);i=b;return}function xg(b,e,f,g,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;_g(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;xe(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=g;g=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((kc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((kc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}xe(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[g>>2]&-2)+ -1|0}xe(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=kc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=d[L]|0}if(($g(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){kc[c[(c[F>>2]|0)+40>>2]&63](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);h[l>>3]=+Kl(K,c[q>>2]|0,k);jj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((kc[c[(c[F>>2]|0)+36>>2]&63](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}if((kc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;ve(p);ve(o);i=e;return}function yg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0;e=i;i=i+8|0;l=e;m=i;i=i+16|0;n=i;i=i+32|0;o=i;i=i+16|0;p=i;i=i+8|0;q=i;i=i+16|0;r=i;i=i+160|0;s=o;c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;Pe(p,h);h=p;p=c[h>>2]|0;if(!((c[1826]|0)==-1)){c[m>>2]=7304;c[m+4>>2]=113;c[m+8>>2]=0;qe(7304,m,114)}m=(c[7308>>2]|0)+ -1|0;t=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-t>>2>>>0>m>>>0)){u=Ta(4)|0;v=u;mm(v);Vb(u|0,15264,101)}p=c[t+(m<<2)>>2]|0;if((p|0)==0){u=Ta(4)|0;v=u;mm(v);Vb(u|0,15264,101)}u=n;qc[c[(c[p>>2]|0)+32>>2]&7](p,5848,5874|0,u)|0;Yd(c[h>>2]|0)|0;h=q;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(q,10,0);if((a[h]&1)==0){p=q+1|0;w=p;x=q+8|0;y=p}else{p=q+8|0;w=q+1|0;x=p;y=c[p>>2]|0}p=f;f=g;g=q;v=q+4|0;m=n+24|0;t=n+25|0;z=r;A=n+26|0;B=n;n=o+4|0;C=c[p>>2]|0;D=y;E=r;r=0;F=y;a:while(1){do{if((C|0)==0){G=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){G=C;break}if(!((kc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){G=C;break}c[p>>2]=0;G=0}}while(0);y=(G|0)==0;H=c[f>>2]|0;do{if((H|0)==0){I=19}else{if((c[H+12>>2]|0)!=(c[H+16>>2]|0)){if(y){break}else{J=F;break a}}if((kc[c[(c[H>>2]|0)+36>>2]&63](H)|0)==-1){c[f>>2]=0;I=19;break}else{if(y){break}else{J=F;break a}}}}while(0);if((I|0)==19){I=0;if(y){J=F;break}}H=a[h]|0;K=(H&1)==0;if(K){L=(H&255)>>>1}else{L=c[v>>2]|0}if((D-F|0)==(L|0)){if(K){M=(H&255)>>>1;N=(H&255)>>>1}else{H=c[v>>2]|0;M=H;N=H}xe(q,N<<1,0);if((a[h]&1)==0){O=10}else{O=(c[g>>2]&-2)+ -1|0}xe(q,O,0);if((a[h]&1)==0){P=w}else{P=c[x>>2]|0}Q=P+M|0;R=P}else{Q=D;R=F}H=c[G+12>>2]|0;if((H|0)==(c[G+16>>2]|0)){S=kc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{S=d[H]|0}H=S&255;K=(Q|0)==(R|0);do{if(K){T=(a[m]|0)==H<<24>>24;if(!T){if(!((a[t]|0)==H<<24>>24)){I=40;break}}a[Q]=T?43:45;U=Q+1|0;V=E;W=0}else{I=40}}while(0);do{if((I|0)==40){I=0;y=a[s]|0;if((y&1)==0){X=(y&255)>>>1}else{X=c[n>>2]|0}if((X|0)!=0&H<<24>>24==0){if((E-z|0)>=160){U=Q;V=E;W=r;break}c[E>>2]=r;U=Q;V=E+4|0;W=0;break}else{Y=u}while(1){y=Y+1|0;if((a[Y]|0)==H<<24>>24){Z=Y;break}if((y|0)==(A|0)){Z=A;break}else{Y=y}}y=Z-B|0;if((y|0)>23){J=R;break a}if((y|0)<22){a[Q]=a[5848+y|0]|0;U=Q+1|0;V=E;W=r+1|0;break}if(K){J=Q;break a}if((Q-R|0)>=3){J=R;break a}if((a[Q+ -1|0]|0)!=48){J=R;break a}a[Q]=a[5848+y|0]|0;U=Q+1|0;V=E;W=0}}while(0);K=c[p>>2]|0;H=K+12|0;y=c[H>>2]|0;if((y|0)==(c[K+16>>2]|0)){kc[c[(c[K>>2]|0)+40>>2]&63](K)|0;C=K;D=U;E=V;r=W;F=R;continue}else{c[H>>2]=y+1;C=K;D=U;E=V;r=W;F=R;continue}}a[J+3|0]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);R=c[1798]|0;c[l>>2]=k;if((Ag(J,R,5888,l)|0)!=1){c[j>>2]=4}l=c[p>>2]|0;do{if((l|0)==0){_=0}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){_=l;break}if(!((kc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1)){_=l;break}c[p>>2]=0;_=0}}while(0);p=(_|0)==0;l=c[f>>2]|0;do{if((l|0)==0){I=72}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){if(!p){break}$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}if((kc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1){c[f>>2]=0;I=72;break}if(!(p^(l|0)==0)){break}$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}}while(0);do{if((I|0)==72){if(p){break}$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;$=b;c[$>>2]=_;ve(q);ve(o);i=e;return}function zg(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;o=c[f>>2]|0;p=(o|0)==(e|0);do{if(p){q=(a[m+24|0]|0)==b<<24>>24;if(!q){if(!((a[m+25|0]|0)==b<<24>>24)){break}}c[f>>2]=e+1;a[e]=q?43:45;c[g>>2]=0;r=0;i=n;return r|0}}while(0);q=a[j]|0;if((q&1)==0){s=(q&255)>>>1}else{s=c[j+4>>2]|0}if((s|0)!=0&b<<24>>24==h<<24>>24){h=c[l>>2]|0;if((h-k|0)>=160){r=0;i=n;return r|0}k=c[g>>2]|0;c[l>>2]=h+4;c[h>>2]=k;c[g>>2]=0;r=0;i=n;return r|0}k=m+26|0;h=m;while(1){l=h+1|0;if((a[h]|0)==b<<24>>24){t=h;break}if((l|0)==(k|0)){t=k;break}else{h=l}}h=t-m|0;if((h|0)>23){r=-1;i=n;return r|0}do{if((d|0)==10|(d|0)==8){if((h|0)<(d|0)){break}else{r=-1}i=n;return r|0}else if((d|0)==16){if((h|0)<22){break}if(p){r=-1;i=n;return r|0}if((o-e|0)>=3){r=-1;i=n;return r|0}if((a[o+ -1|0]|0)!=48){r=-1;i=n;return r|0}c[g>>2]=0;m=a[5848+h|0]|0;c[f>>2]=o+1;a[o]=m;r=0;i=n;return r|0}}while(0);e=a[5848+h|0]|0;c[f>>2]=o+1;a[o]=e;c[g>>2]=(c[g>>2]|0)+1;r=0;i=n;return r|0}function Ag(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;e=fb(b|0)|0;b=Ia(a|0,d|0,g|0)|0;if((e|0)==0){i=f;return b|0}fb(e|0)|0;i=f;return b|0}function Bg(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Cg(a){a=a|0;i=i;return}function Dg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+136|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=k+40|0;q=k+56|0;r=k+64|0;s=k+72|0;t=k+80|0;u=k+88|0;v=k+96|0;w=k+104|0;x=k+128|0;if((c[g+4>>2]&1|0)==0){c[q>>2]=-1;y=c[(c[d>>2]|0)+16>>2]|0;z=e;c[s>>2]=c[z>>2];c[t>>2]=c[f>>2];A=n;B=s;c[A+0>>2]=c[B+0>>2];B=m;A=t;c[B+0>>2]=c[A+0>>2];fc[y&63](r,d,n,m,g,h,q);m=c[r>>2]|0;c[z>>2]=m;z=c[q>>2]|0;if((z|0)==1){a[j]=1}else if((z|0)==0){a[j]=0}else{a[j]=1;c[h>>2]=4}c[b>>2]=m;i=k;return}Pe(u,g);m=u;u=c[m>>2]|0;if(!((c[1824]|0)==-1)){c[p>>2]=7296;c[p+4>>2]=113;c[p+8>>2]=0;qe(7296,p,114)}p=(c[7300>>2]|0)+ -1|0;z=c[u+8>>2]|0;if(!((c[u+12>>2]|0)-z>>2>>>0>p>>>0)){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}u=c[z+(p<<2)>>2]|0;if((u|0)==0){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}C=u;Yd(c[m>>2]|0)|0;Pe(v,g);g=v;v=c[g>>2]|0;if(!((c[1864]|0)==-1)){c[o>>2]=7456;c[o+4>>2]=113;c[o+8>>2]=0;qe(7456,o,114)}o=(c[7460>>2]|0)+ -1|0;m=c[v+8>>2]|0;if(!((c[v+12>>2]|0)-m>>2>>>0>o>>>0)){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}v=c[m+(o<<2)>>2]|0;if((v|0)==0){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}E=v;Yd(c[g>>2]|0)|0;g=w;F=v;ic[c[(c[F>>2]|0)+24>>2]&63](g,E);ic[c[(c[F>>2]|0)+28>>2]&63](w+12|0,E);c[x>>2]=c[f>>2];f=w+24|0;E=l;F=x;c[E+0>>2]=c[F+0>>2];F=Eg(e,l,g,f,C,h,1)|0;a[j]=(F|0)==(g|0)|0;c[b>>2]=c[e>>2];Ge(w+12|0);Ge(w);i=k;return}\n\n\n\nfunction ej(e,f,g,h,j,k,l,m,n,o,p){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;var q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,ic=0,jc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0;q=i;i=i+408|0;r=q;s=q+400|0;t=s;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+8|0;D=r;c[s>>2]=0;E=w;c[E+0>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;F=x;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;G=y;c[G+0>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;H=z;c[H+0>>2]=0;c[H+4>>2]=0;c[H+8>>2]=0;I=A;c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;ij(g,h,t,u,v,w,x,y,z,B);t=n;c[o>>2]=c[t>>2];h=e;e=f;f=s;s=m+8|0;m=z+1|0;g=z+4|0;J=z+8|0;K=y+1|0;L=y+4|0;M=y+8|0;N=(j&512|0)!=0;j=x+1|0;O=x+8|0;P=x+4|0;Q=A;R=Q+1|0;S=A+8|0;T=A+4|0;U=f+3|0;V=n+4|0;n=w+4|0;W=r+400|0;r=D;X=D;D=p;p=0;Y=0;Z=115;a:while(1){_=c[h>>2]|0;do{if((_|0)==0){$=0}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){$=_;break}if((kc[c[(c[_>>2]|0)+36>>2]&63](_)|0)==-1){c[h>>2]=0;$=0;break}else{$=c[h>>2]|0;break}}}while(0);_=($|0)==0;aa=c[e>>2]|0;do{if((aa|0)==0){ba=12}else{if((c[aa+12>>2]|0)!=(c[aa+16>>2]|0)){if(_){ca=aa;break}else{da=X;ea=r;fa=Y;ga=Z;ba=269;break a}}if((kc[c[(c[aa>>2]|0)+36>>2]&63](aa)|0)==-1){c[e>>2]=0;ba=12;break}else{if(_){ca=aa;break}else{da=X;ea=r;fa=Y;ga=Z;ba=269;break a}}}}while(0);if((ba|0)==12){ba=0;if(_){da=X;ea=r;fa=Y;ga=Z;ba=269;break}else{ca=0}}b:do{switch(a[f+p|0]|0){case 4:{aa=D;ha=X;ia=r;ja=W;ka=0;la=Z;c:while(1){ma=c[h>>2]|0;do{if((ma|0)==0){na=0}else{if((c[ma+12>>2]|0)!=(c[ma+16>>2]|0)){na=ma;break}if((kc[c[(c[ma>>2]|0)+36>>2]&63](ma)|0)==-1){c[h>>2]=0;na=0;break}else{na=c[h>>2]|0;break}}}while(0);ma=(na|0)==0;oa=c[e>>2]|0;do{if((oa|0)==0){ba=173}else{if((c[oa+12>>2]|0)!=(c[oa+16>>2]|0)){if(ma){break}else{break c}}if((kc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0)==-1){c[e>>2]=0;ba=173;break}else{if(ma){break}else{break c}}}}while(0);if((ba|0)==173){ba=0;if(ma){break}}oa=c[h>>2]|0;pa=c[oa+12>>2]|0;if((pa|0)==(c[oa+16>>2]|0)){qa=kc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0}else{qa=d[pa]|0}pa=qa&255;do{if(pa<<24>>24>-1){if((b[(c[s>>2]|0)+(qa<<24>>24<<1)>>1]&2048)==0){ba=189;break}oa=c[o>>2]|0;if((oa|0)==(aa|0)){ra=(c[V>>2]|0)!=115;sa=c[t>>2]|0;ta=aa-sa|0;ua=ta>>>0<2147483647?ta<<1:-1;va=Jm(ra?sa:0,ua)|0;if((va|0)==0){ba=182;break a}do{if(ra){c[t>>2]=va;wa=va}else{sa=c[t>>2]|0;c[t>>2]=va;if((sa|0)==0){wa=va;break}hc[c[V>>2]&127](sa);wa=c[t>>2]|0}}while(0);c[V>>2]=116;va=wa+ta|0;c[o>>2]=va;xa=va;ya=(c[t>>2]|0)+ua|0}else{xa=oa;ya=aa}c[o>>2]=xa+1;a[xa]=pa;za=ya;Aa=ha;Ba=ia;Ca=ja;Da=ka+1|0;Ea=la}else{ba=189}}while(0);if((ba|0)==189){ba=0;ma=a[E]|0;if((ma&1)==0){Fa=(ma&255)>>>1}else{Fa=c[n>>2]|0}if((Fa|0)==0|(ka|0)==0){break}if(!(pa<<24>>24==(a[v]|0))){break}if((ia|0)==(ja|0)){ma=ia-ha|0;va=ma>>>0<2147483647?ma<<1:-1;if((la|0)==115){Ga=0}else{Ga=ha}ra=Jm(Ga,va)|0;sa=ra;if((ra|0)==0){ba=198;break a}Ha=sa;Ia=sa+(ma>>2<<2)|0;Ja=sa+(va>>>2<<2)|0;Ka=116}else{Ha=ha;Ia=ia;Ja=ja;Ka=la}c[Ia>>2]=ka;za=aa;Aa=Ha;Ba=Ia+4|0;Ca=Ja;Da=0;Ea=Ka}va=c[h>>2]|0;sa=va+12|0;ma=c[sa>>2]|0;if((ma|0)==(c[va+16>>2]|0)){kc[c[(c[va>>2]|0)+40>>2]&63](va)|0;aa=za;ha=Aa;ia=Ba;ja=Ca;ka=Da;la=Ea;continue}else{c[sa>>2]=ma+1;aa=za;ha=Aa;ia=Ba;ja=Ca;ka=Da;la=Ea;continue}}if((ha|0)==(ia|0)|(ka|0)==0){La=ha;Ma=ia;Na=ja;Oa=la}else{if((ia|0)==(ja|0)){ma=ia-ha|0;sa=ma>>>0<2147483647?ma<<1:-1;if((la|0)==115){Pa=0}else{Pa=ha}va=Jm(Pa,sa)|0;ra=va;if((va|0)==0){ba=209;break a}Qa=ra;Ra=ra+(ma>>2<<2)|0;Sa=ra+(sa>>>2<<2)|0;Ta=116}else{Qa=ha;Ra=ia;Sa=ja;Ta=la}c[Ra>>2]=ka;La=Qa;Ma=Ra+4|0;Na=Sa;Oa=Ta}sa=c[B>>2]|0;if((sa|0)>0){ra=c[h>>2]|0;do{if((ra|0)==0){Ua=0}else{if((c[ra+12>>2]|0)!=(c[ra+16>>2]|0)){Ua=ra;break}if((kc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0)==-1){c[h>>2]=0;Ua=0;break}else{Ua=c[h>>2]|0;break}}}while(0);ra=(Ua|0)==0;ka=c[e>>2]|0;do{if((ka|0)==0){ba=223}else{if((c[ka+12>>2]|0)!=(c[ka+16>>2]|0)){if(ra){Va=ka;break}else{ba=229;break a}}if((kc[c[(c[ka>>2]|0)+36>>2]&63](ka)|0)==-1){c[e>>2]=0;ba=223;break}else{if(ra){Va=ka;break}else{ba=229;break a}}}}while(0);if((ba|0)==223){ba=0;if(ra){ba=229;break a}else{Va=0}}ka=c[h>>2]|0;la=c[ka+12>>2]|0;if((la|0)==(c[ka+16>>2]|0)){Wa=kc[c[(c[ka>>2]|0)+36>>2]&63](ka)|0}else{Wa=d[la]|0}if(!((Wa&255)<<24>>24==(a[u]|0))){ba=229;break a}la=c[h>>2]|0;ka=la+12|0;ja=c[ka>>2]|0;if((ja|0)==(c[la+16>>2]|0)){kc[c[(c[la>>2]|0)+40>>2]&63](la)|0;Xa=Va;Ya=sa;Za=Va;_a=aa}else{c[ka>>2]=ja+1;Xa=Va;Ya=sa;Za=Va;_a=aa}while(1){ja=c[h>>2]|0;do{if((ja|0)==0){$a=0}else{if((c[ja+12>>2]|0)!=(c[ja+16>>2]|0)){$a=ja;break}if((kc[c[(c[ja>>2]|0)+36>>2]&63](ja)|0)==-1){c[h>>2]=0;$a=0;break}else{$a=c[h>>2]|0;break}}}while(0);ja=($a|0)==0;do{if((Za|0)==0){ab=Xa;ba=243}else{if((c[Za+12>>2]|0)!=(c[Za+16>>2]|0)){if(ja){bb=Xa;cb=Za;break}else{ba=250;break a}}if((kc[c[(c[Za>>2]|0)+36>>2]&63](Za)|0)==-1){c[e>>2]=0;ab=0;ba=243;break}else{if(ja^(Xa|0)==0){bb=Xa;cb=Xa;break}else{ba=250;break a}}}}while(0);if((ba|0)==243){ba=0;if(ja){ba=250;break a}else{bb=ab;cb=0}}pa=c[h>>2]|0;ka=c[pa+12>>2]|0;if((ka|0)==(c[pa+16>>2]|0)){db=kc[c[(c[pa>>2]|0)+36>>2]&63](pa)|0}else{db=d[ka]|0}if(!((db&255)<<24>>24>-1)){ba=250;break a}if((b[(c[s>>2]|0)+(db<<24>>24<<1)>>1]&2048)==0){ba=250;break a}ka=c[o>>2]|0;if((ka|0)==(_a|0)){pa=(c[V>>2]|0)!=115;la=c[t>>2]|0;ia=_a-la|0;ha=ia>>>0<2147483647?ia<<1:-1;ma=Jm(pa?la:0,ha)|0;if((ma|0)==0){ba=253;break a}do{if(pa){c[t>>2]=ma;eb=ma}else{la=c[t>>2]|0;c[t>>2]=ma;if((la|0)==0){eb=ma;break}hc[c[V>>2]&127](la);eb=c[t>>2]|0}}while(0);c[V>>2]=116;ma=eb+ia|0;c[o>>2]=ma;fb=ma;gb=(c[t>>2]|0)+ha|0}else{fb=ka;gb=_a}ma=c[h>>2]|0;pa=c[ma+12>>2]|0;if((pa|0)==(c[ma+16>>2]|0)){ja=kc[c[(c[ma>>2]|0)+36>>2]&63](ma)|0;hb=ja;ib=c[o>>2]|0}else{hb=d[pa]|0;ib=fb}c[o>>2]=ib+1;a[ib]=hb;pa=Ya+ -1|0;c[B>>2]=pa;ja=c[h>>2]|0;ma=ja+12|0;la=c[ma>>2]|0;if((la|0)==(c[ja+16>>2]|0)){kc[c[(c[ja>>2]|0)+40>>2]&63](ja)|0}else{c[ma>>2]=la+1}if((pa|0)>0){Xa=bb;Ya=pa;Za=cb;_a=gb}else{jb=gb;break}}}else{jb=aa}if((c[o>>2]|0)==(c[t>>2]|0)){ba=267;break a}else{kb=jb;lb=La;mb=Ma;nb=Na;ob=Y;pb=Oa}break};case 1:{if((p|0)==3){da=X;ea=r;fa=Y;ga=Z;ba=269;break a}sa=c[h>>2]|0;ra=c[sa+12>>2]|0;if((ra|0)==(c[sa+16>>2]|0)){qb=kc[c[(c[sa>>2]|0)+36>>2]&63](sa)|0}else{qb=d[ra]|0}if(!((qb&255)<<24>>24>-1)){ba=25;break a}if((b[(c[s>>2]|0)+(qb<<24>>24<<1)>>1]&8192)==0){ba=25;break a}ra=c[h>>2]|0;sa=ra+12|0;pa=c[sa>>2]|0;if((pa|0)==(c[ra+16>>2]|0)){rb=kc[c[(c[ra>>2]|0)+40>>2]&63](ra)|0}else{c[sa>>2]=pa+1;rb=d[pa]|0}Ae(A,rb&255);ba=26;break};case 3:{pa=a[G]|0;sa=(pa&1)==0;if(sa){sb=(pa&255)>>>1}else{sb=c[L>>2]|0}ra=a[H]|0;la=(ra&1)==0;if(la){tb=(ra&255)>>>1}else{tb=c[g>>2]|0}if((sb|0)==(0-tb|0)){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}if(sa){ub=(pa&255)>>>1}else{ub=c[L>>2]|0}do{if((ub|0)!=0){if(la){vb=(ra&255)>>>1}else{vb=c[g>>2]|0}if((vb|0)==0){break}ma=c[h>>2]|0;ja=c[ma+12>>2]|0;va=c[ma+16>>2]|0;if((ja|0)==(va|0)){wb=kc[c[(c[ma>>2]|0)+36>>2]&63](ma)|0;xb=c[h>>2]|0;yb=wb;zb=c[xb+16>>2]|0;Ab=c[xb+12>>2]|0;Bb=xb;Cb=a[G]|0}else{yb=d[ja]|0;zb=va;Ab=ja;Bb=ma;Cb=pa}ma=Bb+12|0;ja=(Ab|0)==(zb|0);if((yb&255)<<24>>24==(a[(Cb&1)==0?K:c[M>>2]|0]|0)){if(ja){kc[c[(c[Bb>>2]|0)+40>>2]&63](Bb)|0}else{c[ma>>2]=Ab+1}ma=a[G]|0;if((ma&1)==0){Db=(ma&255)>>>1}else{Db=c[L>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Db>>>0>1?y:Y;pb=Z;break b}if(ja){Eb=kc[c[(c[Bb>>2]|0)+36>>2]&63](Bb)|0}else{Eb=d[Ab]|0}if(!((Eb&255)<<24>>24==(a[(a[H]&1)==0?m:c[J>>2]|0]|0))){ba=112;break a}ja=c[h>>2]|0;ma=ja+12|0;va=c[ma>>2]|0;if((va|0)==(c[ja+16>>2]|0)){kc[c[(c[ja>>2]|0)+40>>2]&63](ja)|0}else{c[ma>>2]=va+1}a[l]=1;va=a[H]|0;if((va&1)==0){Fb=(va&255)>>>1}else{Fb=c[g>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Fb>>>0>1?z:Y;pb=Z;break b}}while(0);if(sa){Gb=(pa&255)>>>1}else{Gb=c[L>>2]|0}la=c[h>>2]|0;aa=c[la+12>>2]|0;va=(aa|0)==(c[la+16>>2]|0);if((Gb|0)==0){if(va){ma=kc[c[(c[la>>2]|0)+36>>2]&63](la)|0;Hb=ma;Ib=a[H]|0}else{Hb=d[aa]|0;Ib=ra}if(!((Hb&255)<<24>>24==(a[(Ib&1)==0?m:c[J>>2]|0]|0))){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}ma=c[h>>2]|0;ja=ma+12|0;xb=c[ja>>2]|0;if((xb|0)==(c[ma+16>>2]|0)){kc[c[(c[ma>>2]|0)+40>>2]&63](ma)|0}else{c[ja>>2]=xb+1}a[l]=1;xb=a[H]|0;if((xb&1)==0){Jb=(xb&255)>>>1}else{Jb=c[g>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Jb>>>0>1?z:Y;pb=Z;break b}if(va){va=kc[c[(c[la>>2]|0)+36>>2]&63](la)|0;Kb=va;Lb=a[G]|0}else{Kb=d[aa]|0;Lb=pa}if(!((Kb&255)<<24>>24==(a[(Lb&1)==0?K:c[M>>2]|0]|0))){a[l]=1;kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}aa=c[h>>2]|0;va=aa+12|0;la=c[va>>2]|0;if((la|0)==(c[aa+16>>2]|0)){kc[c[(c[aa>>2]|0)+40>>2]&63](aa)|0}else{c[va>>2]=la+1}la=a[G]|0;if((la&1)==0){Mb=(la&255)>>>1}else{Mb=c[L>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Mb>>>0>1?y:Y;pb=Z;break};case 2:{if(!((Y|0)!=0|p>>>0<2)){if((p|0)==2){Nb=(a[U]|0)!=0}else{Nb=0}if(!(N|Nb)){kb=D;lb=X;mb=r;nb=W;ob=0;pb=Z;break b}}la=a[F]|0;va=(la&1)==0;aa=va?j:c[O>>2]|0;d:do{if((p|0)==0){Ob=ca;Pb=ca;Qb=la;Rb=aa}else{if((d[f+(p+ -1)|0]|0)>=2){Ob=ca;Pb=ca;Qb=la;Rb=aa;break}xb=aa+(va?(la&255)>>>1:c[P>>2]|0)|0;ja=aa;while(1){if((ja|0)==(xb|0)){Sb=xb;break}ma=a[ja]|0;if(!(ma<<24>>24>-1)){Sb=ja;break}if((b[(c[s>>2]|0)+(ma<<24>>24<<1)>>1]&8192)==0){Sb=ja;break}else{ja=ja+1|0}}ja=Sb-aa|0;xb=a[I]|0;ka=(xb&1)==0;if(ka){Tb=(xb&255)>>>1}else{Tb=c[T>>2]|0}if(ja>>>0>Tb>>>0){Ob=ca;Pb=ca;Qb=la;Rb=aa;break}if(ka){ka=(xb&255)>>>1;Ub=Q+(ka-ja)+1|0;Vb=R;Wb=ka}else{ka=c[S>>2]|0;xb=c[T>>2]|0;Ub=ka+(xb-ja)|0;Vb=ka;Wb=xb}xb=Vb+Wb|0;if((Ub|0)==(xb|0)){Ob=ca;Pb=ca;Qb=la;Rb=Sb;break}else{Xb=aa;Yb=Ub}while(1){if((a[Yb]|0)!=(a[Xb]|0)){Ob=ca;Pb=ca;Qb=la;Rb=aa;break d}ka=Yb+1|0;if((ka|0)==(xb|0)){Ob=ca;Pb=ca;Qb=la;Rb=Sb;break}else{Xb=Xb+1|0;Yb=ka}}}}while(0);e:while(1){if((Qb&1)==0){Zb=j;_b=(Qb&255)>>>1}else{Zb=c[O>>2]|0;_b=c[P>>2]|0}if((Rb|0)==(Zb+_b|0)){break}la=c[h>>2]|0;do{if((la|0)==0){$b=0}else{if((c[la+12>>2]|0)!=(c[la+16>>2]|0)){$b=la;break}if((kc[c[(c[la>>2]|0)+36>>2]&63](la)|0)==-1){c[h>>2]=0;$b=0;break}else{$b=c[h>>2]|0;break}}}while(0);la=($b|0)==0;do{if((Pb|0)==0){ac=Ob;ba=147}else{if((c[Pb+12>>2]|0)!=(c[Pb+16>>2]|0)){if(la){bc=Ob;cc=Pb;break}else{break e}}if((kc[c[(c[Pb>>2]|0)+36>>2]&63](Pb)|0)==-1){c[e>>2]=0;ac=0;ba=147;break}else{if(la^(Ob|0)==0){bc=Ob;cc=Ob;break}else{break e}}}}while(0);if((ba|0)==147){ba=0;if(la){break}else{bc=ac;cc=0}}aa=c[h>>2]|0;va=c[aa+12>>2]|0;if((va|0)==(c[aa+16>>2]|0)){dc=kc[c[(c[aa>>2]|0)+36>>2]&63](aa)|0}else{dc=d[va]|0}if(!((dc&255)<<24>>24==(a[Rb]|0))){break}va=c[h>>2]|0;aa=va+12|0;pa=c[aa>>2]|0;if((pa|0)==(c[va+16>>2]|0)){kc[c[(c[va>>2]|0)+40>>2]&63](va)|0}else{c[aa>>2]=pa+1}Ob=bc;Pb=cc;Qb=a[F]|0;Rb=Rb+1|0}if(!N){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}pa=a[F]|0;if((pa&1)==0){ec=j;fc=(pa&255)>>>1}else{ec=c[O>>2]|0;fc=c[P>>2]|0}if((Rb|0)==(ec+fc|0)){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z}else{ba=162;break a}break};case 0:{ba=26;break};default:{kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z}}}while(0);f:do{if((ba|0)==26){ba=0;if((p|0)==3){da=X;ea=r;fa=Y;ga=Z;ba=269;break a}else{gc=ca;ic=ca}while(1){_=c[h>>2]|0;do{if((_|0)==0){jc=0}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){jc=_;break}if((kc[c[(c[_>>2]|0)+36>>2]&63](_)|0)==-1){c[h>>2]=0;jc=0;break}else{jc=c[h>>2]|0;break}}}while(0);_=(jc|0)==0;do{if((ic|0)==0){lc=gc;ba=37}else{if((c[ic+12>>2]|0)!=(c[ic+16>>2]|0)){if(_){mc=gc;nc=ic;break}else{kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}}if((kc[c[(c[ic>>2]|0)+36>>2]&63](ic)|0)==-1){c[e>>2]=0;lc=0;ba=37;break}else{if(_^(gc|0)==0){mc=gc;nc=gc;break}else{kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}}}}while(0);if((ba|0)==37){ba=0;if(_){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}else{mc=lc;nc=0}}la=c[h>>2]|0;pa=c[la+12>>2]|0;if((pa|0)==(c[la+16>>2]|0)){oc=kc[c[(c[la>>2]|0)+36>>2]&63](la)|0}else{oc=d[pa]|0}if(!((oc&255)<<24>>24>-1)){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}if((b[(c[s>>2]|0)+(oc<<24>>24<<1)>>1]&8192)==0){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}pa=c[h>>2]|0;la=pa+12|0;aa=c[la>>2]|0;if((aa|0)==(c[pa+16>>2]|0)){pc=kc[c[(c[pa>>2]|0)+40>>2]&63](pa)|0}else{c[la>>2]=aa+1;pc=d[aa]|0}Ae(A,pc&255);gc=mc;ic=nc}}}while(0);aa=p+1|0;if(aa>>>0<4){W=nb;r=mb;X=lb;D=kb;p=aa;Y=ob;Z=pb}else{da=lb;ea=mb;fa=ob;ga=pb;ba=269;break}}g:do{if((ba|0)==25){c[k>>2]=c[k>>2]|4;qc=0;rc=X;sc=Z}else if((ba|0)==112){c[k>>2]=c[k>>2]|4;qc=0;rc=X;sc=Z}else if((ba|0)==162){c[k>>2]=c[k>>2]|4;qc=0;rc=X;sc=Z}else if((ba|0)==182){Tm()}else if((ba|0)==198){Tm()}else if((ba|0)==209){Tm()}else if((ba|0)==229){c[k>>2]=c[k>>2]|4;qc=0;rc=La;sc=Oa}else if((ba|0)==250){c[k>>2]=c[k>>2]|4;qc=0;rc=La;sc=Oa}else if((ba|0)==253){Tm()}else if((ba|0)==267){c[k>>2]=c[k>>2]|4;qc=0;rc=La;sc=Oa}else if((ba|0)==269){h:do{if((fa|0)!=0){pb=fa;ob=fa+1|0;mb=fa+8|0;lb=fa+4|0;Y=1;i:while(1){p=a[pb]|0;if((p&1)==0){tc=(p&255)>>>1}else{tc=c[lb>>2]|0}if(!(Y>>>0<tc>>>0)){break h}p=c[h>>2]|0;do{if((p|0)==0){uc=0}else{if((c[p+12>>2]|0)!=(c[p+16>>2]|0)){uc=p;break}if((kc[c[(c[p>>2]|0)+36>>2]&63](p)|0)==-1){c[h>>2]=0;uc=0;break}else{uc=c[h>>2]|0;break}}}while(0);p=(uc|0)==0;_=c[e>>2]|0;do{if((_|0)==0){ba=285}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){if(p){break}else{break i}}if((kc[c[(c[_>>2]|0)+36>>2]&63](_)|0)==-1){c[e>>2]=0;ba=285;break}else{if(p){break}else{break i}}}}while(0);if((ba|0)==285){ba=0;if(p){break}}_=c[h>>2]|0;kb=c[_+12>>2]|0;if((kb|0)==(c[_+16>>2]|0)){vc=kc[c[(c[_>>2]|0)+36>>2]&63](_)|0}else{vc=d[kb]|0}if((a[pb]&1)==0){wc=ob}else{wc=c[mb>>2]|0}if(!((vc&255)<<24>>24==(a[wc+Y|0]|0))){break}kb=Y+1|0;_=c[h>>2]|0;D=_+12|0;r=c[D>>2]|0;if((r|0)==(c[_+16>>2]|0)){kc[c[(c[_>>2]|0)+40>>2]&63](_)|0;Y=kb;continue}else{c[D>>2]=r+1;Y=kb;continue}}c[k>>2]=c[k>>2]|4;qc=0;rc=da;sc=ga;break g}}while(0);if((da|0)==(ea|0)){qc=1;rc=ea;sc=ga;break}c[C>>2]=0;jj(w,da,ea,C);if((c[C>>2]|0)==0){qc=1;rc=da;sc=ga;break}c[k>>2]=c[k>>2]|4;qc=0;rc=da;sc=ga}}while(0);ve(A);ve(z);ve(y);ve(x);ve(w);if((rc|0)==0){i=q;return qc|0}hc[sc&127](rc);i=q;return qc|0}function fj(a){a=a|0;var b=0;b=Ta(8)|0;ce(b,a);Vb(b|0,4312,11)}function gj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;d=i;i=i+168|0;l=d;m=d+8|0;n=d+24|0;o=d+128|0;p=d+136|0;q=d+144|0;r=d+152|0;s=d+160|0;t=o;c[t>>2]=n;u=o+4|0;c[u>>2]=115;v=n+100|0;Pe(q,h);n=q;w=c[n>>2]|0;if(!((c[1826]|0)==-1)){c[m>>2]=7304;c[m+4>>2]=113;c[m+8>>2]=0;qe(7304,m,114)}m=(c[7308>>2]|0)+ -1|0;x=c[w+8>>2]|0;if(!((c[w+12>>2]|0)-x>>2>>>0>m>>>0)){y=Ta(4)|0;z=y;mm(z);Vb(y|0,15264,101)}w=c[x+(m<<2)>>2]|0;if((w|0)==0){y=Ta(4)|0;z=y;mm(z);Vb(y|0,15264,101)}y=w;a[r]=0;z=f;f=c[z>>2]|0;c[s>>2]=f;m=c[h+4>>2]|0;h=l;x=s;c[h+0>>2]=c[x+0>>2];x=ej(e,l,g,q,m,j,r,y,o,p,v)|0;if(x){x=k;if((a[x]&1)==0){a[k+1|0]=0;a[x]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}x=w;if((a[r]|0)!=0){Ae(k,tc[c[(c[x>>2]|0)+28>>2]&15](y,45)|0)}r=tc[c[(c[x>>2]|0)+28>>2]&15](y,48)|0;y=c[t>>2]|0;x=c[p>>2]|0;p=x+ -1|0;a:do{if(y>>>0<p>>>0){w=y;while(1){v=w+1|0;if(!((a[w]|0)==r<<24>>24)){A=w;break a}if(v>>>0<p>>>0){w=v}else{A=v;break}}}else{A=y}}while(0);hj(k,A,x)|0}x=e;e=c[x>>2]|0;do{if((e|0)==0){B=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){B=e;break}if(!((kc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){B=e;break}c[x>>2]=0;B=0}}while(0);x=(B|0)==0;do{if((f|0)==0){C=25}else{if((c[f+12>>2]|0)!=(c[f+16>>2]|0)){if(x){break}else{C=27;break}}if((kc[c[(c[f>>2]|0)+36>>2]&63](f)|0)==-1){c[z>>2]=0;C=25;break}else{if(x^(f|0)==0){break}else{C=27;break}}}}while(0);if((C|0)==25){if(x){C=27}}if((C|0)==27){c[j>>2]=c[j>>2]|2}c[b>>2]=B;Yd(c[n>>2]|0)|0;n=c[t>>2]|0;c[t>>2]=0;if((n|0)==0){i=d;return}hc[c[u>>2]&127](n);i=d;return}function hj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;g=b;h=d;j=a[g]|0;if((j&1)==0){k=(j&255)>>>1;l=j;m=10}else{j=c[b>>2]|0;k=c[b+4>>2]|0;l=j&255;m=(j&-2)+ -1|0}j=e-h|0;if((e|0)==(d|0)){i=f;return b|0}if((m-k|0)>>>0<j>>>0){De(b,m,k+j-m|0,k,k,0,0);n=a[g]|0}else{n=l}if((n&1)==0){o=b+1|0}else{o=c[b+8>>2]|0}n=e+(k-h)|0;h=d;d=o+k|0;while(1){a[d]=a[h]|0;l=h+1|0;if((l|0)==(e|0)){break}else{d=d+1|0;h=l}}a[o+n|0]=0;n=k+j|0;if((a[g]&1)==0){a[g]=n<<1;i=f;return b|0}else{c[b+4>>2]=n;i=f;return b|0}return 0}function ij(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;n=i;i=i+176|0;o=n;p=n+16|0;q=n+32|0;r=n+40|0;s=n+56|0;t=n+72|0;u=n+88|0;v=n+104|0;w=n+112|0;x=n+128|0;y=n+144|0;z=n+160|0;if(b){b=c[d>>2]|0;if(!((c[1686]|0)==-1)){c[p>>2]=6744;c[p+4>>2]=113;c[p+8>>2]=0;qe(6744,p,114)}p=(c[6748>>2]|0)+ -1|0;A=c[b+8>>2]|0;if(!((c[b+12>>2]|0)-A>>2>>>0>p>>>0)){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}b=c[A+(p<<2)>>2]|0;if((b|0)==0){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}B=b;ic[c[(c[b>>2]|0)+44>>2]&63](q,B);C=e;p=c[q>>2]|0;a[C]=p;a[C+1|0]=p>>8;a[C+2|0]=p>>16;a[C+3|0]=p>>24;p=b;ic[c[(c[p>>2]|0)+32>>2]&63](r,B);C=l;if((a[C]&1)==0){a[l+1|0]=0;a[C]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}ze(l,0);q=r;c[C+0>>2]=c[q+0>>2];c[C+4>>2]=c[q+4>>2];c[C+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(r);ic[c[(c[p>>2]|0)+28>>2]&63](s,B);r=k;if((a[r]&1)==0){a[k+1|0]=0;a[r]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}ze(k,0);q=s;c[r+0>>2]=c[q+0>>2];c[r+4>>2]=c[q+4>>2];c[r+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(s);s=b;a[f]=kc[c[(c[s>>2]|0)+12>>2]&63](B)|0;a[g]=kc[c[(c[s>>2]|0)+16>>2]&63](B)|0;ic[c[(c[p>>2]|0)+20>>2]&63](t,B);s=h;if((a[s]&1)==0){a[h+1|0]=0;a[s]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}ze(h,0);q=t;c[s+0>>2]=c[q+0>>2];c[s+4>>2]=c[q+4>>2];c[s+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(t);ic[c[(c[p>>2]|0)+24>>2]&63](u,B);p=j;if((a[p]&1)==0){a[j+1|0]=0;a[p]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}ze(j,0);t=u;c[p+0>>2]=c[t+0>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;ve(u);D=kc[c[(c[b>>2]|0)+36>>2]&63](B)|0;c[m>>2]=D;i=n;return}else{B=c[d>>2]|0;if(!((c[1670]|0)==-1)){c[o>>2]=6680;c[o+4>>2]=113;c[o+8>>2]=0;qe(6680,o,114)}o=(c[6684>>2]|0)+ -1|0;d=c[B+8>>2]|0;if(!((c[B+12>>2]|0)-d>>2>>>0>o>>>0)){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}B=c[d+(o<<2)>>2]|0;if((B|0)==0){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}E=B;ic[c[(c[B>>2]|0)+44>>2]&63](v,E);F=e;e=c[v>>2]|0;a[F]=e;a[F+1|0]=e>>8;a[F+2|0]=e>>16;a[F+3|0]=e>>24;e=B;ic[c[(c[e>>2]|0)+32>>2]&63](w,E);F=l;if((a[F]&1)==0){a[l+1|0]=0;a[F]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}ze(l,0);l=w;c[F+0>>2]=c[l+0>>2];c[F+4>>2]=c[l+4>>2];c[F+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;ve(w);ic[c[(c[e>>2]|0)+28>>2]&63](x,E);w=k;if((a[w]&1)==0){a[k+1|0]=0;a[w]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}ze(k,0);k=x;c[w+0>>2]=c[k+0>>2];c[w+4>>2]=c[k+4>>2];c[w+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;ve(x);x=B;a[f]=kc[c[(c[x>>2]|0)+12>>2]&63](E)|0;a[g]=kc[c[(c[x>>2]|0)+16>>2]&63](E)|0;ic[c[(c[e>>2]|0)+20>>2]&63](y,E);x=h;if((a[x]&1)==0){a[h+1|0]=0;a[x]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}ze(h,0);h=y;c[x+0>>2]=c[h+0>>2];c[x+4>>2]=c[h+4>>2];c[x+8>>2]=c[h+8>>2];c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ve(y);ic[c[(c[e>>2]|0)+24>>2]&63](z,E);e=j;if((a[e]&1)==0){a[j+1|0]=0;a[e]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}ze(j,0);j=z;c[e+0>>2]=c[j+0>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ve(z);D=kc[c[(c[B>>2]|0)+36>>2]&63](E)|0;c[m>>2]=D;i=n;return}}function jj(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;h=b;j=a[h]|0;if((j&1)==0){k=(j&255)>>>1}else{k=c[b+4>>2]|0}if((k|0)==0){i=g;return}do{if((d|0)==(e|0)){l=j}else{k=e+ -4|0;if(k>>>0>d>>>0){m=d;n=k}else{l=j;break}do{k=c[m>>2]|0;c[m>>2]=c[n>>2];c[n>>2]=k;m=m+4|0;n=n+ -4|0;}while(m>>>0<n>>>0);l=a[h]|0}}while(0);if((l&1)==0){o=b+1|0;p=(l&255)>>>1}else{o=c[b+8>>2]|0;p=c[b+4>>2]|0}b=e+ -4|0;e=a[o]|0;l=e<<24>>24<1|e<<24>>24==127;a:do{if(b>>>0>d>>>0){h=o+p|0;n=e;m=o;j=d;k=l;while(1){if(!k){if((n<<24>>24|0)!=(c[j>>2]|0)){break}}q=(h-m|0)>1?m+1|0:m;r=j+4|0;s=a[q]|0;t=s<<24>>24<1|s<<24>>24==127;if(r>>>0<b>>>0){n=s;m=q;j=r;k=t}else{u=s;v=t;break a}}c[f>>2]=4;i=g;return}else{u=e;v=l}}while(0);if(v){i=g;return}v=c[b>>2]|0;if(!(u<<24>>24>>>0<v>>>0|(v|0)==0)){i=g;return}c[f>>2]=4;i=g;return}function kj(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function lj(a){a=a|0;i=i;return}function mj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+400|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=i;i=i+8|0;u=i;i=i+40|0;v=i;i=i+104|0;w=p;c[w>>2]=o;x=p+4|0;c[x>>2]=115;y=o+400|0;Pe(r,h);o=r;z=c[o>>2]|0;if(!((c[1824]|0)==-1)){c[n>>2]=7296;c[n+4>>2]=113;c[n+8>>2]=0;qe(7296,n,114)}n=(c[7300>>2]|0)+ -1|0;A=c[z+8>>2]|0;if(!((c[z+12>>2]|0)-A>>2>>>0>n>>>0)){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}z=c[A+(n<<2)>>2]|0;if((z|0)==0){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}B=z;a[s]=0;C=f;c[t>>2]=c[C>>2];f=c[h+4>>2]|0;h=l;n=t;c[h+0>>2]=c[n+0>>2];n=nj(e,l,g,r,f,j,s,B,p,q,y)|0;do{if(n){y=u;qc[c[(c[z>>2]|0)+48>>2]&7](B,7e3,7010|0,y)|0;p=v;f=c[q>>2]|0;r=c[w>>2]|0;g=f-r|0;do{if((g|0)>392){l=Hm((g>>2)+2|0)|0;if((l|0)!=0){D=l;E=l;break}Tm()}else{D=0;E=p}}while(0);if((a[s]|0)==0){F=E}else{a[E]=45;F=E+1|0}if(r>>>0<f>>>0){g=u+40|0;l=u;h=F;t=r;while(1){A=c[t>>2]|0;G=y;while(1){H=G+4|0;if((c[G>>2]|0)==(A|0)){I=G;break}if((H|0)==(g|0)){I=g;break}else{G=H}}a[h]=a[7e3+(I-l>>2)|0]|0;G=t+4|0;A=h+1|0;if(G>>>0<(c[q>>2]|0)>>>0){h=A;t=G}else{J=A;break}}}else{J=F}a[J]=0;c[m>>2]=k;if((db(p|0,6936,m|0)|0)!=1){t=Ta(8)|0;ce(t,6944);Vb(t|0,4312,11)}if((D|0)==0){break}Im(D)}}while(0);D=e;e=c[D>>2]|0;do{if((e|0)==0){K=1}else{m=c[e+12>>2]|0;if((m|0)==(c[e+16>>2]|0)){L=kc[c[(c[e>>2]|0)+36>>2]&63](e)|0}else{L=c[m>>2]|0}if((L|0)==-1){c[D>>2]=0;K=1;break}else{K=(c[D>>2]|0)==0;break}}}while(0);L=c[C>>2]|0;do{if((L|0)==0){M=35}else{e=c[L+12>>2]|0;if((e|0)==(c[L+16>>2]|0)){N=kc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{N=c[e>>2]|0}if((N|0)==-1){c[C>>2]=0;M=35;break}else{if(K){break}else{M=37;break}}}}while(0);if((M|0)==35){if(K){M=37}}if((M|0)==37){c[j>>2]=c[j>>2]|2}c[b>>2]=c[D>>2];Yd(c[o>>2]|0)|0;o=c[w>>2]|0;c[w>>2]=0;if((o|0)==0){i=d;return}hc[c[x>>2]&127](o);i=d;return}function nj(b,e,f,g,h,j,k,l,m,n,o){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,fc=0,gc=0,ic=0,jc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec=0,Fc=0;p=i;i=i+408|0;q=p;r=p+400|0;s=r;t=i;i=i+8|0;u=i;i=i+8|0;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+8|0;B=i;i=i+8|0;C=q;c[r>>2]=0;D=v;c[D+0>>2]=0;c[D+4>>2]=0;c[D+8>>2]=0;E=w;c[E+0>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;F=x;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;G=y;c[G+0>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;H=z;c[H+0>>2]=0;c[H+4>>2]=0;c[H+8>>2]=0;qj(f,g,s,t,u,v,w,x,y,A);s=m;c[n>>2]=c[s>>2];g=b;b=e;e=r;r=l;f=y+4|0;I=y+8|0;J=x+4|0;K=x+8|0;L=(h&512|0)!=0;h=w+4|0;M=w+8|0;N=z+4|0;O=z+8|0;P=e+3|0;Q=m+4|0;m=v+4|0;R=q+400|0;q=C;S=C;C=o;o=0;T=0;U=115;a:while(1){V=c[g>>2]|0;do{if((V|0)==0){W=1}else{X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){Y=kc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{Y=c[X>>2]|0}if((Y|0)==-1){c[g>>2]=0;W=1;break}else{W=(c[g>>2]|0)==0;break}}}while(0);V=c[b>>2]|0;do{if((V|0)==0){Z=15}else{X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){_=kc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{_=c[X>>2]|0}if((_|0)==-1){c[b>>2]=0;Z=15;break}else{if(W){$=V;break}else{aa=S;ba=q;ca=T;da=U;Z=292;break a}}}}while(0);if((Z|0)==15){Z=0;if(W){aa=S;ba=q;ca=T;da=U;Z=292;break}else{$=0}}b:do{switch(a[e+o|0]|0){case 0:{Z=28;break};case 4:{V=C;X=S;ea=q;fa=R;ga=0;ha=U;c:while(1){ia=c[g>>2]|0;do{if((ia|0)==0){ja=1}else{ka=c[ia+12>>2]|0;if((ka|0)==(c[ia+16>>2]|0)){la=kc[c[(c[ia>>2]|0)+36>>2]&63](ia)|0}else{la=c[ka>>2]|0}if((la|0)==-1){c[g>>2]=0;ja=1;break}else{ja=(c[g>>2]|0)==0;break}}}while(0);ia=c[b>>2]|0;do{if((ia|0)==0){Z=188}else{ka=c[ia+12>>2]|0;if((ka|0)==(c[ia+16>>2]|0)){ma=kc[c[(c[ia>>2]|0)+36>>2]&63](ia)|0}else{ma=c[ka>>2]|0}if((ma|0)==-1){c[b>>2]=0;Z=188;break}else{if(ja){break}else{break c}}}}while(0);if((Z|0)==188){Z=0;if(ja){break}}ia=c[g>>2]|0;ka=c[ia+12>>2]|0;if((ka|0)==(c[ia+16>>2]|0)){na=kc[c[(c[ia>>2]|0)+36>>2]&63](ia)|0}else{na=c[ka>>2]|0}if(ec[c[(c[r>>2]|0)+12>>2]&31](l,2048,na)|0){ka=c[n>>2]|0;if((ka|0)==(V|0)){ia=(c[Q>>2]|0)!=115;oa=c[s>>2]|0;pa=V-oa|0;qa=pa>>>0<2147483647?pa<<1:-1;ra=pa>>2;if(ia){sa=oa}else{sa=0}oa=Jm(sa,qa)|0;pa=oa;if((oa|0)==0){Z=198;break a}do{if(ia){c[s>>2]=pa;ta=pa}else{oa=c[s>>2]|0;c[s>>2]=pa;if((oa|0)==0){ta=pa;break}hc[c[Q>>2]&127](oa);ta=c[s>>2]|0}}while(0);c[Q>>2]=116;pa=ta+(ra<<2)|0;c[n>>2]=pa;ua=pa;va=(c[s>>2]|0)+(qa>>>2<<2)|0}else{ua=ka;va=V}c[n>>2]=ua+4;c[ua>>2]=na;wa=va;xa=X;ya=ea;za=fa;Aa=ga+1|0;Ba=ha}else{pa=a[D]|0;if((pa&1)==0){Ca=(pa&255)>>>1}else{Ca=c[m>>2]|0}if((Ca|0)==0|(ga|0)==0){break}if((na|0)!=(c[u>>2]|0)){break}if((ea|0)==(fa|0)){pa=ea-X|0;ia=pa>>>0<2147483647?pa<<1:-1;if((ha|0)!=115){Da=X}else{Da=0}oa=Jm(Da,ia)|0;Ea=oa;if((oa|0)==0){Z=214;break a}Fa=Ea;Ga=Ea+(pa>>2<<2)|0;Ha=Ea+(ia>>>2<<2)|0;Ia=116}else{Fa=X;Ga=ea;Ha=fa;Ia=ha}c[Ga>>2]=ga;wa=V;xa=Fa;ya=Ga+4|0;za=Ha;Aa=0;Ba=Ia}ia=c[g>>2]|0;Ea=ia+12|0;pa=c[Ea>>2]|0;if((pa|0)==(c[ia+16>>2]|0)){kc[c[(c[ia>>2]|0)+40>>2]&63](ia)|0;V=wa;X=xa;ea=ya;fa=za;ga=Aa;ha=Ba;continue}else{c[Ea>>2]=pa+4;V=wa;X=xa;ea=ya;fa=za;ga=Aa;ha=Ba;continue}}if((X|0)==(ea|0)|(ga|0)==0){Ja=X;Ka=ea;La=fa;Ma=ha}else{if((ea|0)==(fa|0)){pa=ea-X|0;Ea=pa>>>0<2147483647?pa<<1:-1;if((ha|0)!=115){Na=X}else{Na=0}ia=Jm(Na,Ea)|0;oa=ia;if((ia|0)==0){Z=225;break a}Oa=oa;Pa=oa+(pa>>2<<2)|0;Qa=oa+(Ea>>>2<<2)|0;Ra=116}else{Oa=X;Pa=ea;Qa=fa;Ra=ha}c[Pa>>2]=ga;Ja=Oa;Ka=Pa+4|0;La=Qa;Ma=Ra}Ea=c[A>>2]|0;if((Ea|0)>0){oa=c[g>>2]|0;do{if((oa|0)==0){Sa=1}else{pa=c[oa+12>>2]|0;if((pa|0)==(c[oa+16>>2]|0)){Ta=kc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0}else{Ta=c[pa>>2]|0}if((Ta|0)==-1){c[g>>2]=0;Sa=1;break}else{Sa=(c[g>>2]|0)==0;break}}}while(0);oa=c[b>>2]|0;do{if((oa|0)==0){Z=242}else{ga=c[oa+12>>2]|0;if((ga|0)==(c[oa+16>>2]|0)){Ua=kc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0}else{Ua=c[ga>>2]|0}if((Ua|0)==-1){c[b>>2]=0;Z=242;break}else{if(Sa){Va=oa;break}else{Z=248;break a}}}}while(0);if((Z|0)==242){Z=0;if(Sa){Z=248;break a}else{Va=0}}oa=c[g>>2]|0;ga=c[oa+12>>2]|0;if((ga|0)==(c[oa+16>>2]|0)){Wa=kc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0}else{Wa=c[ga>>2]|0}if((Wa|0)!=(c[t>>2]|0)){Z=248;break a}ga=c[g>>2]|0;oa=ga+12|0;ha=c[oa>>2]|0;if((ha|0)==(c[ga+16>>2]|0)){kc[c[(c[ga>>2]|0)+40>>2]&63](ga)|0;Xa=Va;Ya=Ea;Za=Va;_a=V}else{c[oa>>2]=ha+4;Xa=Va;Ya=Ea;Za=Va;_a=V}while(1){ha=c[g>>2]|0;do{if((ha|0)==0){$a=1}else{oa=c[ha+12>>2]|0;if((oa|0)==(c[ha+16>>2]|0)){ab=kc[c[(c[ha>>2]|0)+36>>2]&63](ha)|0}else{ab=c[oa>>2]|0}if((ab|0)==-1){c[g>>2]=0;$a=1;break}else{$a=(c[g>>2]|0)==0;break}}}while(0);do{if((Za|0)==0){bb=Xa;Z=265}else{ha=c[Za+12>>2]|0;if((ha|0)==(c[Za+16>>2]|0)){cb=kc[c[(c[Za>>2]|0)+36>>2]&63](Za)|0}else{cb=c[ha>>2]|0}if((cb|0)==-1){c[b>>2]=0;bb=0;Z=265;break}else{if($a^(Xa|0)==0){db=Xa;eb=Xa;break}else{Z=271;break a}}}}while(0);if((Z|0)==265){Z=0;if($a){Z=271;break a}else{db=bb;eb=0}}ha=c[g>>2]|0;ka=c[ha+12>>2]|0;if((ka|0)==(c[ha+16>>2]|0)){fb=kc[c[(c[ha>>2]|0)+36>>2]&63](ha)|0}else{fb=c[ka>>2]|0}if(!(ec[c[(c[r>>2]|0)+12>>2]&31](l,2048,fb)|0)){Z=271;break a}ka=c[n>>2]|0;if((ka|0)==(_a|0)){ha=(c[Q>>2]|0)!=115;qa=c[s>>2]|0;ra=_a-qa|0;oa=ra>>>0<2147483647?ra<<1:-1;ga=ra>>2;if(ha){gb=qa}else{gb=0}qa=Jm(gb,oa)|0;ra=qa;if((qa|0)==0){Z=276;break a}do{if(ha){c[s>>2]=ra;hb=ra}else{qa=c[s>>2]|0;c[s>>2]=ra;if((qa|0)==0){hb=ra;break}hc[c[Q>>2]&127](qa);hb=c[s>>2]|0}}while(0);c[Q>>2]=116;ra=hb+(ga<<2)|0;c[n>>2]=ra;ib=ra;jb=(c[s>>2]|0)+(oa>>>2<<2)|0}else{ib=ka;jb=_a}ra=c[g>>2]|0;ha=c[ra+12>>2]|0;if((ha|0)==(c[ra+16>>2]|0)){qa=kc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0;kb=qa;lb=c[n>>2]|0}else{kb=c[ha>>2]|0;lb=ib}c[n>>2]=lb+4;c[lb>>2]=kb;ha=Ya+ -1|0;c[A>>2]=ha;qa=c[g>>2]|0;ra=qa+12|0;fa=c[ra>>2]|0;if((fa|0)==(c[qa+16>>2]|0)){kc[c[(c[qa>>2]|0)+40>>2]&63](qa)|0}else{c[ra>>2]=fa+4}if((ha|0)>0){Xa=db;Ya=ha;Za=eb;_a=jb}else{mb=jb;break}}}else{mb=V}if((c[n>>2]|0)==(c[s>>2]|0)){Z=290;break a}else{nb=mb;ob=Ja;pb=Ka;qb=La;rb=T;sb=Ma}break};case 1:{if((o|0)==3){aa=S;ba=q;ca=T;da=U;Z=292;break a}Ea=c[g>>2]|0;ha=c[Ea+12>>2]|0;if((ha|0)==(c[Ea+16>>2]|0)){tb=kc[c[(c[Ea>>2]|0)+36>>2]&63](Ea)|0}else{tb=c[ha>>2]|0}if(!(ec[c[(c[r>>2]|0)+12>>2]&31](l,8192,tb)|0)){Z=27;break a}ha=c[g>>2]|0;Ea=ha+12|0;fa=c[Ea>>2]|0;if((fa|0)==(c[ha+16>>2]|0)){ub=kc[c[(c[ha>>2]|0)+40>>2]&63](ha)|0}else{c[Ea>>2]=fa+4;ub=c[fa>>2]|0}Ke(z,ub);Z=28;break};case 3:{fa=a[F]|0;Ea=(fa&1)==0;if(Ea){vb=(fa&255)>>>1}else{vb=c[J>>2]|0}ha=a[G]|0;ra=(ha&1)==0;if(ra){wb=(ha&255)>>>1}else{wb=c[f>>2]|0}if((vb|0)==(0-wb|0)){nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break b}if(Ea){xb=(fa&255)>>>1}else{xb=c[J>>2]|0}do{if((xb|0)!=0){if(ra){yb=(ha&255)>>>1}else{yb=c[f>>2]|0}if((yb|0)==0){break}qa=c[g>>2]|0;ea=c[qa+12>>2]|0;if((ea|0)==(c[qa+16>>2]|0)){X=kc[c[(c[qa>>2]|0)+36>>2]&63](qa)|0;zb=X;Ab=a[F]|0}else{zb=c[ea>>2]|0;Ab=fa}ea=c[g>>2]|0;X=ea+12|0;qa=c[X>>2]|0;pa=(qa|0)==(c[ea+16>>2]|0);if((zb|0)==(c[((Ab&1)==0?J:c[K>>2]|0)>>2]|0)){if(pa){kc[c[(c[ea>>2]|0)+40>>2]&63](ea)|0}else{c[X>>2]=qa+4}X=a[F]|0;if((X&1)==0){Bb=(X&255)>>>1}else{Bb=c[J>>2]|0}nb=C;ob=S;pb=q;qb=R;rb=Bb>>>0>1?x:T;sb=U;break b}if(pa){Cb=kc[c[(c[ea>>2]|0)+36>>2]&63](ea)|0}else{Cb=c[qa>>2]|0}if((Cb|0)!=(c[((a[G]&1)==0?f:c[I>>2]|0)>>2]|0)){Z=116;break a}qa=c[g>>2]|0;ea=qa+12|0;pa=c[ea>>2]|0;if((pa|0)==(c[qa+16>>2]|0)){kc[c[(c[qa>>2]|0)+40>>2]&63](qa)|0}else{c[ea>>2]=pa+4}a[k]=1;pa=a[G]|0;if((pa&1)==0){Db=(pa&255)>>>1}else{Db=c[f>>2]|0}nb=C;ob=S;pb=q;qb=R;rb=Db>>>0>1?y:T;sb=U;break b}}while(0);if(Ea){Eb=(fa&255)>>>1}else{Eb=c[J>>2]|0}ra=c[g>>2]|0;V=c[ra+12>>2]|0;pa=(V|0)==(c[ra+16>>2]|0);if((Eb|0)==0){if(pa){ea=kc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0;Fb=ea;Gb=a[G]|0}else{Fb=c[V>>2]|0;Gb=ha}if((Fb|0)!=(c[((Gb&1)==0?f:c[I>>2]|0)>>2]|0)){nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break b}ea=c[g>>2]|0;qa=ea+12|0;X=c[qa>>2]|0;if((X|0)==(c[ea+16>>2]|0)){kc[c[(c[ea>>2]|0)+40>>2]&63](ea)|0}else{c[qa>>2]=X+4}a[k]=1;X=a[G]|0;if((X&1)==0){Hb=(X&255)>>>1}else{Hb=c[f>>2]|0}nb=C;ob=S;pb=q;qb=R;rb=Hb>>>0>1?y:T;sb=U;break b}if(pa){pa=kc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0;Ib=pa;Jb=a[F]|0}else{Ib=c[V>>2]|0;Jb=fa}if((Ib|0)!=(c[((Jb&1)==0?J:c[K>>2]|0)>>2]|0)){a[k]=1;nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break b}V=c[g>>2]|0;pa=V+12|0;ra=c[pa>>2]|0;if((ra|0)==(c[V+16>>2]|0)){kc[c[(c[V>>2]|0)+40>>2]&63](V)|0}else{c[pa>>2]=ra+4}ra=a[F]|0;if((ra&1)==0){Kb=(ra&255)>>>1}else{Kb=c[J>>2]|0}nb=C;ob=S;pb=q;qb=R;rb=Kb>>>0>1?x:T;sb=U;break};case 2:{if(!((T|0)!=0|o>>>0<2)){if((o|0)==2){Lb=(a[P]|0)!=0}else{Lb=0}if(!(L|Lb)){nb=C;ob=S;pb=q;qb=R;rb=0;sb=U;break b}}ra=a[E]|0;pa=(ra&1)==0?h:c[M>>2]|0;d:do{if((o|0)==0){Mb=$;Nb=$;Ob=ra;Pb=pa}else{if((d[e+(o+ -1)|0]|0)<2){Qb=ra;Rb=pa}else{Mb=$;Nb=$;Ob=ra;Pb=pa;break}while(1){if((Qb&1)==0){Sb=h;Tb=(Qb&255)>>>1}else{Sb=c[M>>2]|0;Tb=c[h>>2]|0}if((Rb|0)==(Sb+(Tb<<2)|0)){Ub=Qb;break}if(!(ec[c[(c[r>>2]|0)+12>>2]&31](l,8192,c[Rb>>2]|0)|0)){Z=129;break}Qb=a[E]|0;Rb=Rb+4|0}if((Z|0)==129){Z=0;Ub=a[E]|0}ka=(Ub&1)==0;oa=Rb-(ka?h:c[M>>2]|0)>>2;ga=a[H]|0;V=(ga&1)==0;if(V){Vb=(ga&255)>>>1}else{Vb=c[N>>2]|0}e:do{if(!(oa>>>0>Vb>>>0)){if(V){Wb=N+(((ga&255)>>>1)-oa<<2)|0;Xb=N;Yb=(ga&255)>>>1}else{X=c[O>>2]|0;qa=c[N>>2]|0;Wb=X+(qa-oa<<2)|0;Xb=X;Yb=qa}qa=Xb+(Yb<<2)|0;if((Wb|0)==(qa|0)){Mb=$;Nb=$;Ob=Ub;Pb=Rb;break d}else{Zb=ka?h:c[M>>2]|0;_b=Wb}while(1){if((c[_b>>2]|0)!=(c[Zb>>2]|0)){break e}X=_b+4|0;if((X|0)==(qa|0)){Mb=$;Nb=$;Ob=Ub;Pb=Rb;break d}Zb=Zb+4|0;_b=X}}}while(0);Mb=$;Nb=$;Ob=Ub;Pb=ka?h:c[M>>2]|0}}while(0);f:while(1){if((Ob&1)==0){$b=h;ac=(Ob&255)>>>1}else{$b=c[M>>2]|0;ac=c[h>>2]|0}if((Pb|0)==($b+(ac<<2)|0)){break}pa=c[g>>2]|0;do{if((pa|0)==0){bc=1}else{ra=c[pa+12>>2]|0;if((ra|0)==(c[pa+16>>2]|0)){cc=kc[c[(c[pa>>2]|0)+36>>2]&63](pa)|0}else{cc=c[ra>>2]|0}if((cc|0)==-1){c[g>>2]=0;bc=1;break}else{bc=(c[g>>2]|0)==0;break}}}while(0);do{if((Nb|0)==0){dc=Mb;Z=159}else{pa=c[Nb+12>>2]|0;if((pa|0)==(c[Nb+16>>2]|0)){fc=kc[c[(c[Nb>>2]|0)+36>>2]&63](Nb)|0}else{fc=c[pa>>2]|0}if((fc|0)==-1){c[b>>2]=0;dc=0;Z=159;break}else{if(bc^(Mb|0)==0){gc=Mb;ic=Mb;break}else{break f}}}}while(0);if((Z|0)==159){Z=0;if(bc){break}else{gc=dc;ic=0}}pa=c[g>>2]|0;ka=c[pa+12>>2]|0;if((ka|0)==(c[pa+16>>2]|0)){jc=kc[c[(c[pa>>2]|0)+36>>2]&63](pa)|0}else{jc=c[ka>>2]|0}if((jc|0)!=(c[Pb>>2]|0)){break}ka=c[g>>2]|0;pa=ka+12|0;ra=c[pa>>2]|0;if((ra|0)==(c[ka+16>>2]|0)){kc[c[(c[ka>>2]|0)+40>>2]&63](ka)|0}else{c[pa>>2]=ra+4}Mb=gc;Nb=ic;Ob=a[E]|0;Pb=Pb+4|0}if(!L){nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break b}ra=a[E]|0;if((ra&1)==0){lc=h;mc=(ra&255)>>>1}else{lc=c[M>>2]|0;mc=c[h>>2]|0}if((Pb|0)==(lc+(mc<<2)|0)){nb=C;ob=S;pb=q;qb=R;rb=T;sb=U}else{Z=174;break a}break};default:{nb=C;ob=S;pb=q;qb=R;rb=T;sb=U}}}while(0);g:do{if((Z|0)==28){Z=0;if((o|0)==3){aa=S;ba=q;ca=T;da=U;Z=292;break a}else{nc=$;oc=$}while(1){ra=c[g>>2]|0;do{if((ra|0)==0){pc=1}else{pa=c[ra+12>>2]|0;if((pa|0)==(c[ra+16>>2]|0)){qc=kc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0}else{qc=c[pa>>2]|0}if((qc|0)==-1){c[g>>2]=0;pc=1;break}else{pc=(c[g>>2]|0)==0;break}}}while(0);do{if((oc|0)==0){rc=nc;Z=42}else{ra=c[oc+12>>2]|0;if((ra|0)==(c[oc+16>>2]|0)){sc=kc[c[(c[oc>>2]|0)+36>>2]&63](oc)|0}else{sc=c[ra>>2]|0}if((sc|0)==-1){c[b>>2]=0;rc=0;Z=42;break}else{if(pc^(nc|0)==0){tc=nc;uc=nc;break}else{nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break g}}}}while(0);if((Z|0)==42){Z=0;if(pc){nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break g}else{tc=rc;uc=0}}ra=c[g>>2]|0;pa=c[ra+12>>2]|0;if((pa|0)==(c[ra+16>>2]|0)){vc=kc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0}else{vc=c[pa>>2]|0}if(!(ec[c[(c[r>>2]|0)+12>>2]&31](l,8192,vc)|0)){nb=C;ob=S;pb=q;qb=R;rb=T;sb=U;break g}pa=c[g>>2]|0;ra=pa+12|0;ka=c[ra>>2]|0;if((ka|0)==(c[pa+16>>2]|0)){wc=kc[c[(c[pa>>2]|0)+40>>2]&63](pa)|0}else{c[ra>>2]=ka+4;wc=c[ka>>2]|0}Ke(z,wc);nc=tc;oc=uc}}}while(0);ka=o+1|0;if(ka>>>0<4){R=qb;q=pb;S=ob;C=nb;o=ka;T=rb;U=sb}else{aa=ob;ba=pb;ca=rb;da=sb;Z=292;break}}h:do{if((Z|0)==27){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==116){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==174){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==198){Tm()}else if((Z|0)==214){Tm()}else if((Z|0)==225){Tm()}else if((Z|0)==248){c[j>>2]=c[j>>2]|4;xc=0;yc=Ja;zc=Ma}else if((Z|0)==271){c[j>>2]=c[j>>2]|4;xc=0;yc=Ja;zc=Ma}else if((Z|0)==276){Tm()}else if((Z|0)==290){c[j>>2]=c[j>>2]|4;xc=0;yc=Ja;zc=Ma}else if((Z|0)==292){i:do{if((ca|0)!=0){sb=ca;rb=ca+4|0;pb=ca+8|0;ob=1;j:while(1){T=a[sb]|0;if((T&1)==0){Ac=(T&255)>>>1}else{Ac=c[rb>>2]|0}if(!(ob>>>0<Ac>>>0)){break i}T=c[g>>2]|0;do{if((T|0)==0){Bc=1}else{o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Cc=kc[c[(c[T>>2]|0)+36>>2]&63](T)|0}else{Cc=c[o>>2]|0}if((Cc|0)==-1){c[g>>2]=0;Bc=1;break}else{Bc=(c[g>>2]|0)==0;break}}}while(0);T=c[b>>2]|0;do{if((T|0)==0){Z=311}else{o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Dc=kc[c[(c[T>>2]|0)+36>>2]&63](T)|0}else{Dc=c[o>>2]|0}if((Dc|0)==-1){c[b>>2]=0;Z=311;break}else{if(Bc){break}else{break j}}}}while(0);if((Z|0)==311){Z=0;if(Bc){break}}T=c[g>>2]|0;o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Ec=kc[c[(c[T>>2]|0)+36>>2]&63](T)|0}else{Ec=c[o>>2]|0}if((a[sb]&1)==0){Fc=rb}else{Fc=c[pb>>2]|0}if((Ec|0)!=(c[Fc+(ob<<2)>>2]|0)){break}o=ob+1|0;T=c[g>>2]|0;nb=T+12|0;C=c[nb>>2]|0;if((C|0)==(c[T+16>>2]|0)){kc[c[(c[T>>2]|0)+40>>2]&63](T)|0;ob=o;continue}else{c[nb>>2]=C+4;ob=o;continue}}c[j>>2]=c[j>>2]|4;xc=0;yc=aa;zc=da;break h}}while(0);if((aa|0)==(ba|0)){xc=1;yc=ba;zc=da;break}c[B>>2]=0;jj(v,aa,ba,B);if((c[B>>2]|0)==0){xc=1;yc=aa;zc=da;break}c[j>>2]=c[j>>2]|4;xc=0;yc=aa;zc=da}}while(0);Ge(z);Ge(y);Ge(x);Ge(w);ve(v);if((yc|0)==0){i=p;return xc|0}hc[zc&127](yc);i=p;return xc|0}function oj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+464|0;l=d;m=d+8|0;n=d+24|0;o=d+424|0;p=d+432|0;q=d+440|0;r=d+448|0;s=d+456|0;t=o;c[t>>2]=n;u=o+4|0;c[u>>2]=115;v=n+400|0;Pe(q,h);n=q;w=c[n>>2]|0;if(!((c[1824]|0)==-1)){c[m>>2]=7296;c[m+4>>2]=113;c[m+8>>2]=0;qe(7296,m,114)}m=(c[7300>>2]|0)+ -1|0;x=c[w+8>>2]|0;if(!((c[w+12>>2]|0)-x>>2>>>0>m>>>0)){y=Ta(4)|0;z=y;mm(z);Vb(y|0,15264,101)}w=c[x+(m<<2)>>2]|0;if((w|0)==0){y=Ta(4)|0;z=y;mm(z);Vb(y|0,15264,101)}y=w;a[r]=0;z=f;f=c[z>>2]|0;c[s>>2]=f;m=c[h+4>>2]|0;h=l;x=s;c[h+0>>2]=c[x+0>>2];x=nj(e,l,g,q,m,j,r,y,o,p,v)|0;if(x){x=k;if((a[x]&1)==0){c[k+4>>2]=0;a[x]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}x=w;if((a[r]|0)!=0){Ke(k,tc[c[(c[x>>2]|0)+44>>2]&15](y,45)|0)}r=tc[c[(c[x>>2]|0)+44>>2]&15](y,48)|0;y=c[t>>2]|0;x=c[p>>2]|0;p=x+ -4|0;a:do{if(y>>>0<p>>>0){w=y;while(1){v=w+4|0;if((c[w>>2]|0)!=(r|0)){A=w;break a}if(v>>>0<p>>>0){w=v}else{A=v;break}}}else{A=y}}while(0);pj(k,A,x)|0}x=e;e=c[x>>2]|0;do{if((e|0)==0){B=1}else{A=c[e+12>>2]|0;if((A|0)==(c[e+16>>2]|0)){C=kc[c[(c[e>>2]|0)+36>>2]&63](e)|0}else{C=c[A>>2]|0}if((C|0)==-1){c[x>>2]=0;B=1;break}else{B=(c[x>>2]|0)==0;break}}}while(0);do{if((f|0)==0){D=29}else{C=c[f+12>>2]|0;if((C|0)==(c[f+16>>2]|0)){E=kc[c[(c[f>>2]|0)+36>>2]&63](f)|0}else{E=c[C>>2]|0}if((E|0)==-1){c[z>>2]=0;D=29;break}else{if(B){break}else{D=31;break}}}}while(0);if((D|0)==29){if(B){D=31}}if((D|0)==31){c[j>>2]=c[j>>2]|2}c[b>>2]=c[x>>2];Yd(c[n>>2]|0)|0;n=c[t>>2]|0;c[t>>2]=0;if((n|0)==0){i=d;return}hc[c[u>>2]&127](n);i=d;return}function pj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;g=b;h=d;j=a[g]|0;if((j&1)==0){k=(j&255)>>>1;l=j;m=1}else{j=c[b>>2]|0;k=c[b+4>>2]|0;l=j&255;m=(j&-2)+ -1|0}j=e-h>>2;if((j|0)==0){i=f;return b|0}if((m-k|0)>>>0<j>>>0){Me(b,m,k+j-m|0,k,k,0,0);n=a[g]|0}else{n=l}if((n&1)==0){o=b+4|0}else{o=c[b+8>>2]|0}n=o+(k<<2)|0;if((d|0)==(e|0)){p=n}else{l=k+((e+ -4+(0-h)|0)>>>2)+1|0;h=d;d=n;while(1){c[d>>2]=c[h>>2];n=h+4|0;if((n|0)==(e|0)){break}else{d=d+4|0;h=n}}p=o+(l<<2)|0}c[p>>2]=0;p=k+j|0;if((a[g]&1)==0){a[g]=p<<1;i=f;return b|0}else{c[b+4>>2]=p;i=f;return b|0}return 0}function qj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;n=i;i=i+176|0;o=n;p=n+16|0;q=n+32|0;r=n+40|0;s=n+56|0;t=n+72|0;u=n+88|0;v=n+104|0;w=n+112|0;x=n+128|0;y=n+144|0;z=n+160|0;if(b){b=c[d>>2]|0;if(!((c[1718]|0)==-1)){c[p>>2]=6872;c[p+4>>2]=113;c[p+8>>2]=0;qe(6872,p,114)}p=(c[6876>>2]|0)+ -1|0;A=c[b+8>>2]|0;if(!((c[b+12>>2]|0)-A>>2>>>0>p>>>0)){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}b=c[A+(p<<2)>>2]|0;if((b|0)==0){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}B=b;ic[c[(c[b>>2]|0)+44>>2]&63](q,B);C=e;p=c[q>>2]|0;a[C]=p;a[C+1|0]=p>>8;a[C+2|0]=p>>16;a[C+3|0]=p>>24;p=b;ic[c[(c[p>>2]|0)+32>>2]&63](r,B);C=l;if((a[C]&1)==0){c[l+4>>2]=0;a[C]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Je(l,0);q=r;c[C+0>>2]=c[q+0>>2];c[C+4>>2]=c[q+4>>2];c[C+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;Ge(r);ic[c[(c[p>>2]|0)+28>>2]&63](s,B);r=k;if((a[r]&1)==0){c[k+4>>2]=0;a[r]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Je(k,0);q=s;c[r+0>>2]=c[q+0>>2];c[r+4>>2]=c[q+4>>2];c[r+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;Ge(s);s=b;c[f>>2]=kc[c[(c[s>>2]|0)+12>>2]&63](B)|0;c[g>>2]=kc[c[(c[s>>2]|0)+16>>2]&63](B)|0;ic[c[(c[b>>2]|0)+20>>2]&63](t,B);b=h;if((a[b]&1)==0){a[h+1|0]=0;a[b]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}ze(h,0);q=t;c[b+0>>2]=c[q+0>>2];c[b+4>>2]=c[q+4>>2];c[b+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;ve(t);ic[c[(c[p>>2]|0)+24>>2]&63](u,B);p=j;if((a[p]&1)==0){c[j+4>>2]=0;a[p]=0}else{c[c[j+8>>2]>>2]=0;c[j+4>>2]=0}Je(j,0);t=u;c[p+0>>2]=c[t+0>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;Ge(u);D=kc[c[(c[s>>2]|0)+36>>2]&63](B)|0;c[m>>2]=D;i=n;return}else{B=c[d>>2]|0;if(!((c[1702]|0)==-1)){c[o>>2]=6808;c[o+4>>2]=113;c[o+8>>2]=0;qe(6808,o,114)}o=(c[6812>>2]|0)+ -1|0;d=c[B+8>>2]|0;if(!((c[B+12>>2]|0)-d>>2>>>0>o>>>0)){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}B=c[d+(o<<2)>>2]|0;if((B|0)==0){E=Ta(4)|0;F=E;mm(F);Vb(E|0,15264,101)}E=B;ic[c[(c[B>>2]|0)+44>>2]&63](v,E);F=e;e=c[v>>2]|0;a[F]=e;a[F+1|0]=e>>8;a[F+2|0]=e>>16;a[F+3|0]=e>>24;e=B;ic[c[(c[e>>2]|0)+32>>2]&63](w,E);F=l;if((a[F]&1)==0){c[l+4>>2]=0;a[F]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Je(l,0);l=w;c[F+0>>2]=c[l+0>>2];c[F+4>>2]=c[l+4>>2];c[F+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;Ge(w);ic[c[(c[e>>2]|0)+28>>2]&63](x,E);w=k;if((a[w]&1)==0){c[k+4>>2]=0;a[w]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Je(k,0);k=x;c[w+0>>2]=c[k+0>>2];c[w+4>>2]=c[k+4>>2];c[w+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;Ge(x);x=B;c[f>>2]=kc[c[(c[x>>2]|0)+12>>2]&63](E)|0;c[g>>2]=kc[c[(c[x>>2]|0)+16>>2]&63](E)|0;ic[c[(c[B>>2]|0)+20>>2]&63](y,E);B=h;if((a[B]&1)==0){a[h+1|0]=0;a[B]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}ze(h,0);h=y;c[B+0>>2]=c[h+0>>2];c[B+4>>2]=c[h+4>>2];c[B+8>>2]=c[h+8>>2];c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;ve(y);ic[c[(c[e>>2]|0)+24>>2]&63](z,E);e=j;if((a[e]&1)==0){c[j+4>>2]=0;a[e]=0}else{c[c[j+8>>2]>>2]=0;c[j+4>>2]=0}Je(j,0);j=z;c[e+0>>2]=c[j+0>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;Ge(z);D=kc[c[(c[x>>2]|0)+36>>2]&63](E)|0;c[m>>2]=D;i=n;return}}function rj(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function sj(a){a=a|0;i=i;return}function tj(b,d,e,f,g,j,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;l=+l;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0;d=i;i=i+16|0;m=d;n=d+8|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+104|0;r=i;i=i+8|0;s=i;i=i+104|0;t=i;i=i+8|0;u=i;i=i+8|0;v=u;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+104|0;D=i;i=i+8|0;E=i;i=i+8|0;F=i;i=i+8|0;G=q;c[r>>2]=G;q=s;s=o;h[k>>3]=l;c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];s=ib(G|0,100,7056,o|0)|0;do{if(s>>>0>99){do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);o=c[1798]|0;G=n;h[k>>3]=l;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];G=oh(r,o,7056,n)|0;o=c[r>>2]|0;if((o|0)==0){Tm()}H=Hm(G)|0;if((H|0)!=0){I=o;J=H;K=H;L=G;break}Tm()}else{I=0;J=0;K=q;L=s}}while(0);Pe(t,g);s=t;q=c[s>>2]|0;if(!((c[1826]|0)==-1)){c[p>>2]=7304;c[p+4>>2]=113;c[p+8>>2]=0;qe(7304,p,114)}p=(c[7308>>2]|0)+ -1|0;n=c[q+8>>2]|0;if(!((c[q+12>>2]|0)-n>>2>>>0>p>>>0)){M=Ta(4)|0;N=M;mm(N);Vb(M|0,15264,101)}q=c[n+(p<<2)>>2]|0;if((q|0)==0){M=Ta(4)|0;N=M;mm(N);Vb(M|0,15264,101)}M=q;N=c[r>>2]|0;qc[c[(c[q>>2]|0)+32>>2]&7](M,N,N+L|0,K)|0;if((L|0)==0){O=0}else{O=(a[c[r>>2]|0]|0)==45}c[u>>2]=0;u=y;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;u=z;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;r=A;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;uj(f,O,t,v,w,x,y,z,A,B);t=C;C=c[B>>2]|0;if((L|0)>(C|0)){B=a[r]|0;if((B&1)==0){P=(B&255)>>>1}else{P=c[A+4>>2]|0}B=a[u]|0;if((B&1)==0){Q=(B&255)>>>1}else{Q=c[z+4>>2]|0}R=P+(L-C<<1|1)+Q|0}else{Q=a[r]|0;if((Q&1)==0){S=(Q&255)>>>1}else{S=c[A+4>>2]|0}Q=a[u]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[z+4>>2]|0}R=S+2+T|0}T=R+C|0;do{if(T>>>0>100){R=Hm(T)|0;if((R|0)!=0){U=R;V=R;break}Tm()}else{U=0;V=t}}while(0);vj(V,D,E,c[g+4>>2]|0,K,K+L|0,M,O,v,a[w]|0,a[x]|0,y,z,A,C);c[F>>2]=c[e>>2];e=c[D>>2]|0;D=c[E>>2]|0;E=m;C=F;c[E+0>>2]=c[C+0>>2];jh(b,m,V,e,D,g,j);if((U|0)!=0){Im(U)}ve(A);ve(z);ve(y);Yd(c[s>>2]|0)|0;if((J|0)!=0){Im(J)}if((I|0)==0){i=d;return}Im(I);i=d;return}function uj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=i;i=i+40|0;o=n;p=n+16|0;q=n+32|0;r=q;s=i;i=i+16|0;t=i;i=i+8|0;u=t;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+8|0;z=y;A=i;i=i+16|0;B=i;i=i+8|0;C=B;D=i;i=i+16|0;E=i;i=i+16|0;F=i;i=i+16|0;G=c[e>>2]|0;if(b){if(!((c[1686]|0)==-1)){c[p>>2]=6744;c[p+4>>2]=113;c[p+8>>2]=0;qe(6744,p,114)}p=(c[6748>>2]|0)+ -1|0;b=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-b>>2>>>0>p>>>0)){H=Ta(4)|0;I=H;mm(I);Vb(H|0,15264,101)}e=c[b+(p<<2)>>2]|0;if((e|0)==0){H=Ta(4)|0;I=H;mm(I);Vb(H|0,15264,101)}H=e;I=c[e>>2]|0;if(d){ic[c[I+44>>2]&63](r,H);r=f;p=c[q>>2]|0;a[r]=p;a[r+1|0]=p>>8;a[r+2|0]=p>>16;a[r+3|0]=p>>24;ic[c[(c[e>>2]|0)+32>>2]&63](s,H);p=l;if((a[p]&1)==0){a[l+1|0]=0;a[p]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}ze(l,0);r=s;c[p+0>>2]=c[r+0>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;ve(s)}else{ic[c[I+40>>2]&63](u,H);u=f;I=c[t>>2]|0;a[u]=I;a[u+1|0]=I>>8;a[u+2|0]=I>>16;a[u+3|0]=I>>24;ic[c[(c[e>>2]|0)+28>>2]&63](v,H);I=l;if((a[I]&1)==0){a[l+1|0]=0;a[I]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}ze(l,0);u=v;c[I+0>>2]=c[u+0>>2];c[I+4>>2]=c[u+4>>2];c[I+8>>2]=c[u+8>>2];c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;ve(v)}v=e;a[g]=kc[c[(c[v>>2]|0)+12>>2]&63](H)|0;a[h]=kc[c[(c[v>>2]|0)+16>>2]&63](H)|0;v=e;ic[c[(c[v>>2]|0)+20>>2]&63](w,H);u=j;if((a[u]&1)==0){a[j+1|0]=0;a[u]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}ze(j,0);I=w;c[u+0>>2]=c[I+0>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;ve(w);ic[c[(c[v>>2]|0)+24>>2]&63](x,H);v=k;if((a[v]&1)==0){a[k+1|0]=0;a[v]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}ze(k,0);w=x;c[v+0>>2]=c[w+0>>2];c[v+4>>2]=c[w+4>>2];c[v+8>>2]=c[w+8>>2];c[w+0>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;ve(x);J=kc[c[(c[e>>2]|0)+36>>2]&63](H)|0;c[m>>2]=J;i=n;return}else{if(!((c[1670]|0)==-1)){c[o>>2]=6680;c[o+4>>2]=113;c[o+8>>2]=0;qe(6680,o,114)}o=(c[6684>>2]|0)+ -1|0;H=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-H>>2>>>0>o>>>0)){K=Ta(4)|0;L=K;mm(L);Vb(K|0,15264,101)}G=c[H+(o<<2)>>2]|0;if((G|0)==0){K=Ta(4)|0;L=K;mm(L);Vb(K|0,15264,101)}K=G;L=c[G>>2]|0;if(d){ic[c[L+44>>2]&63](z,K);z=f;d=c[y>>2]|0;a[z]=d;a[z+1|0]=d>>8;a[z+2|0]=d>>16;a[z+3|0]=d>>24;ic[c[(c[G>>2]|0)+32>>2]&63](A,K);d=l;if((a[d]&1)==0){a[l+1|0]=0;a[d]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}ze(l,0);z=A;c[d+0>>2]=c[z+0>>2];c[d+4>>2]=c[z+4>>2];c[d+8>>2]=c[z+8>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;ve(A)}else{ic[c[L+40>>2]&63](C,K);C=f;f=c[B>>2]|0;a[C]=f;a[C+1|0]=f>>8;a[C+2|0]=f>>16;a[C+3|0]=f>>24;ic[c[(c[G>>2]|0)+28>>2]&63](D,K);f=l;if((a[f]&1)==0){a[l+1|0]=0;a[f]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}ze(l,0);l=D;c[f+0>>2]=c[l+0>>2];c[f+4>>2]=c[l+4>>2];c[f+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;ve(D)}D=G;a[g]=kc[c[(c[D>>2]|0)+12>>2]&63](K)|0;a[h]=kc[c[(c[D>>2]|0)+16>>2]&63](K)|0;D=G;ic[c[(c[D>>2]|0)+20>>2]&63](E,K);h=j;if((a[h]&1)==0){a[j+1|0]=0;a[h]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}ze(j,0);j=E;c[h+0>>2]=c[j+0>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ve(E);ic[c[(c[D>>2]|0)+24>>2]&63](F,K);D=k;if((a[D]&1)==0){a[k+1|0]=0;a[D]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}ze(k,0);k=F;c[D+0>>2]=c[k+0>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;ve(F);J=kc[c[(c[G>>2]|0)+36>>2]&63](K)|0;c[m>>2]=J;i=n;return}}function vj(d,e,f,g,h,j,k,l,m,n,o,p,q,r,s){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;s=s|0;var t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0;t=i;c[f>>2]=d;u=k;v=r;w=r+1|0;x=r+8|0;y=r+4|0;r=q;z=(g&512|0)==0;A=q+1|0;B=q+8|0;C=q+4|0;q=(s|0)>0;D=p;E=p+1|0;F=p+8|0;G=p+4|0;p=k+8|0;H=0-s|0;I=h;h=0;while(1){a:do{switch(a[m+h|0]|0){case 0:{c[e>>2]=c[f>>2];J=I;break};case 4:{K=c[f>>2]|0;L=l?I+1|0:I;b:do{if(L>>>0<j>>>0){M=L;while(1){N=a[M]|0;if(!(N<<24>>24>-1)){O=M;break b}P=M+1|0;if((b[(c[p>>2]|0)+(N<<24>>24<<1)>>1]&2048)==0){O=M;break b}if(P>>>0<j>>>0){M=P}else{O=P;break}}}else{O=L}}while(0);M=O;if(q){if(O>>>0>L>>>0){P=L+(0-M)|0;M=P>>>0<H>>>0?H:P;P=M+s|0;N=K;Q=O;R=s;while(1){S=Q+ -1|0;T=a[S]|0;c[f>>2]=N+1;a[N]=T;T=R+ -1|0;U=(T|0)>0;if(!(S>>>0>L>>>0&U)){break}N=c[f>>2]|0;R=T;Q=S}Q=O+M|0;if(U){V=Q;W=P;X=32}else{Y=0;Z=Q;_=P}}else{V=O;W=s;X=32}if((X|0)==32){X=0;Y=tc[c[(c[u>>2]|0)+28>>2]&15](k,48)|0;Z=V;_=W}Q=c[f>>2]|0;c[f>>2]=Q+1;if((_|0)>0){R=Q;N=_;while(1){a[R]=Y;S=N+ -1|0;T=c[f>>2]|0;c[f>>2]=T+1;if((S|0)>0){N=S;R=T}else{$=T;break}}}else{$=Q}a[$]=n;aa=Z}else{aa=O}if((aa|0)==(L|0)){R=tc[c[(c[u>>2]|0)+28>>2]&15](k,48)|0;N=c[f>>2]|0;c[f>>2]=N+1;a[N]=R}else{R=a[D]|0;N=(R&1)==0;if(N){ba=(R&255)>>>1}else{ba=c[G>>2]|0}if((ba|0)==0){ca=aa;da=-1;ea=0;fa=0}else{if(N){ga=E}else{ga=c[F>>2]|0}ca=aa;da=a[ga]|0;ea=0;fa=0}while(1){do{if((fa|0)==(da|0)){N=c[f>>2]|0;c[f>>2]=N+1;a[N]=o;N=ea+1|0;R=a[D]|0;P=(R&1)==0;if(P){ha=(R&255)>>>1}else{ha=c[G>>2]|0}if(!(N>>>0<ha>>>0)){ia=da;ja=N;ka=0;break}if(P){la=E}else{la=c[F>>2]|0}if((a[la+N|0]|0)==127){ia=-1;ja=N;ka=0;break}if(P){ma=E}else{ma=c[F>>2]|0}ia=a[ma+N|0]|0;ja=N;ka=0}else{ia=da;ja=ea;ka=fa}}while(0);N=ca+ -1|0;P=a[N]|0;R=c[f>>2]|0;c[f>>2]=R+1;a[R]=P;if((N|0)==(L|0)){break}else{ca=N;da=ia;ea=ja;fa=ka+1|0}}}Q=c[f>>2]|0;if((K|0)==(Q|0)){J=L;break a}N=Q+ -1|0;if(N>>>0>K>>>0){na=K;oa=N}else{J=L;break a}while(1){N=a[na]|0;a[na]=a[oa]|0;a[oa]=N;N=na+1|0;Q=oa+ -1|0;if(N>>>0<Q>>>0){oa=Q;na=N}else{J=L;break}}break};case 2:{L=a[r]|0;K=(L&1)==0;if(K){pa=(L&255)>>>1}else{pa=c[C>>2]|0}if((pa|0)==0|z){J=I;break a}if(K){qa=A;ra=(L&255)>>>1}else{qa=c[B>>2]|0;ra=c[C>>2]|0}L=qa+ra|0;K=c[f>>2]|0;if((qa|0)==(L|0)){sa=K}else{N=K;K=qa;while(1){a[N]=a[K]|0;Q=K+1|0;P=N+1|0;if((Q|0)==(L|0)){sa=P;break}else{K=Q;N=P}}}c[f>>2]=sa;J=I;break};case 3:{N=a[v]|0;K=(N&1)==0;if(K){ta=(N&255)>>>1}else{ta=c[y>>2]|0}if((ta|0)==0){J=I;break a}if(K){ua=w}else{ua=c[x>>2]|0}K=a[ua]|0;N=c[f>>2]|0;c[f>>2]=N+1;a[N]=K;J=I;break};case 1:{c[e>>2]=c[f>>2];K=tc[c[(c[u>>2]|0)+28>>2]&15](k,32)|0;N=c[f>>2]|0;c[f>>2]=N+1;a[N]=K;J=I;break};default:{J=I}}}while(0);K=h+1|0;if((K|0)==4){break}else{I=J;h=K}}h=a[v]|0;v=(h&1)==0;if(v){va=(h&255)>>>1}else{va=c[y>>2]|0}if(va>>>0>1){if(v){wa=w;xa=(h&255)>>>1}else{wa=c[x>>2]|0;xa=c[y>>2]|0}y=wa+1|0;x=wa+xa|0;xa=c[f>>2]|0;if((y|0)==(x|0)){ya=xa}else{wa=xa;xa=y;while(1){a[wa]=a[xa]|0;y=xa+1|0;h=wa+1|0;if((y|0)==(x|0)){ya=h;break}else{xa=y;wa=h}}}c[f>>2]=ya}ya=g&176;if((ya|0)==32){c[e>>2]=c[f>>2];i=t;return}else if((ya|0)==16){i=t;return}else{c[e>>2]=d;i=t;return}}function wj(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;d=i;i=i+40|0;k=d;l=d+8|0;m=d+24|0;n=d+32|0;o=n;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+16|0;s=i;i=i+16|0;t=i;i=i+16|0;u=i;i=i+8|0;v=i;i=i+104|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;Pe(m,g);z=m;A=c[z>>2]|0;if(!((c[1826]|0)==-1)){c[l>>2]=7304;c[l+4>>2]=113;c[l+8>>2]=0;qe(7304,l,114)}l=(c[7308>>2]|0)+ -1|0;B=c[A+8>>2]|0;if(!((c[A+12>>2]|0)-B>>2>>>0>l>>>0)){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}A=c[B+(l<<2)>>2]|0;if((A|0)==0){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}C=A;D=j;l=a[D]|0;B=(l&1)==0;if(B){E=(l&255)>>>1}else{E=c[j+4>>2]|0}if((E|0)==0){F=0}else{if(B){G=j+1|0}else{G=c[j+8>>2]|0}B=a[G]|0;F=B<<24>>24==(tc[c[(c[A>>2]|0)+28>>2]&15](C,45)|0)<<24>>24}c[n>>2]=0;n=r;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;n=s;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;A=t;c[A+0>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;uj(f,F,m,o,p,q,r,s,t,u);m=v;v=a[D]|0;D=(v&1)==0;if(D){H=(v&255)>>>1}else{H=c[j+4>>2]|0}f=c[u>>2]|0;if((H|0)>(f|0)){if(D){I=(v&255)>>>1}else{I=c[j+4>>2]|0}D=a[A]|0;if((D&1)==0){J=(D&255)>>>1}else{J=c[t+4>>2]|0}D=a[n]|0;if((D&1)==0){K=(D&255)>>>1}else{K=c[s+4>>2]|0}L=J+(I-f<<1|1)+K|0}else{K=a[A]|0;if((K&1)==0){M=(K&255)>>>1}else{M=c[t+4>>2]|0}K=a[n]|0;if((K&1)==0){N=(K&255)>>>1}else{N=c[s+4>>2]|0}L=M+2+N|0}N=L+f|0;do{if(N>>>0>100){L=Hm(N)|0;if((L|0)!=0){O=L;P=L;break}Tm()}else{O=0;P=m}}while(0);if((v&1)==0){Q=j+1|0;R=(v&255)>>>1}else{Q=c[j+8>>2]|0;R=c[j+4>>2]|0}vj(P,w,x,c[g+4>>2]|0,Q,Q+R|0,C,F,o,a[p]|0,a[q]|0,r,s,t,f);c[y>>2]=c[e>>2];e=c[w>>2]|0;w=c[x>>2]|0;x=k;f=y;c[x+0>>2]=c[f+0>>2];jh(b,k,P,e,w,g,h);if((O|0)==0){ve(t);ve(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}Im(O);ve(t);ve(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}function xj(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function yj(a){a=a|0;i=i;return}function zj(b,d,e,f,g,j,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;l=+l;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;d=i;i=i+16|0;m=d;n=d+8|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+104|0;r=i;i=i+8|0;s=i;i=i+400|0;t=i;i=i+8|0;u=i;i=i+8|0;v=u;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+400|0;D=i;i=i+8|0;E=i;i=i+8|0;F=i;i=i+8|0;G=q;c[r>>2]=G;q=s;s=o;h[k>>3]=l;c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];s=ib(G|0,100,7056,o|0)|0;do{if(s>>>0>99){do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);o=c[1798]|0;G=n;h[k>>3]=l;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];G=oh(r,o,7056,n)|0;o=c[r>>2]|0;if((o|0)==0){Tm()}H=Hm(G<<2)|0;I=H;if((H|0)!=0){J=o;K=I;L=I;M=G;break}Tm()}else{J=0;K=0;L=q;M=s}}while(0);Pe(t,g);s=t;q=c[s>>2]|0;if(!((c[1824]|0)==-1)){c[p>>2]=7296;c[p+4>>2]=113;c[p+8>>2]=0;qe(7296,p,114)}p=(c[7300>>2]|0)+ -1|0;n=c[q+8>>2]|0;if(!((c[q+12>>2]|0)-n>>2>>>0>p>>>0)){N=Ta(4)|0;O=N;mm(O);Vb(N|0,15264,101)}q=c[n+(p<<2)>>2]|0;if((q|0)==0){N=Ta(4)|0;O=N;mm(O);Vb(N|0,15264,101)}N=q;O=c[r>>2]|0;qc[c[(c[q>>2]|0)+48>>2]&7](N,O,O+M|0,L)|0;if((M|0)==0){P=0}else{P=(a[c[r>>2]|0]|0)==45}c[u>>2]=0;u=y;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;u=z;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;r=A;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;Aj(f,P,t,v,w,x,y,z,A,B);t=C;C=c[B>>2]|0;if((M|0)>(C|0)){B=a[r]|0;if((B&1)==0){Q=(B&255)>>>1}else{Q=c[A+4>>2]|0}B=a[u]|0;if((B&1)==0){R=(B&255)>>>1}else{R=c[z+4>>2]|0}S=Q+(M-C<<1|1)+R|0}else{R=a[r]|0;if((R&1)==0){T=(R&255)>>>1}else{T=c[A+4>>2]|0}R=a[u]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[z+4>>2]|0}S=T+2+U|0}U=S+C|0;do{if(U>>>0>100){S=Hm(U<<2)|0;T=S;if((S|0)!=0){V=T;W=T;break}Tm()}else{V=0;W=t}}while(0);Bj(W,D,E,c[g+4>>2]|0,L,L+(M<<2)|0,N,P,v,c[w>>2]|0,c[x>>2]|0,y,z,A,C);c[F>>2]=c[e>>2];e=c[D>>2]|0;D=c[E>>2]|0;E=m;C=F;c[E+0>>2]=c[C+0>>2];xh(b,m,W,e,D,g,j);if((V|0)!=0){Im(V)}Ge(A);Ge(z);ve(y);Yd(c[s>>2]|0)|0;if((K|0)!=0){Im(K)}if((J|0)==0){i=d;return}Im(J);i=d;return}function Aj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=i;i=i+40|0;o=n;p=n+16|0;q=n+32|0;r=q;s=i;i=i+16|0;t=i;i=i+8|0;u=t;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+8|0;z=y;A=i;i=i+16|0;B=i;i=i+8|0;C=B;D=i;i=i+16|0;E=i;i=i+16|0;F=i;i=i+16|0;G=c[e>>2]|0;if(b){if(!((c[1718]|0)==-1)){c[p>>2]=6872;c[p+4>>2]=113;c[p+8>>2]=0;qe(6872,p,114)}p=(c[6876>>2]|0)+ -1|0;b=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-b>>2>>>0>p>>>0)){H=Ta(4)|0;I=H;mm(I);Vb(H|0,15264,101)}e=c[b+(p<<2)>>2]|0;if((e|0)==0){H=Ta(4)|0;I=H;mm(I);Vb(H|0,15264,101)}H=e;I=c[e>>2]|0;if(d){ic[c[I+44>>2]&63](r,H);r=f;p=c[q>>2]|0;a[r]=p;a[r+1|0]=p>>8;a[r+2|0]=p>>16;a[r+3|0]=p>>24;ic[c[(c[e>>2]|0)+32>>2]&63](s,H);p=l;if((a[p]&1)==0){c[l+4>>2]=0;a[p]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Je(l,0);r=s;c[p+0>>2]=c[r+0>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;Ge(s)}else{ic[c[I+40>>2]&63](u,H);u=f;I=c[t>>2]|0;a[u]=I;a[u+1|0]=I>>8;a[u+2|0]=I>>16;a[u+3|0]=I>>24;ic[c[(c[e>>2]|0)+28>>2]&63](v,H);I=l;if((a[I]&1)==0){c[l+4>>2]=0;a[I]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Je(l,0);u=v;c[I+0>>2]=c[u+0>>2];c[I+4>>2]=c[u+4>>2];c[I+8>>2]=c[u+8>>2];c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;Ge(v)}v=e;c[g>>2]=kc[c[(c[v>>2]|0)+12>>2]&63](H)|0;c[h>>2]=kc[c[(c[v>>2]|0)+16>>2]&63](H)|0;ic[c[(c[e>>2]|0)+20>>2]&63](w,H);u=j;if((a[u]&1)==0){a[j+1|0]=0;a[u]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}ze(j,0);I=w;c[u+0>>2]=c[I+0>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;ve(w);ic[c[(c[e>>2]|0)+24>>2]&63](x,H);e=k;if((a[e]&1)==0){c[k+4>>2]=0;a[e]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Je(k,0);w=x;c[e+0>>2]=c[w+0>>2];c[e+4>>2]=c[w+4>>2];c[e+8>>2]=c[w+8>>2];c[w+0>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;Ge(x);J=kc[c[(c[v>>2]|0)+36>>2]&63](H)|0;c[m>>2]=J;i=n;return}else{if(!((c[1702]|0)==-1)){c[o>>2]=6808;c[o+4>>2]=113;c[o+8>>2]=0;qe(6808,o,114)}o=(c[6812>>2]|0)+ -1|0;H=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-H>>2>>>0>o>>>0)){K=Ta(4)|0;L=K;mm(L);Vb(K|0,15264,101)}G=c[H+(o<<2)>>2]|0;if((G|0)==0){K=Ta(4)|0;L=K;mm(L);Vb(K|0,15264,101)}K=G;L=c[G>>2]|0;if(d){ic[c[L+44>>2]&63](z,K);z=f;d=c[y>>2]|0;a[z]=d;a[z+1|0]=d>>8;a[z+2|0]=d>>16;a[z+3|0]=d>>24;ic[c[(c[G>>2]|0)+32>>2]&63](A,K);d=l;if((a[d]&1)==0){c[l+4>>2]=0;a[d]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Je(l,0);z=A;c[d+0>>2]=c[z+0>>2];c[d+4>>2]=c[z+4>>2];c[d+8>>2]=c[z+8>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;Ge(A)}else{ic[c[L+40>>2]&63](C,K);C=f;f=c[B>>2]|0;a[C]=f;a[C+1|0]=f>>8;a[C+2|0]=f>>16;a[C+3|0]=f>>24;ic[c[(c[G>>2]|0)+28>>2]&63](D,K);f=l;if((a[f]&1)==0){c[l+4>>2]=0;a[f]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Je(l,0);l=D;c[f+0>>2]=c[l+0>>2];c[f+4>>2]=c[l+4>>2];c[f+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;Ge(D)}D=G;c[g>>2]=kc[c[(c[D>>2]|0)+12>>2]&63](K)|0;c[h>>2]=kc[c[(c[D>>2]|0)+16>>2]&63](K)|0;ic[c[(c[G>>2]|0)+20>>2]&63](E,K);h=j;if((a[h]&1)==0){a[j+1|0]=0;a[h]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}ze(j,0);j=E;c[h+0>>2]=c[j+0>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;ve(E);ic[c[(c[G>>2]|0)+24>>2]&63](F,K);G=k;if((a[G]&1)==0){c[k+4>>2]=0;a[G]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Je(k,0);k=F;c[G+0>>2]=c[k+0>>2];c[G+4>>2]=c[k+4>>2];c[G+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;Ge(F);J=kc[c[(c[D>>2]|0)+36>>2]&63](K)|0;c[m>>2]=J;i=n;return}}function Bj(b,d,e,f,g,h,j,k,l,m,n,o,p,q,r){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0;s=i;c[e>>2]=b;t=j;u=q;v=q+4|0;w=q+8|0;q=p;x=(f&512|0)==0;y=p+4|0;z=p+8|0;p=(r|0)>0;A=o;B=o+1|0;C=o+8|0;D=o+4|0;o=j;E=g;g=0;while(1){a:do{switch(a[l+g|0]|0){case 1:{c[d>>2]=c[e>>2];F=tc[c[(c[t>>2]|0)+44>>2]&15](j,32)|0;G=c[e>>2]|0;c[e>>2]=G+4;c[G>>2]=F;H=E;break};case 4:{F=c[e>>2]|0;G=k?E+4|0:E;b:do{if(G>>>0<h>>>0){I=G;while(1){J=I+4|0;if(!(ec[c[(c[o>>2]|0)+12>>2]&31](j,2048,c[I>>2]|0)|0)){K=I;break b}if(J>>>0<h>>>0){I=J}else{K=J;break}}}else{K=G}}while(0);if(p){do{if(K>>>0>G>>>0){I=c[e>>2]|0;J=K;L=r;while(1){M=J+ -4|0;N=I+4|0;c[I>>2]=c[M>>2];O=L+ -1|0;P=(O|0)>0;if(M>>>0>G>>>0&P){L=O;J=M;I=N}else{break}}c[e>>2]=N;if(P){Q=M;R=O;S=34;break}I=c[e>>2]|0;c[e>>2]=I+4;T=I;U=M}else{Q=K;R=r;S=34}}while(0);do{if((S|0)==34){S=0;I=tc[c[(c[t>>2]|0)+44>>2]&15](j,48)|0;J=c[e>>2]|0;L=J+4|0;c[e>>2]=L;if((R|0)>0){V=L;W=J;X=R}else{T=J;U=Q;break}while(1){c[W>>2]=I;L=X+ -1|0;if((L|0)>0){X=L;W=V;V=V+4|0}else{break}}c[e>>2]=J+(R+1<<2);T=J+(R<<2)|0;U=Q}}while(0);c[T>>2]=m;Y=U}else{Y=K}if((Y|0)==(G|0)){I=tc[c[(c[t>>2]|0)+44>>2]&15](j,48)|0;L=c[e>>2]|0;Z=L+4|0;c[e>>2]=Z;c[L>>2]=I;_=Z}else{Z=a[A]|0;I=(Z&1)==0;if(I){$=(Z&255)>>>1}else{$=c[D>>2]|0}if(($|0)==0){aa=Y;ba=-1;ca=0;da=0}else{if(I){ea=B}else{ea=c[C>>2]|0}aa=Y;ba=a[ea]|0;ca=0;da=0}while(1){I=c[e>>2]|0;do{if((da|0)==(ba|0)){Z=I+4|0;c[e>>2]=Z;c[I>>2]=n;L=ca+1|0;fa=a[A]|0;ga=(fa&1)==0;if(ga){ha=(fa&255)>>>1}else{ha=c[D>>2]|0}if(!(L>>>0<ha>>>0)){ia=Z;ja=ba;ka=L;la=0;break}if(ga){ma=B}else{ma=c[C>>2]|0}if((a[ma+L|0]|0)==127){ia=Z;ja=-1;ka=L;la=0;break}if(ga){na=B}else{na=c[C>>2]|0}ia=Z;ja=a[na+L|0]|0;ka=L;la=0}else{ia=I;ja=ba;ka=ca;la=da}}while(0);I=aa+ -4|0;J=c[I>>2]|0;L=ia+4|0;c[e>>2]=L;c[ia>>2]=J;if((I|0)==(G|0)){_=L;break}else{aa=I;ba=ja;ca=ka;da=la+1|0}}}if((F|0)==(_|0)){H=G;break a}I=_+ -4|0;if(I>>>0>F>>>0){oa=F;pa=I}else{H=G;break a}while(1){I=c[oa>>2]|0;c[oa>>2]=c[pa>>2];c[pa>>2]=I;I=oa+4|0;L=pa+ -4|0;if(I>>>0<L>>>0){pa=L;oa=I}else{H=G;break}}break};case 2:{G=a[q]|0;F=(G&1)==0;if(F){qa=(G&255)>>>1}else{qa=c[y>>2]|0}if((qa|0)==0|x){H=E;break a}if(F){ra=y;sa=(G&255)>>>1}else{ra=c[z>>2]|0;sa=c[y>>2]|0}G=ra+(sa<<2)|0;F=c[e>>2]|0;if((ra|0)==(G|0)){ta=F}else{I=(ra+(sa+ -1<<2)+(0-ra)|0)>>>2;L=F;J=ra;while(1){c[L>>2]=c[J>>2];Z=J+4|0;if((Z|0)==(G|0)){break}L=L+4|0;J=Z}ta=F+(I+1<<2)|0}c[e>>2]=ta;H=E;break};case 3:{J=a[u]|0;L=(J&1)==0;if(L){ua=(J&255)>>>1}else{ua=c[v>>2]|0}if((ua|0)==0){H=E;break a}if(L){va=v}else{va=c[w>>2]|0}L=c[va>>2]|0;J=c[e>>2]|0;c[e>>2]=J+4;c[J>>2]=L;H=E;break};case 0:{c[d>>2]=c[e>>2];H=E;break};default:{H=E}}}while(0);L=g+1|0;if((L|0)==4){break}else{E=H;g=L}}g=a[u]|0;u=(g&1)==0;if(u){wa=(g&255)>>>1}else{wa=c[v>>2]|0}if(wa>>>0>1){if(u){xa=v;ya=(g&255)>>>1}else{xa=c[w>>2]|0;ya=c[v>>2]|0}v=xa+4|0;w=xa+(ya<<2)|0;g=c[e>>2]|0;if((v|0)==(w|0)){za=g}else{u=(xa+(ya+ -1<<2)+(0-v)|0)>>>2;ya=g;xa=v;while(1){c[ya>>2]=c[xa>>2];v=xa+4|0;if((v|0)==(w|0)){break}else{xa=v;ya=ya+4|0}}za=g+(u+1<<2)|0}c[e>>2]=za}za=f&176;if((za|0)==32){c[d>>2]=c[e>>2];i=s;return}else if((za|0)==16){i=s;return}else{c[d>>2]=b;i=s;return}}function Cj(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;d=i;i=i+40|0;k=d;l=d+8|0;m=d+24|0;n=d+32|0;o=n;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+16|0;s=i;i=i+16|0;t=i;i=i+16|0;u=i;i=i+8|0;v=i;i=i+400|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;Pe(m,g);z=m;A=c[z>>2]|0;if(!((c[1824]|0)==-1)){c[l>>2]=7296;c[l+4>>2]=113;c[l+8>>2]=0;qe(7296,l,114)}l=(c[7300>>2]|0)+ -1|0;B=c[A+8>>2]|0;if(!((c[A+12>>2]|0)-B>>2>>>0>l>>>0)){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}A=c[B+(l<<2)>>2]|0;if((A|0)==0){C=Ta(4)|0;D=C;mm(D);Vb(C|0,15264,101)}C=A;D=j;l=a[D]|0;B=(l&1)==0;if(B){E=(l&255)>>>1}else{E=c[j+4>>2]|0}if((E|0)==0){F=0}else{if(B){G=j+4|0}else{G=c[j+8>>2]|0}B=c[G>>2]|0;F=(B|0)==(tc[c[(c[A>>2]|0)+44>>2]&15](C,45)|0)}c[n>>2]=0;n=r;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;n=s;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;A=t;c[A+0>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;Aj(f,F,m,o,p,q,r,s,t,u);m=v;v=a[D]|0;D=(v&1)==0;if(D){H=(v&255)>>>1}else{H=c[j+4>>2]|0}f=c[u>>2]|0;if((H|0)>(f|0)){if(D){I=(v&255)>>>1}else{I=c[j+4>>2]|0}D=a[A]|0;if((D&1)==0){J=(D&255)>>>1}else{J=c[t+4>>2]|0}D=a[n]|0;if((D&1)==0){K=(D&255)>>>1}else{K=c[s+4>>2]|0}L=J+(I-f<<1|1)+K|0}else{K=a[A]|0;if((K&1)==0){M=(K&255)>>>1}else{M=c[t+4>>2]|0}K=a[n]|0;if((K&1)==0){N=(K&255)>>>1}else{N=c[s+4>>2]|0}L=M+2+N|0}N=L+f|0;do{if(N>>>0>100){L=Hm(N<<2)|0;M=L;if((L|0)!=0){O=M;P=M;break}Tm()}else{O=0;P=m}}while(0);if((v&1)==0){Q=j+4|0;R=(v&255)>>>1}else{Q=c[j+8>>2]|0;R=c[j+4>>2]|0}Bj(P,w,x,c[g+4>>2]|0,Q,Q+(R<<2)|0,C,F,o,c[p>>2]|0,c[q>>2]|0,r,s,t,f);c[y>>2]=c[e>>2];e=c[w>>2]|0;w=c[x>>2]|0;x=k;f=y;c[x+0>>2]=c[f+0>>2];xh(b,k,P,e,w,g,h);if((O|0)==0){Ge(t);Ge(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}Im(O);Ge(t);Ge(s);ve(r);S=c[z>>2]|0;T=S;Yd(T)|0;i=d;return}function Dj(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Ej(a){a=a|0;i=i;return}function Fj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=_b(f|0,1)|0;i=e;return d>>>((d|0)!=(-1|0)|0)|0}function Gj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;i=i+16|0;j=d;k=j;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;l=a[h]|0;if((l&1)==0){m=h+1|0;n=h+1|0;o=(l&255)>>>1}else{l=c[h+8>>2]|0;m=l;n=l;o=c[h+4>>2]|0}h=m+o|0;do{if(n>>>0<h>>>0){o=n;do{Ae(j,a[o]|0);o=o+1|0;}while((o|0)!=(h|0));o=(e|0)==-1?-1:e<<1;if((a[k]&1)==0){p=o;q=9;break}r=o;s=c[j+8>>2]|0}else{p=(e|0)==-1?-1:e<<1;q=9}}while(0);if((q|0)==9){r=p;s=j+1|0}p=gb(r|0,f|0,g|0,s|0)|0;s=b;c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;s=hn(p|0)|0;g=p+s|0;if((s|0)>0){t=p}else{ve(j);i=d;return}do{Ae(b,a[t]|0);t=t+1|0;}while((t|0)!=(g|0));ve(j);i=d;return}function Hj(a,b){a=a|0;b=b|0;a=i;Tb(((b|0)==-1?-1:b<<1)|0)|0;i=a;return}function Ij(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Jj(a){a=a|0;i=i;return}function Kj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=_b(f|0,1)|0;i=e;return d>>>((d|0)!=(-1|0)|0)|0}function Lj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;d=i;i=i+240|0;j=d;k=d+8|0;l=d+40|0;m=d+48|0;n=d+56|0;o=d+64|0;p=d+192|0;q=d+200|0;r=d+208|0;s=d+224|0;t=d+232|0;u=r;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[s+4>>2]=0;c[s>>2]=8960;v=a[h]|0;if((v&1)==0){w=h+4|0;x=h+4|0;y=(v&255)>>>1}else{v=c[h+8>>2]|0;w=v;x=v;y=c[h+4>>2]|0}h=w+(y<<2)|0;y=k;w=j;v=j;c[v>>2]=0;c[v+4>>2]=0;a:do{if(x>>>0<h>>>0){v=s;j=s;z=k+32|0;A=x;B=8960|0;while(1){c[m>>2]=A;C=(pc[c[B+12>>2]&15](v,w,A,h,m,y,z,l)|0)==2;D=c[m>>2]|0;if(C|(D|0)==(A|0)){break}if(y>>>0<(c[l>>2]|0)>>>0){C=y;do{Ae(r,a[C]|0);C=C+1|0;}while(C>>>0<(c[l>>2]|0)>>>0);E=c[m>>2]|0}else{E=D}if(!(E>>>0<h>>>0)){break a}A=E;B=c[j>>2]|0}fj(8184)}}while(0);if((a[u]&1)==0){F=r+1|0}else{F=c[r+8>>2]|0}u=gb(((e|0)==-1?-1:e<<1)|0,f|0,g|0,F|0)|0;F=b;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;c[t+4>>2]=0;c[t>>2]=9064;F=hn(u|0)|0;g=u+F|0;f=n;e=n;c[e>>2]=0;c[e+4>>2]=0;if((F|0)<=0){ve(r);i=d;return}F=t;e=t;t=g;n=o;E=o+128|0;o=u;u=9064|0;while(1){c[q>>2]=o;h=(pc[c[u+16>>2]&15](F,f,o,(t-o|0)>32?o+32|0:g,q,n,E,p)|0)==2;m=c[q>>2]|0;if(h|(m|0)==(o|0)){G=20;break}if(n>>>0<(c[p>>2]|0)>>>0){h=n;do{Ke(b,c[h>>2]|0);h=h+4|0;}while(h>>>0<(c[p>>2]|0)>>>0);H=c[q>>2]|0}else{H=m}if(!(H>>>0<g>>>0)){G=25;break}o=H;u=c[e>>2]|0}if((G|0)==20){fj(8184)}else if((G|0)==25){ve(r);i=d;return}}function Mj(a,b){a=a|0;b=b|0;a=i;Tb(((b|0)==-1?-1:b<<1)|0)|0;i=a;return}function Nj(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=7392;e=b+8|0;b=c[e>>2]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);if((b|0)==(c[1798]|0)){i=d;return}tb(c[e>>2]|0);i=d;return}function Oj(a){a=a|0;a=Ta(8)|0;Zd(a,7184);c[a>>2]=4232;Vb(a|0,4272,9)}function Pj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;e=i;i=i+448|0;f=e;g=e+16|0;h=e+32|0;j=e+48|0;k=e+64|0;l=e+80|0;m=e+96|0;n=e+112|0;o=e+128|0;p=e+144|0;q=e+160|0;r=e+176|0;s=e+192|0;t=e+208|0;u=e+224|0;v=e+240|0;w=e+256|0;x=e+272|0;y=e+288|0;z=e+304|0;A=e+320|0;B=e+336|0;C=e+352|0;D=e+368|0;E=e+384|0;F=e+400|0;G=e+416|0;H=e+432|0;c[b+4>>2]=d+ -1;c[b>>2]=7224;d=b+8|0;I=b+12|0;J=b+136|0;a[J]=1;K=b+24|0;c[I>>2]=K;c[d>>2]=K;c[b+16>>2]=J;J=28;L=K;do{if((L|0)==0){M=0}else{c[L>>2]=0;M=c[I>>2]|0}L=M+4|0;c[I>>2]=L;J=J+ -1|0;}while((J|0)!=0);te(b+144|0,7208,1);J=c[d>>2]|0;d=c[I>>2]|0;if((d|0)!=(J|0)){c[I>>2]=d+(~((d+ -4+(0-J)|0)>>>2)<<2)}c[12116>>2]=0;c[3028]=5704;if(!((c[1432]|0)==-1)){c[G>>2]=5728;c[G+4>>2]=113;c[G+8>>2]=0;qe(5728,G,114)}Qj(b,12112,(c[5732>>2]|0)+ -1|0);c[12108>>2]=0;c[3026]=5744;if(!((c[1442]|0)==-1)){c[F>>2]=5768;c[F+4>>2]=113;c[F+8>>2]=0;qe(5768,F,114)}Qj(b,12104,(c[5772>>2]|0)+ -1|0);c[12092>>2]=0;c[3022]=7320;c[12096>>2]=0;a[12100|0]=0;c[12096>>2]=c[(Ja()|0)>>2];if(!((c[1826]|0)==-1)){c[E>>2]=7304;c[E+4>>2]=113;c[E+8>>2]=0;qe(7304,E,114)}Qj(b,12088,(c[7308>>2]|0)+ -1|0);c[12084>>2]=0;c[3020]=8280;if(!((c[1824]|0)==-1)){c[D>>2]=7296;c[D+4>>2]=113;c[D+8>>2]=0;qe(7296,D,114)}Qj(b,12080,(c[7300>>2]|0)+ -1|0);c[12076>>2]=0;c[3018]=8496;if(!((c[1842]|0)==-1)){c[C>>2]=7368;c[C+4>>2]=113;c[C+8>>2]=0;qe(7368,C,114)}Qj(b,12072,(c[7372>>2]|0)+ -1|0);c[12060>>2]=0;c[3014]=7392;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);c[12064>>2]=c[1798];if(!((c[1844]|0)==-1)){c[B>>2]=7376;c[B+4>>2]=113;c[B+8>>2]=0;qe(7376,B,114)}Qj(b,12056,(c[7380>>2]|0)+ -1|0);c[12052>>2]=0;c[3012]=8720;if(!((c[1858]|0)==-1)){c[A>>2]=7432;c[A+4>>2]=113;c[A+8>>2]=0;qe(7432,A,114)}Qj(b,12048,(c[7436>>2]|0)+ -1|0);c[12044>>2]=0;c[3010]=8840;if(!((c[1860]|0)==-1)){c[z>>2]=7440;c[z+4>>2]=113;c[z+8>>2]=0;qe(7440,z,114)}Qj(b,12040,(c[7444>>2]|0)+ -1|0);c[12020>>2]=0;c[3004]=7472;a[12024|0]=46;a[12025|0]=44;c[12028>>2]=0;c[12032>>2]=0;c[12036>>2]=0;if(!((c[1862]|0)==-1)){c[y>>2]=7448;c[y+4>>2]=113;c[y+8>>2]=0;qe(7448,y,114)}Qj(b,12016,(c[7452>>2]|0)+ -1|0);c[11988>>2]=0;c[2996]=7512;c[11992>>2]=46;c[11996>>2]=44;c[12e3>>2]=0;c[12004>>2]=0;c[12008>>2]=0;if(!((c[1864]|0)==-1)){c[x>>2]=7456;c[x+4>>2]=113;c[x+8>>2]=0;qe(7456,x,114)}Qj(b,11984,(c[7460>>2]|0)+ -1|0);c[11980>>2]=0;c[2994]=5784;if(!((c[1460]|0)==-1)){c[w>>2]=5840;c[w+4>>2]=113;c[w+8>>2]=0;qe(5840,w,114)}Qj(b,11976,(c[5844>>2]|0)+ -1|0);c[11972>>2]=0;c[2992]=5904;if(!((c[1490]|0)==-1)){c[v>>2]=5960;c[v+4>>2]=113;c[v+8>>2]=0;qe(5960,v,114)}Qj(b,11968,(c[5964>>2]|0)+ -1|0);c[11964>>2]=0;c[2990]=5976;if(!((c[1506]|0)==-1)){c[u>>2]=6024;c[u+4>>2]=113;c[u+8>>2]=0;qe(6024,u,114)}Qj(b,11960,(c[6028>>2]|0)+ -1|0);c[11956>>2]=0;c[2988]=6040;if(!((c[1522]|0)==-1)){c[t>>2]=6088;c[t+4>>2]=113;c[t+8>>2]=0;qe(6088,t,114)}Qj(b,11952,(c[6092>>2]|0)+ -1|0);c[11948>>2]=0;c[2986]=6632;if(!((c[1670]|0)==-1)){c[s>>2]=6680;c[s+4>>2]=113;c[s+8>>2]=0;qe(6680,s,114)}Qj(b,11944,(c[6684>>2]|0)+ -1|0);c[11940>>2]=0;c[2984]=6696;if(!((c[1686]|0)==-1)){c[r>>2]=6744;c[r+4>>2]=113;c[r+8>>2]=0;qe(6744,r,114)}Qj(b,11936,(c[6748>>2]|0)+ -1|0);c[11932>>2]=0;c[2982]=6760;if(!((c[1702]|0)==-1)){c[q>>2]=6808;c[q+4>>2]=113;c[q+8>>2]=0;qe(6808,q,114)}Qj(b,11928,(c[6812>>2]|0)+ -1|0);c[11924>>2]=0;c[2980]=6824;if(!((c[1718]|0)==-1)){c[p>>2]=6872;c[p+4>>2]=113;c[p+8>>2]=0;qe(6872,p,114)}Qj(b,11920,(c[6876>>2]|0)+ -1|0);c[11916>>2]=0;c[2978]=6888;if(!((c[1728]|0)==-1)){c[o>>2]=6912;c[o+4>>2]=113;c[o+8>>2]=0;qe(6912,o,114)}Qj(b,11912,(c[6916>>2]|0)+ -1|0);c[11908>>2]=0;c[2976]=6968;if(!((c[1748]|0)==-1)){c[n>>2]=6992;c[n+4>>2]=113;c[n+8>>2]=0;qe(6992,n,114)}Qj(b,11904,(c[6996>>2]|0)+ -1|0);c[11900>>2]=0;c[2974]=7024;if(!((c[1762]|0)==-1)){c[m>>2]=7048;c[m+4>>2]=113;c[m+8>>2]=0;qe(7048,m,114)}Qj(b,11896,(c[7052>>2]|0)+ -1|0);c[11892>>2]=0;c[2972]=7072;if(!((c[1774]|0)==-1)){c[l>>2]=7096;c[l+4>>2]=113;c[l+8>>2]=0;qe(7096,l,114)}Qj(b,11888,(c[7100>>2]|0)+ -1|0);c[11876>>2]=0;c[2968]=6120;c[11880>>2]=6168;if(!((c[1550]|0)==-1)){c[k>>2]=6200;c[k+4>>2]=113;c[k+8>>2]=0;qe(6200,k,114)}Qj(b,11872,(c[6204>>2]|0)+ -1|0);c[11860>>2]=0;c[2964]=6272;c[11864>>2]=6320;if(!((c[1588]|0)==-1)){c[j>>2]=6352;c[j+4>>2]=113;c[j+8>>2]=0;qe(6352,j,114)}Qj(b,11856,(c[6356>>2]|0)+ -1|0);c[11844>>2]=0;c[2960]=8216;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);c[11848>>2]=c[1798];c[2960]=6568;if(!((c[1646]|0)==-1)){c[h>>2]=6584;c[h+4>>2]=113;c[h+8>>2]=0;qe(6584,h,114)}Qj(b,11840,(c[6588>>2]|0)+ -1|0);c[11828>>2]=0;c[2956]=8216;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);c[11832>>2]=c[1798];c[2956]=6600;if(!((c[1654]|0)==-1)){c[g>>2]=6616;c[g+4>>2]=113;c[g+8>>2]=0;qe(6616,g,114)}Qj(b,11824,(c[6620>>2]|0)+ -1|0);c[11820>>2]=0;c[2954]=7112;if(!((c[1784]|0)==-1)){c[f>>2]=7136;c[f+4>>2]=113;c[f+8>>2]=0;qe(7136,f,114)}Qj(b,11816,(c[7140>>2]|0)+ -1|0);c[11812>>2]=0;c[2952]=7152;if((c[1794]|0)==-1){N=c[7180>>2]|0;O=N+ -1|0;Qj(b,11808,O);i=e;return}c[H>>2]=7176;c[H+4>>2]=113;c[H+8>>2]=0;qe(7176,H,114);N=c[7180>>2]|0;O=N+ -1|0;Qj(b,11808,O);i=e;return}function Qj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;Xd(b);f=a+8|0;g=a+12|0;a=c[g>>2]|0;h=f;j=c[h>>2]|0;k=a-j>>2;do{if(k>>>0>d>>>0){l=j}else{m=d+1|0;if(k>>>0<m>>>0){Ul(f,m-k|0);l=c[h>>2]|0;break}if(!(k>>>0>m>>>0)){l=j;break}n=j+(m<<2)|0;if((a|0)==(n|0)){l=j;break}c[g>>2]=a+(~((a+ -4+(0-n)|0)>>>2)<<2);l=j}}while(0);j=c[l+(d<<2)>>2]|0;if((j|0)==0){o=l;p=o+(d<<2)|0;c[p>>2]=b;i=e;return}Yd(j)|0;o=c[h>>2]|0;p=o+(d<<2)|0;c[p>>2]=b;i=e;return}function Rj(a){a=a|0;var b=0;b=i;Sj(a);Om(a);i=b;return}function Sj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;d=i;c[b>>2]=7224;e=b+12|0;f=c[e>>2]|0;g=b+8|0;h=c[g>>2]|0;if((f|0)!=(h|0)){j=f;f=h;h=0;while(1){k=c[f+(h<<2)>>2]|0;if((k|0)==0){l=f;m=j}else{Yd(k)|0;l=c[g>>2]|0;m=c[e>>2]|0}k=h+1|0;if(k>>>0<m-l>>2>>>0){j=m;f=l;h=k}else{break}}}ve(b+144|0);h=c[g>>2]|0;if((h|0)==0){i=d;return}g=c[e>>2]|0;if((g|0)!=(h|0)){c[e>>2]=g+(~((g+ -4+(0-h)|0)>>>2)<<2)}if((b+24|0)==(h|0)){a[b+136|0]=0;i=d;return}else{Om(h);i=d;return}}function Tj(){var b=0,d=0,e=0;b=i;if((a[7280]|0)!=0){d=c[1818]|0;i=b;return d|0}if((Ma(7280)|0)==0){d=c[1818]|0;i=b;return d|0}do{if((a[7256]|0)==0){if((Ma(7256)|0)==0){break}Pj(11648,1);c[1810]=11648;c[1812]=7240;Za(7256)}}while(0);e=c[c[1812]>>2]|0;c[1816]=e;Xd(e);c[1818]=7264;Za(7280);d=c[1818]|0;i=b;return d|0}function Uj(a){a=a|0;var b=0,d=0;b=i;d=c[(Tj()|0)>>2]|0;c[a>>2]=d;Xd(d);i=b;return}function Vj(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;e=c[b>>2]|0;c[a>>2]=e;Xd(e);i=d;return}function Wj(a){a=a|0;var b=0;b=i;Yd(c[a>>2]|0)|0;i=b;return}function Xj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d;f=c[a>>2]|0;a=b;if(!((c[a>>2]|0)==-1)){c[e>>2]=b;c[e+4>>2]=113;c[e+8>>2]=0;qe(a,e,114)}e=(c[b+4>>2]|0)+ -1|0;b=c[f+8>>2]|0;if(!((c[f+12>>2]|0)-b>>2>>>0>e>>>0)){g=Ta(4)|0;h=g;mm(h);Vb(g|0,15264,101)}f=c[b+(e<<2)>>2]|0;if((f|0)==0){g=Ta(4)|0;h=g;mm(h);Vb(g|0,15264,101)}else{i=d;return f|0}return 0}function Yj(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Zj(a){a=a|0;var b=0;b=i;if((a|0)==0){i=b;return}hc[c[(c[a>>2]|0)+4>>2]&127](a);i=b;return}function _j(a){a=a|0;var b=0;b=c[1822]|0;c[1822]=b+1;c[a+4>>2]=b+1;i=i;return}function $j(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function ak(a,d,e){a=a|0;d=d|0;e=e|0;var f=0;a=i;if(!(e>>>0<128)){f=0;i=a;return f|0}f=(b[(c[(Ja()|0)>>2]|0)+(e<<1)>>1]&d)<<16>>16!=0;i=a;return f|0}function bk(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;a=i;if((d|0)==(e|0)){g=d;i=a;return g|0}else{h=d;j=f}while(1){f=c[h>>2]|0;if(f>>>0<128){k=b[(c[(Ja()|0)>>2]|0)+(f<<1)>>1]|0}else{k=0}b[j>>1]=k;f=h+4|0;if((f|0)==(e|0)){g=e;break}else{h=f;j=j+2|0}}i=a;return g|0}function ck(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;a=i;a:do{if((e|0)==(f|0)){g=e}else{h=e;while(1){j=c[h>>2]|0;if(j>>>0<128){if(!((b[(c[(Ja()|0)>>2]|0)+(j<<1)>>1]&d)<<16>>16==0)){g=h;break a}}j=h+4|0;if((j|0)==(f|0)){g=f;break}else{h=j}}}}while(0);i=a;return g|0}function dk(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;a=i;a:do{if((e|0)==(f|0)){g=e}else{h=e;while(1){j=c[h>>2]|0;if(!(j>>>0<128)){g=h;break a}k=h+4|0;if((b[(c[(Ja()|0)>>2]|0)+(j<<1)>>1]&d)<<16>>16==0){g=h;break a}if((k|0)==(f|0)){g=f;break}else{h=k}}}}while(0);i=a;return g|0}function ek(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b>>>0<128)){d=b;i=a;return d|0}d=c[(c[(Cb()|0)>>2]|0)+(b<<2)>>2]|0;i=a;return d|0}function fk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;a=i;if((b|0)==(d|0)){e=b;i=a;return e|0}else{f=b}while(1){b=c[f>>2]|0;if(b>>>0<128){g=c[(c[(Cb()|0)>>2]|0)+(b<<2)>>2]|0}else{g=b}c[f>>2]=g;b=f+4|0;if((b|0)==(d|0)){e=d;break}else{f=b}}i=a;return e|0}function gk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b>>>0<128)){d=b;i=a;return d|0}d=c[(c[(wb()|0)>>2]|0)+(b<<2)>>2]|0;i=a;return d|0}function hk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;a=i;if((b|0)==(d|0)){e=b;i=a;return e|0}else{f=b}while(1){b=c[f>>2]|0;if(b>>>0<128){g=c[(c[(wb()|0)>>2]|0)+(b<<2)>>2]|0}else{g=b}c[f>>2]=g;b=f+4|0;if((b|0)==(d|0)){e=d;break}else{f=b}}i=a;return e|0}function ik(a,b){a=a|0;b=b|0;i=i;return b<<24>>24|0}function jk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;b=i;if((d|0)==(e|0)){g=d;i=b;return g|0}else{h=d;j=f}while(1){c[j>>2]=a[h]|0;f=h+1|0;if((f|0)==(e|0)){g=e;break}else{j=j+4|0;h=f}}i=b;return g|0}function kk(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return(b>>>0<128?b&255:c)|0}function lk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0;b=i;if((d|0)==(e|0)){h=d;i=b;return h|0}j=((e+ -4+(0-d)|0)>>>2)+1|0;k=d;l=g;while(1){g=c[k>>2]|0;a[l]=g>>>0<128?g&255:f;g=k+4|0;if((g|0)==(e|0)){break}else{l=l+1|0;k=g}}h=d+(j<<2)|0;i=b;return h|0}function mk(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=7320;e=c[b+8>>2]|0;do{if((e|0)!=0){if((a[b+12|0]|0)==0){break}Pm(e)}}while(0);Om(b);i=d;return}function nk(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=7320;e=c[b+8>>2]|0;if((e|0)==0){i=d;return}if((a[b+12|0]|0)==0){i=d;return}Pm(e);i=d;return}function ok(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b<<24>>24>-1)){d=b;i=a;return d|0}d=c[(c[(Cb()|0)>>2]|0)+((b&255)<<2)>>2]&255;i=a;return d|0}function pk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;b=i;if((d|0)==(e|0)){f=d;i=b;return f|0}else{g=d}while(1){d=a[g]|0;if(d<<24>>24>-1){h=c[(c[(Cb()|0)>>2]|0)+(d<<24>>24<<2)>>2]&255}else{h=d}a[g]=h;d=g+1|0;if((d|0)==(e|0)){f=e;break}else{g=d}}i=b;return f|0}function qk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b<<24>>24>-1)){d=b;i=a;return d|0}d=c[(c[(wb()|0)>>2]|0)+(b<<24>>24<<2)>>2]&255;i=a;return d|0}function rk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;b=i;if((d|0)==(e|0)){f=d;i=b;return f|0}else{g=d}while(1){d=a[g]|0;if(d<<24>>24>-1){h=c[(c[(wb()|0)>>2]|0)+(d<<24>>24<<2)>>2]&255}else{h=d}a[g]=h;d=g+1|0;if((d|0)==(e|0)){f=e;break}else{g=d}}i=b;return f|0}function sk(a,b){a=a|0;b=b|0;i=i;return b|0}function tk(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;b=i;if((c|0)==(d|0)){f=c}else{g=c;c=e;while(1){a[c]=a[g]|0;e=g+1|0;if((e|0)==(d|0)){f=d;break}else{c=c+1|0;g=e}}}i=b;return f|0}function uk(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return(b<<24>>24>-1?b:c)|0}function vk(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;b=i;if((c|0)==(d|0)){g=c;i=b;return g|0}else{h=c;j=f}while(1){f=a[h]|0;a[j]=f<<24>>24>-1?f:e;f=h+1|0;if((f|0)==(d|0)){g=d;break}else{j=j+1|0;h=f}}i=b;return g|0}function wk(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function xk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;c[f>>2]=d;c[j>>2]=g;i=i;return 3}function yk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;c[f>>2]=d;c[j>>2]=g;i=i;return 3}function zk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function Ak(a){a=a|0;i=i;return 1}function Bk(a){a=a|0;i=i;return 1}function Ck(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=d-c|0;i=i;return(b>>>0<e>>>0?b:e)|0}function Dk(a){a=a|0;i=i;return 1}function Ek(a){a=a|0;var b=0;b=i;Nj(a);Om(a);i=b;return}function Fk(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;l=i;i=i+8|0;m=l;n=m;o=i;i=i+8|0;p=(e|0)==(f|0);a:do{if(p){c[k>>2]=h;c[g>>2]=e;q=e}else{r=e;while(1){s=r+4|0;if((c[r>>2]|0)==0){t=r;break}if((s|0)==(f|0)){t=f;break}else{r=s}}c[k>>2]=h;c[g>>2]=e;if(p|(h|0)==(j|0)){q=e;break}r=d;s=j;u=b+8|0;v=o;w=e;x=h;y=t;while(1){z=r;A=c[z+4>>2]|0;B=m;c[B>>2]=c[z>>2];c[B+4>>2]=A;A=fb(c[u>>2]|0)|0;B=fm(x,g,y-w>>2,s-x|0,d)|0;if((A|0)!=0){fb(A|0)|0}if((B|0)==-1){C=10;break}else if((B|0)==0){D=1;C=33;break}A=(c[k>>2]|0)+B|0;c[k>>2]=A;if((A|0)==(j|0)){C=31;break}if((y|0)==(f|0)){E=c[g>>2]|0;F=A;G=f}else{A=fb(c[u>>2]|0)|0;B=em(v,0,d)|0;if((A|0)!=0){fb(A|0)|0}if((B|0)==-1){D=2;C=33;break}A=c[k>>2]|0;if(B>>>0>(s-A|0)>>>0){D=1;C=33;break}b:do{if((B|0)!=0){z=A;H=B;I=v;while(1){J=a[I]|0;c[k>>2]=z+1;a[z]=J;J=H+ -1|0;if((J|0)==0){break b}z=c[k>>2]|0;I=I+1|0;H=J}}}while(0);B=(c[g>>2]|0)+4|0;c[g>>2]=B;c:do{if((B|0)==(f|0)){K=f}else{A=B;while(1){H=A+4|0;if((c[A>>2]|0)==0){K=A;break c}if((H|0)==(f|0)){K=f;break}else{A=H}}}}while(0);E=B;F=c[k>>2]|0;G=K}if((E|0)==(f|0)|(F|0)==(j|0)){q=E;break a}else{w=E;x=F;y=G}}if((C|0)==10){c[k>>2]=x;d:do{if((w|0)==(c[g>>2]|0)){L=w}else{y=w;v=x;while(1){s=c[y>>2]|0;r=fb(c[u>>2]|0)|0;A=em(v,s,n)|0;if((r|0)!=0){fb(r|0)|0}if((A|0)==-1){L=y;break d}r=(c[k>>2]|0)+A|0;c[k>>2]=r;A=y+4|0;if((A|0)==(c[g>>2]|0)){L=A;break}else{y=A;v=r}}}}while(0);c[g>>2]=L;D=2;i=l;return D|0}else if((C|0)==31){q=c[g>>2]|0;break}else if((C|0)==33){i=l;return D|0}}}while(0);D=(q|0)!=(f|0)|0;i=l;return D|0}function Gk(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;l=i;i=i+8|0;m=l;n=m;o=(e|0)==(f|0);a:do{if(o){c[k>>2]=h;c[g>>2]=e;p=e}else{q=e;while(1){r=q+1|0;if((a[q]|0)==0){s=q;break}if((r|0)==(f|0)){s=f;break}else{q=r}}c[k>>2]=h;c[g>>2]=e;if(o|(h|0)==(j|0)){p=e;break}q=d;r=j;t=b+8|0;u=e;v=h;w=s;while(1){x=q;y=c[x+4>>2]|0;z=m;c[z>>2]=c[x>>2];c[z+4>>2]=y;A=w;y=fb(c[t>>2]|0)|0;z=bm(v,g,A-u|0,r-v>>2,d)|0;if((y|0)!=0){fb(y|0)|0}if((z|0)==0){B=2;C=32;break}else if((z|0)==-1){C=10;break}y=(c[k>>2]|0)+(z<<2)|0;c[k>>2]=y;if((y|0)==(j|0)){C=30;break}z=c[g>>2]|0;if((w|0)==(f|0)){D=z;E=y;F=f}else{x=fb(c[t>>2]|0)|0;G=am(y,z,1,d)|0;if((x|0)!=0){fb(x|0)|0}if((G|0)!=0){B=2;C=32;break}c[k>>2]=(c[k>>2]|0)+4;G=(c[g>>2]|0)+1|0;c[g>>2]=G;b:do{if((G|0)==(f|0)){H=f}else{x=G;while(1){z=x+1|0;if((a[x]|0)==0){H=x;break b}if((z|0)==(f|0)){H=f;break}else{x=z}}}}while(0);D=G;E=c[k>>2]|0;F=H}if((D|0)==(f|0)|(E|0)==(j|0)){p=D;break a}else{u=D;v=E;w=F}}if((C|0)==10){c[k>>2]=v;c:do{if((u|0)==(c[g>>2]|0)){I=u}else{w=u;r=v;while(1){q=fb(c[t>>2]|0)|0;x=am(r,w,A-w|0,n)|0;if((q|0)!=0){fb(q|0)|0}if((x|0)==0){J=w+1|0}else if((x|0)==-1){C=15;break}else if((x|0)==-2){C=16;break}else{J=w+x|0}x=(c[k>>2]|0)+4|0;c[k>>2]=x;if((J|0)==(c[g>>2]|0)){I=J;break c}else{w=J;r=x}}if((C|0)==15){c[g>>2]=w;B=2;i=l;return B|0}else if((C|0)==16){c[g>>2]=w;B=1;i=l;return B|0}}}while(0);c[g>>2]=I;B=(I|0)!=(f|0)|0;i=l;return B|0}else if((C|0)==30){p=c[g>>2]|0;break}else if((C|0)==32){i=l;return B|0}}}while(0);B=(p|0)!=(f|0)|0;i=l;return B|0}function Hk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+8|0;c[g>>2]=e;e=h;j=fb(c[b+8>>2]|0)|0;b=em(e,0,d)|0;if((j|0)!=0){fb(j|0)|0}if((b|0)==0|(b|0)==-1){k=2;i=h;return k|0}j=b+ -1|0;b=c[g>>2]|0;if(j>>>0>(f-b|0)>>>0){k=1;i=h;return k|0}if((j|0)==0){k=0;i=h;return k|0}else{l=b;m=j;n=e}while(1){e=a[n]|0;c[g>>2]=l+1;a[l]=e;e=m+ -1|0;if((e|0)==0){k=0;break}l=c[g>>2]|0;n=n+1|0;m=e}i=h;return k|0}function Ik(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;d=a+8|0;a=fb(c[d>>2]|0)|0;e=dm(0,0,4)|0;if((a|0)!=0){fb(a|0)|0}do{if((e|0)==0){a=c[d>>2]|0;if((a|0)==0){f=1;break}g=fb(a|0)|0;if((g|0)==0){f=0;break}fb(g|0)|0;f=0}else{f=-1}}while(0);i=b;return f|0}function Jk(a){a=a|0;i=i;return 0}function Kk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;if((f|0)==0|(d|0)==(e|0)){h=0;i=g;return h|0}j=e;k=a+8|0;a=d;d=0;l=0;while(1){m=fb(c[k>>2]|0)|0;n=$l(a,j-a|0,b)|0;if((m|0)!=0){fb(m|0)|0}if((n|0)==0){o=a+1|0;p=1}else if((n|0)==-2|(n|0)==-1){h=d;q=9;break}else{o=a+n|0;p=n}n=p+d|0;m=l+1|0;if(m>>>0>=f>>>0|(o|0)==(e|0)){h=n;q=9;break}else{a=o;d=n;l=m}}if((q|0)==9){i=g;return h|0}return 0}function Lk(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a+8>>2]|0;do{if((d|0)==0){e=1}else{a=fb(d|0)|0;if((a|0)==0){e=4;break}fb(a|0)|0;e=4}}while(0);i=b;return e|0}function Mk(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Nk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Ok(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d>>1<<1);c[j>>2]=g+((c[k>>2]|0)-g);i=b;return l|0}function Ok(d,f,g,h,j,k,l,m){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;c[g>>2]=d;c[k>>2]=h;do{if((m&2|0)!=0){if((j-h|0)<3){o=1;i=n;return o|0}else{c[k>>2]=h+1;a[h]=-17;d=c[k>>2]|0;c[k>>2]=d+1;a[d]=-69;d=c[k>>2]|0;c[k>>2]=d+1;a[d]=-65;break}}}while(0);h=f;m=c[g>>2]|0;if(!(m>>>0<f>>>0)){o=0;i=n;return o|0}d=j;j=m;a:while(1){m=b[j>>1]|0;p=m&65535;if(p>>>0>l>>>0){o=2;q=26;break}do{if((m&65535)<128){r=c[k>>2]|0;if((d-r|0)<1){o=1;q=26;break a}c[k>>2]=r+1;a[r]=m}else{if((m&65535)<2048){r=c[k>>2]|0;if((d-r|0)<2){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>6|192;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if((m&65535)<55296){r=c[k>>2]|0;if((d-r|0)<3){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>12|224;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p>>>6&63|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if(!((m&65535)<56320)){if((m&65535)<57344){o=2;q=26;break a}r=c[k>>2]|0;if((d-r|0)<3){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>12|224;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p>>>6&63|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if((h-j|0)<4){o=1;q=26;break a}r=j+2|0;s=e[r>>1]|0;if((s&64512|0)!=56320){o=2;q=26;break a}if((d-(c[k>>2]|0)|0)<4){o=1;q=26;break a}t=p&960;if(((t<<10)+65536|p<<10&64512|s&1023)>>>0>l>>>0){o=2;q=26;break a}c[g>>2]=r;r=(t>>>6)+1|0;t=c[k>>2]|0;c[k>>2]=t+1;a[t]=r>>>2|240;t=c[k>>2]|0;c[k>>2]=t+1;a[t]=p>>>2&15|r<<4&48|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p<<4&48|s>>>6&15|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=s&63|128}}while(0);p=(c[g>>2]|0)+2|0;c[g>>2]=p;if(p>>>0<f>>>0){j=p}else{o=0;q=26;break}}if((q|0)==26){i=n;return o|0}return 0}function Pk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Qk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d);c[j>>2]=g+((c[k>>2]|0)-g>>1<<1);i=b;return l|0}function Qk(e,f,g,h,j,k,l,m){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;n=i;c[g>>2]=e;c[k>>2]=h;h=c[g>>2]|0;do{if((m&4|0)==0){o=h}else{if((f-h|0)<=2){o=h;break}if(!((a[h]|0)==-17)){o=h;break}if(!((a[h+1|0]|0)==-69)){o=h;break}if(!((a[h+2|0]|0)==-65)){o=h;break}e=h+3|0;c[g>>2]=e;o=e}}while(0);a:do{if(o>>>0<f>>>0){h=f;m=j;e=o;p=c[k>>2]|0;b:while(1){if(!(p>>>0<j>>>0)){q=e;break a}r=a[e]|0;s=r&255;if(s>>>0>l>>>0){t=2;u=41;break}do{if(r<<24>>24>-1){b[p>>1]=r&255;c[g>>2]=e+1}else{if((r&255)<194){t=2;u=41;break b}if((r&255)<224){if((h-e|0)<2){t=1;u=41;break b}v=d[e+1|0]|0;if((v&192|0)!=128){t=2;u=41;break b}w=v&63|s<<6&1984;if(w>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=w;c[g>>2]=e+2;break}if((r&255)<240){if((h-e|0)<3){t=1;u=41;break b}w=a[e+1|0]|0;v=a[e+2|0]|0;if((s|0)==224){if(!((w&-32)<<24>>24==-96)){t=2;u=41;break b}}else if((s|0)==237){if(!((w&-32)<<24>>24==-128)){t=2;u=41;break b}}else{if(!((w&-64)<<24>>24==-128)){t=2;u=41;break b}}x=v&255;if((x&192|0)!=128){t=2;u=41;break b}v=(w&255)<<6&4032|s<<12|x&63;if((v&65535)>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=v;c[g>>2]=e+3;break}if(!((r&255)<245)){t=2;u=41;break b}if((h-e|0)<4){t=1;u=41;break b}v=a[e+1|0]|0;x=a[e+2|0]|0;w=a[e+3|0]|0;if((s|0)==244){if(!((v&-16)<<24>>24==-128)){t=2;u=41;break b}}else if((s|0)==240){if(!((v+112<<24>>24&255)<48)){t=2;u=41;break b}}else{if(!((v&-64)<<24>>24==-128)){t=2;u=41;break b}}y=x&255;if((y&192|0)!=128){t=2;u=41;break b}x=w&255;if((x&192|0)!=128){t=2;u=41;break b}if((m-p|0)<4){t=1;u=41;break b}w=s&7;z=v&255;v=y<<6;A=x&63;if((z<<12&258048|w<<18|v&4032|A)>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=z<<2&60|y>>>4&3|((z>>>4&3|w<<2)<<6)+16320|55296;w=p+2|0;c[k>>2]=w;b[w>>1]=A|v&960|56320;c[g>>2]=(c[g>>2]|0)+4}}while(0);s=(c[k>>2]|0)+2|0;c[k>>2]=s;r=c[g>>2]|0;if(r>>>0<f>>>0){e=r;p=s}else{q=r;break a}}if((u|0)==41){i=n;return t|0}}else{q=o}}while(0);t=q>>>0<f>>>0|0;i=n;return t|0}function Rk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function Sk(a){a=a|0;i=i;return 0}function Tk(a){a=a|0;i=i;return 0}function Uk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=i;a=Vk(c,d,e,1114111,0)|0;i=b;return a|0}function Vk(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;h=i;do{if((g&4|0)==0){j=b}else{if((c-b|0)<=2){j=b;break}if(!((a[b]|0)==-17)){j=b;break}if(!((a[b+1|0]|0)==-69)){j=b;break}j=(a[b+2|0]|0)==-65?b+3|0:b}}while(0);a:do{if(j>>>0<c>>>0&(e|0)!=0){g=c;k=j;l=0;b:while(1){m=a[k]|0;n=m&255;if(n>>>0>f>>>0){o=k;break a}do{if(m<<24>>24>-1){p=k+1|0;q=l}else{if((m&255)<194){o=k;break a}if((m&255)<224){if((g-k|0)<2){o=k;break a}r=d[k+1|0]|0;if((r&192|0)!=128){o=k;break a}if((r&63|n<<6&1984)>>>0>f>>>0){o=k;break a}p=k+2|0;q=l;break}if((m&255)<240){s=k;if((g-s|0)<3){o=k;break a}r=a[k+1|0]|0;t=a[k+2|0]|0;if((n|0)==237){if(!((r&-32)<<24>>24==-128)){u=23;break b}}else if((n|0)==224){if(!((r&-32)<<24>>24==-96)){u=21;break b}}else{if(!((r&-64)<<24>>24==-128)){u=25;break b}}v=t&255;if((v&192|0)!=128){o=k;break a}if(((r&255)<<6&4032|n<<12&61440|v&63)>>>0>f>>>0){o=k;break a}p=k+3|0;q=l;break}if(!((m&255)<245)){o=k;break a}w=k;if((g-w|0)<4){o=k;break a}if((e-l|0)>>>0<2){o=k;break a}v=a[k+1|0]|0;r=a[k+2|0]|0;t=a[k+3|0]|0;if((n|0)==244){if(!((v&-16)<<24>>24==-128)){u=36;break b}}else if((n|0)==240){if(!((v+112<<24>>24&255)<48)){u=34;break b}}else{if(!((v&-64)<<24>>24==-128)){u=38;break b}}x=r&255;if((x&192|0)!=128){o=k;break a}r=t&255;if((r&192|0)!=128){o=k;break a}if(((v&255)<<12&258048|n<<18&1835008|x<<6&4032|r&63)>>>0>f>>>0){o=k;break a}p=k+4|0;q=l+1|0}}while(0);n=q+1|0;if(p>>>0<c>>>0&n>>>0<e>>>0){k=p;l=n}else{o=p;break a}}if((u|0)==21){y=s-b|0;i=h;return y|0}else if((u|0)==23){y=s-b|0;i=h;return y|0}else if((u|0)==25){y=s-b|0;i=h;return y|0}else if((u|0)==34){y=w-b|0;i=h;return y|0}else if((u|0)==36){y=w-b|0;i=h;return y|0}else if((u|0)==38){y=w-b|0;i=h;return y|0}}else{o=j}}while(0);y=o-b|0;i=h;return y|0}function Wk(a){a=a|0;i=i;return 4}function Xk(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Yk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Zk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d>>2<<2);c[j>>2]=g+((c[k>>2]|0)-g);i=b;return l|0}function Zk(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0;l=i;c[e>>2]=b;c[h>>2]=f;do{if((k&2|0)!=0){if((g-f|0)<3){m=1;i=l;return m|0}else{c[h>>2]=f+1;a[f]=-17;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=-69;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=-65;break}}}while(0);f=c[e>>2]|0;if(!(f>>>0<d>>>0)){m=0;i=l;return m|0}k=g;g=f;a:while(1){f=c[g>>2]|0;if((f&-2048|0)==55296|f>>>0>j>>>0){m=2;n=19;break}do{if(f>>>0<128){b=c[h>>2]|0;if((k-b|0)<1){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f}else{if(f>>>0<2048){b=c[h>>2]|0;if((k-b|0)<2){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>6|192;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f&63|128;break}b=c[h>>2]|0;o=k-b|0;if(f>>>0<65536){if((o|0)<3){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>12|224;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=f>>>6&63|128;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=f&63|128;break}else{if((o|0)<4){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>18|240;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f>>>12&63|128;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f>>>6&63|128;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f&63|128;break}}}while(0);f=(c[e>>2]|0)+4|0;c[e>>2]=f;if(f>>>0<d>>>0){g=f}else{m=0;n=19;break}}if((n|0)==19){i=l;return m|0}return 0}function _k(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=$k(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d);c[j>>2]=g+((c[k>>2]|0)-g>>2<<2);i=b;return l|0}function $k(b,e,f,g,h,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;m=i;c[f>>2]=b;c[j>>2]=g;g=c[f>>2]|0;do{if((l&4|0)==0){n=g}else{if((e-g|0)<=2){n=g;break}if(!((a[g]|0)==-17)){n=g;break}if(!((a[g+1|0]|0)==-69)){n=g;break}if(!((a[g+2|0]|0)==-65)){n=g;break}b=g+3|0;c[f>>2]=b;n=b}}while(0);a:do{if(n>>>0<e>>>0){g=e;l=n;b=c[j>>2]|0;while(1){if(!(b>>>0<h>>>0)){o=l;p=39;break a}q=a[l]|0;r=q&255;do{if(q<<24>>24>-1){if(r>>>0>k>>>0){s=2;break a}c[b>>2]=r;c[f>>2]=l+1}else{if((q&255)<194){s=2;break a}if((q&255)<224){if((g-l|0)<2){s=1;break a}t=d[l+1|0]|0;if((t&192|0)!=128){s=2;break a}u=t&63|r<<6&1984;if(u>>>0>k>>>0){s=2;break a}c[b>>2]=u;c[f>>2]=l+2;break}if((q&255)<240){if((g-l|0)<3){s=1;break a}u=a[l+1|0]|0;t=a[l+2|0]|0;if((r|0)==237){if(!((u&-32)<<24>>24==-128)){s=2;break a}}else if((r|0)==224){if(!((u&-32)<<24>>24==-96)){s=2;break a}}else{if(!((u&-64)<<24>>24==-128)){s=2;break a}}v=t&255;if((v&192|0)!=128){s=2;break a}t=(u&255)<<6&4032|r<<12&61440|v&63;if(t>>>0>k>>>0){s=2;break a}c[b>>2]=t;c[f>>2]=l+3;break}if(!((q&255)<245)){s=2;break a}if((g-l|0)<4){s=1;break a}t=a[l+1|0]|0;v=a[l+2|0]|0;u=a[l+3|0]|0;if((r|0)==240){if(!((t+112<<24>>24&255)<48)){s=2;break a}}else if((r|0)==244){if(!((t&-16)<<24>>24==-128)){s=2;break a}}else{if(!((t&-64)<<24>>24==-128)){s=2;break a}}w=v&255;if((w&192|0)!=128){s=2;break a}v=u&255;if((v&192|0)!=128){s=2;break a}u=(t&255)<<12&258048|r<<18&1835008|w<<6&4032|v&63;if(u>>>0>k>>>0){s=2;break a}c[b>>2]=u;c[f>>2]=l+4}}while(0);r=(c[j>>2]|0)+4|0;c[j>>2]=r;q=c[f>>2]|0;if(q>>>0<e>>>0){l=q;b=r}else{o=q;p=39;break}}}else{o=n;p=39}}while(0);if((p|0)==39){s=o>>>0<e>>>0|0}i=m;return s|0}function al(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function bl(a){a=a|0;i=i;return 0}function cl(a){a=a|0;i=i;return 0}function dl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=i;a=el(c,d,e,1114111,0)|0;i=b;return a|0}function el(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=i;do{if((g&4|0)==0){j=b}else{if((c-b|0)<=2){j=b;break}if(!((a[b]|0)==-17)){j=b;break}if(!((a[b+1|0]|0)==-69)){j=b;break}j=(a[b+2|0]|0)==-65?b+3|0:b}}while(0);a:do{if(j>>>0<c>>>0&(e|0)!=0){g=c;k=j;l=1;b:while(1){m=a[k]|0;n=m&255;do{if(m<<24>>24>-1){if(n>>>0>f>>>0){o=k;break a}p=k+1|0}else{if((m&255)<194){o=k;break a}if((m&255)<224){if((g-k|0)<2){o=k;break a}q=d[k+1|0]|0;if((q&192|0)!=128){o=k;break a}if((q&63|n<<6&1984)>>>0>f>>>0){o=k;break a}p=k+2|0;break}if((m&255)<240){r=k;if((g-r|0)<3){o=k;break a}q=a[k+1|0]|0;s=a[k+2|0]|0;if((n|0)==224){if(!((q&-32)<<24>>24==-96)){t=21;break b}}else if((n|0)==237){if(!((q&-32)<<24>>24==-128)){t=23;break b}}else{if(!((q&-64)<<24>>24==-128)){t=25;break b}}u=s&255;if((u&192|0)!=128){o=k;break a}if(((q&255)<<6&4032|n<<12&61440|u&63)>>>0>f>>>0){o=k;break a}p=k+3|0;break}if(!((m&255)<245)){o=k;break a}v=k;if((g-v|0)<4){o=k;break a}u=a[k+1|0]|0;q=a[k+2|0]|0;s=a[k+3|0]|0;if((n|0)==244){if(!((u&-16)<<24>>24==-128)){t=35;break b}}else if((n|0)==240){if(!((u+112<<24>>24&255)<48)){t=33;break b}}else{if(!((u&-64)<<24>>24==-128)){t=37;break b}}w=q&255;if((w&192|0)!=128){o=k;break a}q=s&255;if((q&192|0)!=128){o=k;break a}if(((u&255)<<12&258048|n<<18&1835008|w<<6&4032|q&63)>>>0>f>>>0){o=k;break a}p=k+4|0}}while(0);if(!(p>>>0<c>>>0&l>>>0<e>>>0)){o=p;break a}k=p;l=l+1|0}if((t|0)==21){x=r-b|0;i=h;return x|0}else if((t|0)==23){x=r-b|0;i=h;return x|0}else if((t|0)==25){x=r-b|0;i=h;return x|0}else if((t|0)==33){x=v-b|0;i=h;return x|0}else if((t|0)==35){x=v-b|0;i=h;return x|0}else if((t|0)==37){x=v-b|0;i=h;return x|0}}else{o=j}}while(0);x=o-b|0;i=h;return x|0}function fl(a){a=a|0;i=i;return 4}function gl(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function hl(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function il(a){a=a|0;var b=0;b=i;c[a>>2]=7472;ve(a+12|0);Om(a);i=b;return}function jl(a){a=a|0;var b=0;b=i;c[a>>2]=7472;ve(a+12|0);i=b;return}function kl(a){a=a|0;var b=0;b=i;c[a>>2]=7512;ve(a+16|0);Om(a);i=b;return}function ll(a){a=a|0;var b=0;b=i;c[a>>2]=7512;ve(a+16|0);i=b;return}function ml(b){b=b|0;i=i;return a[b+8|0]|0}function nl(a){a=a|0;i=i;return c[a+8>>2]|0}function ol(b){b=b|0;i=i;return a[b+9|0]|0}function pl(a){a=a|0;i=i;return c[a+12>>2]|0}function ql(a,b){a=a|0;b=b|0;var c=0;c=i;se(a,b+12|0);i=c;return}function rl(a,b){a=a|0;b=b|0;var c=0;c=i;se(a,b+16|0);i=c;return}function sl(a,b){a=a|0;b=b|0;b=i;te(a,7544,4);i=b;return}function tl(a,b){a=a|0;b=b|0;b=i;Ee(a,7552,hm(7552)|0);i=b;return}function ul(a,b){a=a|0;b=b|0;b=i;te(a,7576,5);i=b;return}function vl(a,b){a=a|0;b=b|0;b=i;Ee(a,7584,hm(7584)|0);i=b;return}function wl(b){b=b|0;var d=0;b=i;if((a[7616]|0)!=0){d=c[1902]|0;i=b;return d|0}if((Ma(7616)|0)==0){d=c[1902]|0;i=b;return d|0}do{if((a[14816]|0)==0){if((Ma(14816)|0)==0){break}cn(14648,0,168)|0;Zb(117,0,p|0)|0;Za(14816)}}while(0);we(14648,14824)|0;we(14660|0,14832)|0;we(14672|0,14840)|0;we(14684|0,14848)|0;we(14696|0,14864)|0;we(14708|0,14880)|0;we(14720|0,14888)|0;we(14732|0,14904)|0;we(14744|0,14912)|0;we(14756|0,14920)|0;we(14768|0,14928)|0;we(14780|0,14936)|0;we(14792|0,14944)|0;we(14804|0,14952)|0;c[1902]=14648;Za(7616);d=c[1902]|0;i=b;return d|0}function xl(b){b=b|0;var d=0;b=i;if((a[7632]|0)!=0){d=c[1906]|0;i=b;return d|0}if((Ma(7632)|0)==0){d=c[1906]|0;i=b;return d|0}do{if((a[14280]|0)==0){if((Ma(14280)|0)==0){break}cn(14112,0,168)|0;Zb(118,0,p|0)|0;Za(14280)}}while(0);He(14112,14288)|0;He(14124|0,14320)|0;He(14136|0,14352)|0;He(14148|0,14384)|0;He(14160|0,14424)|0;He(14172|0,14464)|0;He(14184|0,14496)|0;He(14196|0,14536)|0;He(14208|0,14552)|0;He(14220|0,14568)|0;He(14232|0,14584)|0;He(14244|0,14600)|0;He(14256|0,14616)|0;He(14268|0,14632)|0;c[1906]=14112;Za(7632);d=c[1906]|0;i=b;return d|0}function yl(b){b=b|0;var d=0;b=i;if((a[7648]|0)!=0){d=c[1910]|0;i=b;return d|0}if((Ma(7648)|0)==0){d=c[1910]|0;i=b;return d|0}do{if((a[13888]|0)==0){if((Ma(13888)|0)==0){break}cn(13600,0,288)|0;Zb(119,0,p|0)|0;Za(13888)}}while(0);we(13600,13896)|0;we(13612|0,13904)|0;we(13624|0,13920)|0;we(13636|0,13928)|0;we(13648|0,13936)|0;we(13660|0,13944)|0;we(13672|0,13952)|0;we(13684|0,13960)|0;we(13696|0,13968)|0;we(13708|0,13984)|0;we(13720|0,13992)|0;we(13732|0,14008)|0;we(13744|0,14024)|0;we(13756|0,14032)|0;we(13768|0,14040)|0;we(13780|0,14048)|0;we(13792|0,13936)|0;we(13804|0,14056)|0;we(13816|0,14064)|0;we(13828|0,14072)|0;we(13840|0,14080)|0;we(13852|0,14088)|0;we(13864|0,14096)|0;we(13876|0,14104)|0;c[1910]=13600;Za(7648);d=c[1910]|0;i=b;return d|0}function zl(b){b=b|0;var d=0;b=i;if((a[7664]|0)!=0){d=c[1914]|0;i=b;return d|0}if((Ma(7664)|0)==0){d=c[1914]|0;i=b;return d|0}do{if((a[13048]|0)==0){if((Ma(13048)|0)==0){break}cn(12760,0,288)|0;Zb(120,0,p|0)|0;Za(13048)}}while(0);He(12760,13056)|0;He(12772|0,13088)|0;He(12784|0,13128)|0;He(12796|0,13152)|0;He(12808|0,13472)|0;He(12820|0,13176)|0;He(12832|0,13200)|0;He(12844|0,13224)|0;He(12856|0,13256)|0;He(12868|0,13296)|0;He(12880|0,13328)|0;He(12892|0,13368)|0;He(12904|0,13408)|0;He(12916|0,13424)|0;He(12928|0,13440)|0;He(12940|0,13456)|0;He(12952|0,13472)|0;He(12964|0,13488)|0;He(12976|0,13504)|0;He(12988|0,13520)|0;He(13e3|0,13536)|0;He(13012|0,13552)|0;He(13024|0,13568)|0;He(13036|0,13584)|0;c[1914]=12760;Za(7664);d=c[1914]|0;i=b;return d|0}function Al(b){b=b|0;var d=0;b=i;if((a[7680]|0)!=0){d=c[1918]|0;i=b;return d|0}if((Ma(7680)|0)==0){d=c[1918]|0;i=b;return d|0}do{if((a[12736]|0)==0){if((Ma(12736)|0)==0){break}cn(12448,0,288)|0;Zb(121,0,p|0)|0;Za(12736)}}while(0);we(12448,12744)|0;we(12460|0,12752)|0;c[1918]=12448;Za(7680);d=c[1918]|0;i=b;return d|0}function Bl(b){b=b|0;var d=0;b=i;if((a[7696]|0)!=0){d=c[1922]|0;i=b;return d|0}if((Ma(7696)|0)==0){d=c[1922]|0;i=b;return d|0}do{if((a[12408]|0)==0){if((Ma(12408)|0)==0){break}cn(12120,0,288)|0;Zb(122,0,p|0)|0;Za(12408)}}while(0);He(12120,12416)|0;He(12132|0,12432)|0;c[1922]=12120;Za(7696);d=c[1922]|0;i=b;return d|0}function Cl(b){b=b|0;b=i;do{if((a[7720]|0)==0){if((Ma(7720)|0)==0){break}te(7704,7728,8);Zb(123,7704,p|0)|0;Za(7720)}}while(0);i=b;return 7704}function Dl(b){b=b|0;b=i;if((a[7760]|0)!=0){i=b;return 7744}if((Ma(7760)|0)==0){i=b;return 7744}Ee(7744,7768,hm(7768)|0);Zb(124,7744,p|0)|0;Za(7760);i=b;return 7744}function El(b){b=b|0;b=i;do{if((a[7824]|0)==0){if((Ma(7824)|0)==0){break}te(7808,7832,8);Zb(123,7808,p|0)|0;Za(7824)}}while(0);i=b;return 7808}function Fl(b){b=b|0;b=i;if((a[7864]|0)!=0){i=b;return 7848}if((Ma(7864)|0)==0){i=b;return 7848}Ee(7848,7872,hm(7872)|0);Zb(124,7848,p|0)|0;Za(7864);i=b;return 7848}function Gl(b){b=b|0;b=i;do{if((a[7928]|0)==0){if((Ma(7928)|0)==0){break}te(7912,7936,20);Zb(123,7912,p|0)|0;Za(7928)}}while(0);i=b;return 7912}function Hl(b){b=b|0;b=i;if((a[7976]|0)!=0){i=b;return 7960}if((Ma(7976)|0)==0){i=b;return 7960}Ee(7960,7984,hm(7984)|0);Zb(124,7960,p|0)|0;Za(7976);i=b;return 7960}function Il(b){b=b|0;b=i;do{if((a[8088]|0)==0){if((Ma(8088)|0)==0){break}te(8072,8096,11);Zb(123,8072,p|0)|0;Za(8088)}}while(0);i=b;return 8072}function Jl(b){b=b|0;b=i;if((a[8128]|0)!=0){i=b;return 8112}if((Ma(8128)|0)==0){i=b;return 8112}Ee(8112,8136,hm(8136)|0);Zb(124,8112,p|0)|0;Za(8128);i=b;return 8112}function Kl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=Hb()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);l=+an(b,g,c[1798]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)!=34){h=l;i=f;return+h}c[e>>2]=4;h=l;i=f;return+h}function Ll(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=Hb()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);l=+an(b,g,c[1798]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)!=34){h=l;i=f;return+h}c[e>>2]=4;h=l;i=f;return+h}function Ml(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=Hb()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);l=+an(b,g,c[1798]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)==34){c[e>>2]=4}h=l;i=f;return+h}function Nl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+8|0;h=g;do{if((b|0)==(d|0)){c[e>>2]=4;j=0;k=0}else{if((a[b]|0)==45){c[e>>2]=4;j=0;k=0;break}l=Hb()|0;m=c[l>>2]|0;c[l>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);n=sb(b|0,h|0,f|0,c[1798]|0)|0;o=c[l>>2]|0;if((o|0)==0){c[l>>2]=m}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;k=0;break}if((o|0)!=34){j=n;k=I;break}c[e>>2]=4;j=-1;k=-1}}while(0);I=k;i=g;return j|0}function Ol(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=Hb()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);m=sb(b|0,h|0,f|0,c[1798]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>4294967295)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m;i=g;return j|0}return 0}function Pl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=Hb()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);m=sb(b|0,h|0,f|0,c[1798]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>4294967295)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m;i=g;return j|0}return 0}function Ql(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=Hb()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);m=sb(b|0,h|0,f|0,c[1798]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>65535)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m&65535;i=g;return j|0}return 0}function Rl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;k=0;I=k;i=g;return j|0}l=Hb()|0;m=c[l>>2]|0;c[l>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);n=Ha(b|0,h|0,f|0,c[1798]|0)|0;f=I;b=c[l>>2]|0;if((b|0)==0){c[l>>2]=m}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;k=0;I=k;i=g;return j|0}if((b|0)==34){c[e>>2]=4;e=(f|0)>0|(f|0)==0&n>>>0>0;I=e?2147483647:-2147483648;i=g;return(e?-1:0)|0}else{j=n;k=f;I=k;i=g;return j|0}return 0}function Sl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}k=Hb()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);m=Ha(b|0,h|0,f|0,c[1798]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}do{if((b|0)==34){c[e>>2]=4;if((f|0)>0|(f|0)==0&m>>>0>0){j=2147483647}else{break}i=g;return j|0}else{if((f|0)<-1|(f|0)==-1&m>>>0<2147483648){c[e>>2]=4;break}if((f|0)>0|(f|0)==0&m>>>0>2147483647){c[e>>2]=4;j=2147483647;i=g;return j|0}else{j=m;i=g;return j|0}}}while(0);j=-2147483648;i=g;return j|0}function Tl(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;b=i;e=a+4|0;f=e;g=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;f=e+4|0;e=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;f=(c[a>>2]|0)+(e>>1)|0;a=f;if((e&1|0)==0){h=g;hc[h&127](a);i=b;return}else{h=c[(c[f>>2]|0)+g>>2]|0;hc[h&127](a);i=b;return}}function Ul(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;f=b+8|0;g=b+4|0;h=c[g>>2]|0;j=c[f>>2]|0;k=h;if(!(j-k>>2>>>0<d>>>0)){l=d;m=h;do{if((m|0)==0){n=0}else{c[m>>2]=0;n=c[g>>2]|0}m=n+4|0;c[g>>2]=m;l=l+ -1|0;}while((l|0)!=0);i=e;return}l=b+16|0;m=b;n=c[m>>2]|0;h=k-n>>2;k=h+d|0;if(k>>>0>1073741823){Oj(0)}o=j-n|0;do{if(o>>2>>>0<536870911){n=o>>1;j=n>>>0<k>>>0?k:n;if((j|0)==0){p=0;q=0;break}n=b+128|0;if(!((a[n]|0)==0&j>>>0<29)){r=j;s=11;break}a[n]=1;p=j;q=l}else{r=1073741823;s=11}}while(0);if((s|0)==11){p=r;q=Mm(r<<2)|0}r=d;d=q+(h<<2)|0;do{if((d|0)==0){t=0}else{c[d>>2]=0;t=d}d=t+4|0;r=r+ -1|0;}while((r|0)!=0);r=c[m>>2]|0;t=(c[g>>2]|0)-r|0;s=q+(h-(t>>2)<<2)|0;h=r;fn(s|0,h|0,t|0)|0;c[m>>2]=s;c[g>>2]=d;c[f>>2]=q+(p<<2);if((r|0)==0){i=e;return}if((l|0)==(r|0)){a[b+128|0]=0;i=e;return}else{Om(h);i=e;return}}function Vl(a){a=a|0;a=i;Ge(12396|0);Ge(12384|0);Ge(12372|0);Ge(12360|0);Ge(12348|0);Ge(12336|0);Ge(12324|0);Ge(12312|0);Ge(12300|0);Ge(12288|0);Ge(12276|0);Ge(12264|0);Ge(12252|0);Ge(12240|0);Ge(12228|0);Ge(12216|0);Ge(12204|0);Ge(12192|0);Ge(12180|0);Ge(12168|0);Ge(12156|0);Ge(12144|0);Ge(12132|0);Ge(12120);i=a;return}function Wl(a){a=a|0;a=i;ve(12724|0);ve(12712|0);ve(12700|0);ve(12688|0);ve(12676|0);ve(12664|0);ve(12652|0);ve(12640|0);ve(12628|0);ve(12616|0);ve(12604|0);ve(12592|0);ve(12580|0);ve(12568|0);ve(12556|0);ve(12544|0);ve(12532|0);ve(12520|0);ve(12508|0);ve(12496|0);ve(12484|0);ve(12472|0);ve(12460|0);ve(12448);i=a;return}function Xl(a){a=a|0;a=i;Ge(13036|0);Ge(13024|0);Ge(13012|0);Ge(13e3|0);Ge(12988|0);Ge(12976|0);Ge(12964|0);Ge(12952|0);Ge(12940|0);Ge(12928|0);Ge(12916|0);Ge(12904|0);Ge(12892|0);Ge(12880|0);Ge(12868|0);Ge(12856|0);Ge(12844|0);Ge(12832|0);Ge(12820|0);Ge(12808|0);Ge(12796|0);Ge(12784|0);Ge(12772|0);Ge(12760);i=a;return}function Yl(a){a=a|0;a=i;ve(13876|0);ve(13864|0);ve(13852|0);ve(13840|0);ve(13828|0);ve(13816|0);ve(13804|0);ve(13792|0);ve(13780|0);ve(13768|0);ve(13756|0);ve(13744|0);ve(13732|0);ve(13720|0);ve(13708|0);ve(13696|0);ve(13684|0);ve(13672|0);ve(13660|0);ve(13648|0);ve(13636|0);ve(13624|0);ve(13612|0);ve(13600);i=a;return}function Zl(a){a=a|0;a=i;Ge(14268|0);Ge(14256|0);Ge(14244|0);Ge(14232|0);Ge(14220|0);Ge(14208|0);Ge(14196|0);Ge(14184|0);Ge(14172|0);Ge(14160|0);Ge(14148|0);Ge(14136|0);Ge(14124|0);Ge(14112);i=a;return}function _l(a){a=a|0;a=i;ve(14804|0);ve(14792|0);ve(14780|0);ve(14768|0);ve(14756|0);ve(14744|0);ve(14732|0);ve(14720|0);ve(14708|0);ve(14696|0);ve(14684|0);ve(14672|0);ve(14660|0);ve(14648);i=a;return}function $l(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=i;e=am(0,a,b,(c|0)!=0?c:15168)|0;i=d;return e|0}function am(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;i=i+8|0;h=g;c[h>>2]=b;j=(f|0)==0?15176:f;f=c[j>>2]|0;a:do{if((d|0)==0){if((f|0)==0){k=0}else{break}i=g;return k|0}else{if((b|0)==0){l=h;c[h>>2]=l;m=l}else{m=b}if((e|0)==0){k=-2;i=g;return k|0}do{if((f|0)==0){l=a[d]|0;n=l&255;if(l<<24>>24>-1){c[m>>2]=n;k=l<<24>>24!=0|0;i=g;return k|0}else{l=n+ -194|0;if(l>>>0>50){break a}o=e+ -1|0;p=c[14960+(l<<2)>>2]|0;q=d+1|0;break}}else{o=e;p=f;q=d}}while(0);b:do{if((o|0)==0){r=p}else{l=a[q]|0;n=(l&255)>>>3;if((n+ -16|n+(p>>26))>>>0>7){break a}else{s=o;t=l;u=p;v=q}while(1){v=v+1|0;u=(t&255)+ -128|u<<6;s=s+ -1|0;if((u|0)>=0){break}if((s|0)==0){r=u;break b}t=a[v]|0;if(((t&255)+ -128|0)>>>0>63){break a}}c[j>>2]=0;c[m>>2]=u;k=e-s|0;i=g;return k|0}}while(0);c[j>>2]=r;k=-2;i=g;return k|0}}while(0);c[j>>2]=0;c[(Hb()|0)>>2]=84;k=-1;i=g;return k|0}function bm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;g=i;i=i+1032|0;h=g+1024|0;j=c[b>>2]|0;c[h>>2]=j;k=(a|0)!=0;l=g;m=k?e:256;e=k?a:l;a:do{if((j|0)==0|(m|0)==0){n=d;o=m;p=j;q=0;r=e}else{a=d;s=m;t=j;u=0;v=e;while(1){w=a>>>2;x=w>>>0>=s>>>0;if(!(x|a>>>0>131)){n=a;o=s;p=t;q=u;r=v;break a}y=x?s:w;z=a-y|0;w=cm(v,h,y,f)|0;if((w|0)==-1){break}if((v|0)==(l|0)){A=s;B=l}else{A=s-w|0;B=v+(w<<2)|0}y=w+u|0;w=c[h>>2]|0;if((w|0)==0|(A|0)==0){n=z;o=A;p=w;q=y;r=B;break a}else{a=z;s=A;t=w;u=y;v=B}}n=z;o=0;p=c[h>>2]|0;q=-1;r=v}}while(0);b:do{if((p|0)==0){C=q}else{if((o|0)==0|(n|0)==0){C=q;break}else{D=n;E=o;F=p;G=q;H=r}while(1){I=am(H,F,D,f)|0;if((I+2|0)>>>0<3){break}z=(c[h>>2]|0)+I|0;c[h>>2]=z;B=E+ -1|0;A=G+1|0;if((B|0)==0|(D|0)==(I|0)){C=A;break b}else{D=D-I|0;E=B;F=z;G=A;H=H+4|0}}if((I|0)==-1){C=-1;break}else if((I|0)==0){c[h>>2]=0;C=G;break}else{c[f>>2]=0;C=G;break}}}while(0);if(!k){i=g;return C|0}c[b>>2]=c[h>>2];i=g;return C|0}function cm(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0;h=i;j=c[e>>2]|0;do{if((g|0)==0){k=5}else{l=g;m=c[l>>2]|0;if((m|0)==0){k=5;break}if((b|0)==0){n=f;o=m;p=j;k=16;break}c[l>>2]=0;q=b;r=f;s=m;t=j;k=36}}while(0);if((k|0)==5){if((b|0)==0){u=f;v=j;k=7}else{w=b;x=f;y=j;k=6}}a:while(1){if((k|0)==6){k=0;if((x|0)==0){z=f;k=53;break}else{A=w;B=x;C=y}while(1){j=a[C]|0;do{if(((j&255)+ -1|0)>>>0<127){if((C&3|0)==0&B>>>0>3){D=A;E=B;F=C}else{G=A;H=B;I=j;J=C;break}while(1){K=c[F>>2]|0;if(((K+ -16843009|K)&-2139062144|0)!=0){k=30;break}c[D>>2]=K&255;c[D+4>>2]=d[F+1|0]|0;c[D+8>>2]=d[F+2|0]|0;L=F+4|0;M=D+16|0;c[D+12>>2]=d[F+3|0]|0;N=E+ -4|0;if(N>>>0>3){D=M;E=N;F=L}else{k=31;break}}if((k|0)==30){k=0;G=D;H=E;I=K&255;J=F;break}else if((k|0)==31){k=0;G=M;H=N;I=a[L]|0;J=L;break}}else{G=A;H=B;I=j;J=C}}while(0);O=I&255;if(!((O+ -1|0)>>>0<127)){break}c[G>>2]=O;j=H+ -1|0;if((j|0)==0){z=f;k=53;break a}else{A=G+4|0;B=j;C=J+1|0}}j=O+ -194|0;if(j>>>0>50){P=G;Q=H;R=J;k=47;break}q=G;r=H;s=c[14960+(j<<2)>>2]|0;t=J+1|0;k=36;continue}else if((k|0)==7){k=0;j=a[v]|0;do{if(((j&255)+ -1|0)>>>0<127){if((v&3|0)!=0){S=u;T=j;U=v;break}g=c[v>>2]|0;if(((g+ -16843009|g)&-2139062144|0)==0){m=u;l=v;while(1){V=l+4|0;W=m+ -4|0;X=c[V>>2]|0;if(((X+ -16843009|X)&-2139062144|0)==0){l=V;m=W}else{Y=W;Z=X;_=V;break}}}else{Y=u;Z=g;_=v}S=Y;T=Z&255;U=_}else{S=u;T=j;U=v}}while(0);j=T&255;if((j+ -1|0)>>>0<127){u=S+ -1|0;v=U+1|0;k=7;continue}m=j+ -194|0;if(m>>>0>50){P=b;Q=S;R=U;k=47;break}n=S;o=c[14960+(m<<2)>>2]|0;p=U+1|0;k=16;continue}else if((k|0)==16){k=0;m=(d[p]|0)>>>3;if((m+ -16|m+(o>>26))>>>0>7){k=17;break}m=p+1|0;do{if((o&33554432|0)==0){$=m}else{if(((d[m]|0)+ -128|0)>>>0>63){k=20;break a}j=p+2|0;if((o&524288|0)==0){$=j;break}if(((d[j]|0)+ -128|0)>>>0>63){k=23;break a}$=p+3|0}}while(0);u=n+ -1|0;v=$;k=7;continue}else if((k|0)==36){k=0;m=d[t]|0;j=m>>>3;if((j+ -16|j+(s>>26))>>>0>7){k=37;break}j=t+1|0;aa=m+ -128|s<<6;do{if((aa|0)<0){m=(d[j]|0)+ -128|0;if(m>>>0>63){k=40;break a}l=t+2|0;ba=m|aa<<6;if((ba|0)>=0){ca=ba;da=l;break}m=(d[l]|0)+ -128|0;if(m>>>0>63){k=43;break a}ca=m|ba<<6;da=t+3|0}else{ca=aa;da=j}}while(0);c[q>>2]=ca;w=q+4|0;x=r+ -1|0;y=da;k=6;continue}}if((k|0)==17){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==20){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==23){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==37){ea=q;fa=r;ga=s;ha=t+ -1|0;k=46}else if((k|0)==40){ea=q;fa=r;ga=aa;ha=t+ -1|0;k=46}else if((k|0)==43){ea=q;fa=r;ga=ba;ha=t+ -1|0;k=46}else if((k|0)==53){i=h;return z|0}if((k|0)==46){if((ga|0)==0){P=ea;Q=fa;R=ha;k=47}else{ia=ea;ja=ha}}do{if((k|0)==47){if((a[R]|0)!=0){ia=P;ja=R;break}if((P|0)!=0){c[P>>2]=0;c[e>>2]=0}z=f-Q|0;i=h;return z|0}}while(0);c[(Hb()|0)>>2]=84;if((ia|0)==0){z=-1;i=h;return z|0}c[e>>2]=ja;z=-1;i=h;return z|0}function dm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+8|0;h=g;c[h>>2]=b;if((e|0)==0){j=0;i=g;return j|0}do{if((f|0)!=0){if((b|0)==0){k=h;c[h>>2]=k;l=k}else{l=b}k=a[e]|0;m=k&255;if(k<<24>>24>-1){c[l>>2]=m;j=k<<24>>24!=0|0;i=g;return j|0}k=m+ -194|0;if(k>>>0>50){break}m=e+1|0;n=c[14960+(k<<2)>>2]|0;if(f>>>0<4){if((n&-2147483648>>>((f*6|0)+ -6|0)|0)!=0){break}}k=d[m]|0;m=k>>>3;if((m+ -16|m+(n>>26))>>>0>7){break}m=k+ -128|n<<6;if((m|0)>=0){c[l>>2]=m;j=2;i=g;return j|0}n=(d[e+2|0]|0)+ -128|0;if(n>>>0>63){break}k=n|m<<6;if((k|0)>=0){c[l>>2]=k;j=3;i=g;return j|0}m=(d[e+3|0]|0)+ -128|0;if(m>>>0>63){break}c[l>>2]=m|k<<6;j=4;i=g;return j|0}}while(0);c[(Hb()|0)>>2]=84;j=-1;i=g;return j|0}function em(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((b|0)==0){f=1;i=e;return f|0}if(d>>>0<128){a[b]=d;f=1;i=e;return f|0}if(d>>>0<2048){a[b]=d>>>6|192;a[b+1|0]=d&63|128;f=2;i=e;return f|0}if(d>>>0<55296|(d+ -57344|0)>>>0<8192){a[b]=d>>>12|224;a[b+1|0]=d>>>6&63|128;a[b+2|0]=d&63|128;f=3;i=e;return f|0}if((d+ -65536|0)>>>0<1048576){a[b]=d>>>18|240;a[b+1|0]=d>>>12&63|128;a[b+2|0]=d>>>6&63|128;a[b+3|0]=d&63|128;f=4;i=e;return f|0}else{c[(Hb()|0)>>2]=84;f=-1;i=e;return f|0}return 0}function fm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;f=i;i=i+264|0;g=f+256|0;h=f;j=c[b>>2]|0;c[g>>2]=j;k=(a|0)!=0;l=k?e:256;e=k?a:h;a:do{if((j|0)==0|(l|0)==0){m=d;n=l;o=j;p=0;q=e}else{a=d;r=l;s=j;t=0;u=e;while(1){v=a>>>0>=r>>>0;if(!(v|a>>>0>32)){m=a;n=r;o=s;p=t;q=u;break a}w=v?r:a;x=a-w|0;v=gm(u,g,w,0)|0;if((v|0)==-1){break}if((u|0)==(h|0)){y=r;z=h}else{y=r-v|0;z=u+v|0}w=v+t|0;v=c[g>>2]|0;if((v|0)==0|(y|0)==0){m=x;n=y;o=v;p=w;q=z;break a}else{a=x;r=y;s=v;t=w;u=z}}m=x;n=0;o=c[g>>2]|0;p=-1;q=u}}while(0);b:do{if((o|0)==0){A=p}else{if((n|0)==0|(m|0)==0){A=p;break}else{B=m;C=n;D=o;E=p;F=q}while(1){G=em(F,c[D>>2]|0,0)|0;if((G+1|0)>>>0<2){break}x=(c[g>>2]|0)+4|0;c[g>>2]=x;z=B+ -1|0;y=E+1|0;if((C|0)==(G|0)|(z|0)==0){A=y;break b}else{B=z;C=C-G|0;D=x;E=y;F=F+G|0}}if((G|0)!=0){A=-1;break}c[g>>2]=0;A=E}}while(0);if(!k){i=f;return A|0}c[b>>2]=c[g>>2];i=f;return A|0}function gm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=i;i=i+8|0;g=f;if((b|0)==0){h=c[d>>2]|0;j=g;k=c[h>>2]|0;if((k|0)==0){l=0;i=f;return l|0}else{m=0;n=k;o=h}while(1){if(n>>>0>127){h=em(j,n,0)|0;if((h|0)==-1){l=-1;p=26;break}else{q=h}}else{q=1}h=q+m|0;k=o+4|0;r=c[k>>2]|0;if((r|0)==0){l=h;p=26;break}else{m=h;n=r;o=k}}if((p|0)==26){i=f;return l|0}}a:do{if(e>>>0>3){o=b;n=e;m=c[d>>2]|0;while(1){q=c[m>>2]|0;if((q|0)==0){s=o;t=n;break a}if(q>>>0>127){j=em(o,q,0)|0;if((j|0)==-1){l=-1;break}u=o+j|0;v=n-j|0;w=m}else{a[o]=q;u=o+1|0;v=n+ -1|0;w=c[d>>2]|0}q=w+4|0;c[d>>2]=q;if(v>>>0>3){o=u;n=v;m=q}else{s=u;t=v;break a}}i=f;return l|0}else{s=b;t=e}}while(0);b:do{if((t|0)==0){x=0}else{b=g;v=s;u=t;w=c[d>>2]|0;while(1){m=c[w>>2]|0;if((m|0)==0){p=24;break}if(m>>>0>127){n=em(b,m,0)|0;if((n|0)==-1){l=-1;p=26;break}if(n>>>0>u>>>0){p=20;break}em(v,c[w>>2]|0,0)|0;y=v+n|0;z=u-n|0;A=w}else{a[v]=m;y=v+1|0;z=u+ -1|0;A=c[d>>2]|0}m=A+4|0;c[d>>2]=m;if((z|0)==0){x=0;break b}else{v=y;u=z;w=m}}if((p|0)==20){l=e-u|0;i=f;return l|0}else if((p|0)==24){a[v]=0;x=u;break}else if((p|0)==26){i=f;return l|0}}}while(0);c[d>>2]=0;l=e-x|0;i=f;return l|0}function hm(a){a=a|0;var b=0,d=0;b=i;d=a;while(1){if((c[d>>2]|0)==0){break}else{d=d+4|0}}i=b;return d-a>>2|0}function im(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;if((d|0)==0){i=e;return a|0}else{f=d;g=b;h=a}while(1){b=f+ -1|0;c[h>>2]=c[g>>2];if((b|0)==0){break}else{h=h+4|0;g=g+4|0;f=b}}i=e;return a|0}function jm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;f=(d|0)==0;do{if(a-b>>2>>>0<d>>>0){if(f){break}else{g=d}do{g=g+ -1|0;c[a+(g<<2)>>2]=c[b+(g<<2)>>2];}while((g|0)!=0)}else{if(f){break}else{h=b;j=a;k=d}while(1){l=k+ -1|0;c[j>>2]=c[h>>2];if((l|0)==0){break}else{k=l;j=j+4|0;h=h+4|0}}}}while(0);i=e;return a|0}function km(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;if((d|0)!=0){f=d;d=a;while(1){g=f+ -1|0;c[d>>2]=b;if((g|0)==0){break}else{d=d+4|0;f=g}}}i=e;return a|0}function lm(a){a=a|0;i=i;return}function mm(a){a=a|0;c[a>>2]=15192;i=i;return}function nm(a){a=a|0;var b=0;b=i;Kb(a|0);Om(a);i=b;return}function om(a){a=a|0;var b=0;b=i;Kb(a|0);i=b;return}function pm(a){a=a|0;i=i;return 15208}function qm(a){a=a|0;i=i;return}function rm(a){a=a|0;i=i;return}function sm(a){a=a|0;i=i;return}function tm(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function um(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function vm(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function wm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+56|0;f=e;if((a|0)==(b|0)){g=1;i=e;return g|0}if((b|0)==0){g=0;i=e;return g|0}h=Am(b,15320,15376,0)|0;b=h;if((h|0)==0){g=0;i=e;return g|0}j=f+0|0;k=j+56|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));c[f>>2]=b;c[f+8>>2]=a;c[f+12>>2]=-1;c[f+48>>2]=1;vc[c[(c[h>>2]|0)+28>>2]&7](b,f,c[d>>2]|0,1);if((c[f+24>>2]|0)!=1){g=0;i=e;return g|0}c[d>>2]=c[f+16>>2];g=1;i=e;return g|0}function xm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;if((c[d+8>>2]|0)!=(b|0)){i=g;return}b=d+16|0;h=c[b>>2]|0;if((h|0)==0){c[b>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((h|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}e=d+24|0;if((c[e>>2]|0)!=2){i=g;return}c[e>>2]=f;i=g;return}function ym(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;if((b|0)!=(c[d+8>>2]|0)){h=c[b+8>>2]|0;vc[c[(c[h>>2]|0)+28>>2]&7](h,d,e,f);i=g;return}h=d+16|0;b=c[h>>2]|0;if((b|0)==0){c[h>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((b|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}e=d+24|0;if((c[e>>2]|0)!=2){i=g;return}c[e>>2]=f;i=g;return}function zm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;if((b|0)==(c[d+8>>2]|0)){h=d+16|0;j=c[h>>2]|0;if((j|0)==0){c[h>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((j|0)!=(e|0)){j=d+36|0;c[j>>2]=(c[j>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}j=d+24|0;if((c[j>>2]|0)!=2){i=g;return}c[j>>2]=f;i=g;return}j=c[b+12>>2]|0;h=b+(j<<3)+16|0;k=c[b+20>>2]|0;l=k>>8;if((k&1|0)==0){m=l}else{m=c[(c[e>>2]|0)+l>>2]|0}l=c[b+16>>2]|0;vc[c[(c[l>>2]|0)+28>>2]&7](l,d,e+m|0,(k&2|0)!=0?f:2);if((j|0)<=1){i=g;return}j=d+54|0;k=e;m=b+24|0;while(1){b=c[m+4>>2]|0;l=b>>8;if((b&1|0)==0){n=l}else{n=c[(c[k>>2]|0)+l>>2]|0}l=c[m>>2]|0;vc[c[(c[l>>2]|0)+28>>2]&7](l,d,e+n|0,(b&2|0)!=0?f:2);if((a[j]|0)!=0){o=16;break}b=m+8|0;if(b>>>0<h>>>0){m=b}else{o=16;break}}if((o|0)==16){i=g;return}}function Am(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+56|0;j=h;k=c[d>>2]|0;l=d+(c[k+ -8>>2]|0)|0;m=c[k+ -4>>2]|0;k=m;c[j>>2]=f;c[j+4>>2]=d;c[j+8>>2]=e;c[j+12>>2]=g;g=j+16|0;e=j+20|0;d=j+24|0;n=j+28|0;o=j+32|0;p=j+40|0;q=(m|0)==(f|0);f=g;r=f+0|0;s=r+36|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(s|0));b[f+36>>1]=0;a[f+38|0]=0;if(q){c[j+48>>2]=1;sc[c[(c[m>>2]|0)+20>>2]&15](k,j,l,l,1,0);t=(c[d>>2]|0)==1?l:0;i=h;return t|0}gc[c[(c[m>>2]|0)+24>>2]&3](k,j,l,1,0);l=c[j+36>>2]|0;if((l|0)==0){if((c[p>>2]|0)!=1){t=0;i=h;return t|0}if((c[n>>2]|0)!=1){t=0;i=h;return t|0}t=(c[o>>2]|0)==1?c[e>>2]|0:0;i=h;return t|0}else if((l|0)==1){do{if((c[d>>2]|0)!=1){if((c[p>>2]|0)!=0){t=0;i=h;return t|0}if((c[n>>2]|0)!=1){t=0;i=h;return t|0}if((c[o>>2]|0)==1){break}else{t=0}i=h;return t|0}}while(0);t=c[g>>2]|0;i=h;return t|0}else{t=0;i=h;return t|0}return 0}function Bm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;h=i;j=b;if((j|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)!=(e|0)){i=h;return}k=d+28|0;if((c[k>>2]|0)==1){i=h;return}c[k>>2]=f;i=h;return}if((j|0)==(c[d>>2]|0)){do{if((c[d+16>>2]|0)!=(e|0)){j=d+20|0;if((c[j>>2]|0)==(e|0)){break}c[d+32>>2]=f;k=d+44|0;if((c[k>>2]|0)==4){i=h;return}l=c[b+12>>2]|0;m=b+(l<<3)+16|0;a:do{if((l|0)>0){n=d+52|0;o=d+53|0;p=d+54|0;q=b+8|0;r=d+24|0;s=e;t=0;u=0;v=b+16|0;b:while(1){a[n]=0;a[o]=0;w=c[v+4>>2]|0;x=w>>8;if((w&1|0)==0){y=x}else{y=c[(c[s>>2]|0)+x>>2]|0}x=c[v>>2]|0;sc[c[(c[x>>2]|0)+20>>2]&15](x,d,e,e+y|0,2-(w>>>1&1)|0,g);if((a[p]|0)!=0){z=t;A=u;break}do{if((a[o]|0)==0){B=t;C=u}else{if((a[n]|0)==0){if((c[q>>2]&1|0)==0){z=t;A=1;break b}else{B=t;C=1;break}}if((c[r>>2]|0)==1){D=27;break a}if((c[q>>2]&2|0)==0){D=27;break a}else{B=1;C=1}}}while(0);w=v+8|0;if(w>>>0<m>>>0){t=B;u=C;v=w}else{z=B;A=C;break}}if(z){E=A;D=26}else{F=A;D=23}}else{F=0;D=23}}while(0);do{if((D|0)==23){c[j>>2]=e;m=d+40|0;c[m>>2]=(c[m>>2]|0)+1;if((c[d+36>>2]|0)!=1){E=F;D=26;break}if((c[d+24>>2]|0)!=2){E=F;D=26;break}a[d+54|0]=1;if(F){D=27}else{D=28}}}while(0);if((D|0)==26){if(E){D=27}else{D=28}}if((D|0)==27){c[k>>2]=3;i=h;return}else if((D|0)==28){c[k>>2]=4;i=h;return}}}while(0);if((f|0)!=1){i=h;return}c[d+32>>2]=1;i=h;return}E=c[b+12>>2]|0;F=b+(E<<3)+16|0;A=c[b+20>>2]|0;z=A>>8;if((A&1|0)==0){G=z}else{G=c[(c[e>>2]|0)+z>>2]|0}z=c[b+16>>2]|0;gc[c[(c[z>>2]|0)+24>>2]&3](z,d,e+G|0,(A&2|0)!=0?f:2,g);A=b+24|0;if((E|0)<=1){i=h;return}E=c[b+8>>2]|0;do{if((E&2|0)==0){b=d+36|0;if((c[b>>2]|0)==1){break}if((E&1|0)==0){G=d+54|0;z=e;C=A;while(1){if((a[G]|0)!=0){D=53;break}if((c[b>>2]|0)==1){D=53;break}B=c[C+4>>2]|0;y=B>>8;if((B&1|0)==0){H=y}else{H=c[(c[z>>2]|0)+y>>2]|0}y=c[C>>2]|0;gc[c[(c[y>>2]|0)+24>>2]&3](y,d,e+H|0,(B&2|0)!=0?f:2,g);B=C+8|0;if(B>>>0<F>>>0){C=B}else{D=53;break}}if((D|0)==53){i=h;return}}C=d+24|0;z=d+54|0;G=e;k=A;while(1){if((a[z]|0)!=0){D=53;break}if((c[b>>2]|0)==1){if((c[C>>2]|0)==1){D=53;break}}B=c[k+4>>2]|0;y=B>>8;if((B&1|0)==0){I=y}else{I=c[(c[G>>2]|0)+y>>2]|0}y=c[k>>2]|0;gc[c[(c[y>>2]|0)+24>>2]&3](y,d,e+I|0,(B&2|0)!=0?f:2,g);B=k+8|0;if(B>>>0<F>>>0){k=B}else{D=53;break}}if((D|0)==53){i=h;return}}}while(0);I=d+54|0;H=e;E=A;while(1){if((a[I]|0)!=0){D=53;break}A=c[E+4>>2]|0;k=A>>8;if((A&1|0)==0){J=k}else{J=c[(c[H>>2]|0)+k>>2]|0}k=c[E>>2]|0;gc[c[(c[k>>2]|0)+24>>2]&3](k,d,e+J|0,(A&2|0)!=0?f:2,g);A=E+8|0;if(A>>>0<F>>>0){E=A}else{D=53;break}}if((D|0)==53){i=h;return}}function Cm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=i;j=b;if((j|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)!=(e|0)){i=h;return}k=d+28|0;if((c[k>>2]|0)==1){i=h;return}c[k>>2]=f;i=h;return}if((j|0)!=(c[d>>2]|0)){j=c[b+8>>2]|0;gc[c[(c[j>>2]|0)+24>>2]&3](j,d,e,f,g);i=h;return}do{if((c[d+16>>2]|0)!=(e|0)){j=d+20|0;if((c[j>>2]|0)==(e|0)){break}c[d+32>>2]=f;k=d+44|0;if((c[k>>2]|0)==4){i=h;return}l=d+52|0;a[l]=0;m=d+53|0;a[m]=0;n=c[b+8>>2]|0;sc[c[(c[n>>2]|0)+20>>2]&15](n,d,e,e,1,g);if((a[m]|0)==0){o=0;p=13}else{if((a[l]|0)==0){o=1;p=13}}a:do{if((p|0)==13){c[j>>2]=e;l=d+40|0;c[l>>2]=(c[l>>2]|0)+1;do{if((c[d+36>>2]|0)==1){if((c[d+24>>2]|0)!=2){p=16;break}a[d+54|0]=1;if(o){break a}}else{p=16}}while(0);if((p|0)==16){if(o){break}}c[k>>2]=4;i=h;return}}while(0);c[k>>2]=3;i=h;return}}while(0);if((f|0)!=1){i=h;return}c[d+32>>2]=1;i=h;return}function Dm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;g=i;if((c[d+8>>2]|0)==(b|0)){if((c[d+4>>2]|0)!=(e|0)){i=g;return}h=d+28|0;if((c[h>>2]|0)==1){i=g;return}c[h>>2]=f;i=g;return}if((c[d>>2]|0)!=(b|0)){i=g;return}do{if((c[d+16>>2]|0)!=(e|0)){b=d+20|0;if((c[b>>2]|0)==(e|0)){break}c[d+32>>2]=f;c[b>>2]=e;b=d+40|0;c[b>>2]=(c[b>>2]|0)+1;do{if((c[d+36>>2]|0)==1){if((c[d+24>>2]|0)!=2){break}a[d+54|0]=1}}while(0);c[d+44>>2]=4;i=g;return}}while(0);if((f|0)!=1){i=g;return}c[d+32>>2]=1;i=g;return}\n\n\n\nfunction Eg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0;k=i;i=i+104|0;l=(f-e|0)/12|0;m=k;do{if(l>>>0>100){n=Hm(l)|0;if((n|0)!=0){o=n;p=n;break}Tm()}else{o=0;p=m}}while(0);m=(e|0)==(f|0);if(m){q=0;r=l}else{n=e;s=0;t=l;l=p;while(1){u=a[n]|0;if((u&1)==0){v=(u&255)>>>1}else{v=c[n+4>>2]|0}if((v|0)==0){a[l]=2;w=s+1|0;x=t+ -1|0}else{a[l]=1;w=s;x=t}u=n+12|0;if((u|0)==(f|0)){q=w;r=x;break}else{n=u;s=w;t=x;l=l+1|0}}}l=b;b=d;d=g;x=0;t=q;q=r;a:while(1){r=c[l>>2]|0;do{if((r|0)==0){y=1}else{w=c[r+12>>2]|0;if((w|0)==(c[r+16>>2]|0)){z=kc[c[(c[r>>2]|0)+36>>2]&63](r)|0}else{z=c[w>>2]|0}if((z|0)==-1){c[l>>2]=0;y=1;break}else{y=(c[l>>2]|0)==0;break}}}while(0);r=c[b>>2]|0;do{if((r|0)==0){A=0;B=1}else{w=c[r+12>>2]|0;if((w|0)==(c[r+16>>2]|0)){C=kc[c[(c[r>>2]|0)+36>>2]&63](r)|0}else{C=c[w>>2]|0}if(!((C|0)==-1)){A=r;B=0;break}c[b>>2]=0;A=0;B=1}}while(0);D=c[l>>2]|0;if(!((y^B)&(q|0)!=0)){break}r=c[D+12>>2]|0;if((r|0)==(c[D+16>>2]|0)){E=kc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{E=c[r>>2]|0}if(j){F=E}else{F=tc[c[(c[d>>2]|0)+28>>2]&15](g,E)|0}r=x+1|0;if(m){x=r;q=q;t=t;continue}b:do{if(j){w=0;s=e;n=t;v=q;u=p;while(1){do{if((a[u]|0)==1){G=a[s]|0;H=(G&1)==0;if(H){I=s+4|0}else{I=c[s+8>>2]|0}if((F|0)!=(c[I+(x<<2)>>2]|0)){a[u]=0;J=w;K=n;L=v+ -1|0;break}if(H){M=(G&255)>>>1}else{M=c[s+4>>2]|0}if((M|0)!=(r|0)){J=1;K=n;L=v;break}a[u]=2;J=1;K=n+1|0;L=v+ -1|0}else{J=w;K=n;L=v}}while(0);G=s+12|0;if((G|0)==(f|0)){N=J;O=K;P=L;break b}w=J;s=G;n=K;v=L;u=u+1|0}}else{u=0;v=e;n=t;s=q;w=p;while(1){do{if((a[w]|0)==1){G=v;if((a[G]&1)==0){Q=v+4|0}else{Q=c[v+8>>2]|0}if((F|0)!=(tc[c[(c[d>>2]|0)+28>>2]&15](g,c[Q+(x<<2)>>2]|0)|0)){a[w]=0;R=u;S=n;T=s+ -1|0;break}H=a[G]|0;if((H&1)==0){U=(H&255)>>>1}else{U=c[v+4>>2]|0}if((U|0)!=(r|0)){R=1;S=n;T=s;break}a[w]=2;R=1;S=n+1|0;T=s+ -1|0}else{R=u;S=n;T=s}}while(0);H=v+12|0;if((H|0)==(f|0)){N=R;O=S;P=T;break b}u=R;v=H;n=S;s=T;w=w+1|0}}}while(0);if(!N){x=r;t=O;q=P;continue}w=c[l>>2]|0;s=w+12|0;n=c[s>>2]|0;if((n|0)==(c[w+16>>2]|0)){kc[c[(c[w>>2]|0)+40>>2]&63](w)|0}else{c[s>>2]=n+4}if((P+O|0)>>>0<2){x=r;t=O;q=P;continue}else{V=e;W=O;X=p}while(1){do{if((a[X]|0)==2){n=a[V]|0;if((n&1)==0){Y=(n&255)>>>1}else{Y=c[V+4>>2]|0}if((Y|0)==(r|0)){Z=W;break}a[X]=0;Z=W+ -1|0}else{Z=W}}while(0);n=V+12|0;if((n|0)==(f|0)){x=r;t=Z;q=P;continue a}else{V=n;W=Z;X=X+1|0}}}do{if((D|0)==0){_=1}else{X=c[D+12>>2]|0;if((X|0)==(c[D+16>>2]|0)){$=kc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{$=c[X>>2]|0}if(($|0)==-1){c[l>>2]=0;_=1;break}else{_=(c[l>>2]|0)==0;break}}}while(0);do{if((A|0)==0){aa=85}else{l=c[A+12>>2]|0;if((l|0)==(c[A+16>>2]|0)){ba=kc[c[(c[A>>2]|0)+36>>2]&63](A)|0}else{ba=c[l>>2]|0}if((ba|0)==-1){c[b>>2]=0;aa=85;break}else{if(_){break}else{aa=87;break}}}}while(0);if((aa|0)==85){if(_){aa=87}}if((aa|0)==87){c[h>>2]=c[h>>2]|2}c:do{if(m){aa=92}else{if((a[p]|0)==2){ca=e;break}else{da=e;ea=p}while(1){_=da+12|0;b=ea+1|0;if((_|0)==(f|0)){aa=92;break c}if((a[b]|0)==2){ca=_;break}else{ea=b;da=_}}}}while(0);if((aa|0)==92){c[h>>2]=c[h>>2]|4;ca=f}if((o|0)==0){i=k;return ca|0}Im(o);i=k;return ca|0}function Fg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Gg(a,0,k,j,f,g,h);i=b;return}function Gg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==0){t=0}else if((s|0)==64){t=8}else{t=10}s=k;ah(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=kc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=kc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}xe(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}xe(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{R=c[F>>2]|0}if((Yg(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){kc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Sl(J,c[o>>2]|0,h,t)|0;jj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=kc[c[(c[I>>2]|0)+36>>2]&63](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}function Hg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Ig(a,0,k,j,f,g,h);i=b;return}function Ig(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==0){t=0}else if((s|0)==8){t=16}else if((s|0)==64){t=8}else{t=10}s=k;ah(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=kc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=kc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{J=w;K=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){J=0;K=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){L=(w&255)>>>1}else{L=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(L|0)){if(F){M=(w&255)>>>1;N=(w&255)>>>1}else{w=c[y>>2]|0;M=w;N=w}xe(n,N<<1,0);if((a[g]&1)==0){O=10}else{O=(c[f>>2]&-2)+ -1|0}xe(n,O,0);if((a[g]&1)==0){P=u}else{P=c[v>>2]|0}c[o>>2]=P+M;Q=P}else{Q=A}w=B+12|0;F=c[w>>2]|0;R=B+16|0;if((F|0)==(c[R>>2]|0)){S=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{S=c[F>>2]|0}if((Yg(S,t,Q,o,r,z,m,k,q,s)|0)!=0){J=H;K=Q;break}F=c[w>>2]|0;if((F|0)==(c[R>>2]|0)){kc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=Q;continue}else{c[w>>2]=F+4;l=B;A=Q;continue}}Q=a[m]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[m+4>>2]|0}do{if((T|0)!=0){Q=c[q>>2]|0;if((Q-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=Q+4;c[Q>>2]=A}}while(0);r=Rl(K,c[o>>2]|0,h,t)|0;t=j;c[t>>2]=r;c[t+4>>2]=I;jj(m,k,c[q>>2]|0,h);do{if((B|0)==0){U=0;V=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){W=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{W=c[q>>2]|0}if(!((W|0)==-1)){U=B;V=0;break}c[x>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){E=60}else{x=c[J+12>>2]|0;if((x|0)==(c[J+16>>2]|0)){X=kc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{X=c[x>>2]|0}if((X|0)==-1){c[e>>2]=0;E=60;break}if(!V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}function Jg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Kg(a,0,k,j,f,g,h);i=b;return}function Kg(d,e,f,g,h,j,k){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;e=i;i=i+328|0;l=e;m=e+104|0;n=e+112|0;o=e+128|0;p=e+144|0;q=e+152|0;r=e+312|0;s=e+320|0;t=c[h+4>>2]&74;if((t|0)==0){u=0}else if((t|0)==64){u=8}else if((t|0)==8){u=16}else{u=10}t=l;ah(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=c[m>>2]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0;D=1}else{x=c[m+12>>2]|0;if((x|0)==(c[m+16>>2]|0)){E=kc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{E=c[x>>2]|0}if(!((E|0)==-1)){C=m;D=0;break}c[y>>2]=0;C=0;D=1}}while(0);x=c[f>>2]|0;do{if((x|0)==0){F=21}else{G=c[x+12>>2]|0;if((G|0)==(c[x+16>>2]|0)){H=kc[c[(c[x>>2]|0)+36>>2]&63](x)|0}else{H=c[G>>2]|0}if((H|0)==-1){c[f>>2]=0;F=21;break}else{if(D){I=x;break}else{J=x;K=B;break a}}}}while(0);if((F|0)==21){F=0;if(D){J=0;K=B;break}else{I=0}}x=a[h]|0;G=(x&1)==0;if(G){L=(x&255)>>>1}else{L=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(L|0)){if(G){M=(x&255)>>>1;N=(x&255)>>>1}else{x=c[z>>2]|0;M=x;N=x}xe(o,N<<1,0);if((a[h]&1)==0){O=10}else{O=(c[g>>2]&-2)+ -1|0}xe(o,O,0);if((a[h]&1)==0){P=v}else{P=c[w>>2]|0}c[p>>2]=P+M;Q=P}else{Q=B}x=C+12|0;G=c[x>>2]|0;R=C+16|0;if((G|0)==(c[R>>2]|0)){S=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{S=c[G>>2]|0}if((Yg(S,u,Q,p,s,A,n,l,r,t)|0)!=0){J=I;K=Q;break}G=c[x>>2]|0;if((G|0)==(c[R>>2]|0)){kc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=Q;continue}else{c[x>>2]=G+4;m=C;B=Q;continue}}Q=a[n]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[n+4>>2]|0}do{if((T|0)!=0){Q=c[r>>2]|0;if((Q-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=Q+4;c[Q>>2]=B}}while(0);b[k>>1]=Ql(K,c[p>>2]|0,j,u)|0;jj(n,l,c[r>>2]|0,j);do{if((C|0)==0){U=0;V=1}else{r=c[C+12>>2]|0;if((r|0)==(c[C+16>>2]|0)){W=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{W=c[r>>2]|0}if(!((W|0)==-1)){U=C;V=0;break}c[y>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){F=60}else{y=c[J+12>>2]|0;if((y|0)==(c[J+16>>2]|0)){X=kc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{X=c[y>>2]|0}if((X|0)==-1){c[f>>2]=0;F=60;break}if(!V){break}Y=d;c[Y>>2]=U;ve(o);ve(n);i=e;return}}while(0);do{if((F|0)==60){if(V){break}Y=d;c[Y>>2]=U;ve(o);ve(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;Y=d;c[Y>>2]=U;ve(o);ve(n);i=e;return}function Lg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Mg(a,0,k,j,f,g,h);i=b;return}function Mg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==0){t=0}else if((s|0)==8){t=16}else if((s|0)==64){t=8}else{t=10}s=k;ah(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=kc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=kc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}xe(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}xe(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{R=c[F>>2]|0}if((Yg(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){kc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Pl(J,c[o>>2]|0,h,t)|0;jj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=kc[c[(c[I>>2]|0)+36>>2]&63](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}function Ng(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Og(a,0,k,j,f,g,h);i=b;return}function Og(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==64){t=8}else if((s|0)==0){t=0}else if((s|0)==8){t=16}else{t=10}s=k;ah(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=kc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=kc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}xe(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}xe(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{R=c[F>>2]|0}if((Yg(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){kc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Ol(J,c[o>>2]|0,h,t)|0;jj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=kc[c[(c[I>>2]|0)+36>>2]&63](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;ve(n);ve(m);i=d;return}function Pg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Qg(a,0,k,j,f,g,h);i=b;return}function Qg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==64){t=8}else if((s|0)==0){t=0}else{t=10}s=k;ah(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=kc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=kc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{J=w;K=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){J=0;K=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){L=(w&255)>>>1}else{L=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(L|0)){if(F){M=(w&255)>>>1;N=(w&255)>>>1}else{w=c[y>>2]|0;M=w;N=w}xe(n,N<<1,0);if((a[g]&1)==0){O=10}else{O=(c[f>>2]&-2)+ -1|0}xe(n,O,0);if((a[g]&1)==0){P=u}else{P=c[v>>2]|0}c[o>>2]=P+M;Q=P}else{Q=A}w=B+12|0;F=c[w>>2]|0;R=B+16|0;if((F|0)==(c[R>>2]|0)){S=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{S=c[F>>2]|0}if((Yg(S,t,Q,o,r,z,m,k,q,s)|0)!=0){J=H;K=Q;break}F=c[w>>2]|0;if((F|0)==(c[R>>2]|0)){kc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=Q;continue}else{c[w>>2]=F+4;l=B;A=Q;continue}}Q=a[m]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[m+4>>2]|0}do{if((T|0)!=0){Q=c[q>>2]|0;if((Q-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=Q+4;c[Q>>2]=A}}while(0);r=Nl(K,c[o>>2]|0,h,t)|0;t=j;c[t>>2]=r;c[t+4>>2]=I;jj(m,k,c[q>>2]|0,h);do{if((B|0)==0){U=0;V=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){W=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{W=c[q>>2]|0}if(!((W|0)==-1)){U=B;V=0;break}c[x>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){E=60}else{x=c[J+12>>2]|0;if((x|0)==(c[J+16>>2]|0)){X=kc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{X=c[x>>2]|0}if((X|0)==-1){c[e>>2]=0;E=60;break}if(!V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);do{if((E|0)==60){if(V){break}Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;Y=b;c[Y>>2]=U;ve(n);ve(m);i=d;return}function Rg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Sg(a,0,k,j,f,g,h);i=b;return}function Sg(b,d,e,f,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;bh(n,h,v,l,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;xe(o,10,0);if((a[h]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=kc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=kc[c[(c[z>>2]|0)+36>>2]&63](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[h]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}xe(o,P<<1,0);if((a[h]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}xe(o,Q,0);if((a[h]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=kc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{U=c[I>>2]|0}if((ch(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){kc[c[(c[E>>2]|0)+40>>2]&63](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);g[k>>2]=+Ml(M,c[p>>2]|0,j);jj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=kc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=kc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}function Tg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Ug(a,0,k,j,f,g,h);i=b;return}function Ug(b,d,e,f,g,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;bh(n,g,v,l,m);g=o;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(o,10,0);if((a[g]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=kc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=kc[c[(c[z>>2]|0)+36>>2]&63](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[g]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}xe(o,P<<1,0);if((a[g]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}xe(o,Q,0);if((a[g]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=kc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{U=c[I>>2]|0}if((ch(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){kc[c[(c[E>>2]|0)+40>>2]&63](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);h[k>>3]=+Ll(M,c[p>>2]|0,j);jj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=kc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=kc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}function Vg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Wg(a,0,k,j,f,g,h);i=b;return}function Wg(b,d,e,f,g,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;bh(n,g,v,l,m);g=o;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(o,10,0);if((a[g]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=kc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=kc[c[(c[z>>2]|0)+36>>2]&63](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[g]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}xe(o,P<<1,0);if((a[g]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}xe(o,Q,0);if((a[g]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=kc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{U=c[I>>2]|0}if((ch(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){kc[c[(c[E>>2]|0)+40>>2]&63](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);h[k>>3]=+Kl(M,c[p>>2]|0,j);jj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=kc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=kc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;ve(o);ve(n);i=d;return}function Xg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0;d=i;i=i+8|0;k=d;l=i;i=i+16|0;m=i;i=i+104|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+160|0;r=n;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;Pe(o,g);g=o;o=c[g>>2]|0;if(!((c[1824]|0)==-1)){c[l>>2]=7296;c[l+4>>2]=113;c[l+8>>2]=0;qe(7296,l,114)}l=(c[7300>>2]|0)+ -1|0;s=c[o+8>>2]|0;if(!((c[o+12>>2]|0)-s>>2>>>0>l>>>0)){t=Ta(4)|0;u=t;mm(u);Vb(t|0,15264,101)}o=c[s+(l<<2)>>2]|0;if((o|0)==0){t=Ta(4)|0;u=t;mm(u);Vb(t|0,15264,101)}t=m;qc[c[(c[o>>2]|0)+48>>2]&7](o,5848,5874|0,t)|0;Yd(c[g>>2]|0)|0;g=p;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;xe(p,10,0);if((a[g]&1)==0){o=p+1|0;v=o;w=p+8|0;x=o}else{o=p+8|0;v=p+1|0;w=o;x=c[o>>2]|0}o=e;e=f;f=p;u=p+4|0;l=m+96|0;s=m+100|0;y=q;z=m+104|0;A=m;m=n+4|0;B=c[o>>2]|0;C=x;D=q;q=0;E=x;a:while(1){do{if((B|0)==0){F=0;G=1}else{x=c[B+12>>2]|0;if((x|0)==(c[B+16>>2]|0)){H=kc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{H=c[x>>2]|0}if(!((H|0)==-1)){F=B;G=0;break}c[o>>2]=0;F=0;G=1}}while(0);x=c[e>>2]|0;do{if((x|0)==0){I=22}else{J=c[x+12>>2]|0;if((J|0)==(c[x+16>>2]|0)){K=kc[c[(c[x>>2]|0)+36>>2]&63](x)|0}else{K=c[J>>2]|0}if((K|0)==-1){c[e>>2]=0;I=22;break}else{if(G){break}else{L=E;break a}}}}while(0);if((I|0)==22){I=0;if(G){L=E;break}}x=a[g]|0;J=(x&1)==0;if(J){M=(x&255)>>>1}else{M=c[u>>2]|0}if((C-E|0)==(M|0)){if(J){N=(x&255)>>>1;O=(x&255)>>>1}else{x=c[u>>2]|0;N=x;O=x}xe(p,O<<1,0);if((a[g]&1)==0){P=10}else{P=(c[f>>2]&-2)+ -1|0}xe(p,P,0);if((a[g]&1)==0){Q=v}else{Q=c[w>>2]|0}R=Q+N|0;S=Q}else{R=C;S=E}x=c[F+12>>2]|0;if((x|0)==(c[F+16>>2]|0)){T=kc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=c[x>>2]|0}x=(R|0)==(S|0);do{if(x){J=(c[l>>2]|0)==(T|0);if(!J){if((c[s>>2]|0)!=(T|0)){I=43;break}}a[R]=J?43:45;U=R+1|0;V=D;W=0}else{I=43}}while(0);do{if((I|0)==43){I=0;J=a[r]|0;if((J&1)==0){X=(J&255)>>>1}else{X=c[m>>2]|0}if((X|0)!=0&(T|0)==0){if((D-y|0)>=160){U=R;V=D;W=q;break}c[D>>2]=q;U=R;V=D+4|0;W=0;break}else{Y=t}while(1){J=Y+4|0;if((c[Y>>2]|0)==(T|0)){Z=Y;break}if((J|0)==(z|0)){Z=z;break}else{Y=J}}J=Z-A|0;_=J>>2;if((J|0)>92){L=S;break a}if((J|0)<88){a[R]=a[5848+_|0]|0;U=R+1|0;V=D;W=q+1|0;break}if(x){L=R;break a}if((R-S|0)>=3){L=S;break a}if((a[R+ -1|0]|0)!=48){L=S;break a}a[R]=a[5848+_|0]|0;U=R+1|0;V=D;W=0}}while(0);x=c[o>>2]|0;_=x+12|0;J=c[_>>2]|0;if((J|0)==(c[x+16>>2]|0)){kc[c[(c[x>>2]|0)+40>>2]&63](x)|0;B=x;C=U;D=V;q=W;E=S;continue}else{c[_>>2]=J+4;B=x;C=U;D=V;q=W;E=S;continue}}a[L+3|0]=0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);S=c[1798]|0;c[k>>2]=j;if((Ag(L,S,5888,k)|0)!=1){c[h>>2]=4}k=c[o>>2]|0;do{if((k|0)==0){$=0;aa=1}else{S=c[k+12>>2]|0;if((S|0)==(c[k+16>>2]|0)){ba=kc[c[(c[k>>2]|0)+36>>2]&63](k)|0}else{ba=c[S>>2]|0}if(!((ba|0)==-1)){$=k;aa=0;break}c[o>>2]=0;$=0;aa=1}}while(0);o=c[e>>2]|0;do{if((o|0)==0){I=78}else{k=c[o+12>>2]|0;if((k|0)==(c[o+16>>2]|0)){ca=kc[c[(c[o>>2]|0)+36>>2]&63](o)|0}else{ca=c[k>>2]|0}if((ca|0)==-1){c[e>>2]=0;I=78;break}if(!aa){break}da=b;c[da>>2]=$;ve(p);ve(n);i=d;return}}while(0);do{if((I|0)==78){if(aa){break}da=b;c[da>>2]=$;ve(p);ve(n);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;da=b;c[da>>2]=$;ve(p);ve(n);i=d;return}function Yg(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;o=c[f>>2]|0;p=(o|0)==(e|0);do{if(p){q=(c[m+96>>2]|0)==(b|0);if(!q){if((c[m+100>>2]|0)!=(b|0)){break}}c[f>>2]=e+1;a[e]=q?43:45;c[g>>2]=0;r=0;i=n;return r|0}}while(0);q=a[j]|0;if((q&1)==0){s=(q&255)>>>1}else{s=c[j+4>>2]|0}if((s|0)!=0&(b|0)==(h|0)){h=c[l>>2]|0;if((h-k|0)>=160){r=0;i=n;return r|0}k=c[g>>2]|0;c[l>>2]=h+4;c[h>>2]=k;c[g>>2]=0;r=0;i=n;return r|0}k=m+104|0;h=m;while(1){l=h+4|0;if((c[h>>2]|0)==(b|0)){t=h;break}if((l|0)==(k|0)){t=k;break}else{h=l}}h=t-m|0;m=h>>2;if((h|0)>92){r=-1;i=n;return r|0}do{if((d|0)==16){if((h|0)<88){break}if(p){r=-1;i=n;return r|0}if((o-e|0)>=3){r=-1;i=n;return r|0}if((a[o+ -1|0]|0)!=48){r=-1;i=n;return r|0}c[g>>2]=0;t=a[5848+m|0]|0;c[f>>2]=o+1;a[o]=t;r=0;i=n;return r|0}else if((d|0)==10|(d|0)==8){if((m|0)<(d|0)){break}else{r=-1}i=n;return r|0}}while(0);d=a[5848+m|0]|0;c[f>>2]=o+1;a[o]=d;c[g>>2]=(c[g>>2]|0)+1;r=0;i=n;return r|0}function Zg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+40|0;h=g;j=g+16|0;k=g+32|0;Pe(k,d);d=k;k=c[d>>2]|0;if(!((c[1826]|0)==-1)){c[j>>2]=7304;c[j+4>>2]=113;c[j+8>>2]=0;qe(7304,j,114)}j=(c[7308>>2]|0)+ -1|0;l=c[k+8>>2]|0;if(!((c[k+12>>2]|0)-l>>2>>>0>j>>>0)){m=Ta(4)|0;n=m;mm(n);Vb(m|0,15264,101)}k=c[l+(j<<2)>>2]|0;if((k|0)==0){m=Ta(4)|0;n=m;mm(n);Vb(m|0,15264,101)}qc[c[(c[k>>2]|0)+32>>2]&7](k,5848,5874|0,e)|0;e=c[d>>2]|0;if(!((c[1862]|0)==-1)){c[h>>2]=7448;c[h+4>>2]=113;c[h+8>>2]=0;qe(7448,h,114)}h=(c[7452>>2]|0)+ -1|0;k=c[e+8>>2]|0;if(!((c[e+12>>2]|0)-k>>2>>>0>h>>>0)){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}e=c[k+(h<<2)>>2]|0;if((e|0)==0){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}else{o=e;a[f]=kc[c[(c[e>>2]|0)+16>>2]&63](o)|0;ic[c[(c[e>>2]|0)+20>>2]&63](b,o);Yd(c[d>>2]|0)|0;i=g;return}}function _g(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+40|0;j=h;k=h+16|0;l=h+32|0;Pe(l,d);d=l;l=c[d>>2]|0;if(!((c[1826]|0)==-1)){c[k>>2]=7304;c[k+4>>2]=113;c[k+8>>2]=0;qe(7304,k,114)}k=(c[7308>>2]|0)+ -1|0;m=c[l+8>>2]|0;if(!((c[l+12>>2]|0)-m>>2>>>0>k>>>0)){n=Ta(4)|0;o=n;mm(o);Vb(n|0,15264,101)}l=c[m+(k<<2)>>2]|0;if((l|0)==0){n=Ta(4)|0;o=n;mm(o);Vb(n|0,15264,101)}qc[c[(c[l>>2]|0)+32>>2]&7](l,5848,5880|0,e)|0;e=c[d>>2]|0;if(!((c[1862]|0)==-1)){c[j>>2]=7448;c[j+4>>2]=113;c[j+8>>2]=0;qe(7448,j,114)}j=(c[7452>>2]|0)+ -1|0;l=c[e+8>>2]|0;if(!((c[e+12>>2]|0)-l>>2>>>0>j>>>0)){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}e=c[l+(j<<2)>>2]|0;if((e|0)==0){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}else{p=e;q=e;a[f]=kc[c[(c[q>>2]|0)+12>>2]&63](p)|0;a[g]=kc[c[(c[q>>2]|0)+16>>2]&63](p)|0;ic[c[(c[e>>2]|0)+20>>2]&63](b,p);Yd(c[d>>2]|0)|0;i=h;return}}function $g(b,d,e,f,g,h,j,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0;p=i;if(b<<24>>24==h<<24>>24){if((a[d]|0)==0){q=-1;i=p;return q|0}a[d]=0;h=c[g>>2]|0;c[g>>2]=h+1;a[h]=46;h=a[k]|0;if((h&1)==0){r=(h&255)>>>1}else{r=c[k+4>>2]|0}if((r|0)==0){q=0;i=p;return q|0}r=c[m>>2]|0;if((r-l|0)>=160){q=0;i=p;return q|0}h=c[n>>2]|0;c[m>>2]=r+4;c[r>>2]=h;q=0;i=p;return q|0}do{if(b<<24>>24==j<<24>>24){h=a[k]|0;if((h&1)==0){s=(h&255)>>>1}else{s=c[k+4>>2]|0}if((s|0)==0){break}if((a[d]|0)==0){q=-1;i=p;return q|0}h=c[m>>2]|0;if((h-l|0)>=160){q=0;i=p;return q|0}r=c[n>>2]|0;c[m>>2]=h+4;c[h>>2]=r;c[n>>2]=0;q=0;i=p;return q|0}}while(0);s=o+32|0;j=o;while(1){r=j+1|0;if((a[j]|0)==b<<24>>24){t=j;break}if((r|0)==(s|0)){t=s;break}else{j=r}}j=t-o|0;if((j|0)>31){q=-1;i=p;return q|0}o=a[5848+j|0]|0;if((j|0)==24|(j|0)==25){t=c[g>>2]|0;do{if((t|0)!=(f|0)){if((a[t+ -1|0]&95|0)==(a[e]&127|0)){break}else{q=-1}i=p;return q|0}}while(0);c[g>>2]=t+1;a[t]=o;q=0;i=p;return q|0}else if((j|0)==23|(j|0)==22){a[e]=80;t=c[g>>2]|0;c[g>>2]=t+1;a[t]=o;q=0;i=p;return q|0}else{t=o&95;do{if((t|0)==(a[e]|0)){a[e]=t|128;if((a[d]|0)==0){break}a[d]=0;f=a[k]|0;if((f&1)==0){u=(f&255)>>>1}else{u=c[k+4>>2]|0}if((u|0)==0){break}f=c[m>>2]|0;if((f-l|0)>=160){break}s=c[n>>2]|0;c[m>>2]=f+4;c[f>>2]=s}}while(0);m=c[g>>2]|0;c[g>>2]=m+1;a[m]=o;if((j|0)>21){q=0;i=p;return q|0}c[n>>2]=(c[n>>2]|0)+1;q=0;i=p;return q|0}return 0}function ah(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+40|0;g=f;h=f+16|0;j=f+32|0;Pe(j,b);b=j;j=c[b>>2]|0;if(!((c[1824]|0)==-1)){c[h>>2]=7296;c[h+4>>2]=113;c[h+8>>2]=0;qe(7296,h,114)}h=(c[7300>>2]|0)+ -1|0;k=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-k>>2>>>0>h>>>0)){l=Ta(4)|0;m=l;mm(m);Vb(l|0,15264,101)}j=c[k+(h<<2)>>2]|0;if((j|0)==0){l=Ta(4)|0;m=l;mm(m);Vb(l|0,15264,101)}qc[c[(c[j>>2]|0)+48>>2]&7](j,5848,5874|0,d)|0;d=c[b>>2]|0;if(!((c[1864]|0)==-1)){c[g>>2]=7456;c[g+4>>2]=113;c[g+8>>2]=0;qe(7456,g,114)}g=(c[7460>>2]|0)+ -1|0;j=c[d+8>>2]|0;if(!((c[d+12>>2]|0)-j>>2>>>0>g>>>0)){n=Ta(4)|0;o=n;mm(o);Vb(n|0,15264,101)}d=c[j+(g<<2)>>2]|0;if((d|0)==0){n=Ta(4)|0;o=n;mm(o);Vb(n|0,15264,101)}else{n=d;c[e>>2]=kc[c[(c[d>>2]|0)+16>>2]&63](n)|0;ic[c[(c[d>>2]|0)+20>>2]&63](a,n);Yd(c[b>>2]|0)|0;i=f;return}}function bh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+40|0;h=g;j=g+16|0;k=g+32|0;Pe(k,b);b=k;k=c[b>>2]|0;if(!((c[1824]|0)==-1)){c[j>>2]=7296;c[j+4>>2]=113;c[j+8>>2]=0;qe(7296,j,114)}j=(c[7300>>2]|0)+ -1|0;l=c[k+8>>2]|0;if(!((c[k+12>>2]|0)-l>>2>>>0>j>>>0)){m=Ta(4)|0;n=m;mm(n);Vb(m|0,15264,101)}k=c[l+(j<<2)>>2]|0;if((k|0)==0){m=Ta(4)|0;n=m;mm(n);Vb(m|0,15264,101)}qc[c[(c[k>>2]|0)+48>>2]&7](k,5848,5880|0,d)|0;d=c[b>>2]|0;if(!((c[1864]|0)==-1)){c[h>>2]=7456;c[h+4>>2]=113;c[h+8>>2]=0;qe(7456,h,114)}h=(c[7460>>2]|0)+ -1|0;k=c[d+8>>2]|0;if(!((c[d+12>>2]|0)-k>>2>>>0>h>>>0)){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}d=c[k+(h<<2)>>2]|0;if((d|0)==0){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}else{o=d;p=d;c[e>>2]=kc[c[(c[p>>2]|0)+12>>2]&63](o)|0;c[f>>2]=kc[c[(c[p>>2]|0)+16>>2]&63](o)|0;ic[c[(c[d>>2]|0)+20>>2]&63](a,o);Yd(c[b>>2]|0)|0;i=g;return}}function ch(b,d,e,f,g,h,j,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0;p=i;if((b|0)==(h|0)){if((a[d]|0)==0){q=-1;i=p;return q|0}a[d]=0;h=c[g>>2]|0;c[g>>2]=h+1;a[h]=46;h=a[k]|0;if((h&1)==0){r=(h&255)>>>1}else{r=c[k+4>>2]|0}if((r|0)==0){q=0;i=p;return q|0}r=c[m>>2]|0;if((r-l|0)>=160){q=0;i=p;return q|0}h=c[n>>2]|0;c[m>>2]=r+4;c[r>>2]=h;q=0;i=p;return q|0}do{if((b|0)==(j|0)){h=a[k]|0;if((h&1)==0){s=(h&255)>>>1}else{s=c[k+4>>2]|0}if((s|0)==0){break}if((a[d]|0)==0){q=-1;i=p;return q|0}h=c[m>>2]|0;if((h-l|0)>=160){q=0;i=p;return q|0}r=c[n>>2]|0;c[m>>2]=h+4;c[h>>2]=r;c[n>>2]=0;q=0;i=p;return q|0}}while(0);s=o+128|0;j=o;while(1){r=j+4|0;if((c[j>>2]|0)==(b|0)){t=j;break}if((r|0)==(s|0)){t=s;break}else{j=r}}j=t-o|0;o=j>>2;if((j|0)>124){q=-1;i=p;return q|0}t=a[5848+o|0]|0;do{if((o|0)==23|(o|0)==22){a[e]=80}else if((o|0)==24|(o|0)==25){s=c[g>>2]|0;do{if((s|0)!=(f|0)){if((a[s+ -1|0]&95|0)==(a[e]&127|0)){break}else{q=-1}i=p;return q|0}}while(0);c[g>>2]=s+1;a[s]=t;q=0;i=p;return q|0}else{b=t&95;if((b|0)!=(a[e]|0)){break}a[e]=b|128;if((a[d]|0)==0){break}a[d]=0;b=a[k]|0;if((b&1)==0){u=(b&255)>>>1}else{u=c[k+4>>2]|0}if((u|0)==0){break}b=c[m>>2]|0;if((b-l|0)>=160){break}r=c[n>>2]|0;c[m>>2]=b+4;c[b>>2]=r}}while(0);m=c[g>>2]|0;c[g>>2]=m+1;a[m]=t;if((j|0)>84){q=0;i=p;return q|0}c[n>>2]=(c[n>>2]|0)+1;q=0;i=p;return q|0}function dh(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function eh(a){a=a|0;i=i;return}function fh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;j=i;i=i+56|0;k=j;l=j+8|0;m=j+24|0;n=j+32|0;o=j+40|0;if((c[f+4>>2]&1|0)==0){p=c[(c[d>>2]|0)+24>>2]|0;c[m>>2]=c[e>>2];q=h&1;r=k;s=m;c[r+0>>2]=c[s+0>>2];sc[p&15](b,d,k,f,g,q);i=j;return}Pe(n,f);f=n;n=c[f>>2]|0;if(!((c[1862]|0)==-1)){c[l>>2]=7448;c[l+4>>2]=113;c[l+8>>2]=0;qe(7448,l,114)}l=(c[7452>>2]|0)+ -1|0;q=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-q>>2>>>0>l>>>0)){t=Ta(4)|0;u=t;mm(u);Vb(t|0,15264,101)}n=c[q+(l<<2)>>2]|0;if((n|0)==0){t=Ta(4)|0;u=t;mm(u);Vb(t|0,15264,101)}t=n;Yd(c[f>>2]|0)|0;f=c[n>>2]|0;if(h){ic[c[f+24>>2]&63](o,t)}else{ic[c[f+28>>2]&63](o,t)}t=o;f=a[t]|0;if((f&1)==0){h=o+1|0;v=h;w=h;x=o+8|0}else{h=o+8|0;v=c[h>>2]|0;w=o+1|0;x=h}h=e;e=o+4|0;n=f;f=v;while(1){if((n&1)==0){y=w;z=(n&255)>>>1}else{y=c[x>>2]|0;z=c[e>>2]|0}if((f|0)==(y+z|0)){break}v=a[f]|0;u=c[h>>2]|0;do{if((u|0)!=0){l=u+24|0;q=c[l>>2]|0;if((q|0)!=(c[u+28>>2]|0)){c[l>>2]=q+1;a[q]=v;break}if(!((tc[c[(c[u>>2]|0)+52>>2]&15](u,v&255)|0)==-1)){break}c[h>>2]=0}}while(0);n=a[t]|0;f=f+1|0}c[b>>2]=c[h>>2];ve(o);i=j;return}function gh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+24|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[6096|0]|0;a[s+1|0]=a[6097|0]|0;a[s+2|0]=a[6098|0]|0;a[s+3|0]=a[6099|0]|0;a[s+4|0]=a[6100|0]|0;a[s+5|0]=a[6101|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=m;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);v=c[1798]|0;c[k>>2]=h;h=hh(w,12,v,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else if((s|0)==32){y=k}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Pe(q,f);ih(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];jh(b,j,z,e,o,f,g);i=d;return}function hh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+16|0;h=g;c[h>>2]=f;f=fb(d|0)|0;d=Jb(a|0,b|0,e|0,h|0)|0;if((f|0)==0){i=g;return d|0}fb(f|0)|0;i=g;return d|0}function ih(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1826]|0)==-1)){c[m>>2]=7304;c[m+4>>2]=113;c[m+8>>2]=0;qe(7304,m,114)}m=(c[7308>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}q=j;r=c[o>>2]|0;if(!((c[1862]|0)==-1)){c[l>>2]=7448;c[l+4>>2]=113;c[l+8>>2]=0;qe(7448,l,114)}l=(c[7452>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}s=r;ic[c[(c[r>>2]|0)+20>>2]&63](n,s);t=n;l=a[t]|0;if((l&1)==0){u=(l&255)>>>1}else{u=c[n+4>>2]|0}do{if((u|0)==0){qc[c[(c[j>>2]|0)+32>>2]&7](q,b,e,f)|0;c[h>>2]=f+(e-b)}else{c[h>>2]=f;l=a[b]|0;if(l<<24>>24==43|l<<24>>24==45){o=tc[c[(c[j>>2]|0)+28>>2]&15](q,l)|0;l=c[h>>2]|0;c[h>>2]=l+1;a[l]=o;v=b+1|0}else{v=b}do{if((e-v|0)>1){if((a[v]|0)!=48){w=v;break}o=v+1|0;l=a[o]|0;if(!(l<<24>>24==88|l<<24>>24==120)){w=v;break}l=j;m=tc[c[(c[l>>2]|0)+28>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=m;m=tc[c[(c[l>>2]|0)+28>>2]&15](q,a[o]|0)|0;o=c[h>>2]|0;c[h>>2]=o+1;a[o]=m;w=v+2|0}else{w=v}}while(0);do{if((w|0)!=(e|0)){m=e+ -1|0;if(m>>>0>w>>>0){x=w;y=m}else{break}do{m=a[x]|0;a[x]=a[y]|0;a[y]=m;x=x+1|0;y=y+ -1|0;}while(x>>>0<y>>>0)}}while(0);m=kc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(w>>>0<e>>>0){o=n+1|0;l=j;p=n+4|0;z=n+8|0;A=0;B=0;C=w;while(1){D=(a[t]&1)==0;do{if((a[(D?o:c[z>>2]|0)+B|0]|0)==0){E=A;F=B}else{if((A|0)!=(a[(D?o:c[z>>2]|0)+B|0]|0)){E=A;F=B;break}G=c[h>>2]|0;c[h>>2]=G+1;a[G]=m;G=a[t]|0;if((G&1)==0){H=(G&255)>>>1}else{H=c[p>>2]|0}E=0;F=(B>>>0<(H+ -1|0)>>>0)+B|0}}while(0);D=tc[c[(c[l>>2]|0)+28>>2]&15](q,a[C]|0)|0;G=c[h>>2]|0;c[h>>2]=G+1;a[G]=D;D=C+1|0;if(D>>>0<e>>>0){A=E+1|0;B=F;C=D}else{break}}}C=f+(w-b)|0;B=c[h>>2]|0;if((C|0)==(B|0)){break}A=B+ -1|0;if(A>>>0>C>>>0){I=C;J=A}else{break}do{A=a[I]|0;a[I]=a[J]|0;a[J]=A;I=I+1|0;J=J+ -1|0;}while(I>>>0<J>>>0)}}while(0);if((d|0)==(e|0)){K=c[h>>2]|0;c[g>>2]=K;ve(n);i=k;return}else{K=f+(d-b)|0;c[g>>2]=K;ve(n);i=k;return}}function jh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;k=i;i=i+16|0;l=k;m=d;d=c[m>>2]|0;if((d|0)==0){c[b>>2]=0;i=k;return}n=g;g=e;o=n-g|0;p=h+12|0;h=c[p>>2]|0;q=(h|0)>(o|0)?h-o|0:0;o=f;h=o-g|0;do{if((h|0)>0){if((ec[c[(c[d>>2]|0)+48>>2]&31](d,e,h)|0)==(h|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);do{if((q|0)>0){ue(l,q,j);if((a[l]&1)==0){r=l+1|0}else{r=c[l+8>>2]|0}if((ec[c[(c[d>>2]|0)+48>>2]&31](d,r,q)|0)==(q|0)){ve(l);break}c[m>>2]=0;c[b>>2]=0;ve(l);i=k;return}}while(0);l=n-o|0;do{if((l|0)>0){if((ec[c[(c[d>>2]|0)+48>>2]&31](d,f,l)|0)==(l|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);c[p>>2]=0;c[b>>2]=d;i=k;return}function kh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+48|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=n;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);v=c[1798]|0;x=l;c[x>>2]=h;c[x+4>>2]=j;j=hh(w,22,v,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Pe(r,f);ih(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];jh(b,k,z,e,p,f,g);i=d;return}function lh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+24|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[6096|0]|0;a[s+1|0]=a[6097|0]|0;a[s+2|0]=a[6098|0]|0;a[s+3|0]=a[6099|0]|0;a[s+4|0]=a[6100|0]|0;a[s+5|0]=a[6101|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=m;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);x=c[1798]|0;c[k>>2]=h;h=hh(w,12,x,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else if((s|0)==32){y=k}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Pe(q,f);ih(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];jh(b,j,z,e,o,f,g);i=d;return}function mh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+48|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=117}}while(0);w=n;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);v=c[1798]|0;x=l;c[x>>2]=h;c[x+4>>2]=j;j=hh(w,23,v,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Pe(r,f);ih(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];jh(b,k,z,e,p,f,g);i=d;return}function nh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+24|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+64|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){if((q&1|0)==0){a[D]=97;E=0;break}else{a[D]=65;E=0;break}}else{a[D]=46;B=D+2|0;a[D+1|0]=42;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=hh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=hh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[7200]|0)==0;if(E){do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=oh(s,r,z,n)|0}else{do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);o=c[1798]|0;c[m>>2]=c[f+8>>2];r=m+4|0;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=oh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Tm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Hm(J<<1)|0;if((L|0)!=0){M=H;N=L;O=L;break}Tm()}}while(0);Pe(w,f);ph(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];jh(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Im(N)}if((I|0)==0){i=d;return}Im(I);i=d;return}function oh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;e=fb(b|0)|0;b=Eb(a|0,d|0,g|0)|0;if((e|0)==0){i=f;return b|0}fb(e|0)|0;i=f;return b|0}function ph(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1826]|0)==-1)){c[m>>2]=7304;c[m+4>>2]=113;c[m+8>>2]=0;qe(7304,m,114)}m=(c[7308>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}q=j;r=c[o>>2]|0;if(!((c[1862]|0)==-1)){c[l>>2]=7448;c[l+4>>2]=113;c[l+8>>2]=0;qe(7448,l,114)}l=(c[7452>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}s=r;ic[c[(c[r>>2]|0)+20>>2]&63](n,s);c[h>>2]=f;t=a[b]|0;if(t<<24>>24==43|t<<24>>24==45){l=tc[c[(c[j>>2]|0)+28>>2]&15](q,t)|0;t=c[h>>2]|0;c[h>>2]=t+1;a[t]=l;u=b+1|0}else{u=b}l=e;a:do{if((l-u|0)>1){if((a[u]|0)!=48){v=14;break}t=u+1|0;o=a[t]|0;if(!(o<<24>>24==88|o<<24>>24==120)){v=14;break}o=j;m=tc[c[(c[o>>2]|0)+28>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=m;m=u+2|0;p=tc[c[(c[o>>2]|0)+28>>2]&15](q,a[t]|0)|0;t=c[h>>2]|0;c[h>>2]=t+1;a[t]=p;if(m>>>0<e>>>0){w=m}else{x=m;y=m;break}while(1){p=a[w]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);t=w+1|0;if((Wa(p<<24>>24|0,c[1798]|0)|0)==0){x=m;y=w;break a}if(t>>>0<e>>>0){w=t}else{x=m;y=t;break}}}else{v=14}}while(0);b:do{if((v|0)==14){if(u>>>0<e>>>0){z=u}else{x=u;y=u;break}while(1){w=a[z]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);p=z+1|0;if((xb(w<<24>>24|0,c[1798]|0)|0)==0){x=u;y=z;break b}if(p>>>0<e>>>0){z=p}else{x=u;y=p;break}}}}while(0);u=n;z=a[u]|0;if((z&1)==0){A=(z&255)>>>1}else{A=c[n+4>>2]|0}do{if((A|0)==0){qc[c[(c[j>>2]|0)+32>>2]&7](q,x,y,c[h>>2]|0)|0;c[h>>2]=(c[h>>2]|0)+(y-x)}else{do{if((x|0)!=(y|0)){z=y+ -1|0;if(z>>>0>x>>>0){B=x;C=z}else{break}do{z=a[B]|0;a[B]=a[C]|0;a[C]=z;B=B+1|0;C=C+ -1|0;}while(B>>>0<C>>>0)}}while(0);w=kc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(x>>>0<y>>>0){z=n+1|0;v=n+4|0;p=n+8|0;m=j;t=0;o=0;D=x;while(1){E=(a[u]&1)==0;do{if((a[(E?z:c[p>>2]|0)+o|0]|0)>0){if((t|0)!=(a[(E?z:c[p>>2]|0)+o|0]|0)){F=t;G=o;break}H=c[h>>2]|0;c[h>>2]=H+1;a[H]=w;H=a[u]|0;if((H&1)==0){I=(H&255)>>>1}else{I=c[v>>2]|0}F=0;G=(o>>>0<(I+ -1|0)>>>0)+o|0}else{F=t;G=o}}while(0);E=tc[c[(c[m>>2]|0)+28>>2]&15](q,a[D]|0)|0;H=c[h>>2]|0;c[h>>2]=H+1;a[H]=E;E=D+1|0;if(E>>>0<y>>>0){t=F+1|0;o=G;D=E}else{break}}}D=f+(x-b)|0;o=c[h>>2]|0;if((D|0)==(o|0)){break}t=o+ -1|0;if(t>>>0>D>>>0){J=D;K=t}else{break}do{t=a[J]|0;a[J]=a[K]|0;a[K]=t;J=J+1|0;K=K+ -1|0;}while(J>>>0<K>>>0)}}while(0);c:do{if(y>>>0<e>>>0){K=j;J=y;while(1){x=a[J]|0;if(x<<24>>24==46){break}G=tc[c[(c[K>>2]|0)+28>>2]&15](q,x)|0;x=c[h>>2]|0;c[h>>2]=x+1;a[x]=G;G=J+1|0;if(G>>>0<e>>>0){J=G}else{L=G;break c}}K=kc[c[(c[r>>2]|0)+12>>2]&63](s)|0;G=c[h>>2]|0;c[h>>2]=G+1;a[G]=K;L=J+1|0}else{L=y}}while(0);qc[c[(c[j>>2]|0)+32>>2]&7](q,L,e,c[h>>2]|0)|0;q=(c[h>>2]|0)+(l-L)|0;c[h>>2]=q;if((d|0)==(e|0)){M=q;c[g>>2]=M;ve(n);i=k;return}M=f+(d-b)|0;c[g>>2]=M;ve(n);i=k;return}function qh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+64|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){a[D]=76;B=D+1|0;if((q&1|0)==0){a[B]=97;E=0;break}else{a[B]=65;E=0;break}}else{a[D]=46;a[D+1|0]=42;a[D+2|0]=76;B=D+3|0;if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=hh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=hh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[7200]|0)==0;if(E){do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=oh(s,r,z,n)|0}else{do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);o=c[1798]|0;r=m;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=oh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Tm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Hm(J<<1)|0;if((L|0)!=0){M=H;N=L;O=L;break}Tm()}}while(0);Pe(w,f);ph(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];jh(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Im(N)}if((I|0)==0){i=d;return}Im(I);i=d;return}function rh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+16|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+40|0;p=i;i=i+8|0;q=i;i=i+8|0;r=m;a[r+0|0]=a[6104|0]|0;a[r+1|0]=a[6105|0]|0;a[r+2|0]=a[6106|0]|0;a[r+3|0]=a[6107|0]|0;a[r+4|0]=a[6108|0]|0;a[r+5|0]=a[6109|0]|0;m=n;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);s=c[1798]|0;c[k>>2]=h;h=hh(m,20,s,r,k)|0;k=n+h|0;r=c[f+4>>2]&176;do{if((r|0)==32){t=k}else if((r|0)==16){s=a[m]|0;if(s<<24>>24==43|s<<24>>24==45){t=n+1|0;break}if(!((h|0)>1&s<<24>>24==48)){u=10;break}s=a[n+1|0]|0;if(!(s<<24>>24==88|s<<24>>24==120)){u=10;break}t=n+2|0}else{u=10}}while(0);if((u|0)==10){t=m}u=o;Pe(p,f);r=p;p=c[r>>2]|0;if(!((c[1826]|0)==-1)){c[l>>2]=7304;c[l+4>>2]=113;c[l+8>>2]=0;qe(7304,l,114)}l=(c[7308>>2]|0)+ -1|0;s=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-s>>2>>>0>l>>>0)){v=Ta(4)|0;w=v;mm(w);Vb(v|0,15264,101)}p=c[s+(l<<2)>>2]|0;if((p|0)==0){v=Ta(4)|0;w=v;mm(w);Vb(v|0,15264,101)}Yd(c[r>>2]|0)|0;qc[c[(c[p>>2]|0)+32>>2]&7](p,m,k,u)|0;m=o+h|0;if((t|0)==(k|0)){x=m;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];jh(b,j,u,x,m,f,g);E=j;i=d;return}x=o+(t-n)|0;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];jh(b,j,u,x,m,f,g);E=j;i=d;return}function sh(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function th(a){a=a|0;i=i;return}function uh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;j=i;i=i+56|0;k=j;l=j+8|0;m=j+24|0;n=j+32|0;o=j+40|0;if((c[f+4>>2]&1|0)==0){p=c[(c[d>>2]|0)+24>>2]|0;c[m>>2]=c[e>>2];q=h&1;r=k;s=m;c[r+0>>2]=c[s+0>>2];sc[p&15](b,d,k,f,g,q);i=j;return}Pe(n,f);f=n;n=c[f>>2]|0;if(!((c[1864]|0)==-1)){c[l>>2]=7456;c[l+4>>2]=113;c[l+8>>2]=0;qe(7456,l,114)}l=(c[7460>>2]|0)+ -1|0;q=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-q>>2>>>0>l>>>0)){t=Ta(4)|0;u=t;mm(u);Vb(t|0,15264,101)}n=c[q+(l<<2)>>2]|0;if((n|0)==0){t=Ta(4)|0;u=t;mm(u);Vb(t|0,15264,101)}t=n;Yd(c[f>>2]|0)|0;f=c[n>>2]|0;if(h){ic[c[f+24>>2]&63](o,t)}else{ic[c[f+28>>2]&63](o,t)}t=o;f=a[t]|0;if((f&1)==0){h=o+4|0;v=h;w=o+8|0;x=h}else{h=o+8|0;v=c[h>>2]|0;w=h;x=o+4|0}h=e;e=f;f=v;while(1){if((e&1)==0){y=x;z=(e&255)>>>1}else{y=c[w>>2]|0;z=c[x>>2]|0}if((f|0)==(y+(z<<2)|0)){break}v=c[f>>2]|0;n=c[h>>2]|0;do{if((n|0)!=0){u=n+24|0;l=c[u>>2]|0;if((l|0)==(c[n+28>>2]|0)){A=tc[c[(c[n>>2]|0)+52>>2]&15](n,v)|0}else{c[u>>2]=l+4;c[l>>2]=v;A=v}if(!((A|0)==-1)){break}c[h>>2]=0}}while(0);e=a[t]|0;f=f+4|0}c[b>>2]=c[h>>2];Ge(o);i=j;return}function vh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+88|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[6096|0]|0;a[s+1|0]=a[6097|0]|0;a[s+2|0]=a[6098|0]|0;a[s+3|0]=a[6099|0]|0;a[s+4|0]=a[6100|0]|0;a[s+5|0]=a[6101|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=100}}while(0);w=m;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);x=c[1798]|0;c[k>>2]=h;h=hh(w,12,x,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else if((s|0)==32){y=k}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Pe(q,f);wh(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];xh(b,j,z,e,o,f,g);i=d;return}function wh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1824]|0)==-1)){c[m>>2]=7296;c[m+4>>2]=113;c[m+8>>2]=0;qe(7296,m,114)}m=(c[7300>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}q=j;r=c[o>>2]|0;if(!((c[1864]|0)==-1)){c[l>>2]=7456;c[l+4>>2]=113;c[l+8>>2]=0;qe(7456,l,114)}l=(c[7460>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}s=r;ic[c[(c[r>>2]|0)+20>>2]&63](n,s);t=n;l=a[t]|0;if((l&1)==0){u=(l&255)>>>1}else{u=c[n+4>>2]|0}do{if((u|0)==0){qc[c[(c[j>>2]|0)+48>>2]&7](q,b,e,f)|0;l=f+(e-b<<2)|0;c[h>>2]=l;v=l}else{c[h>>2]=f;l=a[b]|0;if(l<<24>>24==43|l<<24>>24==45){o=tc[c[(c[j>>2]|0)+44>>2]&15](q,l)|0;l=c[h>>2]|0;c[h>>2]=l+4;c[l>>2]=o;w=b+1|0}else{w=b}do{if((e-w|0)>1){if((a[w]|0)!=48){x=w;break}o=w+1|0;l=a[o]|0;if(!(l<<24>>24==88|l<<24>>24==120)){x=w;break}l=j;m=tc[c[(c[l>>2]|0)+44>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=m;m=tc[c[(c[l>>2]|0)+44>>2]&15](q,a[o]|0)|0;o=c[h>>2]|0;c[h>>2]=o+4;c[o>>2]=m;x=w+2|0}else{x=w}}while(0);do{if((x|0)!=(e|0)){m=e+ -1|0;if(m>>>0>x>>>0){y=x;z=m}else{break}do{m=a[y]|0;a[y]=a[z]|0;a[z]=m;y=y+1|0;z=z+ -1|0;}while(y>>>0<z>>>0)}}while(0);m=kc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(x>>>0<e>>>0){o=n+1|0;l=j;p=n+4|0;A=n+8|0;B=0;C=0;D=x;while(1){E=(a[t]&1)==0;do{if((a[(E?o:c[A>>2]|0)+C|0]|0)==0){F=B;G=C}else{if((B|0)!=(a[(E?o:c[A>>2]|0)+C|0]|0)){F=B;G=C;break}H=c[h>>2]|0;c[h>>2]=H+4;c[H>>2]=m;H=a[t]|0;if((H&1)==0){I=(H&255)>>>1}else{I=c[p>>2]|0}F=0;G=(C>>>0<(I+ -1|0)>>>0)+C|0}}while(0);E=tc[c[(c[l>>2]|0)+44>>2]&15](q,a[D]|0)|0;H=c[h>>2]|0;J=H+4|0;c[h>>2]=J;c[H>>2]=E;E=D+1|0;if(E>>>0<e>>>0){B=F+1|0;C=G;D=E}else{K=J;break}}}else{K=c[h>>2]|0}D=f+(x-b<<2)|0;if((D|0)==(K|0)){v=K;break}C=K+ -4|0;if(C>>>0>D>>>0){L=D;M=C}else{v=K;break}while(1){C=c[L>>2]|0;c[L>>2]=c[M>>2];c[M>>2]=C;C=L+4|0;D=M+ -4|0;if(C>>>0<D>>>0){M=D;L=C}else{v=K;break}}}}while(0);if((d|0)==(e|0)){N=v;c[g>>2]=N;ve(n);i=k;return}N=f+(d-b<<2)|0;c[g>>2]=N;ve(n);i=k;return}function xh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;k=i;i=i+16|0;l=k;m=d;d=c[m>>2]|0;if((d|0)==0){c[b>>2]=0;i=k;return}n=g;g=e;o=n-g>>2;p=h+12|0;h=c[p>>2]|0;q=(h|0)>(o|0)?h-o|0:0;o=f;h=o-g|0;g=h>>2;do{if((h|0)>0){if((ec[c[(c[d>>2]|0)+48>>2]&31](d,e,g)|0)==(g|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);do{if((q|0)>0){Fe(l,q,j);if((a[l]&1)==0){r=l+4|0}else{r=c[l+8>>2]|0}if((ec[c[(c[d>>2]|0)+48>>2]&31](d,r,q)|0)==(q|0)){Ge(l);break}c[m>>2]=0;c[b>>2]=0;Ge(l);i=k;return}}while(0);l=n-o|0;o=l>>2;do{if((l|0)>0){if((ec[c[(c[d>>2]|0)+48>>2]&31](d,f,o)|0)==(o|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);c[p>>2]=0;c[b>>2]=d;i=k;return}function yh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+168|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=n;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);v=c[1798]|0;x=l;c[x>>2]=h;c[x+4>>2]=j;j=hh(w,22,v,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Pe(r,f);wh(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];xh(b,k,z,e,p,f,g);i=d;return}function zh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+88|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[6096|0]|0;a[s+1|0]=a[6097|0]|0;a[s+2|0]=a[6098|0]|0;a[s+3|0]=a[6099|0]|0;a[s+4|0]=a[6100|0]|0;a[s+5|0]=a[6101|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=m;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);x=c[1798]|0;c[k>>2]=h;h=hh(w,12,x,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else if((s|0)==32){y=k}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Pe(q,f);wh(w,y,k,z,o,p,q);Yd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];xh(b,j,z,e,o,f,g);i=d;return}function Ah(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+176|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=117}}while(0);w=n;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);v=c[1798]|0;x=l;c[x>>2]=h;c[x+4>>2]=j;j=hh(w,23,v,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else if((t|0)==32){y=l}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Pe(r,f);wh(w,y,l,z,p,q,r);Yd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];xh(b,k,z,e,p,f,g);i=d;return}function Bh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+24|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+232|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){if((q&1|0)==0){a[D]=97;E=0;break}else{a[D]=65;E=0;break}}else{a[D]=46;B=D+2|0;a[D+1|0]=42;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=hh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=hh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[7200]|0)==0;if(E){do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=oh(s,r,z,n)|0}else{do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);o=c[1798]|0;c[m>>2]=c[f+8>>2];r=m+4|0;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=oh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Tm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else if((s|0)==32){K=F}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Hm(J<<3)|0;s=L;if((L|0)!=0){M=H;N=s;O=s;break}Tm()}}while(0);Pe(w,f);Ch(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];xh(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Im(N)}if((I|0)==0){i=d;return}Im(I);i=d;return}function Ch(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[1824]|0)==-1)){c[m>>2]=7296;c[m+4>>2]=113;c[m+8>>2]=0;qe(7296,m,114)}m=(c[7300>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Ta(4)|0;r=q;mm(r);Vb(q|0,15264,101)}q=j;r=c[o>>2]|0;if(!((c[1864]|0)==-1)){c[l>>2]=7456;c[l+4>>2]=113;c[l+8>>2]=0;qe(7456,l,114)}l=(c[7460>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Ta(4)|0;t=s;mm(t);Vb(s|0,15264,101)}s=r;ic[c[(c[r>>2]|0)+20>>2]&63](n,s);c[h>>2]=f;t=a[b]|0;if(t<<24>>24==43|t<<24>>24==45){l=tc[c[(c[j>>2]|0)+44>>2]&15](q,t)|0;t=c[h>>2]|0;c[h>>2]=t+4;c[t>>2]=l;u=b+1|0}else{u=b}l=e;a:do{if((l-u|0)>1){if((a[u]|0)!=48){v=14;break}t=u+1|0;o=a[t]|0;if(!(o<<24>>24==88|o<<24>>24==120)){v=14;break}o=j;m=tc[c[(c[o>>2]|0)+44>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=m;m=u+2|0;p=tc[c[(c[o>>2]|0)+44>>2]&15](q,a[t]|0)|0;t=c[h>>2]|0;c[h>>2]=t+4;c[t>>2]=p;if(m>>>0<e>>>0){w=m}else{x=m;y=m;break}while(1){p=a[w]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);t=w+1|0;if((Wa(p<<24>>24|0,c[1798]|0)|0)==0){x=m;y=w;break a}if(t>>>0<e>>>0){w=t}else{x=m;y=t;break}}}else{v=14}}while(0);b:do{if((v|0)==14){if(u>>>0<e>>>0){z=u}else{x=u;y=u;break}while(1){w=a[z]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);p=z+1|0;if((xb(w<<24>>24|0,c[1798]|0)|0)==0){x=u;y=z;break b}if(p>>>0<e>>>0){z=p}else{x=u;y=p;break}}}}while(0);u=n;z=a[u]|0;if((z&1)==0){A=(z&255)>>>1}else{A=c[n+4>>2]|0}do{if((A|0)==0){qc[c[(c[j>>2]|0)+48>>2]&7](q,x,y,c[h>>2]|0)|0;z=(c[h>>2]|0)+(y-x<<2)|0;c[h>>2]=z;B=z}else{do{if((x|0)!=(y|0)){z=y+ -1|0;if(z>>>0>x>>>0){C=x;D=z}else{break}do{z=a[C]|0;a[C]=a[D]|0;a[D]=z;C=C+1|0;D=D+ -1|0;}while(C>>>0<D>>>0)}}while(0);w=kc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(x>>>0<y>>>0){z=n+1|0;v=n+4|0;p=n+8|0;m=j;t=0;o=0;E=x;while(1){F=(a[u]&1)==0;do{if((a[(F?z:c[p>>2]|0)+o|0]|0)>0){if((t|0)!=(a[(F?z:c[p>>2]|0)+o|0]|0)){G=t;H=o;break}I=c[h>>2]|0;c[h>>2]=I+4;c[I>>2]=w;I=a[u]|0;if((I&1)==0){J=(I&255)>>>1}else{J=c[v>>2]|0}G=0;H=(o>>>0<(J+ -1|0)>>>0)+o|0}else{G=t;H=o}}while(0);F=tc[c[(c[m>>2]|0)+44>>2]&15](q,a[E]|0)|0;I=c[h>>2]|0;K=I+4|0;c[h>>2]=K;c[I>>2]=F;F=E+1|0;if(F>>>0<y>>>0){t=G+1|0;o=H;E=F}else{L=K;break}}}else{L=c[h>>2]|0}E=f+(x-b<<2)|0;if((E|0)==(L|0)){B=L;break}o=L+ -4|0;if(o>>>0>E>>>0){M=E;N=o}else{B=L;break}while(1){o=c[M>>2]|0;c[M>>2]=c[N>>2];c[N>>2]=o;o=M+4|0;E=N+ -4|0;if(o>>>0<E>>>0){N=E;M=o}else{B=L;break}}}}while(0);c:do{if(y>>>0<e>>>0){L=j;M=y;while(1){N=a[M]|0;if(N<<24>>24==46){break}x=tc[c[(c[L>>2]|0)+44>>2]&15](q,N)|0;N=c[h>>2]|0;H=N+4|0;c[h>>2]=H;c[N>>2]=x;x=M+1|0;if(x>>>0<e>>>0){M=x}else{O=H;P=x;break c}}L=kc[c[(c[r>>2]|0)+12>>2]&63](s)|0;x=c[h>>2]|0;H=x+4|0;c[h>>2]=H;c[x>>2]=L;O=H;P=M+1|0}else{O=B;P=y}}while(0);qc[c[(c[j>>2]|0)+48>>2]&7](q,P,e,O)|0;O=(c[h>>2]|0)+(l-P<<2)|0;c[h>>2]=O;if((d|0)==(e|0)){Q=O;c[g>>2]=Q;ve(n);i=k;return}Q=f+(d-b<<2)|0;c[g>>2]=Q;ve(n);i=k;return}function Dh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+232|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){a[D]=76;B=D+1|0;if((q&1|0)==0){a[B]=97;E=0;break}else{a[B]=65;E=0;break}}else{a[D]=46;a[D+1|0]=42;a[D+2|0]=76;B=D+3|0;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=hh(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=hh(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[7200]|0)==0;if(E){do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);r=c[1798]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=oh(s,r,z,n)|0}else{do{if(o){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);o=c[1798]|0;r=m;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=oh(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Tm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Hm(J<<3)|0;s=L;if((L|0)!=0){M=H;N=s;O=s;break}Tm()}}while(0);Pe(w,f);Ch(M,K,F,O,u,v,w);Yd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];xh(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Im(N)}if((I|0)==0){i=d;return}Im(I);i=d;return}function Eh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+16|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+152|0;p=i;i=i+8|0;q=i;i=i+8|0;r=m;a[r+0|0]=a[6104|0]|0;a[r+1|0]=a[6105|0]|0;a[r+2|0]=a[6106|0]|0;a[r+3|0]=a[6107|0]|0;a[r+4|0]=a[6108|0]|0;a[r+5|0]=a[6109|0]|0;m=n;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);s=c[1798]|0;c[k>>2]=h;h=hh(m,20,s,r,k)|0;k=n+h|0;r=c[f+4>>2]&176;do{if((r|0)==16){s=a[m]|0;if(s<<24>>24==43|s<<24>>24==45){t=n+1|0;break}if(!((h|0)>1&s<<24>>24==48)){u=10;break}s=a[n+1|0]|0;if(!(s<<24>>24==88|s<<24>>24==120)){u=10;break}t=n+2|0}else if((r|0)==32){t=k}else{u=10}}while(0);if((u|0)==10){t=m}Pe(p,f);u=p;p=c[u>>2]|0;if(!((c[1824]|0)==-1)){c[l>>2]=7296;c[l+4>>2]=113;c[l+8>>2]=0;qe(7296,l,114)}l=(c[7300>>2]|0)+ -1|0;r=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-r>>2>>>0>l>>>0)){v=Ta(4)|0;w=v;mm(w);Vb(v|0,15264,101)}p=c[r+(l<<2)>>2]|0;if((p|0)==0){v=Ta(4)|0;w=v;mm(w);Vb(v|0,15264,101)}Yd(c[u>>2]|0)|0;u=o;qc[c[(c[p>>2]|0)+48>>2]&7](p,m,k,u)|0;m=o+(h<<2)|0;if((t|0)==(k|0)){x=m;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];xh(b,j,u,x,m,f,g);E=j;i=d;return}x=o+(t-n<<2)|0;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];xh(b,j,u,x,m,f,g);E=j;i=d;return}function Fh(e,f,g,h,j,k,l,m,n){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0;o=i;i=i+64|0;p=o;q=o+8|0;r=o+16|0;s=o+32|0;t=o+40|0;u=o+48|0;v=o+56|0;Pe(s,j);w=s;s=c[w>>2]|0;if(!((c[1826]|0)==-1)){c[r>>2]=7304;c[r+4>>2]=113;c[r+8>>2]=0;qe(7304,r,114)}r=(c[7308>>2]|0)+ -1|0;x=c[s+8>>2]|0;if(!((c[s+12>>2]|0)-x>>2>>>0>r>>>0)){y=Ta(4)|0;z=y;mm(z);Vb(y|0,15264,101)}s=c[x+(r<<2)>>2]|0;if((s|0)==0){y=Ta(4)|0;z=y;mm(z);Vb(y|0,15264,101)}y=s;Yd(c[w>>2]|0)|0;c[k>>2]=0;w=g;a:do{if((m|0)==(n|0)){A=65}else{z=h;r=s;x=s+8|0;B=s;C=f;D=u;E=v;F=t;G=m;H=0;b:while(1){I=H;while(1){if((I|0)!=0){A=65;break a}J=c[w>>2]|0;do{if((J|0)==0){K=0}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){K=J;break}if(!((kc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1)){K=J;break}c[w>>2]=0;K=0}}while(0);J=(K|0)==0;L=c[z>>2]|0;c:do{if((L|0)==0){A=19}else{do{if((c[L+12>>2]|0)==(c[L+16>>2]|0)){if(!((kc[c[(c[L>>2]|0)+36>>2]&63](L)|0)==-1)){break}c[z>>2]=0;A=19;break c}}while(0);if(J){M=L}else{A=20;break b}}}while(0);if((A|0)==19){A=0;if(J){A=20;break b}else{M=0}}if((ec[c[(c[r>>2]|0)+36>>2]&31](y,a[G]|0,0)|0)<<24>>24==37){A=22;break}L=a[G]|0;if(L<<24>>24>-1){N=c[x>>2]|0;if(!((b[N+(L<<24>>24<<1)>>1]&8192)==0)){O=G;A=33;break}}P=K+12|0;L=c[P>>2]|0;Q=K+16|0;if((L|0)==(c[Q>>2]|0)){R=kc[c[(c[K>>2]|0)+36>>2]&63](K)|0}else{R=d[L]|0}L=tc[c[(c[B>>2]|0)+12>>2]&15](y,R&255)|0;if(L<<24>>24==(tc[c[(c[B>>2]|0)+12>>2]&15](y,a[G]|0)|0)<<24>>24){A=60;break}c[k>>2]=4;I=4}d:do{if((A|0)==22){A=0;I=G+1|0;if((I|0)==(n|0)){A=23;break b}L=ec[c[(c[r>>2]|0)+36>>2]&31](y,a[I]|0,0)|0;if(L<<24>>24==48|L<<24>>24==69){S=G+2|0;if((S|0)==(n|0)){A=26;break b}T=S;U=ec[c[(c[r>>2]|0)+36>>2]&31](y,a[S]|0,0)|0;V=L}else{T=I;U=L;V=0}L=c[(c[C>>2]|0)+36>>2]|0;c[D>>2]=K;c[E>>2]=M;I=q;S=u;c[I+0>>2]=c[S+0>>2];S=p;I=v;c[S+0>>2]=c[I+0>>2];jc[L&3](t,f,q,p,j,k,l,U,V);c[w>>2]=c[F>>2];W=T+1|0}else if((A|0)==33){while(1){A=0;L=O+1|0;if((L|0)==(n|0)){X=n;break}I=a[L]|0;if(!(I<<24>>24>-1)){X=L;break}if((b[N+(I<<24>>24<<1)>>1]&8192)==0){X=L;break}else{O=L;A=33}}J=K;L=M;I=M;while(1){do{if((J|0)==0){Y=0}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){Y=J;break}if(!((kc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1)){Y=J;break}c[w>>2]=0;Y=0}}while(0);S=(Y|0)==0;do{if((I|0)==0){Z=L;A=46}else{if((c[I+12>>2]|0)!=(c[I+16>>2]|0)){if(S){_=L;$=I;break}else{W=X;break d}}if((kc[c[(c[I>>2]|0)+36>>2]&63](I)|0)==-1){c[z>>2]=0;Z=0;A=46;break}else{if(S^(L|0)==0){_=L;$=L;break}else{W=X;break d}}}}while(0);if((A|0)==46){A=0;if(S){W=X;break d}else{_=Z;$=0}}aa=Y+12|0;ba=c[aa>>2]|0;ca=Y+16|0;if((ba|0)==(c[ca>>2]|0)){da=kc[c[(c[Y>>2]|0)+36>>2]&63](Y)|0}else{da=d[ba]|0}if(!((da&255)<<24>>24>-1)){W=X;break d}if((b[(c[x>>2]|0)+(da<<24>>24<<1)>>1]&8192)==0){W=X;break d}ba=c[aa>>2]|0;if((ba|0)==(c[ca>>2]|0)){kc[c[(c[Y>>2]|0)+40>>2]&63](Y)|0;J=Y;L=_;I=$;continue}else{c[aa>>2]=ba+1;J=Y;L=_;I=$;continue}}}else if((A|0)==60){A=0;I=c[P>>2]|0;if((I|0)==(c[Q>>2]|0)){kc[c[(c[K>>2]|0)+40>>2]&63](K)|0}else{c[P>>2]=I+1}W=G+1|0}}while(0);if((W|0)==(n|0)){A=65;break a}G=W;H=c[k>>2]|0}if((A|0)==20){c[k>>2]=4;ea=K;break}else if((A|0)==23){c[k>>2]=4;ea=K;break}else if((A|0)==26){c[k>>2]=4;ea=K;break}}}while(0);if((A|0)==65){ea=c[w>>2]|0}w=g;do{if((ea|0)==0){fa=0}else{if((c[ea+12>>2]|0)!=(c[ea+16>>2]|0)){fa=ea;break}if(!((kc[c[(c[ea>>2]|0)+36>>2]&63](ea)|0)==-1)){fa=ea;break}c[w>>2]=0;fa=0}}while(0);w=(fa|0)==0;ea=h;h=c[ea>>2]|0;e:do{if((h|0)==0){A=75}else{do{if((c[h+12>>2]|0)==(c[h+16>>2]|0)){if(!((kc[c[(c[h>>2]|0)+36>>2]&63](h)|0)==-1)){break}c[ea>>2]=0;A=75;break e}}while(0);if(!w){break}ga=e;c[ga>>2]=fa;i=o;return}}while(0);do{if((A|0)==75){if(w){break}ga=e;c[ga>>2]=fa;i=o;return}}while(0);c[k>>2]=c[k>>2]|2;ga=e;c[ga>>2]=fa;i=o;return}function Gh(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Hh(a){a=a|0;i=i;return}function Ih(a){a=a|0;i=i;return 2}function Jh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;k=j;l=j+8|0;m=j+16|0;n=j+24|0;c[m>>2]=c[d>>2];c[n>>2]=c[e>>2];e=l;d=m;c[e+0>>2]=c[d+0>>2];d=k;e=n;c[d+0>>2]=c[e+0>>2];Fh(a,b,l,k,f,g,h,6208,6216|0);i=j;return}function Kh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=d+8|0;q=kc[c[(c[p>>2]|0)+20>>2]&63](p)|0;c[n>>2]=c[e>>2];c[o>>2]=c[f>>2];f=a[q]|0;if((f&1)==0){r=q+1|0;s=q+1|0;t=(f&255)>>>1}else{f=c[q+8>>2]|0;r=f;s=f;t=c[q+4>>2]|0}q=r+t|0;t=m;r=n;c[t+0>>2]=c[r+0>>2];r=l;t=o;c[r+0>>2]=c[t+0>>2];Fh(b,d,m,l,g,h,j,s,q);i=k;return}function Lh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Pe(n,f);f=n;n=c[f>>2]|0;if(!((c[1826]|0)==-1)){c[m>>2]=7304;c[m+4>>2]=113;c[m+8>>2]=0;qe(7304,m,114)}m=(c[7308>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=kc[c[c[e>>2]>>2]&63](e)|0;c[l>>2]=f;f=b+168|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=fg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=168){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+24>>2]=((g|0)/12|0|0)%7|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Mh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Pe(n,f);f=n;n=c[f>>2]|0;if(!((c[1826]|0)==-1)){c[m>>2]=7304;c[m+4>>2]=113;c[m+8>>2]=0;qe(7304,m,114)}m=(c[7308>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=kc[c[(c[e>>2]|0)+4>>2]&63](e)|0;c[l>>2]=f;f=b+288|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=fg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=288){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+16>>2]=((g|0)/12|0|0)%12|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Nh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;b=i;i=i+40|0;j=b;k=b+8|0;l=b+16|0;m=b+32|0;Pe(m,f);f=m;m=c[f>>2]|0;if(!((c[1826]|0)==-1)){c[l>>2]=7304;c[l+4>>2]=113;c[l+8>>2]=0;qe(7304,l,114)}l=(c[7308>>2]|0)+ -1|0;n=c[m+8>>2]|0;if(!((c[m+12>>2]|0)-n>>2>>>0>l>>>0)){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}m=c[n+(l<<2)>>2]|0;if((m|0)==0){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}o=m;Yd(c[f>>2]|0)|0;f=h+20|0;c[k>>2]=c[e>>2];e=j;h=k;c[e+0>>2]=c[h+0>>2];h=Rh(d,j,g,o,4)|0;if((c[g>>2]&4|0)!=0){q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}if((h|0)<69){t=h+2e3|0}else{t=(h+ -69|0)>>>0<31?h+1900|0:h}c[f>>2]=t+ -1900;q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}function Oh(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;l=i;i=i+576|0;m=l;n=l+8|0;o=l+16|0;p=l+24|0;q=l+32|0;r=l+40|0;s=l+48|0;t=l+56|0;u=l+64|0;v=l+72|0;w=l+80|0;x=l+88|0;y=l+96|0;z=l+104|0;A=l+112|0;B=l+120|0;C=l+128|0;D=l+136|0;E=l+144|0;F=l+152|0;G=l+160|0;H=l+168|0;I=l+176|0;J=l+184|0;K=l+192|0;L=l+200|0;M=l+208|0;N=l+216|0;O=l+224|0;P=l+232|0;Q=l+240|0;R=l+248|0;S=l+256|0;T=l+264|0;U=l+272|0;V=l+280|0;W=l+288|0;X=l+296|0;Y=l+304|0;Z=l+312|0;_=l+320|0;$=l+328|0;aa=l+336|0;ba=l+344|0;ca=l+352|0;da=l+368|0;ea=l+376|0;fa=l+384|0;ga=l+392|0;ha=l+400|0;ia=l+408|0;ja=l+416|0;ka=l+424|0;la=l+432|0;ma=l+440|0;na=l+448|0;oa=l+456|0;pa=l+464|0;qa=l+472|0;ra=l+480|0;sa=l+488|0;ta=l+496|0;ua=l+504|0;va=l+512|0;wa=l+520|0;xa=l+528|0;ya=l+536|0;za=l+544|0;Aa=l+552|0;Ba=l+560|0;Ca=l+568|0;c[h>>2]=0;Pe(da,g);Da=da;da=c[Da>>2]|0;if(!((c[1826]|0)==-1)){c[ca>>2]=7304;c[ca+4>>2]=113;c[ca+8>>2]=0;qe(7304,ca,114)}ca=(c[7308>>2]|0)+ -1|0;Ea=c[da+8>>2]|0;if(!((c[da+12>>2]|0)-Ea>>2>>>0>ca>>>0)){Fa=Ta(4)|0;Ga=Fa;mm(Ga);Vb(Fa|0,15264,101)}da=c[Ea+(ca<<2)>>2]|0;if((da|0)==0){Fa=Ta(4)|0;Ga=Fa;mm(Ga);Vb(Fa|0,15264,101)}Fa=da;Yd(c[Da>>2]|0)|0;a:do{switch(k<<24>>24|0){case 65:case 97:{Da=c[f>>2]|0;da=d+8|0;Ga=kc[c[c[da>>2]>>2]&63](da)|0;c[ba>>2]=Da;c[Q+0>>2]=c[ba+0>>2];Da=(fg(e,Q,Ga,Ga+168|0,Fa,h,0)|0)-Ga|0;if((Da|0)>=168){break a}c[j+24>>2]=((Da|0)/12|0|0)%7|0;break};case 104:case 66:case 98:{Da=c[f>>2]|0;Ga=d+8|0;da=kc[c[(c[Ga>>2]|0)+4>>2]&63](Ga)|0;c[aa>>2]=Da;c[P+0>>2]=c[aa+0>>2];Da=(fg(e,P,da,da+288|0,Fa,h,0)|0)-da|0;if((Da|0)>=288){break a}c[j+16>>2]=((Da|0)/12|0|0)%12|0;break};case 73:{Da=j+8|0;c[Z>>2]=c[f>>2];c[G+0>>2]=c[Z+0>>2];da=Rh(e,G,h,Fa,2)|0;Ga=c[h>>2]|0;do{if((Ga&4|0)==0){if(!((da+ -1|0)>>>0<12)){break}c[Da>>2]=da;break a}}while(0);c[h>>2]=Ga|4;break};case 99:{da=d+8|0;Da=kc[c[(c[da>>2]|0)+12>>2]&63](da)|0;da=e;c[fa>>2]=c[da>>2];c[ga>>2]=c[f>>2];ca=a[Da]|0;if((ca&1)==0){Ha=Da+1|0;Ia=Da+1|0;Ja=(ca&255)>>>1}else{ca=c[Da+8>>2]|0;Ha=ca;Ia=ca;Ja=c[Da+4>>2]|0}c[O+0>>2]=c[fa+0>>2];c[N+0>>2]=c[ga+0>>2];Fh(ea,d,O,N,g,h,j,Ia,Ha+Ja|0);c[da>>2]=c[ea>>2];break};case 106:{c[Y>>2]=c[f>>2];c[F+0>>2]=c[Y+0>>2];da=Rh(e,F,h,Fa,3)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<366){c[j+28>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 101:case 100:{Da=j+12|0;c[$>>2]=c[f>>2];c[M+0>>2]=c[$+0>>2];da=Rh(e,M,h,Fa,2)|0;ca=c[h>>2]|0;do{if((ca&4|0)==0){if(!((da+ -1|0)>>>0<31)){break}c[Da>>2]=da;break a}}while(0);c[h>>2]=ca|4;break};case 72:{c[_>>2]=c[f>>2];c[H+0>>2]=c[_+0>>2];da=Rh(e,H,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<24){c[j+8>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 109:{c[X>>2]=c[f>>2];c[E+0>>2]=c[X+0>>2];Da=Rh(e,E,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(Da|0)<13){c[j+16>>2]=Da+ -1;break a}else{c[h>>2]=da|4;break a}break};case 77:{c[W>>2]=c[f>>2];c[D+0>>2]=c[W+0>>2];da=Rh(e,D,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<60){c[j+4>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 116:case 110:{c[na>>2]=c[f>>2];c[C+0>>2]=c[na+0>>2];Ph(0,e,C,h,Fa);break};case 112:{Da=j+8|0;da=c[f>>2]|0;Ga=d+8|0;Ea=kc[c[(c[Ga>>2]|0)+8>>2]&63](Ga)|0;Ga=a[Ea]|0;if((Ga&1)==0){Ka=(Ga&255)>>>1}else{Ka=c[Ea+4>>2]|0}Ga=a[Ea+12|0]|0;if((Ga&1)==0){La=(Ga&255)>>>1}else{La=c[Ea+16>>2]|0}if((Ka|0)==(0-La|0)){c[h>>2]=c[h>>2]|4;break a}c[V>>2]=da;c[B+0>>2]=c[V+0>>2];da=fg(e,B,Ea,Ea+24|0,Fa,h,0)|0;Ga=da-Ea|0;do{if((da|0)==(Ea|0)){if((c[Da>>2]|0)!=12){break}c[Da>>2]=0;break a}}while(0);if((Ga|0)!=12){break a}Ea=c[Da>>2]|0;if((Ea|0)>=12){break a}c[Da>>2]=Ea+12;break};case 114:{Ea=e;c[pa>>2]=c[Ea>>2];c[qa>>2]=c[f>>2];c[A+0>>2]=c[pa+0>>2];c[z+0>>2]=c[qa+0>>2];Fh(oa,d,A,z,g,h,j,6232,6243|0);c[Ea>>2]=c[oa>>2];break};case 82:{Ea=e;c[sa>>2]=c[Ea>>2];c[ta>>2]=c[f>>2];c[y+0>>2]=c[sa+0>>2];c[x+0>>2]=c[ta+0>>2];Fh(ra,d,y,x,g,h,j,6248,6253|0);c[Ea>>2]=c[ra>>2];break};case 83:{c[U>>2]=c[f>>2];c[w+0>>2]=c[U+0>>2];Ea=Rh(e,w,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(Ea|0)<61){c[j>>2]=Ea;break a}else{c[h>>2]=da|4;break a}break};case 84:{da=e;c[va>>2]=c[da>>2];c[wa>>2]=c[f>>2];c[v+0>>2]=c[va+0>>2];c[u+0>>2]=c[wa+0>>2];Fh(ua,d,v,u,g,h,j,6256,6264|0);c[da>>2]=c[ua>>2];break};case 119:{c[T>>2]=c[f>>2];c[t+0>>2]=c[T+0>>2];da=Rh(e,t,h,Fa,1)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(da|0)<7){c[j+24>>2]=da;break a}else{c[h>>2]=Ea|4;break a}break};case 120:{Ea=c[(c[d>>2]|0)+20>>2]|0;c[xa>>2]=c[e>>2];c[ya>>2]=c[f>>2];c[s+0>>2]=c[xa+0>>2];c[r+0>>2]=c[ya+0>>2];fc[Ea&63](b,d,s,r,g,h,j);i=l;return};case 88:{Ea=d+8|0;da=kc[c[(c[Ea>>2]|0)+24>>2]&63](Ea)|0;Ea=e;c[Aa>>2]=c[Ea>>2];c[Ba>>2]=c[f>>2];ca=a[da]|0;if((ca&1)==0){Ma=da+1|0;Na=da+1|0;Oa=(ca&255)>>>1}else{ca=c[da+8>>2]|0;Ma=ca;Na=ca;Oa=c[da+4>>2]|0}c[q+0>>2]=c[Aa+0>>2];c[p+0>>2]=c[Ba+0>>2];Fh(za,d,q,p,g,h,j,Na,Ma+Oa|0);c[Ea>>2]=c[za>>2];break};case 121:{c[S>>2]=c[f>>2];c[o+0>>2]=c[S+0>>2];Ea=Rh(e,o,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}if((Ea|0)<69){Pa=Ea+2e3|0}else{Pa=(Ea+ -69|0)>>>0<31?Ea+1900|0:Ea}c[j+20>>2]=Pa+ -1900;break};case 89:{c[R>>2]=c[f>>2];c[n+0>>2]=c[R+0>>2];Ea=Rh(e,n,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}c[j+20>>2]=Ea+ -1900;break};case 37:{c[Ca>>2]=c[f>>2];c[m+0>>2]=c[Ca+0>>2];Qh(0,e,m,h,Fa);break};case 70:{Ea=e;c[la>>2]=c[Ea>>2];c[ma>>2]=c[f>>2];c[J+0>>2]=c[la+0>>2];c[I+0>>2]=c[ma+0>>2];Fh(ka,d,J,I,g,h,j,6224,6232|0);c[Ea>>2]=c[ka>>2];break};case 68:{Ea=e;c[ia>>2]=c[Ea>>2];c[ja>>2]=c[f>>2];c[L+0>>2]=c[ia+0>>2];c[K+0>>2]=c[ja+0>>2];Fh(ha,d,L,K,g,h,j,6216,6224|0);c[Ea>>2]=c[ha>>2];break};default:{c[h>>2]=c[h>>2]|4}}}while(0);c[b>>2]=c[e>>2];i=l;return}function Ph(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;a=i;j=e;e=f;f=h+8|0;a:while(1){h=c[j>>2]|0;do{if((h|0)==0){k=0}else{if((c[h+12>>2]|0)!=(c[h+16>>2]|0)){k=h;break}if((kc[c[(c[h>>2]|0)+36>>2]&63](h)|0)==-1){c[j>>2]=0;k=0;break}else{k=c[j>>2]|0;break}}}while(0);h=(k|0)==0;l=c[e>>2]|0;do{if((l|0)==0){m=12}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){if(h){n=l;break}else{o=l;break a}}if((kc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1){c[e>>2]=0;m=12;break}else{if(h){n=l;break}else{o=l;break a}}}}while(0);if((m|0)==12){m=0;if(h){o=0;break}else{n=0}}l=c[j>>2]|0;p=c[l+12>>2]|0;if((p|0)==(c[l+16>>2]|0)){q=kc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{q=d[p]|0}if(!((q&255)<<24>>24>-1)){o=n;break}if((b[(c[f>>2]|0)+(q<<24>>24<<1)>>1]&8192)==0){o=n;break}p=c[j>>2]|0;l=p+12|0;r=c[l>>2]|0;if((r|0)==(c[p+16>>2]|0)){kc[c[(c[p>>2]|0)+40>>2]&63](p)|0;continue}else{c[l>>2]=r+1;continue}}n=c[j>>2]|0;do{if((n|0)==0){s=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){s=n;break}if((kc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1){c[j>>2]=0;s=0;break}else{s=c[j>>2]|0;break}}}while(0);j=(s|0)==0;b:do{if((o|0)==0){m=32}else{do{if((c[o+12>>2]|0)==(c[o+16>>2]|0)){if(!((kc[c[(c[o>>2]|0)+36>>2]&63](o)|0)==-1)){break}c[e>>2]=0;m=32;break b}}while(0);if(!j){break}i=a;return}}while(0);do{if((m|0)==32){if(j){break}i=a;return}}while(0);c[g>>2]=c[g>>2]|2;i=a;return}function Qh(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;a=i;h=b;b=c[h>>2]|0;do{if((b|0)==0){j=0}else{if((c[b+12>>2]|0)!=(c[b+16>>2]|0)){j=b;break}if((kc[c[(c[b>>2]|0)+36>>2]&63](b)|0)==-1){c[h>>2]=0;j=0;break}else{j=c[h>>2]|0;break}}}while(0);b=(j|0)==0;j=e;e=c[j>>2]|0;a:do{if((e|0)==0){k=11}else{do{if((c[e+12>>2]|0)==(c[e+16>>2]|0)){if(!((kc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){break}c[j>>2]=0;k=11;break a}}while(0);if(b){l=e}else{k=12}}}while(0);if((k|0)==11){if(b){k=12}else{l=0}}if((k|0)==12){c[f>>2]=c[f>>2]|6;i=a;return}b=c[h>>2]|0;e=c[b+12>>2]|0;if((e|0)==(c[b+16>>2]|0)){m=kc[c[(c[b>>2]|0)+36>>2]&63](b)|0}else{m=d[e]|0}if(!((ec[c[(c[g>>2]|0)+36>>2]&31](g,m&255,0)|0)<<24>>24==37)){c[f>>2]=c[f>>2]|4;i=a;return}m=c[h>>2]|0;g=m+12|0;e=c[g>>2]|0;if((e|0)==(c[m+16>>2]|0)){kc[c[(c[m>>2]|0)+40>>2]&63](m)|0}else{c[g>>2]=e+1}e=c[h>>2]|0;do{if((e|0)==0){n=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){n=e;break}if((kc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1){c[h>>2]=0;n=0;break}else{n=c[h>>2]|0;break}}}while(0);h=(n|0)==0;b:do{if((l|0)==0){k=31}else{do{if((c[l+12>>2]|0)==(c[l+16>>2]|0)){if(!((kc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1)){break}c[j>>2]=0;k=31;break b}}while(0);if(!h){break}i=a;return}}while(0);do{if((k|0)==31){if(h){break}i=a;return}}while(0);c[f>>2]=c[f>>2]|2;i=a;return}function Rh(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;j=i;k=a;a=c[k>>2]|0;do{if((a|0)==0){l=0}else{if((c[a+12>>2]|0)!=(c[a+16>>2]|0)){l=a;break}if((kc[c[(c[a>>2]|0)+36>>2]&63](a)|0)==-1){c[k>>2]=0;l=0;break}else{l=c[k>>2]|0;break}}}while(0);a=(l|0)==0;l=e;e=c[l>>2]|0;a:do{if((e|0)==0){m=11}else{do{if((c[e+12>>2]|0)==(c[e+16>>2]|0)){if(!((kc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){break}c[l>>2]=0;m=11;break a}}while(0);if(a){n=e}else{m=12}}}while(0);if((m|0)==11){if(a){m=12}else{n=0}}if((m|0)==12){c[f>>2]=c[f>>2]|6;o=0;i=j;return o|0}a=c[k>>2]|0;e=c[a+12>>2]|0;if((e|0)==(c[a+16>>2]|0)){p=kc[c[(c[a>>2]|0)+36>>2]&63](a)|0}else{p=d[e]|0}e=p&255;do{if(e<<24>>24>-1){a=g+8|0;if((b[(c[a>>2]|0)+(p<<24>>24<<1)>>1]&2048)==0){break}q=g;r=(ec[c[(c[q>>2]|0)+36>>2]&31](g,e,0)|0)<<24>>24;s=c[k>>2]|0;t=s+12|0;u=c[t>>2]|0;if((u|0)==(c[s+16>>2]|0)){kc[c[(c[s>>2]|0)+40>>2]&63](s)|0;v=h;w=n;x=n;y=r}else{c[t>>2]=u+1;v=h;w=n;x=n;y=r}while(1){z=y+ -48|0;r=v+ -1|0;u=c[k>>2]|0;do{if((u|0)==0){A=0}else{if((c[u+12>>2]|0)!=(c[u+16>>2]|0)){A=u;break}if((kc[c[(c[u>>2]|0)+36>>2]&63](u)|0)==-1){c[k>>2]=0;A=0;break}else{A=c[k>>2]|0;break}}}while(0);u=(A|0)==0;do{if((x|0)==0){B=w;C=0}else{if((c[x+12>>2]|0)!=(c[x+16>>2]|0)){B=w;C=x;break}if(!((kc[c[(c[x>>2]|0)+36>>2]&63](x)|0)==-1)){B=w;C=w;break}c[l>>2]=0;B=0;C=0}}while(0);D=c[k>>2]|0;if(!((u^(C|0)==0)&(r|0)>0)){m=40;break}t=c[D+12>>2]|0;if((t|0)==(c[D+16>>2]|0)){E=kc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{E=d[t]|0}t=E&255;if(!(t<<24>>24>-1)){o=z;m=52;break}if((b[(c[a>>2]|0)+(E<<24>>24<<1)>>1]&2048)==0){o=z;m=52;break}s=((ec[c[(c[q>>2]|0)+36>>2]&31](g,t,0)|0)<<24>>24)+(z*10|0)|0;t=c[k>>2]|0;F=t+12|0;G=c[F>>2]|0;if((G|0)==(c[t+16>>2]|0)){kc[c[(c[t>>2]|0)+40>>2]&63](t)|0;H=r;w=B;x=C;y=s;v=H;continue}else{c[F>>2]=G+1;H=r;w=B;x=C;y=s;v=H;continue}}if((m|0)==40){do{if((D|0)==0){I=0}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){I=D;break}if((kc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[k>>2]=0;I=0;break}else{I=c[k>>2]|0;break}}}while(0);q=(I|0)==0;b:do{if((B|0)==0){m=50}else{do{if((c[B+12>>2]|0)==(c[B+16>>2]|0)){if(!((kc[c[(c[B>>2]|0)+36>>2]&63](B)|0)==-1)){break}c[l>>2]=0;m=50;break b}}while(0);if(q){o=z}else{break}i=j;return o|0}}while(0);do{if((m|0)==50){if(q){break}else{o=z}i=j;return o|0}}while(0);c[f>>2]=c[f>>2]|2;o=z;i=j;return o|0}else if((m|0)==52){i=j;return o|0}}}while(0);c[f>>2]=c[f>>2]|4;o=0;i=j;return o|0}function Sh(a,b,d,e,f,g,h,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0;l=i;i=i+64|0;m=l;n=l+8|0;o=l+16|0;p=l+32|0;q=l+40|0;r=l+48|0;s=l+56|0;Pe(p,f);t=p;p=c[t>>2]|0;if(!((c[1824]|0)==-1)){c[o>>2]=7296;c[o+4>>2]=113;c[o+8>>2]=0;qe(7296,o,114)}o=(c[7300>>2]|0)+ -1|0;u=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-u>>2>>>0>o>>>0)){v=Ta(4)|0;w=v;mm(w);Vb(v|0,15264,101)}p=c[u+(o<<2)>>2]|0;if((p|0)==0){v=Ta(4)|0;w=v;mm(w);Vb(v|0,15264,101)}v=p;Yd(c[t>>2]|0)|0;c[g>>2]=0;t=d;a:do{if((j|0)==(k|0)){x=69}else{w=e;o=p;u=p;y=p;z=b;A=r;B=s;C=q;D=j;E=0;b:while(1){F=E;while(1){if((F|0)!=0){x=69;break a}G=c[t>>2]|0;do{if((G|0)==0){H=0;I=1}else{J=c[G+12>>2]|0;if((J|0)==(c[G+16>>2]|0)){K=kc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{K=c[J>>2]|0}if(!((K|0)==-1)){H=G;I=0;break}c[t>>2]=0;H=0;I=1}}while(0);G=c[w>>2]|0;do{if((G|0)==0){x=22}else{J=c[G+12>>2]|0;if((J|0)==(c[G+16>>2]|0)){L=kc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{L=c[J>>2]|0}if((L|0)==-1){c[w>>2]=0;x=22;break}else{if(I){M=G;break}else{x=24;break b}}}}while(0);if((x|0)==22){x=0;if(I){x=24;break b}else{M=0}}if((ec[c[(c[o>>2]|0)+52>>2]&31](v,c[D>>2]|0,0)|0)<<24>>24==37){x=26;break}if(ec[c[(c[u>>2]|0)+12>>2]&31](v,8192,c[D>>2]|0)|0){N=D;x=36;break}O=H+12|0;G=c[O>>2]|0;P=H+16|0;if((G|0)==(c[P>>2]|0)){Q=kc[c[(c[H>>2]|0)+36>>2]&63](H)|0}else{Q=c[G>>2]|0}G=tc[c[(c[y>>2]|0)+28>>2]&15](v,Q)|0;if((G|0)==(tc[c[(c[y>>2]|0)+28>>2]&15](v,c[D>>2]|0)|0)){x=64;break}c[g>>2]=4;F=4}c:do{if((x|0)==26){x=0;F=D+4|0;if((F|0)==(k|0)){x=27;break b}G=ec[c[(c[o>>2]|0)+52>>2]&31](v,c[F>>2]|0,0)|0;if(G<<24>>24==48|G<<24>>24==69){J=D+8|0;if((J|0)==(k|0)){x=30;break b}R=J;S=ec[c[(c[o>>2]|0)+52>>2]&31](v,c[J>>2]|0,0)|0;T=G}else{R=F;S=G;T=0}G=c[(c[z>>2]|0)+36>>2]|0;c[A>>2]=H;c[B>>2]=M;F=n;J=r;c[F+0>>2]=c[J+0>>2];J=m;F=s;c[J+0>>2]=c[F+0>>2];jc[G&3](q,b,n,m,f,g,h,S,T);c[t>>2]=c[C>>2];U=R+4|0}else if((x|0)==36){while(1){x=0;G=N+4|0;if((G|0)==(k|0)){V=k;break}if(ec[c[(c[u>>2]|0)+12>>2]&31](v,8192,c[G>>2]|0)|0){N=G;x=36}else{V=G;break}}G=H;F=M;J=M;while(1){do{if((G|0)==0){W=0;X=1}else{Y=c[G+12>>2]|0;if((Y|0)==(c[G+16>>2]|0)){Z=kc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{Z=c[Y>>2]|0}if(!((Z|0)==-1)){W=G;X=0;break}c[t>>2]=0;W=0;X=1}}while(0);do{if((J|0)==0){_=F;x=51}else{Y=c[J+12>>2]|0;if((Y|0)==(c[J+16>>2]|0)){$=kc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{$=c[Y>>2]|0}if(($|0)==-1){c[w>>2]=0;_=0;x=51;break}else{if(X^(F|0)==0){aa=F;ba=F;break}else{U=V;break c}}}}while(0);if((x|0)==51){x=0;if(X){U=V;break c}else{aa=_;ba=0}}Y=W+12|0;ca=c[Y>>2]|0;da=W+16|0;if((ca|0)==(c[da>>2]|0)){ea=kc[c[(c[W>>2]|0)+36>>2]&63](W)|0}else{ea=c[ca>>2]|0}if(!(ec[c[(c[u>>2]|0)+12>>2]&31](v,8192,ea)|0)){U=V;break c}ca=c[Y>>2]|0;if((ca|0)==(c[da>>2]|0)){kc[c[(c[W>>2]|0)+40>>2]&63](W)|0;G=W;F=aa;J=ba;continue}else{c[Y>>2]=ca+4;G=W;F=aa;J=ba;continue}}}else if((x|0)==64){x=0;J=c[O>>2]|0;if((J|0)==(c[P>>2]|0)){kc[c[(c[H>>2]|0)+40>>2]&63](H)|0}else{c[O>>2]=J+4}U=D+4|0}}while(0);if((U|0)==(k|0)){x=69;break a}D=U;E=c[g>>2]|0}if((x|0)==24){c[g>>2]=4;fa=H;break}else if((x|0)==27){c[g>>2]=4;fa=H;break}else if((x|0)==30){c[g>>2]=4;fa=H;break}}}while(0);if((x|0)==69){fa=c[t>>2]|0}t=d;do{if((fa|0)==0){ga=0;ha=1}else{d=c[fa+12>>2]|0;if((d|0)==(c[fa+16>>2]|0)){ia=kc[c[(c[fa>>2]|0)+36>>2]&63](fa)|0}else{ia=c[d>>2]|0}if(!((ia|0)==-1)){ga=fa;ha=0;break}c[t>>2]=0;ga=0;ha=1}}while(0);t=e;e=c[t>>2]|0;do{if((e|0)==0){x=82}else{fa=c[e+12>>2]|0;if((fa|0)==(c[e+16>>2]|0)){ja=kc[c[(c[e>>2]|0)+36>>2]&63](e)|0}else{ja=c[fa>>2]|0}if((ja|0)==-1){c[t>>2]=0;x=82;break}if(!ha){break}ka=a;c[ka>>2]=ga;i=l;return}}while(0);do{if((x|0)==82){if(ha){break}ka=a;c[ka>>2]=ga;i=l;return}}while(0);c[g>>2]=c[g>>2]|2;ka=a;c[ka>>2]=ga;i=l;return}function Th(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Uh(a){a=a|0;i=i;return}function Vh(a){a=a|0;i=i;return 2}function Wh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;k=j;l=j+8|0;m=j+16|0;n=j+24|0;c[m>>2]=c[d>>2];c[n>>2]=c[e>>2];e=l;d=m;c[e+0>>2]=c[d+0>>2];d=k;e=n;c[d+0>>2]=c[e+0>>2];Sh(a,b,l,k,f,g,h,6360,6392|0);i=j;return}function Xh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=d+8|0;q=kc[c[(c[p>>2]|0)+20>>2]&63](p)|0;c[n>>2]=c[e>>2];c[o>>2]=c[f>>2];f=a[q]|0;if((f&1)==0){r=q+4|0;s=q+4|0;t=(f&255)>>>1}else{f=c[q+8>>2]|0;r=f;s=f;t=c[q+4>>2]|0}q=r+(t<<2)|0;t=m;r=n;c[t+0>>2]=c[r+0>>2];r=l;t=o;c[r+0>>2]=c[t+0>>2];Sh(b,d,m,l,g,h,j,s,q);i=k;return}function Yh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Pe(n,f);f=n;n=c[f>>2]|0;if(!((c[1824]|0)==-1)){c[m>>2]=7296;c[m+4>>2]=113;c[m+8>>2]=0;qe(7296,m,114)}m=(c[7300>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=kc[c[c[e>>2]>>2]&63](e)|0;c[l>>2]=f;f=b+168|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=Eg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=168){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+24>>2]=((g|0)/12|0|0)%7|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Zh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Pe(n,f);f=n;n=c[f>>2]|0;if(!((c[1824]|0)==-1)){c[m>>2]=7296;c[m+4>>2]=113;c[m+8>>2]=0;qe(7296,m,114)}m=(c[7300>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Ta(4)|0;q=p;mm(q);Vb(p|0,15264,101)}p=n;Yd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=kc[c[(c[e>>2]|0)+4>>2]&63](e)|0;c[l>>2]=f;f=b+288|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=Eg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=288){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+16>>2]=((g|0)/12|0|0)%12|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function _h(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;b=i;i=i+40|0;j=b;k=b+8|0;l=b+16|0;m=b+32|0;Pe(m,f);f=m;m=c[f>>2]|0;if(!((c[1824]|0)==-1)){c[l>>2]=7296;c[l+4>>2]=113;c[l+8>>2]=0;qe(7296,l,114)}l=(c[7300>>2]|0)+ -1|0;n=c[m+8>>2]|0;if(!((c[m+12>>2]|0)-n>>2>>>0>l>>>0)){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}m=c[n+(l<<2)>>2]|0;if((m|0)==0){o=Ta(4)|0;p=o;mm(p);Vb(o|0,15264,101)}o=m;Yd(c[f>>2]|0)|0;f=h+20|0;c[k>>2]=c[e>>2];e=j;h=k;c[e+0>>2]=c[h+0>>2];h=ci(d,j,g,o,4)|0;if((c[g>>2]&4|0)!=0){q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}if((h|0)<69){t=h+2e3|0}else{t=(h+ -69|0)>>>0<31?h+1900|0:h}c[f>>2]=t+ -1900;q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}function $h(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;l=i;i=i+576|0;m=l;n=l+8|0;o=l+16|0;p=l+24|0;q=l+32|0;r=l+40|0;s=l+48|0;t=l+56|0;u=l+64|0;v=l+72|0;w=l+80|0;x=l+88|0;y=l+96|0;z=l+104|0;A=l+112|0;B=l+120|0;C=l+128|0;D=l+136|0;E=l+144|0;F=l+152|0;G=l+160|0;H=l+168|0;I=l+176|0;J=l+184|0;K=l+192|0;L=l+200|0;M=l+208|0;N=l+216|0;O=l+224|0;P=l+232|0;Q=l+240|0;R=l+248|0;S=l+256|0;T=l+264|0;U=l+272|0;V=l+280|0;W=l+288|0;X=l+296|0;Y=l+304|0;Z=l+312|0;_=l+320|0;$=l+328|0;aa=l+336|0;ba=l+344|0;ca=l+352|0;da=l+368|0;ea=l+376|0;fa=l+384|0;ga=l+392|0;ha=l+400|0;ia=l+408|0;ja=l+416|0;ka=l+424|0;la=l+432|0;ma=l+440|0;na=l+448|0;oa=l+456|0;pa=l+464|0;qa=l+472|0;ra=l+480|0;sa=l+488|0;ta=l+496|0;ua=l+504|0;va=l+512|0;wa=l+520|0;xa=l+528|0;ya=l+536|0;za=l+544|0;Aa=l+552|0;Ba=l+560|0;Ca=l+568|0;c[h>>2]=0;Pe(da,g);Da=da;da=c[Da>>2]|0;if(!((c[1824]|0)==-1)){c[ca>>2]=7296;c[ca+4>>2]=113;c[ca+8>>2]=0;qe(7296,ca,114)}ca=(c[7300>>2]|0)+ -1|0;Ea=c[da+8>>2]|0;if(!((c[da+12>>2]|0)-Ea>>2>>>0>ca>>>0)){Fa=Ta(4)|0;Ga=Fa;mm(Ga);Vb(Fa|0,15264,101)}da=c[Ea+(ca<<2)>>2]|0;if((da|0)==0){Fa=Ta(4)|0;Ga=Fa;mm(Ga);Vb(Fa|0,15264,101)}Fa=da;Yd(c[Da>>2]|0)|0;a:do{switch(k<<24>>24|0){case 89:{c[R>>2]=c[f>>2];c[n+0>>2]=c[R+0>>2];Da=ci(e,n,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}c[j+20>>2]=Da+ -1900;break};case 120:{Da=c[(c[d>>2]|0)+20>>2]|0;c[xa>>2]=c[e>>2];c[ya>>2]=c[f>>2];c[s+0>>2]=c[xa+0>>2];c[r+0>>2]=c[ya+0>>2];fc[Da&63](b,d,s,r,g,h,j);i=l;return};case 101:case 100:{Da=j+12|0;c[$>>2]=c[f>>2];c[M+0>>2]=c[$+0>>2];da=ci(e,M,h,Fa,2)|0;Ga=c[h>>2]|0;do{if((Ga&4|0)==0){if(!((da+ -1|0)>>>0<31)){break}c[Da>>2]=da;break a}}while(0);c[h>>2]=Ga|4;break};case 112:{da=j+8|0;Da=c[f>>2]|0;ca=d+8|0;Ea=kc[c[(c[ca>>2]|0)+8>>2]&63](ca)|0;ca=a[Ea]|0;if((ca&1)==0){Ha=(ca&255)>>>1}else{Ha=c[Ea+4>>2]|0}ca=a[Ea+12|0]|0;if((ca&1)==0){Ia=(ca&255)>>>1}else{Ia=c[Ea+16>>2]|0}if((Ha|0)==(0-Ia|0)){c[h>>2]=c[h>>2]|4;break a}c[V>>2]=Da;c[B+0>>2]=c[V+0>>2];Da=Eg(e,B,Ea,Ea+24|0,Fa,h,0)|0;ca=Da-Ea|0;do{if((Da|0)==(Ea|0)){if((c[da>>2]|0)!=12){break}c[da>>2]=0;break a}}while(0);if((ca|0)!=12){break a}Ea=c[da>>2]|0;if((Ea|0)>=12){break a}c[da>>2]=Ea+12;break};case 119:{c[T>>2]=c[f>>2];c[t+0>>2]=c[T+0>>2];Ea=ci(e,t,h,Fa,1)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(Ea|0)<7){c[j+24>>2]=Ea;break a}else{c[h>>2]=Da|4;break a}break};case 121:{c[S>>2]=c[f>>2];c[o+0>>2]=c[S+0>>2];Da=ci(e,o,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}if((Da|0)<69){Ja=Da+2e3|0}else{Ja=(Da+ -69|0)>>>0<31?Da+1900|0:Da}c[j+20>>2]=Ja+ -1900;break};case 88:{Da=d+8|0;Ea=kc[c[(c[Da>>2]|0)+24>>2]&63](Da)|0;Da=e;c[Aa>>2]=c[Da>>2];c[Ba>>2]=c[f>>2];Ga=a[Ea]|0;if((Ga&1)==0){Ka=Ea+4|0;La=Ea+4|0;Ma=(Ga&255)>>>1}else{Ga=c[Ea+8>>2]|0;Ka=Ga;La=Ga;Ma=c[Ea+4>>2]|0}c[q+0>>2]=c[Aa+0>>2];c[p+0>>2]=c[Ba+0>>2];Sh(za,d,q,p,g,h,j,La,Ka+(Ma<<2)|0);c[Da>>2]=c[za>>2];break};case 68:{Da=e;c[ia>>2]=c[Da>>2];c[ja>>2]=c[f>>2];c[L+0>>2]=c[ia+0>>2];c[K+0>>2]=c[ja+0>>2];Sh(ha,d,L,K,g,h,j,6392,6424|0);c[Da>>2]=c[ha>>2];break};case 70:{Da=e;c[la>>2]=c[Da>>2];c[ma>>2]=c[f>>2];c[J+0>>2]=c[la+0>>2];c[I+0>>2]=c[ma+0>>2];Sh(ka,d,J,I,g,h,j,6424,6456|0);c[Da>>2]=c[ka>>2];break};case 72:{c[_>>2]=c[f>>2];c[H+0>>2]=c[_+0>>2];Da=ci(e,H,h,Fa,2)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(Da|0)<24){c[j+8>>2]=Da;break a}else{c[h>>2]=Ea|4;break a}break};case 73:{Ea=j+8|0;c[Z>>2]=c[f>>2];c[G+0>>2]=c[Z+0>>2];Da=ci(e,G,h,Fa,2)|0;Ga=c[h>>2]|0;do{if((Ga&4|0)==0){if(!((Da+ -1|0)>>>0<12)){break}c[Ea>>2]=Da;break a}}while(0);c[h>>2]=Ga|4;break};case 106:{c[Y>>2]=c[f>>2];c[F+0>>2]=c[Y+0>>2];Da=ci(e,F,h,Fa,3)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(Da|0)<366){c[j+28>>2]=Da;break a}else{c[h>>2]=Ea|4;break a}break};case 109:{c[X>>2]=c[f>>2];c[E+0>>2]=c[X+0>>2];Ea=ci(e,E,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(Ea|0)<13){c[j+16>>2]=Ea+ -1;break a}else{c[h>>2]=Da|4;break a}break};case 65:case 97:{Da=c[f>>2]|0;Ea=d+8|0;da=kc[c[c[Ea>>2]>>2]&63](Ea)|0;c[ba>>2]=Da;c[Q+0>>2]=c[ba+0>>2];Da=(Eg(e,Q,da,da+168|0,Fa,h,0)|0)-da|0;if((Da|0)>=168){break a}c[j+24>>2]=((Da|0)/12|0|0)%7|0;break};case 104:case 66:case 98:{Da=c[f>>2]|0;da=d+8|0;Ea=kc[c[(c[da>>2]|0)+4>>2]&63](da)|0;c[aa>>2]=Da;c[P+0>>2]=c[aa+0>>2];Da=(Eg(e,P,Ea,Ea+288|0,Fa,h,0)|0)-Ea|0;if((Da|0)>=288){break a}c[j+16>>2]=((Da|0)/12|0|0)%12|0;break};case 99:{Da=d+8|0;Ea=kc[c[(c[Da>>2]|0)+12>>2]&63](Da)|0;Da=e;c[fa>>2]=c[Da>>2];c[ga>>2]=c[f>>2];da=a[Ea]|0;if((da&1)==0){Na=Ea+4|0;Oa=Ea+4|0;Pa=(da&255)>>>1}else{da=c[Ea+8>>2]|0;Na=da;Oa=da;Pa=c[Ea+4>>2]|0}c[O+0>>2]=c[fa+0>>2];c[N+0>>2]=c[ga+0>>2];Sh(ea,d,O,N,g,h,j,Oa,Na+(Pa<<2)|0);c[Da>>2]=c[ea>>2];break};case 114:{Da=e;c[pa>>2]=c[Da>>2];c[qa>>2]=c[f>>2];c[A+0>>2]=c[pa+0>>2];c[z+0>>2]=c[qa+0>>2];Sh(oa,d,A,z,g,h,j,6456,6500|0);c[Da>>2]=c[oa>>2];break};case 82:{Da=e;c[sa>>2]=c[Da>>2];c[ta>>2]=c[f>>2];c[y+0>>2]=c[sa+0>>2];c[x+0>>2]=c[ta+0>>2];Sh(ra,d,y,x,g,h,j,6504,6524|0);c[Da>>2]=c[ra>>2];break};case 83:{c[U>>2]=c[f>>2];c[w+0>>2]=c[U+0>>2];Da=ci(e,w,h,Fa,2)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(Da|0)<61){c[j>>2]=Da;break a}else{c[h>>2]=Ea|4;break a}break};case 84:{Ea=e;c[va>>2]=c[Ea>>2];c[wa>>2]=c[f>>2];c[v+0>>2]=c[va+0>>2];c[u+0>>2]=c[wa+0>>2];Sh(ua,d,v,u,g,h,j,6528,6560|0);c[Ea>>2]=c[ua>>2];break};case 37:{c[Ca>>2]=c[f>>2];c[m+0>>2]=c[Ca+0>>2];bi(0,e,m,h,Fa);break};case 116:case 110:{c[na>>2]=c[f>>2];c[C+0>>2]=c[na+0>>2];ai(0,e,C,h,Fa);break};case 77:{c[W>>2]=c[f>>2];c[D+0>>2]=c[W+0>>2];Ea=ci(e,D,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(Ea|0)<60){c[j+4>>2]=Ea;break a}else{c[h>>2]=Da|4;break a}break};default:{c[h>>2]=c[h>>2]|4}}}while(0);c[b>>2]=c[e>>2];i=l;return}function ai(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;a=i;g=b;b=d;d=f;a:while(1){h=c[g>>2]|0;do{if((h|0)==0){j=1}else{k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){l=kc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{l=c[k>>2]|0}if((l|0)==-1){c[g>>2]=0;j=1;break}else{j=(c[g>>2]|0)==0;break}}}while(0);h=c[b>>2]|0;do{if((h|0)==0){m=15}else{k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){n=kc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{n=c[k>>2]|0}if((n|0)==-1){c[b>>2]=0;m=15;break}else{if(j){o=h;break}else{p=h;break a}}}}while(0);if((m|0)==15){m=0;if(j){p=0;break}else{o=0}}h=c[g>>2]|0;k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){q=kc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{q=c[k>>2]|0}if(!(ec[c[(c[d>>2]|0)+12>>2]&31](f,8192,q)|0)){p=o;break}k=c[g>>2]|0;h=k+12|0;r=c[h>>2]|0;if((r|0)==(c[k+16>>2]|0)){kc[c[(c[k>>2]|0)+40>>2]&63](k)|0;continue}else{c[h>>2]=r+4;continue}}o=c[g>>2]|0;do{if((o|0)==0){s=1}else{q=c[o+12>>2]|0;if((q|0)==(c[o+16>>2]|0)){t=kc[c[(c[o>>2]|0)+36>>2]&63](o)|0}else{t=c[q>>2]|0}if((t|0)==-1){c[g>>2]=0;s=1;break}else{s=(c[g>>2]|0)==0;break}}}while(0);do{if((p|0)==0){m=37}else{g=c[p+12>>2]|0;if((g|0)==(c[p+16>>2]|0)){u=kc[c[(c[p>>2]|0)+36>>2]&63](p)|0}else{u=c[g>>2]|0}if((u|0)==-1){c[b>>2]=0;m=37;break}if(!s){break}i=a;return}}while(0);do{if((m|0)==37){if(s){break}i=a;return}}while(0);c[e>>2]=c[e>>2]|2;i=a;return}function bi(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=i;g=b;b=c[g>>2]|0;do{if((b|0)==0){h=1}else{j=c[b+12>>2]|0;if((j|0)==(c[b+16>>2]|0)){k=kc[c[(c[b>>2]|0)+36>>2]&63](b)|0}else{k=c[j>>2]|0}if((k|0)==-1){c[g>>2]=0;h=1;break}else{h=(c[g>>2]|0)==0;break}}}while(0);k=d;d=c[k>>2]|0;do{if((d|0)==0){l=14}else{b=c[d+12>>2]|0;if((b|0)==(c[d+16>>2]|0)){m=kc[c[(c[d>>2]|0)+36>>2]&63](d)|0}else{m=c[b>>2]|0}if((m|0)==-1){c[k>>2]=0;l=14;break}else{if(h){n=d;break}else{l=16;break}}}}while(0);if((l|0)==14){if(h){l=16}else{n=0}}if((l|0)==16){c[e>>2]=c[e>>2]|6;i=a;return}h=c[g>>2]|0;d=c[h+12>>2]|0;if((d|0)==(c[h+16>>2]|0)){o=kc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{o=c[d>>2]|0}if(!((ec[c[(c[f>>2]|0)+52>>2]&31](f,o,0)|0)<<24>>24==37)){c[e>>2]=c[e>>2]|4;i=a;return}o=c[g>>2]|0;f=o+12|0;d=c[f>>2]|0;if((d|0)==(c[o+16>>2]|0)){kc[c[(c[o>>2]|0)+40>>2]&63](o)|0}else{c[f>>2]=d+4}d=c[g>>2]|0;do{if((d|0)==0){p=1}else{f=c[d+12>>2]|0;if((f|0)==(c[d+16>>2]|0)){q=kc[c[(c[d>>2]|0)+36>>2]&63](d)|0}else{q=c[f>>2]|0}if((q|0)==-1){c[g>>2]=0;p=1;break}else{p=(c[g>>2]|0)==0;break}}}while(0);do{if((n|0)==0){l=38}else{g=c[n+12>>2]|0;if((g|0)==(c[n+16>>2]|0)){r=kc[c[(c[n>>2]|0)+36>>2]&63](n)|0}else{r=c[g>>2]|0}if((r|0)==-1){c[k>>2]=0;l=38;break}if(!p){break}i=a;return}}while(0);do{if((l|0)==38){if(p){break}i=a;return}}while(0);c[e>>2]=c[e>>2]|2;i=a;return}function ci(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;g=i;h=a;a=c[h>>2]|0;do{if((a|0)==0){j=1}else{k=c[a+12>>2]|0;if((k|0)==(c[a+16>>2]|0)){l=kc[c[(c[a>>2]|0)+36>>2]&63](a)|0}else{l=c[k>>2]|0}if((l|0)==-1){c[h>>2]=0;j=1;break}else{j=(c[h>>2]|0)==0;break}}}while(0);l=b;b=c[l>>2]|0;do{if((b|0)==0){m=14}else{a=c[b+12>>2]|0;if((a|0)==(c[b+16>>2]|0)){n=kc[c[(c[b>>2]|0)+36>>2]&63](b)|0}else{n=c[a>>2]|0}if((n|0)==-1){c[l>>2]=0;m=14;break}else{if(j){o=b;break}else{m=16;break}}}}while(0);if((m|0)==14){if(j){m=16}else{o=0}}if((m|0)==16){c[d>>2]=c[d>>2]|6;p=0;i=g;return p|0}j=c[h>>2]|0;b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0)){q=kc[c[(c[j>>2]|0)+36>>2]&63](j)|0}else{q=c[b>>2]|0}b=e;if(!(ec[c[(c[b>>2]|0)+12>>2]&31](e,2048,q)|0)){c[d>>2]=c[d>>2]|4;p=0;i=g;return p|0}j=e;n=(ec[c[(c[j>>2]|0)+52>>2]&31](e,q,0)|0)<<24>>24;q=c[h>>2]|0;a=q+12|0;k=c[a>>2]|0;if((k|0)==(c[q+16>>2]|0)){kc[c[(c[q>>2]|0)+40>>2]&63](q)|0;r=f;s=o;t=o;u=n}else{c[a>>2]=k+4;r=f;s=o;t=o;u=n}while(1){v=u+ -48|0;n=r+ -1|0;o=c[h>>2]|0;do{if((o|0)==0){w=1}else{f=c[o+12>>2]|0;if((f|0)==(c[o+16>>2]|0)){x=kc[c[(c[o>>2]|0)+36>>2]&63](o)|0}else{x=c[f>>2]|0}if((x|0)==-1){c[h>>2]=0;w=1;break}else{w=(c[h>>2]|0)==0;break}}}while(0);do{if((t|0)==0){y=s;z=0;A=1}else{o=c[t+12>>2]|0;if((o|0)==(c[t+16>>2]|0)){B=kc[c[(c[t>>2]|0)+36>>2]&63](t)|0}else{B=c[o>>2]|0}if((B|0)==-1){c[l>>2]=0;y=0;z=0;A=1;break}else{y=s;z=s;A=(s|0)==0;break}}}while(0);C=c[h>>2]|0;if(!((w^A)&(n|0)>0)){break}o=c[C+12>>2]|0;if((o|0)==(c[C+16>>2]|0)){D=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{D=c[o>>2]|0}if(!(ec[c[(c[b>>2]|0)+12>>2]&31](e,2048,D)|0)){p=v;m=63;break}o=((ec[c[(c[j>>2]|0)+52>>2]&31](e,D,0)|0)<<24>>24)+(v*10|0)|0;f=c[h>>2]|0;k=f+12|0;a=c[k>>2]|0;if((a|0)==(c[f+16>>2]|0)){kc[c[(c[f>>2]|0)+40>>2]&63](f)|0;E=n;s=y;t=z;u=o;r=E;continue}else{c[k>>2]=a+4;E=n;s=y;t=z;u=o;r=E;continue}}if((m|0)==63){i=g;return p|0}do{if((C|0)==0){F=1}else{E=c[C+12>>2]|0;if((E|0)==(c[C+16>>2]|0)){G=kc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{G=c[E>>2]|0}if((G|0)==-1){c[h>>2]=0;F=1;break}else{F=(c[h>>2]|0)==0;break}}}while(0);do{if((y|0)==0){m=60}else{h=c[y+12>>2]|0;if((h|0)==(c[y+16>>2]|0)){H=kc[c[(c[y>>2]|0)+36>>2]&63](y)|0}else{H=c[h>>2]|0}if((H|0)==-1){c[l>>2]=0;m=60;break}if(F){p=v}else{break}i=g;return p|0}}while(0);do{if((m|0)==60){if(F){break}else{p=v}i=g;return p|0}}while(0);c[d>>2]=c[d>>2]|2;p=v;i=g;return p|0}function di(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b+8|0;f=c[e>>2]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);if((f|0)==(c[1798]|0)){g=b;Om(g);i=d;return}tb(c[e>>2]|0);g=b;Om(g);i=d;return}function ei(b){b=b|0;var d=0,e=0;d=i;e=b+8|0;b=c[e>>2]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);if((b|0)==(c[1798]|0)){i=d;return}tb(c[e>>2]|0);i=d;return}function fi(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;g=i;i=i+112|0;f=g;l=g+8|0;m=l;n=f;a[n]=37;o=f+1|0;a[o]=j;p=f+2|0;a[p]=k;a[f+3|0]=0;if(!(k<<24>>24==0)){a[o]=k;a[p]=j}j=bb(m|0,100,n|0,h|0,c[d+8>>2]|0)|0;d=l+j|0;l=c[e>>2]|0;if((j|0)==0){q=l;r=b;c[r>>2]=q;i=g;return}else{s=m;t=l;u=l}while(1){l=a[s]|0;do{if((u|0)==0){v=t;w=0}else{m=u+24|0;j=c[m>>2]|0;if((j|0)==(c[u+28>>2]|0)){e=(tc[c[(c[u>>2]|0)+52>>2]&15](u,l&255)|0)==-1;v=e?0:t;w=e?0:u;break}else{c[m>>2]=j+1;a[j]=l;v=t;w=u;break}}}while(0);l=s+1|0;if((l|0)==(d|0)){q=v;break}else{s=l;t=v;u=w}}r=b;c[r>>2]=q;i=g;return}function gi(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b+8|0;f=c[e>>2]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);if((f|0)==(c[1798]|0)){g=b;Om(g);i=d;return}tb(c[e>>2]|0);g=b;Om(g);i=d;return}function hi(b){b=b|0;var d=0,e=0;d=i;e=b+8|0;b=c[e>>2]|0;do{if((a[7200]|0)==0){if((Ma(7200)|0)==0){break}c[1798]=hb(2147483647,7208,0)|0;Za(7200)}}while(0);if((b|0)==(c[1798]|0)){i=d;return}tb(c[e>>2]|0);i=d;return}function ii(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=i;i=i+408|0;e=f;k=f+400|0;l=e;c[k>>2]=e+400;ji(b+8|0,l,k,g,h,j);j=c[k>>2]|0;k=c[d>>2]|0;if((l|0)==(j|0)){m=k;n=a;c[n>>2]=m;i=f;return}else{o=l;p=k;q=k}while(1){k=c[o>>2]|0;if((p|0)==0){r=q;s=0}else{l=p+24|0;d=c[l>>2]|0;if((d|0)==(c[p+28>>2]|0)){t=tc[c[(c[p>>2]|0)+52>>2]&15](p,k)|0}else{c[l>>2]=d+4;c[d>>2]=k;t=k}k=(t|0)==-1;r=k?0:q;s=k?0:p}k=o+4|0;if((k|0)==(j|0)){m=r;break}else{o=k;p=s;q=r}}n=a;c[n>>2]=m;i=f;return}function ji(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+120|0;k=j;l=j+112|0;m=i;i=i+8|0;n=j+8|0;o=k;a[o]=37;p=k+1|0;a[p]=g;q=k+2|0;a[q]=h;a[k+3|0]=0;if(!(h<<24>>24==0)){a[p]=h;a[q]=g}g=b;bb(n|0,100,o|0,f|0,c[g>>2]|0)|0;f=l;c[f>>2]=0;c[f+4>>2]=0;c[m>>2]=n;n=(c[e>>2]|0)-d>>2;f=fb(c[g>>2]|0)|0;g=cm(d,m,n,l)|0;if((f|0)!=0){fb(f|0)|0}if((g|0)==-1){fj(8184)}else{c[e>>2]=d+(g<<2);i=j;return}}function ki(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function li(a){a=a|0;i=i;return}function mi(a){a=a|0;i=i;return 127}function ni(a){a=a|0;i=i;return 127}function oi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function pi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function qi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function ri(a,b){a=a|0;b=b|0;b=i;ue(a,1,45);i=b;return}function si(a){a=a|0;i=i;return 0}function ti(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function ui(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function vi(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function wi(a){a=a|0;i=i;return}function xi(a){a=a|0;i=i;return 127}function yi(a){a=a|0;i=i;return 127}function zi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Ai(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Bi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Ci(a,b){a=a|0;b=b|0;b=i;ue(a,1,45);i=b;return}function Di(a){a=a|0;i=i;return 0}function Ei(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Fi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Gi(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Hi(a){a=a|0;i=i;return}function Ii(a){a=a|0;i=i;return 2147483647}function Ji(a){a=a|0;i=i;return 2147483647}function Ki(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Li(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Mi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Ni(a,b){a=a|0;b=b|0;b=i;Fe(a,1,45);i=b;return}function Oi(a){a=a|0;i=i;return 0}function Pi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Qi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ri(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Si(a){a=a|0;i=i;return}function Ti(a){a=a|0;i=i;return 2147483647}function Ui(a){a=a|0;i=i;return 2147483647}function Vi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Wi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Xi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Yi(a,b){a=a|0;b=b|0;b=i;Fe(a,1,45);i=b;return}function Zi(a){a=a|0;i=i;return 0}function _i(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function $i(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function aj(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function bj(a){a=a|0;i=i;return}function cj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+104|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=i;i=i+8|0;u=i;i=i+16|0;v=i;i=i+104|0;w=p;c[w>>2]=o;x=p+4|0;c[x>>2]=115;y=o+100|0;Pe(r,h);o=r;z=c[o>>2]|0;if(!((c[1826]|0)==-1)){c[n>>2]=7304;c[n+4>>2]=113;c[n+8>>2]=0;qe(7304,n,114)}n=(c[7308>>2]|0)+ -1|0;A=c[z+8>>2]|0;if(!((c[z+12>>2]|0)-A>>2>>>0>n>>>0)){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}z=c[A+(n<<2)>>2]|0;if((z|0)==0){B=Ta(4)|0;C=B;mm(C);Vb(B|0,15264,101)}B=z;a[s]=0;C=f;c[t>>2]=c[C>>2];f=c[h+4>>2]|0;h=l;n=t;c[h+0>>2]=c[n+0>>2];n=ej(e,l,g,r,f,j,s,B,p,q,y)|0;do{if(n){y=u;qc[c[(c[z>>2]|0)+32>>2]&7](B,6920,6930|0,y)|0;p=v;f=c[q>>2]|0;r=c[w>>2]|0;g=f-r|0;do{if((g|0)>98){l=Hm(g+2|0)|0;if((l|0)!=0){D=l;E=l;break}Tm()}else{D=0;E=p}}while(0);if((a[s]|0)==0){F=E}else{a[E]=45;F=E+1|0}if(r>>>0<f>>>0){g=u+10|0;l=u;h=F;t=r;while(1){A=a[t]|0;G=y;while(1){H=G+1|0;if((a[G]|0)==A<<24>>24){I=G;break}if((H|0)==(g|0)){I=g;break}else{G=H}}a[h]=a[6920+(I-l)|0]|0;G=t+1|0;A=h+1|0;if(G>>>0<(c[q>>2]|0)>>>0){h=A;t=G}else{J=A;break}}}else{J=F}a[J]=0;c[m>>2]=k;if((db(p|0,6936,m|0)|0)!=1){t=Ta(8)|0;ce(t,6944);Vb(t|0,4312,11)}if((D|0)==0){break}Im(D)}}while(0);D=e;e=c[D>>2]|0;do{if((e|0)==0){K=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){K=e;break}if(!((kc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){K=e;break}c[D>>2]=0;K=0}}while(0);D=(K|0)==0;e=c[C>>2]|0;do{if((e|0)==0){L=31}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){if(D){break}else{L=33;break}}if((kc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1){c[C>>2]=0;L=31;break}else{if(D){break}else{L=33;break}}}}while(0);if((L|0)==31){if(D){L=33}}if((L|0)==33){c[j>>2]=c[j>>2]|2}c[b>>2]=K;Yd(c[o>>2]|0)|0;o=c[w>>2]|0;c[w>>2]=0;if((o|0)==0){i=d;return}hc[c[x>>2]&127](o);i=d;return}function dj(a){a=a|0;i=i;return}\n\n\n\nfunction Em(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;j=i;if((b|0)!=(c[d+8>>2]|0)){k=d+52|0;l=a[k]|0;m=d+53|0;n=a[m]|0;o=c[b+12>>2]|0;p=b+(o<<3)+16|0;a[k]=0;a[m]=0;q=c[b+20>>2]|0;r=q>>8;if((q&1|0)==0){s=r}else{s=c[(c[f>>2]|0)+r>>2]|0}r=c[b+16>>2]|0;sc[c[(c[r>>2]|0)+20>>2]&15](r,d,e,f+s|0,(q&2|0)!=0?g:2,h);a:do{if((o|0)>1){q=d+24|0;s=b+8|0;r=d+54|0;t=f;u=b+24|0;do{if((a[r]|0)!=0){break a}do{if((a[k]|0)==0){if((a[m]|0)==0){break}if((c[s>>2]&1|0)==0){break a}}else{if((c[q>>2]|0)==1){break a}if((c[s>>2]&2|0)==0){break a}}}while(0);a[k]=0;a[m]=0;v=c[u+4>>2]|0;w=v>>8;if((v&1|0)==0){x=w}else{x=c[(c[t>>2]|0)+w>>2]|0}w=c[u>>2]|0;sc[c[(c[w>>2]|0)+20>>2]&15](w,d,e,f+x|0,(v&2|0)!=0?g:2,h);u=u+8|0;}while(u>>>0<p>>>0)}}while(0);a[k]=l;a[m]=n;i=j;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=j;return}a[d+52|0]=1;f=d+16|0;n=c[f>>2]|0;if((n|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}if((n|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=j;return}e=d+24|0;n=c[e>>2]|0;if((n|0)==2){c[e>>2]=g;y=g}else{y=n}if(!((c[d+48>>2]|0)==1&(y|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}function Fm(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0;j=i;if((b|0)!=(c[d+8>>2]|0)){k=c[b+8>>2]|0;sc[c[(c[k>>2]|0)+20>>2]&15](k,d,e,f,g,h);i=j;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=j;return}a[d+52|0]=1;f=d+16|0;h=c[f>>2]|0;if((h|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}if((h|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=j;return}e=d+24|0;h=c[e>>2]|0;if((h|0)==2){c[e>>2]=g;l=g}else{l=h}if(!((c[d+48>>2]|0)==1&(l|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}function Gm(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0;h=i;if((c[d+8>>2]|0)!=(b|0)){i=h;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=h;return}a[d+52|0]=1;f=d+16|0;b=c[f>>2]|0;if((b|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=h;return}a[d+54|0]=1;i=h;return}if((b|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=h;return}e=d+24|0;b=c[e>>2]|0;if((b|0)==2){c[e>>2]=g;j=g}else{j=b}if(!((c[d+48>>2]|0)==1&(j|0)==1)){i=h;return}a[d+54|0]=1;i=h;return}function Hm(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0;b=i;do{if(a>>>0<245){if(a>>>0<11){d=16}else{d=a+11&-8}e=d>>>3;f=c[3906]|0;g=f>>>e;if((g&3|0)!=0){h=(g&1^1)+e|0;j=h<<1;k=15664+(j<<2)|0;l=15664+(j+2<<2)|0;j=c[l>>2]|0;m=j+8|0;n=c[m>>2]|0;do{if((k|0)==(n|0)){c[3906]=f&~(1<<h)}else{if(n>>>0<(c[15640>>2]|0)>>>0){Sb()}o=n+12|0;if((c[o>>2]|0)==(j|0)){c[o>>2]=k;c[l>>2]=n;break}else{Sb()}}}while(0);n=h<<3;c[j+4>>2]=n|3;l=j+(n|4)|0;c[l>>2]=c[l>>2]|1;p=m;i=b;return p|0}if(!(d>>>0>(c[15632>>2]|0)>>>0)){q=d;break}if((g|0)!=0){l=2<<e;n=g<<e&(l|0-l);l=(n&0-n)+ -1|0;n=l>>>12&16;k=l>>>n;l=k>>>5&8;o=k>>>l;k=o>>>2&4;r=o>>>k;o=r>>>1&2;s=r>>>o;r=s>>>1&1;t=(l|n|k|o|r)+(s>>>r)|0;r=t<<1;s=15664+(r<<2)|0;o=15664+(r+2<<2)|0;r=c[o>>2]|0;k=r+8|0;n=c[k>>2]|0;do{if((s|0)==(n|0)){c[3906]=f&~(1<<t)}else{if(n>>>0<(c[15640>>2]|0)>>>0){Sb()}l=n+12|0;if((c[l>>2]|0)==(r|0)){c[l>>2]=s;c[o>>2]=n;break}else{Sb()}}}while(0);n=t<<3;o=n-d|0;c[r+4>>2]=d|3;s=r;f=s+d|0;c[s+(d|4)>>2]=o|1;c[s+n>>2]=o;n=c[15632>>2]|0;if((n|0)!=0){s=c[15644>>2]|0;e=n>>>3;n=e<<1;g=15664+(n<<2)|0;m=c[3906]|0;j=1<<e;do{if((m&j|0)==0){c[3906]=m|j;u=15664+(n+2<<2)|0;v=g}else{e=15664+(n+2<<2)|0;h=c[e>>2]|0;if(!(h>>>0<(c[15640>>2]|0)>>>0)){u=e;v=h;break}Sb()}}while(0);c[u>>2]=s;c[v+12>>2]=s;c[s+8>>2]=v;c[s+12>>2]=g}c[15632>>2]=o;c[15644>>2]=f;p=k;i=b;return p|0}n=c[15628>>2]|0;if((n|0)==0){q=d;break}j=(n&0-n)+ -1|0;n=j>>>12&16;m=j>>>n;j=m>>>5&8;r=m>>>j;m=r>>>2&4;t=r>>>m;r=t>>>1&2;h=t>>>r;t=h>>>1&1;e=c[15928+((j|n|m|r|t)+(h>>>t)<<2)>>2]|0;t=(c[e+4>>2]&-8)-d|0;h=e;r=e;while(1){e=c[h+16>>2]|0;if((e|0)==0){m=c[h+20>>2]|0;if((m|0)==0){break}else{w=m}}else{w=e}e=(c[w+4>>2]&-8)-d|0;m=e>>>0<t>>>0;t=m?e:t;h=w;r=m?w:r}h=r;k=c[15640>>2]|0;if(h>>>0<k>>>0){Sb()}f=h+d|0;o=f;if(!(h>>>0<f>>>0)){Sb()}f=c[r+24>>2]|0;g=c[r+12>>2]|0;do{if((g|0)==(r|0)){s=r+20|0;m=c[s>>2]|0;if((m|0)==0){e=r+16|0;n=c[e>>2]|0;if((n|0)==0){x=0;break}else{y=n;z=e}}else{y=m;z=s}while(1){s=y+20|0;m=c[s>>2]|0;if((m|0)!=0){z=s;y=m;continue}m=y+16|0;s=c[m>>2]|0;if((s|0)==0){break}else{y=s;z=m}}if(z>>>0<k>>>0){Sb()}else{c[z>>2]=0;x=y;break}}else{m=c[r+8>>2]|0;if(m>>>0<k>>>0){Sb()}s=m+12|0;if((c[s>>2]|0)!=(r|0)){Sb()}e=g+8|0;if((c[e>>2]|0)==(r|0)){c[s>>2]=g;c[e>>2]=m;x=g;break}else{Sb()}}}while(0);a:do{if((f|0)!=0){g=c[r+28>>2]|0;k=15928+(g<<2)|0;do{if((r|0)==(c[k>>2]|0)){c[k>>2]=x;if((x|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<g);break a}else{if(f>>>0<(c[15640>>2]|0)>>>0){Sb()}m=f+16|0;if((c[m>>2]|0)==(r|0)){c[m>>2]=x}else{c[f+20>>2]=x}if((x|0)==0){break a}}}while(0);if(x>>>0<(c[15640>>2]|0)>>>0){Sb()}c[x+24>>2]=f;g=c[r+16>>2]|0;do{if((g|0)!=0){if(g>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[x+16>>2]=g;c[g+24>>2]=x;break}}}while(0);g=c[r+20>>2]|0;if((g|0)==0){break}if(g>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[x+20>>2]=g;c[g+24>>2]=x;break}}}while(0);if(t>>>0<16){f=t+d|0;c[r+4>>2]=f|3;g=h+(f+4)|0;c[g>>2]=c[g>>2]|1}else{c[r+4>>2]=d|3;c[h+(d|4)>>2]=t|1;c[h+(t+d)>>2]=t;g=c[15632>>2]|0;if((g|0)!=0){f=c[15644>>2]|0;k=g>>>3;g=k<<1;m=15664+(g<<2)|0;e=c[3906]|0;s=1<<k;do{if((e&s|0)==0){c[3906]=e|s;A=15664+(g+2<<2)|0;B=m}else{k=15664+(g+2<<2)|0;n=c[k>>2]|0;if(!(n>>>0<(c[15640>>2]|0)>>>0)){A=k;B=n;break}Sb()}}while(0);c[A>>2]=f;c[B+12>>2]=f;c[f+8>>2]=B;c[f+12>>2]=m}c[15632>>2]=t;c[15644>>2]=o}p=r+8|0;i=b;return p|0}else{if(a>>>0>4294967231){q=-1;break}g=a+11|0;s=g&-8;e=c[15628>>2]|0;if((e|0)==0){q=s;break}h=0-s|0;n=g>>>8;do{if((n|0)==0){C=0}else{if(s>>>0>16777215){C=31;break}g=(n+1048320|0)>>>16&8;k=n<<g;j=(k+520192|0)>>>16&4;l=k<<j;k=(l+245760|0)>>>16&2;D=14-(j|g|k)+(l<<k>>>15)|0;C=s>>>(D+7|0)&1|D<<1}}while(0);n=c[15928+(C<<2)>>2]|0;b:do{if((n|0)==0){E=h;F=0;G=0}else{if((C|0)==31){H=0}else{H=25-(C>>>1)|0}r=h;o=0;t=s<<H;m=n;f=0;while(1){D=c[m+4>>2]&-8;k=D-s|0;if(k>>>0<r>>>0){if((D|0)==(s|0)){E=k;F=m;G=m;break b}else{I=k;J=m}}else{I=r;J=f}k=c[m+20>>2]|0;D=c[m+(t>>>31<<2)+16>>2]|0;l=(k|0)==0|(k|0)==(D|0)?o:k;if((D|0)==0){E=I;F=l;G=J;break}else{r=I;o=l;t=t<<1;m=D;f=J}}}}while(0);if((F|0)==0&(G|0)==0){n=2<<C;h=e&(n|0-n);if((h|0)==0){q=s;break}n=(h&0-h)+ -1|0;h=n>>>12&16;f=n>>>h;n=f>>>5&8;m=f>>>n;f=m>>>2&4;t=m>>>f;m=t>>>1&2;o=t>>>m;t=o>>>1&1;K=c[15928+((n|h|f|m|t)+(o>>>t)<<2)>>2]|0}else{K=F}if((K|0)==0){L=E;M=G}else{t=E;o=K;m=G;while(1){f=(c[o+4>>2]&-8)-s|0;h=f>>>0<t>>>0;n=h?f:t;f=h?o:m;h=c[o+16>>2]|0;if((h|0)!=0){N=f;O=n;m=N;o=h;t=O;continue}h=c[o+20>>2]|0;if((h|0)==0){L=n;M=f;break}else{N=f;O=n;o=h;m=N;t=O}}}if((M|0)==0){q=s;break}if(!(L>>>0<((c[15632>>2]|0)-s|0)>>>0)){q=s;break}t=M;m=c[15640>>2]|0;if(t>>>0<m>>>0){Sb()}o=t+s|0;e=o;if(!(t>>>0<o>>>0)){Sb()}h=c[M+24>>2]|0;n=c[M+12>>2]|0;do{if((n|0)==(M|0)){f=M+20|0;r=c[f>>2]|0;if((r|0)==0){D=M+16|0;l=c[D>>2]|0;if((l|0)==0){P=0;break}else{Q=l;R=D}}else{Q=r;R=f}while(1){f=Q+20|0;r=c[f>>2]|0;if((r|0)!=0){R=f;Q=r;continue}r=Q+16|0;f=c[r>>2]|0;if((f|0)==0){break}else{Q=f;R=r}}if(R>>>0<m>>>0){Sb()}else{c[R>>2]=0;P=Q;break}}else{r=c[M+8>>2]|0;if(r>>>0<m>>>0){Sb()}f=r+12|0;if((c[f>>2]|0)!=(M|0)){Sb()}D=n+8|0;if((c[D>>2]|0)==(M|0)){c[f>>2]=n;c[D>>2]=r;P=n;break}else{Sb()}}}while(0);c:do{if((h|0)!=0){n=c[M+28>>2]|0;m=15928+(n<<2)|0;do{if((M|0)==(c[m>>2]|0)){c[m>>2]=P;if((P|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<n);break c}else{if(h>>>0<(c[15640>>2]|0)>>>0){Sb()}r=h+16|0;if((c[r>>2]|0)==(M|0)){c[r>>2]=P}else{c[h+20>>2]=P}if((P|0)==0){break c}}}while(0);if(P>>>0<(c[15640>>2]|0)>>>0){Sb()}c[P+24>>2]=h;n=c[M+16>>2]|0;do{if((n|0)!=0){if(n>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[P+16>>2]=n;c[n+24>>2]=P;break}}}while(0);n=c[M+20>>2]|0;if((n|0)==0){break}if(n>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[P+20>>2]=n;c[n+24>>2]=P;break}}}while(0);d:do{if(L>>>0<16){h=L+s|0;c[M+4>>2]=h|3;n=t+(h+4)|0;c[n>>2]=c[n>>2]|1}else{c[M+4>>2]=s|3;c[t+(s|4)>>2]=L|1;c[t+(L+s)>>2]=L;n=L>>>3;if(L>>>0<256){h=n<<1;m=15664+(h<<2)|0;r=c[3906]|0;D=1<<n;do{if((r&D|0)==0){c[3906]=r|D;S=15664+(h+2<<2)|0;T=m}else{n=15664+(h+2<<2)|0;f=c[n>>2]|0;if(!(f>>>0<(c[15640>>2]|0)>>>0)){S=n;T=f;break}Sb()}}while(0);c[S>>2]=e;c[T+12>>2]=e;c[t+(s+8)>>2]=T;c[t+(s+12)>>2]=m;break}h=o;D=L>>>8;do{if((D|0)==0){U=0}else{if(L>>>0>16777215){U=31;break}r=(D+1048320|0)>>>16&8;f=D<<r;n=(f+520192|0)>>>16&4;l=f<<n;f=(l+245760|0)>>>16&2;k=14-(n|r|f)+(l<<f>>>15)|0;U=L>>>(k+7|0)&1|k<<1}}while(0);D=15928+(U<<2)|0;c[t+(s+28)>>2]=U;c[t+(s+20)>>2]=0;c[t+(s+16)>>2]=0;m=c[15628>>2]|0;k=1<<U;if((m&k|0)==0){c[15628>>2]=m|k;c[D>>2]=h;c[t+(s+24)>>2]=D;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break}k=c[D>>2]|0;if((U|0)==31){V=0}else{V=25-(U>>>1)|0}e:do{if((c[k+4>>2]&-8|0)==(L|0)){W=k}else{D=L<<V;m=k;while(1){X=m+(D>>>31<<2)+16|0;f=c[X>>2]|0;if((f|0)==0){break}if((c[f+4>>2]&-8|0)==(L|0)){W=f;break e}else{D=D<<1;m=f}}if(X>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[X>>2]=h;c[t+(s+24)>>2]=m;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break d}}}while(0);k=W+8|0;D=c[k>>2]|0;f=c[15640>>2]|0;if(W>>>0<f>>>0){Sb()}if(D>>>0<f>>>0){Sb()}else{c[D+12>>2]=h;c[k>>2]=h;c[t+(s+8)>>2]=D;c[t+(s+12)>>2]=W;c[t+(s+24)>>2]=0;break}}}while(0);p=M+8|0;i=b;return p|0}}while(0);M=c[15632>>2]|0;if(!(q>>>0>M>>>0)){W=M-q|0;X=c[15644>>2]|0;if(W>>>0>15){L=X;c[15644>>2]=L+q;c[15632>>2]=W;c[L+(q+4)>>2]=W|1;c[L+M>>2]=W;c[X+4>>2]=q|3}else{c[15632>>2]=0;c[15644>>2]=0;c[X+4>>2]=M|3;W=X+(M+4)|0;c[W>>2]=c[W>>2]|1}p=X+8|0;i=b;return p|0}X=c[15636>>2]|0;if(q>>>0<X>>>0){W=X-q|0;c[15636>>2]=W;X=c[15648>>2]|0;M=X;c[15648>>2]=M+q;c[M+(q+4)>>2]=W|1;c[X+4>>2]=q|3;p=X+8|0;i=b;return p|0}do{if((c[4024]|0)==0){X=Pb(30)|0;if((X+ -1&X|0)==0){c[16104>>2]=X;c[16100>>2]=X;c[16108>>2]=-1;c[16112>>2]=-1;c[16116>>2]=0;c[16068>>2]=0;c[4024]=(ac(0)|0)&-16^1431655768;break}else{Sb()}}}while(0);X=q+48|0;W=c[16104>>2]|0;M=q+47|0;L=W+M|0;V=0-W|0;W=L&V;if(!(W>>>0>q>>>0)){p=0;i=b;return p|0}U=c[16064>>2]|0;do{if((U|0)!=0){T=c[16056>>2]|0;S=T+W|0;if(S>>>0<=T>>>0|S>>>0>U>>>0){p=0}else{break}i=b;return p|0}}while(0);f:do{if((c[16068>>2]&4|0)==0){U=c[15648>>2]|0;g:do{if((U|0)==0){Y=182}else{S=U;T=16072|0;while(1){Z=T;P=c[Z>>2]|0;if(!(P>>>0>S>>>0)){_=T+4|0;if((P+(c[_>>2]|0)|0)>>>0>S>>>0){break}}P=c[T+8>>2]|0;if((P|0)==0){Y=182;break g}else{T=P}}if((T|0)==0){Y=182;break}S=L-(c[15636>>2]|0)&V;if(!(S>>>0<2147483647)){$=0;break}h=eb(S|0)|0;P=(h|0)==((c[Z>>2]|0)+(c[_>>2]|0)|0);aa=h;ba=S;ca=P?h:-1;da=P?S:0;Y=191}}while(0);do{if((Y|0)==182){U=eb(0)|0;if((U|0)==(-1|0)){$=0;break}S=U;P=c[16100>>2]|0;h=P+ -1|0;if((h&S|0)==0){ea=W}else{ea=W-S+(h+S&0-P)|0}P=c[16056>>2]|0;S=P+ea|0;if(!(ea>>>0>q>>>0&ea>>>0<2147483647)){$=0;break}h=c[16064>>2]|0;if((h|0)!=0){if(S>>>0<=P>>>0|S>>>0>h>>>0){$=0;break}}h=eb(ea|0)|0;S=(h|0)==(U|0);aa=h;ba=ea;ca=S?U:-1;da=S?ea:0;Y=191}}while(0);h:do{if((Y|0)==191){S=0-ba|0;if((ca|0)!=(-1|0)){fa=ca;ga=da;Y=202;break f}do{if((aa|0)!=(-1|0)&ba>>>0<2147483647&ba>>>0<X>>>0){U=c[16104>>2]|0;h=M-ba+U&0-U;if(!(h>>>0<2147483647)){ha=ba;break}if((eb(h|0)|0)==(-1|0)){eb(S|0)|0;$=da;break h}else{ha=h+ba|0;break}}else{ha=ba}}while(0);if((aa|0)==(-1|0)){$=da}else{fa=aa;ga=ha;Y=202;break f}}}while(0);c[16068>>2]=c[16068>>2]|4;ia=$;Y=199}else{ia=0;Y=199}}while(0);do{if((Y|0)==199){if(!(W>>>0<2147483647)){break}$=eb(W|0)|0;ha=eb(0)|0;if(!((ha|0)!=(-1|0)&($|0)!=(-1|0)&$>>>0<ha>>>0)){break}aa=ha-$|0;ha=aa>>>0>(q+40|0)>>>0;if(ha){fa=$;ga=ha?aa:ia;Y=202}}}while(0);do{if((Y|0)==202){ia=(c[16056>>2]|0)+ga|0;c[16056>>2]=ia;if(ia>>>0>(c[16060>>2]|0)>>>0){c[16060>>2]=ia}ia=c[15648>>2]|0;i:do{if((ia|0)==0){W=c[15640>>2]|0;if((W|0)==0|fa>>>0<W>>>0){c[15640>>2]=fa}c[16072>>2]=fa;c[16076>>2]=ga;c[16084>>2]=0;c[15660>>2]=c[4024];c[15656>>2]=-1;W=0;do{aa=W<<1;ha=15664+(aa<<2)|0;c[15664+(aa+3<<2)>>2]=ha;c[15664+(aa+2<<2)>>2]=ha;W=W+1|0;}while((W|0)!=32);W=fa+8|0;if((W&7|0)==0){ja=0}else{ja=0-W&7}W=ga+ -40-ja|0;c[15648>>2]=fa+ja;c[15636>>2]=W;c[fa+(ja+4)>>2]=W|1;c[fa+(ga+ -36)>>2]=40;c[15652>>2]=c[16112>>2]}else{W=16072|0;while(1){ka=c[W>>2]|0;la=W+4|0;ma=c[la>>2]|0;if((fa|0)==(ka+ma|0)){Y=214;break}ha=c[W+8>>2]|0;if((ha|0)==0){break}else{W=ha}}do{if((Y|0)==214){if((c[W+12>>2]&8|0)!=0){break}ha=ia;if(!(ha>>>0>=ka>>>0&ha>>>0<fa>>>0)){break}c[la>>2]=ma+ga;aa=(c[15636>>2]|0)+ga|0;$=ia+8|0;if(($&7|0)==0){na=0}else{na=0-$&7}$=aa-na|0;c[15648>>2]=ha+na;c[15636>>2]=$;c[ha+(na+4)>>2]=$|1;c[ha+(aa+4)>>2]=40;c[15652>>2]=c[16112>>2];break i}}while(0);if(fa>>>0<(c[15640>>2]|0)>>>0){c[15640>>2]=fa}W=fa+ga|0;aa=16072|0;while(1){oa=aa;if((c[oa>>2]|0)==(W|0)){Y=224;break}ha=c[aa+8>>2]|0;if((ha|0)==0){break}else{aa=ha}}do{if((Y|0)==224){if((c[aa+12>>2]&8|0)!=0){break}c[oa>>2]=fa;W=aa+4|0;c[W>>2]=(c[W>>2]|0)+ga;W=fa+8|0;if((W&7|0)==0){pa=0}else{pa=0-W&7}W=fa+(ga+8)|0;if((W&7|0)==0){qa=0}else{qa=0-W&7}W=fa+(qa+ga)|0;ha=W;$=pa+q|0;da=fa+$|0;ba=da;M=W-(fa+pa)-q|0;c[fa+(pa+4)>>2]=q|3;j:do{if((ha|0)==(c[15648>>2]|0)){X=(c[15636>>2]|0)+M|0;c[15636>>2]=X;c[15648>>2]=ba;c[fa+($+4)>>2]=X|1}else{if((ha|0)==(c[15644>>2]|0)){X=(c[15632>>2]|0)+M|0;c[15632>>2]=X;c[15644>>2]=ba;c[fa+($+4)>>2]=X|1;c[fa+(X+$)>>2]=X;break}X=ga+4|0;ca=c[fa+(X+qa)>>2]|0;if((ca&3|0)==1){ea=ca&-8;_=ca>>>3;k:do{if(ca>>>0<256){Z=c[fa+((qa|8)+ga)>>2]|0;V=c[fa+(ga+12+qa)>>2]|0;L=15664+(_<<1<<2)|0;do{if((Z|0)!=(L|0)){if(Z>>>0<(c[15640>>2]|0)>>>0){Sb()}if((c[Z+12>>2]|0)==(ha|0)){break}Sb()}}while(0);if((V|0)==(Z|0)){c[3906]=c[3906]&~(1<<_);break}do{if((V|0)==(L|0)){ra=V+8|0}else{if(V>>>0<(c[15640>>2]|0)>>>0){Sb()}S=V+8|0;if((c[S>>2]|0)==(ha|0)){ra=S;break}Sb()}}while(0);c[Z+12>>2]=V;c[ra>>2]=Z}else{L=W;S=c[fa+((qa|24)+ga)>>2]|0;T=c[fa+(ga+12+qa)>>2]|0;do{if((T|0)==(L|0)){h=qa|16;U=fa+(X+h)|0;P=c[U>>2]|0;if((P|0)==0){Q=fa+(h+ga)|0;h=c[Q>>2]|0;if((h|0)==0){sa=0;break}else{ta=h;ua=Q}}else{ta=P;ua=U}while(1){U=ta+20|0;P=c[U>>2]|0;if((P|0)!=0){ua=U;ta=P;continue}P=ta+16|0;U=c[P>>2]|0;if((U|0)==0){break}else{ta=U;ua=P}}if(ua>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[ua>>2]=0;sa=ta;break}}else{P=c[fa+((qa|8)+ga)>>2]|0;if(P>>>0<(c[15640>>2]|0)>>>0){Sb()}U=P+12|0;if((c[U>>2]|0)!=(L|0)){Sb()}Q=T+8|0;if((c[Q>>2]|0)==(L|0)){c[U>>2]=T;c[Q>>2]=P;sa=T;break}else{Sb()}}}while(0);if((S|0)==0){break}T=c[fa+(ga+28+qa)>>2]|0;Z=15928+(T<<2)|0;do{if((L|0)==(c[Z>>2]|0)){c[Z>>2]=sa;if((sa|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<T);break k}else{if(S>>>0<(c[15640>>2]|0)>>>0){Sb()}V=S+16|0;if((c[V>>2]|0)==(L|0)){c[V>>2]=sa}else{c[S+20>>2]=sa}if((sa|0)==0){break k}}}while(0);if(sa>>>0<(c[15640>>2]|0)>>>0){Sb()}c[sa+24>>2]=S;L=qa|16;T=c[fa+(L+ga)>>2]|0;do{if((T|0)!=0){if(T>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[sa+16>>2]=T;c[T+24>>2]=sa;break}}}while(0);T=c[fa+(X+L)>>2]|0;if((T|0)==0){break}if(T>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[sa+20>>2]=T;c[T+24>>2]=sa;break}}}while(0);va=fa+((ea|qa)+ga)|0;wa=ea+M|0}else{va=ha;wa=M}X=va+4|0;c[X>>2]=c[X>>2]&-2;c[fa+($+4)>>2]=wa|1;c[fa+(wa+$)>>2]=wa;X=wa>>>3;if(wa>>>0<256){_=X<<1;ca=15664+(_<<2)|0;T=c[3906]|0;S=1<<X;do{if((T&S|0)==0){c[3906]=T|S;xa=15664+(_+2<<2)|0;ya=ca}else{X=15664+(_+2<<2)|0;Z=c[X>>2]|0;if(!(Z>>>0<(c[15640>>2]|0)>>>0)){xa=X;ya=Z;break}Sb()}}while(0);c[xa>>2]=ba;c[ya+12>>2]=ba;c[fa+($+8)>>2]=ya;c[fa+($+12)>>2]=ca;break}_=da;S=wa>>>8;do{if((S|0)==0){za=0}else{if(wa>>>0>16777215){za=31;break}T=(S+1048320|0)>>>16&8;ea=S<<T;Z=(ea+520192|0)>>>16&4;X=ea<<Z;ea=(X+245760|0)>>>16&2;V=14-(Z|T|ea)+(X<<ea>>>15)|0;za=wa>>>(V+7|0)&1|V<<1}}while(0);S=15928+(za<<2)|0;c[fa+($+28)>>2]=za;c[fa+($+20)>>2]=0;c[fa+($+16)>>2]=0;ca=c[15628>>2]|0;V=1<<za;if((ca&V|0)==0){c[15628>>2]=ca|V;c[S>>2]=_;c[fa+($+24)>>2]=S;c[fa+($+12)>>2]=_;c[fa+($+8)>>2]=_;break}V=c[S>>2]|0;if((za|0)==31){Aa=0}else{Aa=25-(za>>>1)|0}l:do{if((c[V+4>>2]&-8|0)==(wa|0)){Ba=V}else{S=wa<<Aa;ca=V;while(1){Ca=ca+(S>>>31<<2)+16|0;ea=c[Ca>>2]|0;if((ea|0)==0){break}if((c[ea+4>>2]&-8|0)==(wa|0)){Ba=ea;break l}else{S=S<<1;ca=ea}}if(Ca>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[Ca>>2]=_;c[fa+($+24)>>2]=ca;c[fa+($+12)>>2]=_;c[fa+($+8)>>2]=_;break j}}}while(0);V=Ba+8|0;S=c[V>>2]|0;L=c[15640>>2]|0;if(Ba>>>0<L>>>0){Sb()}if(S>>>0<L>>>0){Sb()}else{c[S+12>>2]=_;c[V>>2]=_;c[fa+($+8)>>2]=S;c[fa+($+12)>>2]=Ba;c[fa+($+24)>>2]=0;break}}}while(0);p=fa+(pa|8)|0;i=b;return p|0}}while(0);aa=ia;$=16072|0;while(1){Da=c[$>>2]|0;if(!(Da>>>0>aa>>>0)){Ea=c[$+4>>2]|0;Fa=Da+Ea|0;if(Fa>>>0>aa>>>0){break}}$=c[$+8>>2]|0}$=Da+(Ea+ -39)|0;if(($&7|0)==0){Ga=0}else{Ga=0-$&7}$=Da+(Ea+ -47+Ga)|0;da=$>>>0<(ia+16|0)>>>0?aa:$;$=da+8|0;ba=$;M=fa+8|0;if((M&7|0)==0){Ha=0}else{Ha=0-M&7}M=ga+ -40-Ha|0;c[15648>>2]=fa+Ha;c[15636>>2]=M;c[fa+(Ha+4)>>2]=M|1;c[fa+(ga+ -36)>>2]=40;c[15652>>2]=c[16112>>2];c[da+4>>2]=27;c[$+0>>2]=c[16072>>2];c[$+4>>2]=c[16076>>2];c[$+8>>2]=c[16080>>2];c[$+12>>2]=c[16084>>2];c[16072>>2]=fa;c[16076>>2]=ga;c[16084>>2]=0;c[16080>>2]=ba;ba=da+28|0;c[ba>>2]=7;if((da+32|0)>>>0<Fa>>>0){$=ba;while(1){ba=$+4|0;c[ba>>2]=7;if(($+8|0)>>>0<Fa>>>0){$=ba}else{break}}}if((da|0)==(aa|0)){break}$=da-ia|0;ba=aa+($+4)|0;c[ba>>2]=c[ba>>2]&-2;c[ia+4>>2]=$|1;c[aa+$>>2]=$;ba=$>>>3;if($>>>0<256){M=ba<<1;ha=15664+(M<<2)|0;W=c[3906]|0;m=1<<ba;do{if((W&m|0)==0){c[3906]=W|m;Ia=15664+(M+2<<2)|0;Ja=ha}else{ba=15664+(M+2<<2)|0;S=c[ba>>2]|0;if(!(S>>>0<(c[15640>>2]|0)>>>0)){Ia=ba;Ja=S;break}Sb()}}while(0);c[Ia>>2]=ia;c[Ja+12>>2]=ia;c[ia+8>>2]=Ja;c[ia+12>>2]=ha;break}M=ia;m=$>>>8;do{if((m|0)==0){Ka=0}else{if($>>>0>16777215){Ka=31;break}W=(m+1048320|0)>>>16&8;aa=m<<W;da=(aa+520192|0)>>>16&4;S=aa<<da;aa=(S+245760|0)>>>16&2;ba=14-(da|W|aa)+(S<<aa>>>15)|0;Ka=$>>>(ba+7|0)&1|ba<<1}}while(0);m=15928+(Ka<<2)|0;c[ia+28>>2]=Ka;c[ia+20>>2]=0;c[ia+16>>2]=0;ha=c[15628>>2]|0;ba=1<<Ka;if((ha&ba|0)==0){c[15628>>2]=ha|ba;c[m>>2]=M;c[ia+24>>2]=m;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break}ba=c[m>>2]|0;if((Ka|0)==31){La=0}else{La=25-(Ka>>>1)|0}m:do{if((c[ba+4>>2]&-8|0)==($|0)){Ma=ba}else{m=$<<La;ha=ba;while(1){Na=ha+(m>>>31<<2)+16|0;aa=c[Na>>2]|0;if((aa|0)==0){break}if((c[aa+4>>2]&-8|0)==($|0)){Ma=aa;break m}else{m=m<<1;ha=aa}}if(Na>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[Na>>2]=M;c[ia+24>>2]=ha;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break i}}}while(0);$=Ma+8|0;ba=c[$>>2]|0;m=c[15640>>2]|0;if(Ma>>>0<m>>>0){Sb()}if(ba>>>0<m>>>0){Sb()}else{c[ba+12>>2]=M;c[$>>2]=M;c[ia+8>>2]=ba;c[ia+12>>2]=Ma;c[ia+24>>2]=0;break}}}while(0);ia=c[15636>>2]|0;if(!(ia>>>0>q>>>0)){break}ba=ia-q|0;c[15636>>2]=ba;ia=c[15648>>2]|0;$=ia;c[15648>>2]=$+q;c[$+(q+4)>>2]=ba|1;c[ia+4>>2]=q|3;p=ia+8|0;i=b;return p|0}}while(0);c[(Hb()|0)>>2]=12;p=0;i=b;return p|0}function Im(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;b=i;if((a|0)==0){i=b;return}d=a+ -8|0;e=d;f=c[15640>>2]|0;if(d>>>0<f>>>0){Sb()}g=c[a+ -4>>2]|0;h=g&3;if((h|0)==1){Sb()}j=g&-8;k=a+(j+ -8)|0;l=k;a:do{if((g&1|0)==0){m=c[d>>2]|0;if((h|0)==0){i=b;return}n=-8-m|0;o=a+n|0;p=o;q=m+j|0;if(o>>>0<f>>>0){Sb()}if((p|0)==(c[15644>>2]|0)){r=a+(j+ -4)|0;if((c[r>>2]&3|0)!=3){s=p;t=q;break}c[15632>>2]=q;c[r>>2]=c[r>>2]&-2;c[a+(n+4)>>2]=q|1;c[k>>2]=q;i=b;return}r=m>>>3;if(m>>>0<256){m=c[a+(n+8)>>2]|0;u=c[a+(n+12)>>2]|0;v=15664+(r<<1<<2)|0;do{if((m|0)!=(v|0)){if(m>>>0<f>>>0){Sb()}if((c[m+12>>2]|0)==(p|0)){break}Sb()}}while(0);if((u|0)==(m|0)){c[3906]=c[3906]&~(1<<r);s=p;t=q;break}do{if((u|0)==(v|0)){w=u+8|0}else{if(u>>>0<f>>>0){Sb()}x=u+8|0;if((c[x>>2]|0)==(p|0)){w=x;break}Sb()}}while(0);c[m+12>>2]=u;c[w>>2]=m;s=p;t=q;break}v=o;r=c[a+(n+24)>>2]|0;x=c[a+(n+12)>>2]|0;do{if((x|0)==(v|0)){y=a+(n+20)|0;z=c[y>>2]|0;if((z|0)==0){A=a+(n+16)|0;B=c[A>>2]|0;if((B|0)==0){C=0;break}else{D=B;E=A}}else{D=z;E=y}while(1){y=D+20|0;z=c[y>>2]|0;if((z|0)!=0){E=y;D=z;continue}z=D+16|0;y=c[z>>2]|0;if((y|0)==0){break}else{D=y;E=z}}if(E>>>0<f>>>0){Sb()}else{c[E>>2]=0;C=D;break}}else{z=c[a+(n+8)>>2]|0;if(z>>>0<f>>>0){Sb()}y=z+12|0;if((c[y>>2]|0)!=(v|0)){Sb()}A=x+8|0;if((c[A>>2]|0)==(v|0)){c[y>>2]=x;c[A>>2]=z;C=x;break}else{Sb()}}}while(0);if((r|0)==0){s=p;t=q;break}x=c[a+(n+28)>>2]|0;o=15928+(x<<2)|0;do{if((v|0)==(c[o>>2]|0)){c[o>>2]=C;if((C|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<x);s=p;t=q;break a}else{if(r>>>0<(c[15640>>2]|0)>>>0){Sb()}m=r+16|0;if((c[m>>2]|0)==(v|0)){c[m>>2]=C}else{c[r+20>>2]=C}if((C|0)==0){s=p;t=q;break a}}}while(0);if(C>>>0<(c[15640>>2]|0)>>>0){Sb()}c[C+24>>2]=r;v=c[a+(n+16)>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[C+16>>2]=v;c[v+24>>2]=C;break}}}while(0);v=c[a+(n+20)>>2]|0;if((v|0)==0){s=p;t=q;break}if(v>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[C+20>>2]=v;c[v+24>>2]=C;s=p;t=q;break}}else{s=e;t=j}}while(0);e=s;if(!(e>>>0<k>>>0)){Sb()}C=a+(j+ -4)|0;f=c[C>>2]|0;if((f&1|0)==0){Sb()}do{if((f&2|0)==0){if((l|0)==(c[15648>>2]|0)){D=(c[15636>>2]|0)+t|0;c[15636>>2]=D;c[15648>>2]=s;c[s+4>>2]=D|1;if((s|0)!=(c[15644>>2]|0)){i=b;return}c[15644>>2]=0;c[15632>>2]=0;i=b;return}if((l|0)==(c[15644>>2]|0)){D=(c[15632>>2]|0)+t|0;c[15632>>2]=D;c[15644>>2]=s;c[s+4>>2]=D|1;c[e+D>>2]=D;i=b;return}D=(f&-8)+t|0;E=f>>>3;b:do{if(f>>>0<256){w=c[a+j>>2]|0;h=c[a+(j|4)>>2]|0;d=15664+(E<<1<<2)|0;do{if((w|0)!=(d|0)){if(w>>>0<(c[15640>>2]|0)>>>0){Sb()}if((c[w+12>>2]|0)==(l|0)){break}Sb()}}while(0);if((h|0)==(w|0)){c[3906]=c[3906]&~(1<<E);break}do{if((h|0)==(d|0)){F=h+8|0}else{if(h>>>0<(c[15640>>2]|0)>>>0){Sb()}g=h+8|0;if((c[g>>2]|0)==(l|0)){F=g;break}Sb()}}while(0);c[w+12>>2]=h;c[F>>2]=w}else{d=k;g=c[a+(j+16)>>2]|0;v=c[a+(j|4)>>2]|0;do{if((v|0)==(d|0)){r=a+(j+12)|0;x=c[r>>2]|0;if((x|0)==0){o=a+(j+8)|0;m=c[o>>2]|0;if((m|0)==0){G=0;break}else{H=m;I=o}}else{H=x;I=r}while(1){r=H+20|0;x=c[r>>2]|0;if((x|0)!=0){I=r;H=x;continue}x=H+16|0;r=c[x>>2]|0;if((r|0)==0){break}else{H=r;I=x}}if(I>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[I>>2]=0;G=H;break}}else{x=c[a+j>>2]|0;if(x>>>0<(c[15640>>2]|0)>>>0){Sb()}r=x+12|0;if((c[r>>2]|0)!=(d|0)){Sb()}o=v+8|0;if((c[o>>2]|0)==(d|0)){c[r>>2]=v;c[o>>2]=x;G=v;break}else{Sb()}}}while(0);if((g|0)==0){break}v=c[a+(j+20)>>2]|0;w=15928+(v<<2)|0;do{if((d|0)==(c[w>>2]|0)){c[w>>2]=G;if((G|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<v);break b}else{if(g>>>0<(c[15640>>2]|0)>>>0){Sb()}h=g+16|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=G}else{c[g+20>>2]=G}if((G|0)==0){break b}}}while(0);if(G>>>0<(c[15640>>2]|0)>>>0){Sb()}c[G+24>>2]=g;d=c[a+(j+8)>>2]|0;do{if((d|0)!=0){if(d>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[G+16>>2]=d;c[d+24>>2]=G;break}}}while(0);d=c[a+(j+12)>>2]|0;if((d|0)==0){break}if(d>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[G+20>>2]=d;c[d+24>>2]=G;break}}}while(0);c[s+4>>2]=D|1;c[e+D>>2]=D;if((s|0)!=(c[15644>>2]|0)){J=D;break}c[15632>>2]=D;i=b;return}else{c[C>>2]=f&-2;c[s+4>>2]=t|1;c[e+t>>2]=t;J=t}}while(0);t=J>>>3;if(J>>>0<256){e=t<<1;f=15664+(e<<2)|0;C=c[3906]|0;G=1<<t;do{if((C&G|0)==0){c[3906]=C|G;K=15664+(e+2<<2)|0;L=f}else{t=15664+(e+2<<2)|0;j=c[t>>2]|0;if(!(j>>>0<(c[15640>>2]|0)>>>0)){K=t;L=j;break}Sb()}}while(0);c[K>>2]=s;c[L+12>>2]=s;c[s+8>>2]=L;c[s+12>>2]=f;i=b;return}f=s;L=J>>>8;do{if((L|0)==0){M=0}else{if(J>>>0>16777215){M=31;break}K=(L+1048320|0)>>>16&8;e=L<<K;G=(e+520192|0)>>>16&4;C=e<<G;e=(C+245760|0)>>>16&2;j=14-(G|K|e)+(C<<e>>>15)|0;M=J>>>(j+7|0)&1|j<<1}}while(0);L=15928+(M<<2)|0;c[s+28>>2]=M;c[s+20>>2]=0;c[s+16>>2]=0;j=c[15628>>2]|0;e=1<<M;c:do{if((j&e|0)==0){c[15628>>2]=j|e;c[L>>2]=f;c[s+24>>2]=L;c[s+12>>2]=s;c[s+8>>2]=s}else{C=c[L>>2]|0;if((M|0)==31){N=0}else{N=25-(M>>>1)|0}d:do{if((c[C+4>>2]&-8|0)==(J|0)){O=C}else{K=J<<N;G=C;while(1){P=G+(K>>>31<<2)+16|0;t=c[P>>2]|0;if((t|0)==0){break}if((c[t+4>>2]&-8|0)==(J|0)){O=t;break d}else{K=K<<1;G=t}}if(P>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[P>>2]=f;c[s+24>>2]=G;c[s+12>>2]=s;c[s+8>>2]=s;break c}}}while(0);C=O+8|0;D=c[C>>2]|0;K=c[15640>>2]|0;if(O>>>0<K>>>0){Sb()}if(D>>>0<K>>>0){Sb()}else{c[D+12>>2]=f;c[C>>2]=f;c[s+8>>2]=D;c[s+12>>2]=O;c[s+24>>2]=0;break}}}while(0);s=(c[15656>>2]|0)+ -1|0;c[15656>>2]=s;if((s|0)==0){Q=16080|0}else{i=b;return}while(1){s=c[Q>>2]|0;if((s|0)==0){break}else{Q=s+8|0}}c[15656>>2]=-1;i=b;return}function Jm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;if((a|0)==0){e=Hm(b)|0;i=d;return e|0}if(b>>>0>4294967231){c[(Hb()|0)>>2]=12;e=0;i=d;return e|0}if(b>>>0<11){f=16}else{f=b+11&-8}g=Km(a+ -8|0,f)|0;if((g|0)!=0){e=g+8|0;i=d;return e|0}g=Hm(b)|0;if((g|0)==0){e=0;i=d;return e|0}f=c[a+ -4>>2]|0;h=(f&-8)-((f&3|0)==0?8:4)|0;fn(g|0,a|0,(h>>>0<b>>>0?h:b)|0)|0;Im(a);e=g;i=d;return e|0}function Km(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;d=i;e=a+4|0;f=c[e>>2]|0;g=f&-8;h=a;j=h+g|0;k=j;l=c[15640>>2]|0;if(h>>>0<l>>>0){Sb()}m=f&3;if(!((m|0)!=1&h>>>0<j>>>0)){Sb()}n=h+(g|4)|0;o=c[n>>2]|0;if((o&1|0)==0){Sb()}if((m|0)==0){if(b>>>0<256){p=0;i=d;return p|0}do{if(!(g>>>0<(b+4|0)>>>0)){if((g-b|0)>>>0>c[16104>>2]<<1>>>0){break}else{p=a}i=d;return p|0}}while(0);p=0;i=d;return p|0}if(!(g>>>0<b>>>0)){m=g-b|0;if(!(m>>>0>15)){p=a;i=d;return p|0}c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=m|3;c[n>>2]=c[n>>2]|1;Lm(h+b|0,m);p=a;i=d;return p|0}if((k|0)==(c[15648>>2]|0)){m=(c[15636>>2]|0)+g|0;if(!(m>>>0>b>>>0)){p=0;i=d;return p|0}n=m-b|0;c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=n|1;c[15648>>2]=h+b;c[15636>>2]=n;p=a;i=d;return p|0}if((k|0)==(c[15644>>2]|0)){n=(c[15632>>2]|0)+g|0;if(n>>>0<b>>>0){p=0;i=d;return p|0}m=n-b|0;if(m>>>0>15){c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=m|1;c[h+n>>2]=m;q=h+(n+4)|0;c[q>>2]=c[q>>2]&-2;r=h+b|0;s=m}else{c[e>>2]=f&1|n|2;f=h+(n+4)|0;c[f>>2]=c[f>>2]|1;r=0;s=0}c[15632>>2]=s;c[15644>>2]=r;p=a;i=d;return p|0}if((o&2|0)!=0){p=0;i=d;return p|0}r=(o&-8)+g|0;if(r>>>0<b>>>0){p=0;i=d;return p|0}s=r-b|0;f=o>>>3;a:do{if(o>>>0<256){n=c[h+(g+8)>>2]|0;m=c[h+(g+12)>>2]|0;q=15664+(f<<1<<2)|0;do{if((n|0)!=(q|0)){if(n>>>0<l>>>0){Sb()}if((c[n+12>>2]|0)==(k|0)){break}Sb()}}while(0);if((m|0)==(n|0)){c[3906]=c[3906]&~(1<<f);break}do{if((m|0)==(q|0)){t=m+8|0}else{if(m>>>0<l>>>0){Sb()}u=m+8|0;if((c[u>>2]|0)==(k|0)){t=u;break}Sb()}}while(0);c[n+12>>2]=m;c[t>>2]=n}else{q=j;u=c[h+(g+24)>>2]|0;v=c[h+(g+12)>>2]|0;do{if((v|0)==(q|0)){w=h+(g+20)|0;x=c[w>>2]|0;if((x|0)==0){y=h+(g+16)|0;z=c[y>>2]|0;if((z|0)==0){A=0;break}else{B=z;C=y}}else{B=x;C=w}while(1){w=B+20|0;x=c[w>>2]|0;if((x|0)!=0){C=w;B=x;continue}x=B+16|0;w=c[x>>2]|0;if((w|0)==0){break}else{B=w;C=x}}if(C>>>0<l>>>0){Sb()}else{c[C>>2]=0;A=B;break}}else{x=c[h+(g+8)>>2]|0;if(x>>>0<l>>>0){Sb()}w=x+12|0;if((c[w>>2]|0)!=(q|0)){Sb()}y=v+8|0;if((c[y>>2]|0)==(q|0)){c[w>>2]=v;c[y>>2]=x;A=v;break}else{Sb()}}}while(0);if((u|0)==0){break}v=c[h+(g+28)>>2]|0;n=15928+(v<<2)|0;do{if((q|0)==(c[n>>2]|0)){c[n>>2]=A;if((A|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<v);break a}else{if(u>>>0<(c[15640>>2]|0)>>>0){Sb()}m=u+16|0;if((c[m>>2]|0)==(q|0)){c[m>>2]=A}else{c[u+20>>2]=A}if((A|0)==0){break a}}}while(0);if(A>>>0<(c[15640>>2]|0)>>>0){Sb()}c[A+24>>2]=u;q=c[h+(g+16)>>2]|0;do{if((q|0)!=0){if(q>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[A+16>>2]=q;c[q+24>>2]=A;break}}}while(0);q=c[h+(g+20)>>2]|0;if((q|0)==0){break}if(q>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[A+20>>2]=q;c[q+24>>2]=A;break}}}while(0);if(s>>>0<16){c[e>>2]=r|c[e>>2]&1|2;A=h+(r|4)|0;c[A>>2]=c[A>>2]|1;p=a;i=d;return p|0}else{c[e>>2]=c[e>>2]&1|b|2;c[h+(b+4)>>2]=s|3;e=h+(r|4)|0;c[e>>2]=c[e>>2]|1;Lm(h+b|0,s);p=a;i=d;return p|0}return 0}function Lm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;d=i;e=a;f=e+b|0;g=f;h=c[a+4>>2]|0;a:do{if((h&1|0)==0){j=c[a>>2]|0;if((h&3|0)==0){i=d;return}k=e+(0-j)|0;l=k;m=j+b|0;n=c[15640>>2]|0;if(k>>>0<n>>>0){Sb()}if((l|0)==(c[15644>>2]|0)){o=e+(b+4)|0;if((c[o>>2]&3|0)!=3){p=l;q=m;break}c[15632>>2]=m;c[o>>2]=c[o>>2]&-2;c[e+(4-j)>>2]=m|1;c[f>>2]=m;i=d;return}o=j>>>3;if(j>>>0<256){r=c[e+(8-j)>>2]|0;s=c[e+(12-j)>>2]|0;t=15664+(o<<1<<2)|0;do{if((r|0)!=(t|0)){if(r>>>0<n>>>0){Sb()}if((c[r+12>>2]|0)==(l|0)){break}Sb()}}while(0);if((s|0)==(r|0)){c[3906]=c[3906]&~(1<<o);p=l;q=m;break}do{if((s|0)==(t|0)){u=s+8|0}else{if(s>>>0<n>>>0){Sb()}v=s+8|0;if((c[v>>2]|0)==(l|0)){u=v;break}Sb()}}while(0);c[r+12>>2]=s;c[u>>2]=r;p=l;q=m;break}t=k;o=c[e+(24-j)>>2]|0;v=c[e+(12-j)>>2]|0;do{if((v|0)==(t|0)){w=16-j|0;x=e+(w+4)|0;y=c[x>>2]|0;if((y|0)==0){z=e+w|0;w=c[z>>2]|0;if((w|0)==0){A=0;break}else{B=w;C=z}}else{B=y;C=x}while(1){x=B+20|0;y=c[x>>2]|0;if((y|0)!=0){C=x;B=y;continue}y=B+16|0;x=c[y>>2]|0;if((x|0)==0){break}else{B=x;C=y}}if(C>>>0<n>>>0){Sb()}else{c[C>>2]=0;A=B;break}}else{y=c[e+(8-j)>>2]|0;if(y>>>0<n>>>0){Sb()}x=y+12|0;if((c[x>>2]|0)!=(t|0)){Sb()}z=v+8|0;if((c[z>>2]|0)==(t|0)){c[x>>2]=v;c[z>>2]=y;A=v;break}else{Sb()}}}while(0);if((o|0)==0){p=l;q=m;break}v=c[e+(28-j)>>2]|0;n=15928+(v<<2)|0;do{if((t|0)==(c[n>>2]|0)){c[n>>2]=A;if((A|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<v);p=l;q=m;break a}else{if(o>>>0<(c[15640>>2]|0)>>>0){Sb()}k=o+16|0;if((c[k>>2]|0)==(t|0)){c[k>>2]=A}else{c[o+20>>2]=A}if((A|0)==0){p=l;q=m;break a}}}while(0);if(A>>>0<(c[15640>>2]|0)>>>0){Sb()}c[A+24>>2]=o;t=16-j|0;v=c[e+t>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[A+16>>2]=v;c[v+24>>2]=A;break}}}while(0);v=c[e+(t+4)>>2]|0;if((v|0)==0){p=l;q=m;break}if(v>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[A+20>>2]=v;c[v+24>>2]=A;p=l;q=m;break}}else{p=a;q=b}}while(0);a=c[15640>>2]|0;if(f>>>0<a>>>0){Sb()}A=e+(b+4)|0;B=c[A>>2]|0;do{if((B&2|0)==0){if((g|0)==(c[15648>>2]|0)){C=(c[15636>>2]|0)+q|0;c[15636>>2]=C;c[15648>>2]=p;c[p+4>>2]=C|1;if((p|0)!=(c[15644>>2]|0)){i=d;return}c[15644>>2]=0;c[15632>>2]=0;i=d;return}if((g|0)==(c[15644>>2]|0)){C=(c[15632>>2]|0)+q|0;c[15632>>2]=C;c[15644>>2]=p;c[p+4>>2]=C|1;c[p+C>>2]=C;i=d;return}C=(B&-8)+q|0;u=B>>>3;b:do{if(B>>>0<256){h=c[e+(b+8)>>2]|0;v=c[e+(b+12)>>2]|0;j=15664+(u<<1<<2)|0;do{if((h|0)!=(j|0)){if(h>>>0<a>>>0){Sb()}if((c[h+12>>2]|0)==(g|0)){break}Sb()}}while(0);if((v|0)==(h|0)){c[3906]=c[3906]&~(1<<u);break}do{if((v|0)==(j|0)){D=v+8|0}else{if(v>>>0<a>>>0){Sb()}o=v+8|0;if((c[o>>2]|0)==(g|0)){D=o;break}Sb()}}while(0);c[h+12>>2]=v;c[D>>2]=h}else{j=f;o=c[e+(b+24)>>2]|0;n=c[e+(b+12)>>2]|0;do{if((n|0)==(j|0)){k=e+(b+20)|0;r=c[k>>2]|0;if((r|0)==0){s=e+(b+16)|0;y=c[s>>2]|0;if((y|0)==0){E=0;break}else{F=y;G=s}}else{F=r;G=k}while(1){k=F+20|0;r=c[k>>2]|0;if((r|0)!=0){G=k;F=r;continue}r=F+16|0;k=c[r>>2]|0;if((k|0)==0){break}else{F=k;G=r}}if(G>>>0<a>>>0){Sb()}else{c[G>>2]=0;E=F;break}}else{r=c[e+(b+8)>>2]|0;if(r>>>0<a>>>0){Sb()}k=r+12|0;if((c[k>>2]|0)!=(j|0)){Sb()}s=n+8|0;if((c[s>>2]|0)==(j|0)){c[k>>2]=n;c[s>>2]=r;E=n;break}else{Sb()}}}while(0);if((o|0)==0){break}n=c[e+(b+28)>>2]|0;h=15928+(n<<2)|0;do{if((j|0)==(c[h>>2]|0)){c[h>>2]=E;if((E|0)!=0){break}c[15628>>2]=c[15628>>2]&~(1<<n);break b}else{if(o>>>0<(c[15640>>2]|0)>>>0){Sb()}v=o+16|0;if((c[v>>2]|0)==(j|0)){c[v>>2]=E}else{c[o+20>>2]=E}if((E|0)==0){break b}}}while(0);if(E>>>0<(c[15640>>2]|0)>>>0){Sb()}c[E+24>>2]=o;j=c[e+(b+16)>>2]|0;do{if((j|0)!=0){if(j>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[E+16>>2]=j;c[j+24>>2]=E;break}}}while(0);j=c[e+(b+20)>>2]|0;if((j|0)==0){break}if(j>>>0<(c[15640>>2]|0)>>>0){Sb()}else{c[E+20>>2]=j;c[j+24>>2]=E;break}}}while(0);c[p+4>>2]=C|1;c[p+C>>2]=C;if((p|0)!=(c[15644>>2]|0)){H=C;break}c[15632>>2]=C;i=d;return}else{c[A>>2]=B&-2;c[p+4>>2]=q|1;c[p+q>>2]=q;H=q}}while(0);q=H>>>3;if(H>>>0<256){B=q<<1;A=15664+(B<<2)|0;E=c[3906]|0;b=1<<q;do{if((E&b|0)==0){c[3906]=E|b;I=15664+(B+2<<2)|0;J=A}else{q=15664+(B+2<<2)|0;e=c[q>>2]|0;if(!(e>>>0<(c[15640>>2]|0)>>>0)){I=q;J=e;break}Sb()}}while(0);c[I>>2]=p;c[J+12>>2]=p;c[p+8>>2]=J;c[p+12>>2]=A;i=d;return}A=p;J=H>>>8;do{if((J|0)==0){K=0}else{if(H>>>0>16777215){K=31;break}I=(J+1048320|0)>>>16&8;B=J<<I;b=(B+520192|0)>>>16&4;E=B<<b;B=(E+245760|0)>>>16&2;e=14-(b|I|B)+(E<<B>>>15)|0;K=H>>>(e+7|0)&1|e<<1}}while(0);J=15928+(K<<2)|0;c[p+28>>2]=K;c[p+20>>2]=0;c[p+16>>2]=0;e=c[15628>>2]|0;B=1<<K;if((e&B|0)==0){c[15628>>2]=e|B;c[J>>2]=A;c[p+24>>2]=J;c[p+12>>2]=p;c[p+8>>2]=p;i=d;return}B=c[J>>2]|0;if((K|0)==31){L=0}else{L=25-(K>>>1)|0}c:do{if((c[B+4>>2]&-8|0)==(H|0)){M=B}else{K=H<<L;J=B;while(1){N=J+(K>>>31<<2)+16|0;e=c[N>>2]|0;if((e|0)==0){break}if((c[e+4>>2]&-8|0)==(H|0)){M=e;break c}else{K=K<<1;J=e}}if(N>>>0<(c[15640>>2]|0)>>>0){Sb()}c[N>>2]=A;c[p+24>>2]=J;c[p+12>>2]=p;c[p+8>>2]=p;i=d;return}}while(0);N=M+8|0;H=c[N>>2]|0;B=c[15640>>2]|0;if(M>>>0<B>>>0){Sb()}if(H>>>0<B>>>0){Sb()}c[H+12>>2]=A;c[N>>2]=A;c[p+8>>2]=H;c[p+12>>2]=M;c[p+24>>2]=0;i=d;return}function Mm(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=(a|0)==0?1:a;while(1){e=Hm(d)|0;if((e|0)!=0){f=6;break}a=c[4030]|0;c[4030]=a+0;if((a|0)==0){f=5;break}oc[a&0]()}if((f|0)==5){d=Ta(4)|0;c[d>>2]=16136;Vb(d|0,16184,109)}else if((f|0)==6){i=b;return e|0}return 0}function Nm(a){a=a|0;var b=0,c=0;b=i;c=Mm(a)|0;i=b;return c|0}function Om(a){a=a|0;var b=0;b=i;if((a|0)!=0){Im(a)}i=b;return}function Pm(a){a=a|0;var b=0;b=i;Om(a);i=b;return}function Qm(a){a=a|0;var b=0;b=i;Kb(a|0);Om(a);i=b;return}function Rm(a){a=a|0;var b=0;b=i;Kb(a|0);i=b;return}function Sm(a){a=a|0;i=i;return 16152}function Tm(){var a=0;a=Ta(4)|0;c[a>>2]=16136;Vb(a|0,16184,109)}function Um(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0.0,P=0,Q=0.0,R=0,S=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0.0,fa=0,ga=0.0,ha=0,ia=0.0,ja=0,ka=0.0,la=0.0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0.0,ua=0,va=0.0,wa=0,xa=0,ya=0,za=0,Aa=0.0,Ba=0,Ca=0.0,Da=0.0,Ea=0,Fa=0.0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,Ma=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Ib=0,Jb=0,Kb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0.0,xc=0,yc=0,zc=0.0,Ac=0.0,Bc=0.0,Cc=0.0,Dc=0.0,Ec=0.0,Fc=0,Gc=0,Hc=0.0,Ic=0,Jc=0.0,Kc=0,Lc=0,Mc=0,Nc=0,Oc=0;g=i;i=i+512|0;h=g;if((e|0)==1){j=53;k=-1074}else if((e|0)==2){j=53;k=-1074}else if((e|0)==0){j=24;k=-149}else{l=0.0;i=g;return+l}e=b+4|0;m=b+100|0;do{n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;o=d[n]|0}else{o=Xm(b)|0}}while((Na(o|0)|0)!=0);do{if((o|0)==43|(o|0)==45){n=1-(((o|0)==45)<<1)|0;p=c[e>>2]|0;if(p>>>0<(c[m>>2]|0)>>>0){c[e>>2]=p+1;q=d[p]|0;r=n;break}else{q=Xm(b)|0;r=n;break}}else{q=o;r=1}}while(0);o=q;q=0;while(1){if((o|32|0)!=(a[16200+q|0]|0)){s=o;t=q;break}do{if(q>>>0<7){n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;u=d[n]|0;break}else{u=Xm(b)|0;break}}else{u=o}}while(0);n=q+1|0;if(n>>>0<8){o=u;q=n}else{s=u;t=n;break}}do{if((t|0)==3){v=23}else if((t|0)!=8){u=(f|0)==0;if(!(t>>>0<4|u)){if((t|0)==8){break}else{v=23;break}}a:do{if((t|0)==0){q=s;o=0;while(1){if((q|32|0)!=(a[16216+o|0]|0)){w=q;z=o;break a}do{if(o>>>0<2){n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;A=d[n]|0;break}else{A=Xm(b)|0;break}}else{A=q}}while(0);n=o+1|0;if(n>>>0<3){q=A;o=n}else{w=A;z=n;break}}}else{w=s;z=t}}while(0);if((z|0)==0){do{if((w|0)==48){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;B=d[o]|0}else{B=Xm(b)|0}if((B|32|0)!=120){if((c[m>>2]|0)==0){C=48;break}c[e>>2]=(c[e>>2]|0)+ -1;C=48;break}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;D=d[o]|0;E=0}else{D=Xm(b)|0;E=0}while(1){if((D|0)==46){v=70;break}else if((D|0)!=48){F=0;G=0;H=0;J=0;K=D;L=E;M=0;N=0;O=1.0;P=0;Q=0.0;break}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;D=d[o]|0;E=1;continue}else{D=Xm(b)|0;E=1;continue}}b:do{if((v|0)==70){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;R=d[o]|0}else{R=Xm(b)|0}if((R|0)==48){S=-1;U=-1}else{F=0;G=0;H=0;J=0;K=R;L=E;M=1;N=0;O=1.0;P=0;Q=0.0;break}while(1){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;V=d[o]|0}else{V=Xm(b)|0}if((V|0)!=48){F=S;G=U;H=0;J=0;K=V;L=1;M=1;N=0;O=1.0;P=0;Q=0.0;break b}o=en(S|0,U|0,-1,-1)|0;S=o;U=I}}}while(0);c:while(1){o=K+ -48|0;do{if(o>>>0<10){W=o;v=84}else{q=K|32;n=(K|0)==46;if(!((q+ -97|0)>>>0<6|n)){X=K;break c}if(n){if((M|0)==0){Y=H;Z=J;_=H;$=J;aa=L;ba=1;ca=N;da=O;fa=P;ga=Q;break}else{X=46;break c}}else{W=(K|0)>57?q+ -87|0:o;v=84;break}}}while(0);if((v|0)==84){v=0;do{if((J|0)<0|(J|0)==0&H>>>0<8){ha=N;ia=O;ja=W+(P<<4)|0;ka=Q}else{if((J|0)<0|(J|0)==0&H>>>0<14){la=O*.0625;ha=N;ia=la;ja=P;ka=Q+la*+(W|0);break}if(!((W|0)!=0&(N|0)==0)){ha=N;ia=O;ja=P;ka=Q;break}ha=1;ia=O;ja=P;ka=Q+O*.5}}while(0);o=en(H|0,J|0,1,0)|0;Y=F;Z=G;_=o;$=I;aa=1;ba=M;ca=ha;da=ia;fa=ja;ga=ka}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;F=Y;G=Z;H=_;J=$;K=d[o]|0;L=aa;M=ba;N=ca;O=da;P=fa;Q=ga;continue}else{F=Y;G=Z;H=_;J=$;K=Xm(b)|0;L=aa;M=ba;N=ca;O=da;P=fa;Q=ga;continue}}if((L|0)==0){o=(c[m>>2]|0)==0;if(!o){c[e>>2]=(c[e>>2]|0)+ -1}do{if(u){Wm(b,0)}else{if(o){break}q=c[e>>2]|0;c[e>>2]=q+ -1;if((M|0)==0){break}c[e>>2]=q+ -2}}while(0);l=+(r|0)*0.0;i=g;return+l}o=(M|0)==0;q=o?H:F;n=o?J:G;if((J|0)<0|(J|0)==0&H>>>0<8){o=H;p=J;ma=P;while(1){na=ma<<4;oa=en(o|0,p|0,1,0)|0;pa=I;if((pa|0)<0|(pa|0)==0&oa>>>0<8){ma=na;p=pa;o=oa}else{qa=na;break}}}else{qa=P}do{if((X|32|0)==112){o=Vm(b,f)|0;p=I;if(!((o|0)==0&(p|0)==-2147483648)){ra=o;sa=p;break}if(u){Wm(b,0);l=0.0;i=g;return+l}else{if((c[m>>2]|0)==0){ra=0;sa=0;break}c[e>>2]=(c[e>>2]|0)+ -1;ra=0;sa=0;break}}else{if((c[m>>2]|0)==0){ra=0;sa=0;break}c[e>>2]=(c[e>>2]|0)+ -1;ra=0;sa=0}}while(0);p=kn(q|0,n|0,2)|0;o=en(p|0,I|0,-32,-1)|0;p=en(o|0,I|0,ra|0,sa|0)|0;o=I;if((qa|0)==0){l=+(r|0)*0.0;i=g;return+l}if((o|0)>0|(o|0)==0&p>>>0>(0-k|0)>>>0){c[(Hb()|0)>>2]=34;l=+(r|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+l}ma=k+ -106|0;na=((ma|0)<0)<<31>>31;if((o|0)<(na|0)|(o|0)==(na|0)&p>>>0<ma>>>0){c[(Hb()|0)>>2]=34;l=+(r|0)*2.2250738585072014e-308*2.2250738585072014e-308;i=g;return+l}if((qa|0)>-1){ma=p;na=o;oa=qa;la=Q;while(1){pa=oa<<1;if(!(la>=.5)){ta=la;ua=pa}else{ta=la+-1.0;ua=pa|1}va=la+ta;pa=en(ma|0,na|0,-1,-1)|0;wa=I;if((ua|0)>-1){ma=pa;na=wa;oa=ua;la=va}else{xa=pa;ya=wa;za=ua;Aa=va;break}}}else{xa=p;ya=o;za=qa;Aa=Q}oa=dn(32,0,k|0,((k|0)<0)<<31>>31|0)|0;na=en(xa|0,ya|0,oa|0,I|0)|0;oa=I;if(0>(oa|0)|0==(oa|0)&j>>>0>na>>>0){Ba=(na|0)<0?0:na}else{Ba=j}do{if((Ba|0)<53){la=+(r|0);va=+Lb(+(+Ym(1.0,84-Ba|0)),+la);if(!((Ba|0)<32&Aa!=0.0)){Ca=la;Da=va;Ea=za;Fa=Aa;break}na=za&1;Ca=la;Da=va;Ea=(na^1)+za|0;Fa=(na|0)==0?0.0:Aa}else{Ca=+(r|0);Da=0.0;Ea=za;Fa=Aa}}while(0);va=Ca*Fa+(Da+Ca*+(Ea>>>0))-Da;if(!(va!=0.0)){c[(Hb()|0)>>2]=34}l=+Zm(va,xa);i=g;return+l}else{C=w}}while(0);o=k+j|0;p=0-o|0;na=C;oa=0;while(1){if((na|0)==46){v=139;break}else if((na|0)!=48){Ga=na;Ha=0;Ia=0;Ja=oa;Ka=0;break}ma=c[e>>2]|0;if(ma>>>0<(c[m>>2]|0)>>>0){c[e>>2]=ma+1;na=d[ma]|0;oa=1;continue}else{na=Xm(b)|0;oa=1;continue}}d:do{if((v|0)==139){na=c[e>>2]|0;if(na>>>0<(c[m>>2]|0)>>>0){c[e>>2]=na+1;Ma=d[na]|0}else{Ma=Xm(b)|0}if((Ma|0)==48){Oa=-1;Pa=-1}else{Ga=Ma;Ha=0;Ia=0;Ja=oa;Ka=1;break}while(1){na=c[e>>2]|0;if(na>>>0<(c[m>>2]|0)>>>0){c[e>>2]=na+1;Qa=d[na]|0}else{Qa=Xm(b)|0}if((Qa|0)!=48){Ga=Qa;Ha=Oa;Ia=Pa;Ja=1;Ka=1;break d}na=en(Oa|0,Pa|0,-1,-1)|0;Oa=na;Pa=I}}}while(0);oa=h;c[oa>>2]=0;na=Ga+ -48|0;ma=(Ga|0)==46;e:do{if(na>>>0<10|ma){n=h+496|0;q=Ga;wa=ma;pa=na;Ra=0;Sa=0;Ta=Ha;Ua=Ia;Va=Ja;Wa=Ka;Xa=0;Ya=0;Za=0;while(1){do{if(wa){if((Wa|0)==0){_a=Ra;$a=Sa;ab=Ra;bb=Sa;cb=Va;db=1;eb=Xa;fb=Ya;gb=Za}else{hb=q;ib=Ra;jb=Sa;kb=Ta;lb=Ua;mb=Va;nb=Xa;ob=Ya;pb=Za;break e}}else{qb=en(Ra|0,Sa|0,1,0)|0;rb=I;sb=(q|0)!=48;if((Ya|0)>=125){if(!sb){_a=Ta;$a=Ua;ab=qb;bb=rb;cb=Va;db=Wa;eb=Xa;fb=Ya;gb=Za;break}c[n>>2]=c[n>>2]|1;_a=Ta;$a=Ua;ab=qb;bb=rb;cb=Va;db=Wa;eb=Xa;fb=Ya;gb=Za;break}tb=h+(Ya<<2)|0;if((Xa|0)==0){ub=pa}else{ub=q+ -48+((c[tb>>2]|0)*10|0)|0}c[tb>>2]=ub;tb=Xa+1|0;vb=(tb|0)==9;_a=Ta;$a=Ua;ab=qb;bb=rb;cb=1;db=Wa;eb=vb?0:tb;fb=(vb&1)+Ya|0;gb=sb?qb:Za}}while(0);qb=c[e>>2]|0;if(qb>>>0<(c[m>>2]|0)>>>0){c[e>>2]=qb+1;wb=d[qb]|0}else{wb=Xm(b)|0}qb=wb+ -48|0;sb=(wb|0)==46;if(qb>>>0<10|sb){q=wb;wa=sb;pa=qb;Ra=ab;Sa=bb;Ta=_a;Ua=$a;Va=cb;Wa=db;Xa=eb;Ya=fb;Za=gb}else{xb=wb;yb=ab;zb=bb;Ab=_a;Bb=$a;Cb=cb;Db=db;Eb=eb;Fb=fb;Gb=gb;v=162;break}}}else{xb=Ga;yb=0;zb=0;Ab=Ha;Bb=Ia;Cb=Ja;Db=Ka;Eb=0;Fb=0;Gb=0;v=162}}while(0);if((v|0)==162){na=(Db|0)==0;hb=xb;ib=yb;jb=zb;kb=na?yb:Ab;lb=na?zb:Bb;mb=Cb;nb=Eb;ob=Fb;pb=Gb}na=(mb|0)!=0;do{if(na){if((hb|32|0)!=101){v=171;break}ma=Vm(b,f)|0;Za=I;do{if((ma|0)==0&(Za|0)==-2147483648){if(u){Wm(b,0);l=0.0;i=g;return+l}else{if((c[m>>2]|0)==0){Ib=0;Jb=0;break}c[e>>2]=(c[e>>2]|0)+ -1;Ib=0;Jb=0;break}}else{Ib=ma;Jb=Za}}while(0);Za=en(Ib|0,Jb|0,kb|0,lb|0)|0;Kb=Za;Mb=I}else{v=171}}while(0);do{if((v|0)==171){if(!((hb|0)>-1)){Kb=kb;Mb=lb;break}if((c[m>>2]|0)==0){Kb=kb;Mb=lb;break}c[e>>2]=(c[e>>2]|0)+ -1;Kb=kb;Mb=lb}}while(0);if(!na){c[(Hb()|0)>>2]=22;Wm(b,0);l=0.0;i=g;return+l}Za=c[oa>>2]|0;if((Za|0)==0){l=+(r|0)*0.0;i=g;return+l}do{if((Kb|0)==(ib|0)&(Mb|0)==(jb|0)&((jb|0)<0|(jb|0)==0&ib>>>0<10)){if(!(j>>>0>30)){if((Za>>>j|0)!=0){break}}l=+(r|0)*+(Za>>>0);i=g;return+l}}while(0);Za=(k|0)/-2|0;na=((Za|0)<0)<<31>>31;if((Mb|0)>(na|0)|(Mb|0)==(na|0)&Kb>>>0>Za>>>0){c[(Hb()|0)>>2]=34;l=+(r|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+l}Za=k+ -106|0;na=((Za|0)<0)<<31>>31;if((Mb|0)<(na|0)|(Mb|0)==(na|0)&Kb>>>0<Za>>>0){c[(Hb()|0)>>2]=34;l=+(r|0)*2.2250738585072014e-308*2.2250738585072014e-308;i=g;return+l}if((nb|0)==0){Nb=ob}else{if((nb|0)<9){Za=h+(ob<<2)|0;na=c[Za>>2]|0;ma=nb;do{na=na*10|0;ma=ma+1|0;}while((ma|0)!=9);c[Za>>2]=na}Nb=ob+1|0}do{if((pb|0)<9){if(!((pb|0)<=(Kb|0)&(Kb|0)<18)){break}if((Kb|0)==9){l=+(r|0)*+((c[oa>>2]|0)>>>0);i=g;return+l}if((Kb|0)<9){l=+(r|0)*+((c[oa>>2]|0)>>>0)/+(c[16232+(8-Kb<<2)>>2]|0);i=g;return+l}ma=j+27+(ea(Kb,-3)|0)|0;Ya=c[oa>>2]|0;if((ma|0)<=30){if((Ya>>>ma|0)!=0){break}}l=+(r|0)*+(Ya>>>0)*+(c[16232+(Kb+ -10<<2)>>2]|0);i=g;return+l}}while(0);oa=(Kb|0)%9|0;if((oa|0)==0){Ob=0;Pb=0;Qb=Kb;Rb=Nb}else{na=(Kb|0)>-1?oa:oa+9|0;oa=c[16232+(8-na<<2)>>2]|0;do{if((Nb|0)==0){Sb=0;Tb=Kb;Ub=0}else{Za=1e9/(oa|0)|0;Ya=0;ma=0;Xa=0;Wa=Kb;while(1){Va=h+(Xa<<2)|0;Ua=c[Va>>2]|0;Ta=((Ua>>>0)/(oa>>>0)|0)+ma|0;c[Va>>2]=Ta;Vb=ea((Ua>>>0)%(oa>>>0)|0,Za)|0;Ua=Xa+1|0;if((Xa|0)==(Ya|0)&(Ta|0)==0){Wb=Ua&127;Xb=Wa+ -9|0}else{Wb=Ya;Xb=Wa}if((Ua|0)==(Nb|0)){break}else{Ya=Wb;Wa=Xb;Xa=Ua;ma=Vb}}if((Vb|0)==0){Sb=Wb;Tb=Xb;Ub=Nb;break}c[h+(Nb<<2)>>2]=Vb;Sb=Wb;Tb=Xb;Ub=Nb+1|0}}while(0);Ob=Sb;Pb=0;Qb=9-na+Tb|0;Rb=Ub}f:while(1){oa=h+(Ob<<2)|0;if((Qb|0)<18){ma=Pb;Xa=Rb;while(1){Wa=0;Ya=Xa+127|0;Za=Xa;while(1){Ua=Ya&127;Ta=h+(Ua<<2)|0;Va=kn(c[Ta>>2]|0,0,29)|0;Sa=en(Va|0,I|0,Wa|0,0)|0;Va=I;if(Va>>>0>0|(Va|0)==0&Sa>>>0>1e9){Ra=sn(Sa|0,Va|0,1e9,0)|0;pa=tn(Sa|0,Va|0,1e9,0)|0;Yb=pa;Zb=Ra}else{Yb=Sa;Zb=0}c[Ta>>2]=Yb;Ta=(Ua|0)==(Ob|0);if((Ua|0)!=(Za+127&127|0)|Ta){_b=Za}else{_b=(Yb|0)==0?Ua:Za}if(Ta){break}else{Wa=Zb;Ya=Ua+ -1|0;Za=_b}}Za=ma+ -29|0;if((Zb|0)==0){ma=Za;Xa=_b}else{$b=Za;ac=Zb;bc=_b;break}}}else{if((Qb|0)==18){cc=Pb;dc=Rb}else{ec=Ob;fc=Pb;gc=Qb;hc=Rb;break}while(1){if(!((c[oa>>2]|0)>>>0<9007199)){ec=Ob;fc=cc;gc=18;hc=dc;break f}Xa=0;ma=dc+127|0;Za=dc;while(1){Ya=ma&127;Wa=h+(Ya<<2)|0;Ua=kn(c[Wa>>2]|0,0,29)|0;Ta=en(Ua|0,I|0,Xa|0,0)|0;Ua=I;if(Ua>>>0>0|(Ua|0)==0&Ta>>>0>1e9){Sa=sn(Ta|0,Ua|0,1e9,0)|0;Ra=tn(Ta|0,Ua|0,1e9,0)|0;ic=Ra;jc=Sa}else{ic=Ta;jc=0}c[Wa>>2]=ic;Wa=(Ya|0)==(Ob|0);if((Ya|0)!=(Za+127&127|0)|Wa){kc=Za}else{kc=(ic|0)==0?Ya:Za}if(Wa){break}else{Xa=jc;ma=Ya+ -1|0;Za=kc}}Za=cc+ -29|0;if((jc|0)==0){cc=Za;dc=kc}else{$b=Za;ac=jc;bc=kc;break}}}oa=Ob+127&127;if((oa|0)==(bc|0)){Za=bc+127&127;ma=h+((bc+126&127)<<2)|0;c[ma>>2]=c[ma>>2]|c[h+(Za<<2)>>2];lc=Za}else{lc=bc}c[h+(oa<<2)>>2]=ac;Ob=oa;Pb=$b;Qb=Qb+9|0;Rb=lc}g:while(1){mc=hc+1&127;na=h+((hc+127&127)<<2)|0;oa=ec;Za=fc;ma=gc;while(1){Xa=(ma|0)==18;Ya=(ma|0)>27?9:1;nc=oa;oc=Za;while(1){Wa=0;while(1){Ta=Wa+nc&127;if((Ta|0)==(hc|0)){pc=2;break}Sa=c[h+(Ta<<2)>>2]|0;Ta=c[16224+(Wa<<2)>>2]|0;if(Sa>>>0<Ta>>>0){pc=2;break}Ra=Wa+1|0;if(Sa>>>0>Ta>>>0){pc=Wa;break}if((Ra|0)<2){Wa=Ra}else{pc=Ra;break}}if((pc|0)==2&Xa){break g}qc=Ya+oc|0;if((nc|0)==(hc|0)){nc=hc;oc=qc}else{break}}Xa=(1<<Ya)+ -1|0;Wa=1e9>>>Ya;rc=nc;sc=0;Ra=nc;tc=ma;do{Ta=h+(Ra<<2)|0;Sa=c[Ta>>2]|0;Ua=(Sa>>>Ya)+sc|0;c[Ta>>2]=Ua;sc=ea(Sa&Xa,Wa)|0;Sa=(Ra|0)==(rc|0)&(Ua|0)==0;Ra=Ra+1&127;tc=Sa?tc+ -9|0:tc;rc=Sa?Ra:rc;}while((Ra|0)!=(hc|0));if((sc|0)==0){oa=rc;Za=qc;ma=tc;continue}if((mc|0)!=(rc|0)){break}c[na>>2]=c[na>>2]|1;oa=rc;Za=qc;ma=tc}c[h+(hc<<2)>>2]=sc;ec=rc;fc=qc;gc=tc;hc=mc}ma=nc&127;if((ma|0)==(hc|0)){c[h+(mc+ -1<<2)>>2]=0;uc=mc}else{uc=hc}va=+((c[h+(ma<<2)>>2]|0)>>>0);ma=nc+1&127;if((ma|0)==(uc|0)){Za=uc+1&127;c[h+(Za+ -1<<2)>>2]=0;vc=Za}else{vc=uc}la=+(r|0);wc=la*(va*1.0e9+ +((c[h+(ma<<2)>>2]|0)>>>0));ma=oc+53|0;Za=ma-k|0;if((Za|0)<(j|0)){xc=(Za|0)<0?0:Za;yc=1}else{xc=j;yc=0}if((xc|0)<53){va=+Lb(+(+Ym(1.0,105-xc|0)),+wc);zc=+La(+wc,+(+Ym(1.0,53-xc|0)));Ac=va;Bc=zc;Cc=va+(wc-zc)}else{Ac=0.0;Bc=0.0;Cc=wc}oa=nc+2&127;do{if((oa|0)==(vc|0)){Dc=Bc}else{na=c[h+(oa<<2)>>2]|0;do{if(na>>>0<5e8){if((na|0)==0){if((nc+3&127|0)==(vc|0)){Ec=Bc;break}}Ec=la*.25+Bc}else{if(na>>>0>5e8){Ec=la*.75+Bc;break}if((nc+3&127|0)==(vc|0)){Ec=la*.5+Bc;break}else{Ec=la*.75+Bc;break}}}while(0);if((53-xc|0)<=1){Dc=Ec;break}if(+La(+Ec,1.0)!=0.0){Dc=Ec;break}Dc=Ec+1.0}}while(0);la=Cc+Dc-Ac;do{if((ma&2147483647|0)>(-2-o|0)){if(!(+T(+la)>=9007199254740992.0)){Fc=yc;Gc=oc;Hc=la}else{Fc=(yc|0)!=0&(xc|0)==(Za|0)?0:yc;Gc=oc+1|0;Hc=la*.5}if((Gc+50|0)<=(p|0)){if(!((Fc|0)!=0&Dc!=0.0)){Ic=Gc;Jc=Hc;break}}c[(Hb()|0)>>2]=34;Ic=Gc;Jc=Hc}else{Ic=oc;Jc=la}}while(0);l=+Zm(Jc,Ic);i=g;return+l}else if((z|0)==3){p=c[e>>2]|0;if(p>>>0<(c[m>>2]|0)>>>0){c[e>>2]=p+1;Kc=d[p]|0}else{Kc=Xm(b)|0}if((Kc|0)==40){Lc=1}else{if((c[m>>2]|0)==0){l=x;i=g;return+l}c[e>>2]=(c[e>>2]|0)+ -1;l=x;i=g;return+l}while(1){p=c[e>>2]|0;if(p>>>0<(c[m>>2]|0)>>>0){c[e>>2]=p+1;Mc=d[p]|0}else{Mc=Xm(b)|0}if(!((Mc+ -48|0)>>>0<10|(Mc+ -65|0)>>>0<26)){if(!((Mc+ -97|0)>>>0<26|(Mc|0)==95)){break}}Lc=Lc+1|0}if((Mc|0)==41){l=x;i=g;return+l}p=(c[m>>2]|0)==0;if(!p){c[e>>2]=(c[e>>2]|0)+ -1}if(u){c[(Hb()|0)>>2]=22;Wm(b,0);l=0.0;i=g;return+l}if((Lc|0)==0|p){l=x;i=g;return+l}else{Nc=Lc}while(1){p=Nc+ -1|0;c[e>>2]=(c[e>>2]|0)+ -1;if((p|0)==0){l=x;break}else{Nc=p}}i=g;return+l}else{if((c[m>>2]|0)!=0){c[e>>2]=(c[e>>2]|0)+ -1}c[(Hb()|0)>>2]=22;Wm(b,0);l=0.0;i=g;return+l}}}while(0);do{if((v|0)==23){b=(c[m>>2]|0)==0;if(!b){c[e>>2]=(c[e>>2]|0)+ -1}if(t>>>0<4|(f|0)==0|b){break}else{Oc=t}do{c[e>>2]=(c[e>>2]|0)+ -1;Oc=Oc+ -1|0;}while(Oc>>>0>3)}}while(0);l=+(r|0)*y;i=g;return+l}function Vm(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=i;f=a+4|0;g=c[f>>2]|0;h=a+100|0;if(g>>>0<(c[h>>2]|0)>>>0){c[f>>2]=g+1;j=d[g]|0}else{j=Xm(a)|0}do{if((j|0)==43|(j|0)==45){g=(j|0)==45|0;k=c[f>>2]|0;if(k>>>0<(c[h>>2]|0)>>>0){c[f>>2]=k+1;l=d[k]|0}else{l=Xm(a)|0}if((l+ -48|0)>>>0<10|(b|0)==0){m=l;n=g;break}if((c[h>>2]|0)==0){m=l;n=g;break}c[f>>2]=(c[f>>2]|0)+ -1;m=l;n=g}else{m=j;n=0}}while(0);if((m+ -48|0)>>>0>9){if((c[h>>2]|0)==0){o=0;p=-2147483648;I=p;i=e;return o|0}c[f>>2]=(c[f>>2]|0)+ -1;o=0;p=-2147483648;I=p;i=e;return o|0}else{q=m;r=0}while(1){s=q+ -48+r|0;m=c[f>>2]|0;if(m>>>0<(c[h>>2]|0)>>>0){c[f>>2]=m+1;t=d[m]|0}else{t=Xm(a)|0}if(!((t+ -48|0)>>>0<10&(s|0)<214748364)){break}q=t;r=s*10|0}r=((s|0)<0)<<31>>31;if((t+ -48|0)>>>0<10){q=s;m=r;j=t;while(1){l=rn(q|0,m|0,10,0)|0;b=I;g=en(j|0,((j|0)<0)<<31>>31|0,-48,-1)|0;k=en(g|0,I|0,l|0,b|0)|0;b=I;l=c[f>>2]|0;if(l>>>0<(c[h>>2]|0)>>>0){c[f>>2]=l+1;u=d[l]|0}else{u=Xm(a)|0}if((u+ -48|0)>>>0<10&((b|0)<21474836|(b|0)==21474836&k>>>0<2061584302)){j=u;m=b;q=k}else{v=k;w=b;x=u;break}}}else{v=s;w=r;x=t}if((x+ -48|0)>>>0<10){do{x=c[f>>2]|0;if(x>>>0<(c[h>>2]|0)>>>0){c[f>>2]=x+1;y=d[x]|0}else{y=Xm(a)|0}}while((y+ -48|0)>>>0<10)}if((c[h>>2]|0)!=0){c[f>>2]=(c[f>>2]|0)+ -1}f=(n|0)!=0;n=dn(0,0,v|0,w|0)|0;o=f?n:v;p=f?I:w;I=p;i=e;return o|0}function Wm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a+104>>2]=b;e=c[a+8>>2]|0;f=c[a+4>>2]|0;g=e-f|0;c[a+108>>2]=g;if((b|0)!=0&(g|0)>(b|0)){c[a+100>>2]=f+b;i=d;return}else{c[a+100>>2]=e;i=d;return}}function Xm(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=b+104|0;g=c[f>>2]|0;if((g|0)==0){h=3}else{if((c[b+108>>2]|0)<(g|0)){h=3}}do{if((h|0)==3){g=$m(b)|0;if((g|0)<0){break}j=c[f>>2]|0;k=c[b+8>>2]|0;do{if((j|0)==0){h=8}else{l=c[b+4>>2]|0;m=j-(c[b+108>>2]|0)+ -1|0;if((k-l|0)<=(m|0)){h=8;break}c[b+100>>2]=l+m}}while(0);if((h|0)==8){c[b+100>>2]=k}j=c[b+4>>2]|0;if((k|0)!=0){m=b+108|0;c[m>>2]=k+1-j+(c[m>>2]|0)}m=j+ -1|0;if((d[m]|0|0)==(g|0)){n=g;i=e;return n|0}a[m]=g;n=g;i=e;return n|0}}while(0);c[b+100>>2]=0;n=-1;i=e;return n|0}function Ym(a,b){a=+a;b=b|0;var d=0,e=0.0,f=0,g=0,j=0.0;d=i;do{if((b|0)>1023){e=a*8.98846567431158e+307;f=b+ -1023|0;if((f|0)<=1023){g=f;j=e;break}f=b+ -2046|0;g=(f|0)>1023?1023:f;j=e*8.98846567431158e+307}else{if(!((b|0)<-1022)){g=b;j=a;break}e=a*2.2250738585072014e-308;f=b+1022|0;if(!((f|0)<-1022)){g=f;j=e;break}f=b+2044|0;g=(f|0)<-1022?-1022:f;j=e*2.2250738585072014e-308}}while(0);b=kn(g+1023|0,0,52)|0;g=I;c[k>>2]=b;c[k+4>>2]=g;a=j*+h[k>>3];i=d;return+a}function Zm(a,b){a=+a;b=b|0;var c=0,d=0.0;c=i;d=+Ym(a,b);i=c;return+d}function _m(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=b+74|0;f=a[e]|0;a[e]=f+255|f;f=b+20|0;e=b+44|0;if((c[f>>2]|0)>>>0>(c[e>>2]|0)>>>0){ec[c[b+36>>2]&31](b,0,0)|0}c[b+16>>2]=0;c[b+28>>2]=0;c[f>>2]=0;f=b;g=c[f>>2]|0;if((g&20|0)==0){h=c[e>>2]|0;c[b+8>>2]=h;c[b+4>>2]=h;j=0;i=d;return j|0}if((g&4|0)==0){j=-1;i=d;return j|0}c[f>>2]=g|32;j=-1;i=d;return j|0}function $m(a){a=a|0;var b=0,e=0,f=0,g=0;b=i;i=i+8|0;e=b;if((c[a+8>>2]|0)==0){if((_m(a)|0)==0){f=3}else{g=-1}}else{f=3}do{if((f|0)==3){if((ec[c[a+32>>2]&31](a,e,1)|0)!=1){g=-1;break}g=d[e]|0}}while(0);i=b;return g|0}function an(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0.0,j=0,k=0;d=i;i=i+112|0;e=d;f=e+0|0;g=f+112|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));f=e+4|0;c[f>>2]=a;g=e+8|0;c[g>>2]=-1;c[e+44>>2]=a;c[e+76>>2]=-1;Wm(e,0);h=+Um(e,2,1);j=(c[f>>2]|0)-(c[g>>2]|0)+(c[e+108>>2]|0)|0;if((b|0)==0){i=d;return+h}if((j|0)==0){k=a}else{k=a+j|0}c[b>>2]=k;i=d;return+h}function bn(){c[1054]=o;c[1080]=o;c[3818]=o;c[4048]=o}function cn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function dn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return(I=e,a-c>>>0|0)|0}function en(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return(I=b+d+(e>>>0<a>>>0|0)>>>0,e|0)|0}function fn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return kb(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function gn(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b]=a[c]|0}b=e}else{fn(b,c,d)|0}return b|0}function hn(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function jn(b){b=b|0;var c=0;c=a[n+(b>>>24)|0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)|0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)|0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)|0]|0)+24|0}function kn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}I=a<<c-32;return 0}function ln(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}I=0;return b>>>c-32|0}function mn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b>>c;return a>>>c|(b&(1<<c)-1)<<32-c}I=(b|0)<0?-1:0;return b>>c-32|0}function nn(b){b=b|0;var c=0;c=a[m+(b&255)|0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)|0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)|0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)|0]|0)+24|0}function on(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=ea(d,c)|0;f=a>>>16;a=(e>>>16)+(ea(d,f)|0)|0;d=b>>>16;b=ea(d,c)|0;return(I=(a>>>16)+(ea(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function pn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=dn(e^a,f^b,e,f)|0;b=I;a=g^e;e=h^f;f=dn((un(i,b,dn(g^c,h^d,g,h)|0,I,0)|0)^a,I^e,a,e)|0;return(I=I,f)|0}function qn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+8|0;g=f|0;h=b>>31|((b|0)<0?-1:0)<<1;j=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;k=e>>31|((e|0)<0?-1:0)<<1;l=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;m=dn(h^a,j^b,h,j)|0;b=I;un(m,b,dn(k^d,l^e,k,l)|0,I,g)|0;l=dn(c[g>>2]^h,c[g+4>>2]^j,h,j)|0;j=I;i=f;return(I=j,l)|0}function rn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=on(e,a)|0;f=I;return(I=(ea(b,a)|0)+(ea(d,e)|0)+f|f&0,c|0|0)|0}function sn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=un(a,b,c,d,0)|0;return(I=I,e)|0}function tn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+8|0;g=f|0;un(a,b,d,e,g)|0;i=f;return(I=c[g+4>>2]|0,c[g>>2]|0)|0}function un(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0;g=a;h=b;i=h;j=d;k=e;l=k;if((i|0)==0){m=(f|0)!=0;if((l|0)==0){if(m){c[f>>2]=(g>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return(I=n,o)|0}else{if(!m){n=0;o=0;return(I=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return(I=n,o)|0}}m=(l|0)==0;do{if((j|0)==0){if(m){if((f|0)!=0){c[f>>2]=(i>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return(I=n,o)|0}if((g|0)==0){if((f|0)!=0){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(l>>>0)}n=0;o=(i>>>0)/(l>>>0)>>>0;return(I=n,o)|0}p=l-1|0;if((p&l|0)==0){if((f|0)!=0){c[f>>2]=a|0;c[f+4>>2]=p&i|b&0}n=0;o=i>>>((nn(l|0)|0)>>>0);return(I=n,o)|0}p=(jn(l|0)|0)-(jn(i|0)|0)|0;if(p>>>0<=30){q=p+1|0;r=31-p|0;s=q;t=i<<r|g>>>(q>>>0);u=i>>>(q>>>0);v=0;w=g<<r;break}if((f|0)==0){n=0;o=0;return(I=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(I=n,o)|0}else{if(!m){r=(jn(l|0)|0)-(jn(i|0)|0)|0;if(r>>>0<=31){q=r+1|0;p=31-r|0;x=r-31>>31;s=q;t=g>>>(q>>>0)&x|i<<p;u=i>>>(q>>>0)&x;v=0;w=g<<p;break}if((f|0)==0){n=0;o=0;return(I=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(I=n,o)|0}p=j-1|0;if((p&j|0)!=0){x=(jn(j|0)|0)+33-(jn(i|0)|0)|0;q=64-x|0;r=32-x|0;y=r>>31;z=x-32|0;A=z>>31;s=x;t=r-1>>31&i>>>(z>>>0)|(i<<r|g>>>(x>>>0))&A;u=A&i>>>(x>>>0);v=g<<q&y;w=(i<<q|g>>>(z>>>0))&y|g<<r&x-33>>31;break}if((f|0)!=0){c[f>>2]=p&g;c[f+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return(I=n,o)|0}else{p=nn(j|0)|0;n=i>>>(p>>>0)|0;o=i<<32-p|g>>>(p>>>0)|0;return(I=n,o)|0}}}while(0);if((s|0)==0){B=w;C=v;D=u;E=t;F=0;G=0}else{g=d|0|0;d=k|e&0;e=en(g,d,-1,-1)|0;k=I;i=w;w=v;v=u;u=t;t=s;s=0;while(1){H=w>>>31|i<<1;J=s|w<<1;j=u<<1|i>>>31|0;a=u>>>31|v<<1|0;dn(e,k,j,a)|0;b=I;h=b>>31|((b|0)<0?-1:0)<<1;K=h&1;L=dn(j,a,h&g,(((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1)&d)|0;M=I;b=t-1|0;if((b|0)==0){break}else{i=H;w=J;v=M;u=L;t=b;s=K}}B=H;C=J;D=M;E=L;F=0;G=K}K=C;C=0;if((f|0)!=0){c[f>>2]=E;c[f+4>>2]=D}n=(K|0)>>>31|(B|C)<<1|(C<<1|K>>>31)&0|F;o=(K<<1|0>>>31)&-2|G;return(I=n,o)|0}function vn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ec[a&31](b|0,c|0,d|0)|0}function wn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;fc[a&63](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function xn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;gc[a&3](b|0,c|0,d|0,e|0,f|0)}function yn(a,b){a=a|0;b=b|0;hc[a&127](b|0)}function zn(a,b,c){a=a|0;b=b|0;c=c|0;ic[a&63](b|0,c|0)}function An(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;jc[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function Bn(a,b){a=a|0;b=b|0;return kc[a&63](b|0)|0}function Cn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=+h;lc[a&3](b|0,c|0,d|0,e|0,f|0,g|0,+h)}function Dn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;mc[a&3](b|0,c|0,d|0)}function En(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;nc[a&7](b|0,c|0,d|0,e|0,f|0,+g)}function Fn(a){a=a|0;oc[a&0]()}function Gn(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;return pc[a&15](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)|0}function Hn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return qc[a&7](b|0,c|0,d|0,e|0)|0}function In(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;rc[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)}function Jn(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;sc[a&15](b|0,c|0,d|0,e|0,f|0,g|0)}function Kn(a,b,c){a=a|0;b=b|0;c=c|0;return tc[a&15](b|0,c|0)|0}function Ln(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return uc[a&15](b|0,c|0,d|0,e|0,f|0)|0}function Mn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;vc[a&7](b|0,c|0,d|0,e|0)}function Nn(a,b,c){a=a|0;b=b|0;c=c|0;fa(0);return 0}function On(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;fa(1)}function Pn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;fa(2)}function Qn(a){a=a|0;fa(3)}function Rn(a,b){a=a|0;b=b|0;fa(4)}function Sn(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;fa(5)}function Tn(a){a=a|0;fa(6);return 0}function Un(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;fa(7)}function Vn(a,b,c){a=a|0;b=b|0;c=c|0;fa(8)}function Wn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;fa(9)}function Xn(){fa(10)}function Yn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;fa(11);return 0}function Zn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;fa(12);return 0}function _n(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;fa(13)}function $n(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;fa(14)}function ao(a,b){a=a|0;b=b|0;fa(15);return 0}function bo(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;fa(16);return 0}function co(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;fa(17)}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nvar ec=[Nn,gf,mf,xd,qf,Ue,Ze,Ld,bf,je,ke,Yf,bg,Fj,Kj,pk,rk,uk,ak,fk,hk,kk,wm,Nn,Nn,Nn,Nn,Nn,Nn,Nn,Nn,Nn];var fc=[On,eg,gg,ig,kg,mg,og,qg,sg,ug,wg,yg,Dg,Fg,Hg,Jg,Lg,Ng,Pg,Rg,Tg,Vg,Xg,kh,mh,yh,Ah,Jh,Kh,Lh,Mh,Nh,Wh,Xh,Yh,Zh,_h,wj,Cj,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On,On];var gc=[Pn,Dm,Cm,Bm];var hc=[Qn,td,ud,Ad,Bd,Hd,Id,Od,Pd,$d,_d,ee,de,ge,pe,oe,Se,Re,ef,df,tf,sf,vf,uf,yf,xf,Af,zf,Df,Cf,Ff,Ef,If,Hf,Kf,Jf,Qf,Pf,Oe,Rf,Of,Sf,Uf,Tf,Zj,_f,Zf,dg,cg,Cg,Bg,eh,dh,th,sh,Hh,Gh,Uh,Th,ei,di,hi,gi,li,ki,wi,vi,Hi,Gi,Si,Ri,bj,aj,lj,kj,sj,rj,yj,xj,Ej,Dj,Jj,Ij,Sj,Rj,nk,mk,Nj,Ek,jl,il,ll,kl,Vf,Yj,$j,wk,Mk,Xk,gl,hl,om,nm,qm,tm,rm,sm,um,vm,Rm,Qm,Mc,sd,_j,Tl,dj,Im,_l,Zl,Yl,Xl,Wl,Vl,ve,Ge,Qn,Qn,Qn];var ic=[Rn,vd,Cd,Jd,Qd,Te,ff,oi,pi,qi,ri,ti,ui,zi,Ai,Bi,Ci,Ei,Fi,Ki,Li,Mi,Ni,Pi,Qi,Vi,Wi,Xi,Yi,_i,$i,Hj,Mj,ql,sl,ul,rl,tl,vl,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn,Rn];var jc=[Sn,Oh,$h,Sn];var kc=[Tn,wd,lf,nf,of,kf,Dd,Ed,Kd,Ye,_e,$e,Xe,Rd,Sd,ae,fe,Mf,Ih,wl,yl,Al,Gl,Il,Cl,El,Vh,xl,zl,Bl,Hl,Jl,Dl,Fl,mi,ni,si,xi,yi,Di,Ii,Ji,Oi,Ti,Ui,Zi,Ik,Jk,Lk,ml,ol,nl,pl,Ak,Bk,Dk,Sk,Tk,Wk,bl,cl,fl,pm,Sm];var lc=[Un,tj,zj,Un];var mc=[Vn,ie,Nf,Vn];var nc=[Wn,nh,qh,Bh,Dh,Wn,Wn,Wn];var oc=[Xn];var pc=[Yn,Fk,Gk,xk,yk,Nk,Pk,Yk,_k,Yn,Yn,Yn,Yn,Yn,Yn,Yn];var qc=[Zn,tk,bk,ck,dk,jk,Zn,Zn];var rc=[_n,fi,ii,cj,gj,mj,oj,_n];var sc=[$n,hf,Ve,fh,gh,lh,rh,uh,vh,zh,Eh,Gj,Lj,Gm,Fm,Em];var tc=[ao,pf,yd,Fd,rf,af,Md,Td,cf,ok,qk,sk,ek,gk,ik,ao];var uc=[bo,Wf,$f,vk,Hk,Kk,lk,zk,Ck,Rk,Uk,al,dl,bo,bo,bo];var vc=[co,jf,We,Xf,ag,xm,ym,zm];return{_i64Subtract:dn,_free:Im,_main:Wc,_realloc:Jm,_i64Add:en,_memmove:gn,_strlen:hn,_memset:cn,_malloc:Hm,_memcpy:fn,_llvm_ctlz_i32:jn,_bitshift64Shl:kn,__GLOBAL__I_a:ld,__GLOBAL__I_a18:Vd,runPostSets:bn,stackAlloc:wc,stackSave:xc,stackRestore:yc,setThrew:zc,setTempRet0:Cc,setTempRet1:Dc,setTempRet2:Ec,setTempRet3:Fc,setTempRet4:Gc,setTempRet5:Hc,setTempRet6:Ic,setTempRet7:Jc,setTempRet8:Kc,setTempRet9:Lc,dynCall_iiii:vn,dynCall_viiiiiii:wn,dynCall_viiiii:xn,dynCall_vi:yn,dynCall_vii:zn,dynCall_viiiiiiiii:An,dynCall_ii:Bn,dynCall_viiiiiid:Cn,dynCall_viii:Dn,dynCall_viiiiid:En,dynCall_v:Fn,dynCall_iiiiiiiii:Gn,dynCall_iiiii:Hn,dynCall_viiiiiiii:In,dynCall_viiiiii:Jn,dynCall_iii:Kn,dynCall_iiiiii:Ln,dynCall_viiii:Mn}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"invoke_iiii\": invoke_iiii, \"invoke_viiiiiii\": invoke_viiiiiii, \"invoke_viiiii\": invoke_viiiii, \"invoke_vi\": invoke_vi, \"invoke_vii\": invoke_vii, \"invoke_viiiiiiiii\": invoke_viiiiiiiii, \"invoke_ii\": invoke_ii, \"invoke_viiiiiid\": invoke_viiiiiid, \"invoke_viii\": invoke_viii, \"invoke_viiiiid\": invoke_viiiiid, \"invoke_v\": invoke_v, \"invoke_iiiiiiiii\": invoke_iiiiiiiii, \"invoke_iiiii\": invoke_iiiii, \"invoke_viiiiiiii\": invoke_viiiiiiii, \"invoke_viiiiii\": invoke_viiiiii, \"invoke_iii\": invoke_iii, \"invoke_iiiiii\": invoke_iiiiii, \"invoke_viiii\": invoke_viiii, \"_fabs\": _fabs, \"_pthread_cond_wait\": _pthread_cond_wait, \"_llvm_lifetime_start\": _llvm_lifetime_start, \"_sprintf\": _sprintf, \"_send\": _send, \"_strtoll_l\": _strtoll_l, \"_vsscanf\": _vsscanf, \"___ctype_b_loc\": ___ctype_b_loc, \"__ZSt9terminatev\": __ZSt9terminatev, \"_fmod\": _fmod, \"___cxa_guard_acquire\": ___cxa_guard_acquire, \"_isspace\": _isspace, \"__reallyNegative\": __reallyNegative, \"___cxa_is_number_type\": ___cxa_is_number_type, \"_ungetc\": _ungetc, \"_fread\": _fread, \"__getFloat\": __getFloat, \"___cxa_allocate_exception\": ___cxa_allocate_exception, \"__ZSt18uncaught_exceptionv\": __ZSt18uncaught_exceptionv, \"_floor\": _floor, \"_isxdigit_l\": _isxdigit_l, \"_strtoll\": _strtoll, \"_fflush\": _fflush, \"___cxa_guard_release\": ___cxa_guard_release, \"__addDays\": __addDays, \"_pwrite\": _pwrite, \"_strerror_r\": _strerror_r, \"_strftime_l\": _strftime_l, \"_pthread_mutex_lock\": _pthread_mutex_lock, \"_sscanf\": _sscanf, \"_sbrk\": _sbrk, \"_uselocale\": _uselocale, \"_catgets\": _catgets, \"_newlocale\": _newlocale, \"_snprintf\": _snprintf, \"___cxa_begin_catch\": ___cxa_begin_catch, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"_asprintf\": _asprintf, \"__scanString\": __scanString, \"___resumeException\": ___resumeException, \"___cxa_find_matching_catch\": ___cxa_find_matching_catch, \"__exit\": __exit, \"_strtoull\": _strtoull, \"_strftime\": _strftime, \"_strtoull_l\": _strtoull_l, \"_freelocale\": _freelocale, \"__arraySum\": __arraySum, \"__formatString\": __formatString, \"___ctype_tolower_loc\": ___ctype_tolower_loc, \"_isdigit_l\": _isdigit_l, \"_fileno\": _fileno, \"_pthread_mutex_unlock\": _pthread_mutex_unlock, \"_pread\": _pread, \"_isxdigit\": _isxdigit, \"___ctype_toupper_loc\": ___ctype_toupper_loc, \"_log\": _log, \"_vasprintf\": _vasprintf, \"_write\": _write, \"__isLeapYear\": __isLeapYear, \"___errno_location\": ___errno_location, \"_recv\": _recv, \"_vsnprintf\": _vsnprintf, \"__ZNSt9exceptionD2Ev\": __ZNSt9exceptionD2Ev, \"_copysign\": _copysign, \"_fgetc\": _fgetc, \"_mkport\": _mkport, \"___cxa_does_inherit\": ___cxa_does_inherit, \"_sysconf\": _sysconf, \"_pthread_cond_broadcast\": _pthread_cond_broadcast, \"__parseInt64\": __parseInt64, \"_abort\": _abort, \"_catclose\": _catclose, \"_fwrite\": _fwrite, \"___cxa_throw\": ___cxa_throw, \"_isdigit\": _isdigit, \"_strerror\": _strerror, \"_llvm_lifetime_end\": _llvm_lifetime_end, \"_atexit\": _atexit, \"_catopen\": _catopen, \"_exit\": _exit, \"_time\": _time, \"_read\": _read, \"___setErrNo\": ___setErrNo, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"cttz_i8\": cttz_i8, \"ctlz_i8\": ctlz_i8, \"NaN\": NaN, \"Infinity\": Infinity, \"__ZTISt9exception\": __ZTISt9exception, \"___dso_handle\": ___dso_handle, \"_stderr\": _stderr, \"_stdin\": _stdin, \"_stdout\": _stdout }, buffer);\nvar _i64Subtract = Module[\"_i64Subtract\"] = asm[\"_i64Subtract\"];\nvar _free = Module[\"_free\"] = asm[\"_free\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _realloc = Module[\"_realloc\"] = asm[\"_realloc\"];\nvar _i64Add = Module[\"_i64Add\"] = asm[\"_i64Add\"];\nvar _memmove = Module[\"_memmove\"] = asm[\"_memmove\"];\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar _malloc = Module[\"_malloc\"] = asm[\"_malloc\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _llvm_ctlz_i32 = Module[\"_llvm_ctlz_i32\"] = asm[\"_llvm_ctlz_i32\"];\nvar _bitshift64Shl = Module[\"_bitshift64Shl\"] = asm[\"_bitshift64Shl\"];\nvar __GLOBAL__I_a = Module[\"__GLOBAL__I_a\"] = asm[\"__GLOBAL__I_a\"];\nvar __GLOBAL__I_a18 = Module[\"__GLOBAL__I_a18\"] = asm[\"__GLOBAL__I_a18\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\nvar dynCall_iiii = Module[\"dynCall_iiii\"] = asm[\"dynCall_iiii\"];\nvar dynCall_viiiiiii = Module[\"dynCall_viiiiiii\"] = asm[\"dynCall_viiiiiii\"];\nvar dynCall_viiiii = Module[\"dynCall_viiiii\"] = asm[\"dynCall_viiiii\"];\nvar dynCall_vi = Module[\"dynCall_vi\"] = asm[\"dynCall_vi\"];\nvar dynCall_vii = Module[\"dynCall_vii\"] = asm[\"dynCall_vii\"];\nvar dynCall_viiiiiiiii = Module[\"dynCall_viiiiiiiii\"] = asm[\"dynCall_viiiiiiiii\"];\nvar dynCall_ii = Module[\"dynCall_ii\"] = asm[\"dynCall_ii\"];\nvar dynCall_viiiiiid = Module[\"dynCall_viiiiiid\"] = asm[\"dynCall_viiiiiid\"];\nvar dynCall_viii = Module[\"dynCall_viii\"] = asm[\"dynCall_viii\"];\nvar dynCall_viiiiid = Module[\"dynCall_viiiiid\"] = asm[\"dynCall_viiiiid\"];\nvar dynCall_v = Module[\"dynCall_v\"] = asm[\"dynCall_v\"];\nvar dynCall_iiiiiiiii = Module[\"dynCall_iiiiiiiii\"] = asm[\"dynCall_iiiiiiiii\"];\nvar dynCall_iiiii = Module[\"dynCall_iiiii\"] = asm[\"dynCall_iiiii\"];\nvar dynCall_viiiiiiii = Module[\"dynCall_viiiiiiii\"] = asm[\"dynCall_viiiiiiii\"];\nvar dynCall_viiiiii = Module[\"dynCall_viiiiii\"] = asm[\"dynCall_viiiiii\"];\nvar dynCall_iii = Module[\"dynCall_iii\"] = asm[\"dynCall_iii\"];\nvar dynCall_iiiiii = Module[\"dynCall_iiiiii\"] = asm[\"dynCall_iiiiii\"];\nvar dynCall_viiii = Module[\"dynCall_viiii\"] = asm[\"dynCall_viiii\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// TODO: strip out parts of this we do not need\n\n//======= begin closure i64 code =======\n\n// Copyright 2009 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Defines a Long class for representing a 64-bit two's-complement\n * integer value, which faithfully simulates the behavior of a Java \"long\". This\n * implementation is derived from LongLib in GWT.\n *\n */\n\nvar i64Math = (function() { // Emscripten wrapper\n var goog = { math: {} };\n\n\n /**\n * Constructs a 64-bit two's-complement integer, given its low and high 32-bit\n * values as *signed* integers. See the from* functions below for more\n * convenient ways of constructing Longs.\n *\n * The internal representation of a long is the two given signed, 32-bit values.\n * We use 32-bit pieces because these are the size of integers on which\n * Javascript performs bit-operations. For operations like addition and\n * multiplication, we split each number into 16-bit pieces, which can easily be\n * multiplied within Javascript's floating-point representation without overflow\n * or change in sign.\n *\n * In the algorithms below, we frequently reduce the negative case to the\n * positive case by negating the input(s) and then post-processing the result.\n * Note that we must ALWAYS check specially whether those values are MIN_VALUE\n * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n * a positive number, it overflows back into a negative). Not handling this\n * case would often result in infinite recursion.\n *\n * @param {number} low The low (signed) 32 bits of the long.\n * @param {number} high The high (signed) 32 bits of the long.\n * @constructor\n */\n goog.math.Long = function(low, high) {\n /**\n * @type {number}\n * @private\n */\n this.low_ = low | 0; // force into 32 signed bits.\n\n /**\n * @type {number}\n * @private\n */\n this.high_ = high | 0; // force into 32 signed bits.\n };\n\n\n // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n // from* methods on which they depend.\n\n\n /**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @private\n */\n goog.math.Long.IntCache_ = {};\n\n\n /**\n * Returns a Long representing the given (32-bit) integer value.\n * @param {number} value The 32-bit integer in question.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromInt = function(value) {\n if (-128 <= value && value < 128) {\n var cachedObj = goog.math.Long.IntCache_[value];\n if (cachedObj) {\n return cachedObj;\n }\n }\n\n var obj = new goog.math.Long(value | 0, value < 0 ? -1 : 0);\n if (-128 <= value && value < 128) {\n goog.math.Long.IntCache_[value] = obj;\n }\n return obj;\n };\n\n\n /**\n * Returns a Long representing the given value, provided that it is a finite\n * number. Otherwise, zero is returned.\n * @param {number} value The number in question.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromNumber = function(value) {\n if (isNaN(value) || !isFinite(value)) {\n return goog.math.Long.ZERO;\n } else if (value <= -goog.math.Long.TWO_PWR_63_DBL_) {\n return goog.math.Long.MIN_VALUE;\n } else if (value + 1 >= goog.math.Long.TWO_PWR_63_DBL_) {\n return goog.math.Long.MAX_VALUE;\n } else if (value < 0) {\n return goog.math.Long.fromNumber(-value).negate();\n } else {\n return new goog.math.Long(\n (value % goog.math.Long.TWO_PWR_32_DBL_) | 0,\n (value / goog.math.Long.TWO_PWR_32_DBL_) | 0);\n }\n };\n\n\n /**\n * Returns a Long representing the 64-bit integer that comes by concatenating\n * the given high and low bits. Each is assumed to use 32 bits.\n * @param {number} lowBits The low 32-bits.\n * @param {number} highBits The high 32-bits.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromBits = function(lowBits, highBits) {\n return new goog.math.Long(lowBits, highBits);\n };\n\n\n /**\n * Returns a Long representation of the given string, written using the given\n * radix.\n * @param {string} str The textual representation of the Long.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromString = function(str, opt_radix) {\n if (str.length == 0) {\n throw Error('number format error: empty string');\n }\n\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (str.charAt(0) == '-') {\n return goog.math.Long.fromString(str.substring(1), radix).negate();\n } else if (str.indexOf('-') >= 0) {\n throw Error('number format error: interior \"-\" character: ' + str);\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 8));\n\n var result = goog.math.Long.ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = goog.math.Long.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(goog.math.Long.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(goog.math.Long.fromNumber(value));\n }\n }\n return result;\n };\n\n\n // NOTE: the compiler should inline these constant values below and then remove\n // these variables, so there should be no runtime penalty for these.\n\n\n /**\n * Number used repeated below in calculations. This must appear before the\n * first call to any from* function below.\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_16_DBL_ = 1 << 16;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_24_DBL_ = 1 << 24;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_32_DBL_ =\n goog.math.Long.TWO_PWR_16_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_31_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ / 2;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_48_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_64_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_32_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_63_DBL_ =\n goog.math.Long.TWO_PWR_64_DBL_ / 2;\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.ZERO = goog.math.Long.fromInt(0);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.ONE = goog.math.Long.fromInt(1);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.NEG_ONE = goog.math.Long.fromInt(-1);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.MAX_VALUE =\n goog.math.Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.MIN_VALUE = goog.math.Long.fromBits(0, 0x80000000 | 0);\n\n\n /**\n * @type {!goog.math.Long}\n * @private\n */\n goog.math.Long.TWO_PWR_24_ = goog.math.Long.fromInt(1 << 24);\n\n\n /** @return {number} The value, assuming it is a 32-bit integer. */\n goog.math.Long.prototype.toInt = function() {\n return this.low_;\n };\n\n\n /** @return {number} The closest floating-point representation to this value. */\n goog.math.Long.prototype.toNumber = function() {\n return this.high_ * goog.math.Long.TWO_PWR_32_DBL_ +\n this.getLowBitsUnsigned();\n };\n\n\n /**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n */\n goog.math.Long.prototype.toString = function(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (this.isZero()) {\n return '0';\n }\n\n if (this.isNegative()) {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = goog.math.Long.fromNumber(radix);\n var div = this.div(radixLong);\n var rem = div.multiply(radixLong).subtract(this);\n return div.toString(radix) + rem.toInt().toString(radix);\n } else {\n return '-' + this.negate().toString(radix);\n }\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 6));\n\n var rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower);\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();\n var digits = intval.toString(radix);\n\n rem = remDiv;\n if (rem.isZero()) {\n return digits + result;\n } else {\n while (digits.length < 6) {\n digits = '0' + digits;\n }\n result = '' + digits + result;\n }\n }\n };\n\n\n /** @return {number} The high 32-bits as a signed value. */\n goog.math.Long.prototype.getHighBits = function() {\n return this.high_;\n };\n\n\n /** @return {number} The low 32-bits as a signed value. */\n goog.math.Long.prototype.getLowBits = function() {\n return this.low_;\n };\n\n\n /** @return {number} The low 32-bits as an unsigned value. */\n goog.math.Long.prototype.getLowBitsUnsigned = function() {\n return (this.low_ >= 0) ?\n this.low_ : goog.math.Long.TWO_PWR_32_DBL_ + this.low_;\n };\n\n\n /**\n * @return {number} Returns the number of bits needed to represent the absolute\n * value of this Long.\n */\n goog.math.Long.prototype.getNumBitsAbs = function() {\n if (this.isNegative()) {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return 64;\n } else {\n return this.negate().getNumBitsAbs();\n }\n } else {\n var val = this.high_ != 0 ? this.high_ : this.low_;\n for (var bit = 31; bit > 0; bit--) {\n if ((val & (1 << bit)) != 0) {\n break;\n }\n }\n return this.high_ != 0 ? bit + 33 : bit + 1;\n }\n };\n\n\n /** @return {boolean} Whether this value is zero. */\n goog.math.Long.prototype.isZero = function() {\n return this.high_ == 0 && this.low_ == 0;\n };\n\n\n /** @return {boolean} Whether this value is negative. */\n goog.math.Long.prototype.isNegative = function() {\n return this.high_ < 0;\n };\n\n\n /** @return {boolean} Whether this value is odd. */\n goog.math.Long.prototype.isOdd = function() {\n return (this.low_ & 1) == 1;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long equals the other.\n */\n goog.math.Long.prototype.equals = function(other) {\n return (this.high_ == other.high_) && (this.low_ == other.low_);\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long does not equal the other.\n */\n goog.math.Long.prototype.notEquals = function(other) {\n return (this.high_ != other.high_) || (this.low_ != other.low_);\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than the other.\n */\n goog.math.Long.prototype.lessThan = function(other) {\n return this.compare(other) < 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than or equal to the other.\n */\n goog.math.Long.prototype.lessThanOrEqual = function(other) {\n return this.compare(other) <= 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than the other.\n */\n goog.math.Long.prototype.greaterThan = function(other) {\n return this.compare(other) > 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than or equal to the other.\n */\n goog.math.Long.prototype.greaterThanOrEqual = function(other) {\n return this.compare(other) >= 0;\n };\n\n\n /**\n * Compares this Long with the given one.\n * @param {goog.math.Long} other Long to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n * if the given one is greater.\n */\n goog.math.Long.prototype.compare = function(other) {\n if (this.equals(other)) {\n return 0;\n }\n\n var thisNeg = this.isNegative();\n var otherNeg = other.isNegative();\n if (thisNeg && !otherNeg) {\n return -1;\n }\n if (!thisNeg && otherNeg) {\n return 1;\n }\n\n // at this point, the signs are the same, so subtraction will not overflow\n if (this.subtract(other).isNegative()) {\n return -1;\n } else {\n return 1;\n }\n };\n\n\n /** @return {!goog.math.Long} The negation of this value. */\n goog.math.Long.prototype.negate = function() {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.MIN_VALUE;\n } else {\n return this.not().add(goog.math.Long.ONE);\n }\n };\n\n\n /**\n * Returns the sum of this and the given Long.\n * @param {goog.math.Long} other Long to add to this one.\n * @return {!goog.math.Long} The sum of this and the given Long.\n */\n goog.math.Long.prototype.add = function(other) {\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n };\n\n\n /**\n * Returns the difference of this and the given Long.\n * @param {goog.math.Long} other Long to subtract from this.\n * @return {!goog.math.Long} The difference of this and the given Long.\n */\n goog.math.Long.prototype.subtract = function(other) {\n return this.add(other.negate());\n };\n\n\n /**\n * Returns the product of this and the given long.\n * @param {goog.math.Long} other Long to multiply with this.\n * @return {!goog.math.Long} The product of this and the other.\n */\n goog.math.Long.prototype.multiply = function(other) {\n if (this.isZero()) {\n return goog.math.Long.ZERO;\n } else if (other.isZero()) {\n return goog.math.Long.ZERO;\n }\n\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return other.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return this.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().multiply(other.negate());\n } else {\n return this.negate().multiply(other).negate();\n }\n } else if (other.isNegative()) {\n return this.multiply(other.negate()).negate();\n }\n\n // If both longs are small, use float multiplication\n if (this.lessThan(goog.math.Long.TWO_PWR_24_) &&\n other.lessThan(goog.math.Long.TWO_PWR_24_)) {\n return goog.math.Long.fromNumber(this.toNumber() * other.toNumber());\n }\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n };\n\n\n /**\n * Returns this Long divided by the given one.\n * @param {goog.math.Long} other Long by which to divide.\n * @return {!goog.math.Long} This Long divided by the given one.\n */\n goog.math.Long.prototype.div = function(other) {\n if (other.isZero()) {\n throw Error('division by zero');\n } else if (this.isZero()) {\n return goog.math.Long.ZERO;\n }\n\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n if (other.equals(goog.math.Long.ONE) ||\n other.equals(goog.math.Long.NEG_ONE)) {\n return goog.math.Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.ONE;\n } else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shiftRight(1);\n var approx = halfThis.div(other).shiftLeft(1);\n if (approx.equals(goog.math.Long.ZERO)) {\n return other.isNegative() ? goog.math.Long.ONE : goog.math.Long.NEG_ONE;\n } else {\n var rem = this.subtract(other.multiply(approx));\n var result = approx.add(rem.div(other));\n return result;\n }\n }\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().div(other.negate());\n } else {\n return this.negate().div(other).negate();\n }\n } else if (other.isNegative()) {\n return this.div(other.negate()).negate();\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n var res = goog.math.Long.ZERO;\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n var approxRes = goog.math.Long.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = goog.math.Long.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) {\n approxRes = goog.math.Long.ONE;\n }\n\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return res;\n };\n\n\n /**\n * Returns this Long modulo the given one.\n * @param {goog.math.Long} other Long by which to mod.\n * @return {!goog.math.Long} This Long modulo the given one.\n */\n goog.math.Long.prototype.modulo = function(other) {\n return this.subtract(this.div(other).multiply(other));\n };\n\n\n /** @return {!goog.math.Long} The bitwise-NOT of this value. */\n goog.math.Long.prototype.not = function() {\n return goog.math.Long.fromBits(~this.low_, ~this.high_);\n };\n\n\n /**\n * Returns the bitwise-AND of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to AND.\n * @return {!goog.math.Long} The bitwise-AND of this and the other.\n */\n goog.math.Long.prototype.and = function(other) {\n return goog.math.Long.fromBits(this.low_ & other.low_,\n this.high_ & other.high_);\n };\n\n\n /**\n * Returns the bitwise-OR of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to OR.\n * @return {!goog.math.Long} The bitwise-OR of this and the other.\n */\n goog.math.Long.prototype.or = function(other) {\n return goog.math.Long.fromBits(this.low_ | other.low_,\n this.high_ | other.high_);\n };\n\n\n /**\n * Returns the bitwise-XOR of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to XOR.\n * @return {!goog.math.Long} The bitwise-XOR of this and the other.\n */\n goog.math.Long.prototype.xor = function(other) {\n return goog.math.Long.fromBits(this.low_ ^ other.low_,\n this.high_ ^ other.high_);\n };\n\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the left by the given amount.\n */\n goog.math.Long.prototype.shiftLeft = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var low = this.low_;\n if (numBits < 32) {\n var high = this.high_;\n return goog.math.Long.fromBits(\n low << numBits,\n (high << numBits) | (low >>> (32 - numBits)));\n } else {\n return goog.math.Long.fromBits(0, low << (numBits - 32));\n }\n }\n };\n\n\n /**\n * Returns this Long with bits shifted to the right by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the right by the given amount.\n */\n goog.math.Long.prototype.shiftRight = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return goog.math.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >> numBits);\n } else {\n return goog.math.Long.fromBits(\n high >> (numBits - 32),\n high >= 0 ? 0 : -1);\n }\n }\n };\n\n\n /**\n * Returns this Long with bits shifted to the right by the given amount, with\n * the new top bits matching the current sign bit.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the right by the given amount, with\n * zeros placed into the new leading bits.\n */\n goog.math.Long.prototype.shiftRightUnsigned = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return goog.math.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >>> numBits);\n } else if (numBits == 32) {\n return goog.math.Long.fromBits(high, 0);\n } else {\n return goog.math.Long.fromBits(high >>> (numBits - 32), 0);\n }\n }\n };\n\n //======= begin jsbn =======\n\n var navigator = { appName: 'Modern Browser' }; // polyfill a little\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // http://www-cs-students.stanford.edu/~tjw/jsbn/\n\n /*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. \n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n if(j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<<dbits)-1);\n BigInteger.prototype.DV = (1<<dbits);\n\n var BI_FP = 52;\n BigInteger.prototype.FV = Math.pow(2,BI_FP);\n BigInteger.prototype.F1 = BI_FP-dbits;\n BigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n // Digit conversions\n var BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n var BI_RC = new Array();\n var rr,vv;\n rr = \"0\".charCodeAt(0);\n for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\n rr = \"a\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n rr = \"A\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\n function int2char(n) { return BI_RM.charAt(n); }\n function intAt(s,i) {\n var c = BI_RC[s.charCodeAt(i)];\n return (c==null)?-1:c;\n }\n\n // (protected) copy this to r\n function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n this[this.t++] = (x>>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<<sh;\n sh += k;\n if(sh >= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n }\n this.clamp();\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) clamp off excess high words\n function bnpClamp() {\n var c = this.s&this.DM;\n while(this.t > 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }\n\n // (protected) r = this - a\n function bnpSubTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]-a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3;\t\t// y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // jsbn2 stuff\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }\n\n // (protected) r = this + a\n function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.addTo = bnpAddTo;\n\n //======= end jsbn =======\n\n // Emscripten wrapper\n var Wrapper = {\n abs: function(l, h) {\n var x = new goog.math.Long(l, h);\n var ret;\n if (x.isNegative()) {\n ret = x.negate();\n } else {\n ret = x;\n }\n HEAP32[tempDoublePtr>>2] = ret.low_;\n HEAP32[tempDoublePtr+4>>2] = ret.high_;\n },\n ensureTemps: function() {\n if (Wrapper.ensuredTemps) return;\n Wrapper.ensuredTemps = true;\n Wrapper.two32 = new BigInteger();\n Wrapper.two32.fromString('4294967296', 10);\n Wrapper.two64 = new BigInteger();\n Wrapper.two64.fromString('18446744073709551616', 10);\n Wrapper.temp1 = new BigInteger();\n Wrapper.temp2 = new BigInteger();\n },\n lh2bignum: function(l, h) {\n var a = new BigInteger();\n a.fromString(h.toString(), 10);\n var b = new BigInteger();\n a.multiplyTo(Wrapper.two32, b);\n var c = new BigInteger();\n c.fromString(l.toString(), 10);\n var d = new BigInteger();\n c.addTo(b, d);\n return d;\n },\n stringify: function(l, h, unsigned) {\n var ret = new goog.math.Long(l, h).toString();\n if (unsigned && ret[0] == '-') {\n // unsign slowly using jsbn bignums\n Wrapper.ensureTemps();\n var bignum = new BigInteger();\n bignum.fromString(ret, 10);\n ret = new BigInteger();\n Wrapper.two64.addTo(bignum, ret);\n ret = ret.toString(10);\n }\n return ret;\n },\n fromString: function(str, base, min, max, unsigned) {\n Wrapper.ensureTemps();\n var bignum = new BigInteger();\n bignum.fromString(str, base);\n var bigmin = new BigInteger();\n bigmin.fromString(min, 10);\n var bigmax = new BigInteger();\n bigmax.fromString(max, 10);\n if (unsigned && bignum.compareTo(BigInteger.ZERO) < 0) {\n var temp = new BigInteger();\n bignum.addTo(Wrapper.two64, temp);\n bignum = temp;\n }\n var error = false;\n if (bignum.compareTo(bigmin) < 0) {\n bignum = bigmin;\n error = true;\n } else if (bignum.compareTo(bigmax) > 0) {\n bignum = bigmax;\n error = true;\n }\n var ret = goog.math.Long.fromString(bignum.toString()); // min-max checks should have clamped this to a range goog.math.Long can handle well\n HEAP32[tempDoublePtr>>2] = ret.low_;\n HEAP32[tempDoublePtr+4>>2] = ret.high_;\n if (error) throw 'range error';\n }\n };\n return Wrapper;\n})();\n\n//======= end closure i64 code =======\n\n\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "dry.c", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\n\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(11195);\n/* global initializers */ __ATINIT__.push();\n\n\n/* memory initializer */ allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,72,82,89,83,84,79,78,69,32,80,82,79,71,82,65,77,44,32,83,79,77,69,32,83,84,82,73,78,71], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n \n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;\n\n function _sbrk(bytes) {\n // Implement a Linux-like 'memory area' for our 'process'.\n // Changes the size of the memory area by |bytes|; returns the\n // address of the previous top ('break') of the memory area\n // We control the \"dynamic\" memory - DYNAMIC_BASE to DYNAMICTOP\n var self = _sbrk;\n if (!self.called) {\n DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned\n self.called = true;\n assert(Runtime.dynamicAlloc);\n self.alloc = Runtime.dynamicAlloc;\n Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };\n }\n var ret = DYNAMICTOP;\n if (bytes != 0) self.alloc(bytes);\n return ret; // Previous break location.\n }\n\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(name) {\n // long sysconf(int name);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html\n switch(name) {\n case 30: return PAGE_SIZE;\n case 132:\n case 133:\n case 12:\n case 137:\n case 138:\n case 15:\n case 235:\n case 16:\n case 17:\n case 18:\n case 19:\n case 20:\n case 149:\n case 13:\n case 10:\n case 236:\n case 153:\n case 9:\n case 21:\n case 22:\n case 159:\n case 154:\n case 14:\n case 77:\n case 78:\n case 139:\n case 80:\n case 81:\n case 79:\n case 82:\n case 68:\n case 67:\n case 164:\n case 11:\n case 29:\n case 47:\n case 48:\n case 95:\n case 52:\n case 51:\n case 46:\n return 200809;\n case 27:\n case 246:\n case 127:\n case 128:\n case 23:\n case 24:\n case 160:\n case 161:\n case 181:\n case 182:\n case 242:\n case 183:\n case 184:\n case 243:\n case 244:\n case 245:\n case 165:\n case 178:\n case 179:\n case 49:\n case 50:\n case 168:\n case 169:\n case 175:\n case 170:\n case 171:\n case 172:\n case 97:\n case 76:\n case 32:\n case 173:\n case 35:\n return -1;\n case 176:\n case 177:\n case 7:\n case 155:\n case 8:\n case 157:\n case 125:\n case 126:\n case 92:\n case 93:\n case 129:\n case 130:\n case 131:\n case 94:\n case 91:\n return 1;\n case 74:\n case 60:\n case 69:\n case 70:\n case 4:\n return 1024;\n case 31:\n case 42:\n case 72:\n return 32;\n case 87:\n case 26:\n case 33:\n return 2147483647;\n case 34:\n case 1:\n return 47839;\n case 38:\n case 36:\n return 99;\n case 43:\n case 37:\n return 2048;\n case 0: return 2097152;\n case 3: return 65536;\n case 28: return 32768;\n case 44: return 32767;\n case 75: return 16384;\n case 39: return 1000;\n case 89: return 700;\n case 71: return 256;\n case 40: return 255;\n case 2: return 100;\n case 180: return 64;\n case 25: return 20;\n case 5: return 16;\n case 6: return 6;\n case 73: return 4;\n case 84: return 1;\n }\n ___setErrNo(ERRNO_CODES.EINVAL);\n return -1;\n }\n\n function _clock() {\n if (_clock.start === undefined) _clock.start = Date.now();\n return Math.floor((Date.now() - _clock.start) * (1000000/1000));\n }\n\n \n Module[\"_memset\"] = _memset;\n\n function ___errno_location() {\n return ___errno_state;\n }\n\n function _abort() {\n Module['abort']();\n }\n\n \n \n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);\n \n function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n function _time(ptr) {\n var ret = Math.floor(Date.now()/1000);\n if (ptr) {\n HEAP32[((ptr)>>2)]=ret;\n }\n return ret;\n }\n\n \n Module[\"_strlen\"] = _strlen;\n\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n\nvar Math_min = Math.min;\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=+env.NaN,r=+env.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.asmPrintInt;var ba=env.asmPrintFloat;var ca=env.min;var da=env._clock;var ea=env._fflush;var fa=env._abort;var ga=env.___setErrNo;var ha=env._sbrk;var ia=env._time;var ja=env._emscripten_memcpy_big;var ka=env._sysconf;var la=env.___errno_location;var ma=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction na(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function oa(){return i|0}function pa(a){a=a|0;i=a}function qa(a,b){a=a|0;b=b|0;if((m|0)==0){m=a;n=b}}function ra(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function sa(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function ta(a){a=a|0;B=a}function ua(a){a=a|0;C=a}function va(a){a=a|0;D=a}function wa(a){a=a|0;E=a}function xa(a){a=a|0;F=a}function ya(a){a=a|0;G=a}function za(a){a=a|0;H=a}function Aa(a){a=a|0;I=a}function Ba(a){a=a|0;J=a}function Ca(a){a=a|0;K=a}function Da(){var b=0,d=0,e=0,f=0;b=i;da()|0;da()|0;d=Ea(48)|0;c[2]=d;e=Ea(48)|0;c[4]=e;c[e>>2]=d;c[e+4>>2]=0;c[e+8>>2]=10001;c[e+12>>2]=40;d=e+16|0;e=24|0;f=d+31|0;do{a[d]=a[e]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));c[1716>>2]=10;da()|0;e=0;do{a[10688]=65;a[10680]=66;c[2616]=1;c[10504>>2]=7;c[10508>>2]=7;c[10624>>2]=8;c[1720>>2]=8;c[1724>>2]=8;c[1716>>2]=(c[1716>>2]|0)+1;c[5800>>2]=7;c[2674]=5;d=c[4]|0;c[d+12>>2]=5;f=c[d>>2]|0;c[f+12>>2]=5;c[f>>2]=f;f=a[10680]|0;if(!(f<<24>>24<65)){d=65;do{d=d+1<<24>>24;}while(!(d<<24>>24>f<<24>>24))}e=e+1|0;}while((e|0)!=1e8);i=b;return 0}function Ea(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,ga=0,ja=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0;b=i;do{if(a>>>0<245){if(a>>>0<11){d=16}else{d=a+11&-8}e=d>>>3;f=c[2676]|0;g=f>>>e;if((g&3|0)!=0){h=(g&1^1)+e|0;j=h<<1;k=10744+(j<<2)|0;l=10744+(j+2<<2)|0;j=c[l>>2]|0;m=j+8|0;n=c[m>>2]|0;do{if((k|0)==(n|0)){c[2676]=f&~(1<<h)}else{if(n>>>0<(c[10720>>2]|0)>>>0){fa()}o=n+12|0;if((c[o>>2]|0)==(j|0)){c[o>>2]=k;c[l>>2]=n;break}else{fa()}}}while(0);n=h<<3;c[j+4>>2]=n|3;l=j+(n|4)|0;c[l>>2]=c[l>>2]|1;p=m;i=b;return p|0}if(!(d>>>0>(c[10712>>2]|0)>>>0)){q=d;break}if((g|0)!=0){l=2<<e;n=g<<e&(l|0-l);l=(n&0-n)+ -1|0;n=l>>>12&16;k=l>>>n;l=k>>>5&8;o=k>>>l;k=o>>>2&4;r=o>>>k;o=r>>>1&2;s=r>>>o;r=s>>>1&1;t=(l|n|k|o|r)+(s>>>r)|0;r=t<<1;s=10744+(r<<2)|0;o=10744+(r+2<<2)|0;r=c[o>>2]|0;k=r+8|0;n=c[k>>2]|0;do{if((s|0)==(n|0)){c[2676]=f&~(1<<t)}else{if(n>>>0<(c[10720>>2]|0)>>>0){fa()}l=n+12|0;if((c[l>>2]|0)==(r|0)){c[l>>2]=s;c[o>>2]=n;break}else{fa()}}}while(0);n=t<<3;o=n-d|0;c[r+4>>2]=d|3;s=r;f=s+d|0;c[s+(d|4)>>2]=o|1;c[s+n>>2]=o;n=c[10712>>2]|0;if((n|0)!=0){s=c[10724>>2]|0;e=n>>>3;n=e<<1;g=10744+(n<<2)|0;m=c[2676]|0;j=1<<e;do{if((m&j|0)==0){c[2676]=m|j;u=10744+(n+2<<2)|0;v=g}else{e=10744+(n+2<<2)|0;h=c[e>>2]|0;if(!(h>>>0<(c[10720>>2]|0)>>>0)){u=e;v=h;break}fa()}}while(0);c[u>>2]=s;c[v+12>>2]=s;c[s+8>>2]=v;c[s+12>>2]=g}c[10712>>2]=o;c[10724>>2]=f;p=k;i=b;return p|0}n=c[10708>>2]|0;if((n|0)==0){q=d;break}j=(n&0-n)+ -1|0;n=j>>>12&16;m=j>>>n;j=m>>>5&8;r=m>>>j;m=r>>>2&4;t=r>>>m;r=t>>>1&2;h=t>>>r;t=h>>>1&1;e=c[11008+((j|n|m|r|t)+(h>>>t)<<2)>>2]|0;t=(c[e+4>>2]&-8)-d|0;h=e;r=e;while(1){e=c[h+16>>2]|0;if((e|0)==0){m=c[h+20>>2]|0;if((m|0)==0){break}else{w=m}}else{w=e}e=(c[w+4>>2]&-8)-d|0;m=e>>>0<t>>>0;t=m?e:t;h=w;r=m?w:r}h=r;k=c[10720>>2]|0;if(h>>>0<k>>>0){fa()}f=h+d|0;o=f;if(!(h>>>0<f>>>0)){fa()}f=c[r+24>>2]|0;g=c[r+12>>2]|0;do{if((g|0)==(r|0)){s=r+20|0;m=c[s>>2]|0;if((m|0)==0){e=r+16|0;n=c[e>>2]|0;if((n|0)==0){x=0;break}else{y=n;z=e}}else{y=m;z=s}while(1){s=y+20|0;m=c[s>>2]|0;if((m|0)!=0){z=s;y=m;continue}m=y+16|0;s=c[m>>2]|0;if((s|0)==0){break}else{y=s;z=m}}if(z>>>0<k>>>0){fa()}else{c[z>>2]=0;x=y;break}}else{m=c[r+8>>2]|0;if(m>>>0<k>>>0){fa()}s=m+12|0;if((c[s>>2]|0)!=(r|0)){fa()}e=g+8|0;if((c[e>>2]|0)==(r|0)){c[s>>2]=g;c[e>>2]=m;x=g;break}else{fa()}}}while(0);a:do{if((f|0)!=0){g=c[r+28>>2]|0;k=11008+(g<<2)|0;do{if((r|0)==(c[k>>2]|0)){c[k>>2]=x;if((x|0)!=0){break}c[10708>>2]=c[10708>>2]&~(1<<g);break a}else{if(f>>>0<(c[10720>>2]|0)>>>0){fa()}m=f+16|0;if((c[m>>2]|0)==(r|0)){c[m>>2]=x}else{c[f+20>>2]=x}if((x|0)==0){break a}}}while(0);if(x>>>0<(c[10720>>2]|0)>>>0){fa()}c[x+24>>2]=f;g=c[r+16>>2]|0;do{if((g|0)!=0){if(g>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[x+16>>2]=g;c[g+24>>2]=x;break}}}while(0);g=c[r+20>>2]|0;if((g|0)==0){break}if(g>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[x+20>>2]=g;c[g+24>>2]=x;break}}}while(0);if(t>>>0<16){f=t+d|0;c[r+4>>2]=f|3;g=h+(f+4)|0;c[g>>2]=c[g>>2]|1}else{c[r+4>>2]=d|3;c[h+(d|4)>>2]=t|1;c[h+(t+d)>>2]=t;g=c[10712>>2]|0;if((g|0)!=0){f=c[10724>>2]|0;k=g>>>3;g=k<<1;m=10744+(g<<2)|0;e=c[2676]|0;s=1<<k;do{if((e&s|0)==0){c[2676]=e|s;A=10744+(g+2<<2)|0;B=m}else{k=10744+(g+2<<2)|0;n=c[k>>2]|0;if(!(n>>>0<(c[10720>>2]|0)>>>0)){A=k;B=n;break}fa()}}while(0);c[A>>2]=f;c[B+12>>2]=f;c[f+8>>2]=B;c[f+12>>2]=m}c[10712>>2]=t;c[10724>>2]=o}p=r+8|0;i=b;return p|0}else{if(a>>>0>4294967231){q=-1;break}g=a+11|0;s=g&-8;e=c[10708>>2]|0;if((e|0)==0){q=s;break}h=0-s|0;n=g>>>8;do{if((n|0)==0){C=0}else{if(s>>>0>16777215){C=31;break}g=(n+1048320|0)>>>16&8;k=n<<g;j=(k+520192|0)>>>16&4;l=k<<j;k=(l+245760|0)>>>16&2;D=14-(j|g|k)+(l<<k>>>15)|0;C=s>>>(D+7|0)&1|D<<1}}while(0);n=c[11008+(C<<2)>>2]|0;b:do{if((n|0)==0){E=h;F=0;G=0}else{if((C|0)==31){H=0}else{H=25-(C>>>1)|0}r=h;o=0;t=s<<H;m=n;f=0;while(1){D=c[m+4>>2]&-8;k=D-s|0;if(k>>>0<r>>>0){if((D|0)==(s|0)){E=k;F=m;G=m;break b}else{I=k;J=m}}else{I=r;J=f}k=c[m+20>>2]|0;D=c[m+(t>>>31<<2)+16>>2]|0;l=(k|0)==0|(k|0)==(D|0)?o:k;if((D|0)==0){E=I;F=l;G=J;break}else{r=I;o=l;t=t<<1;m=D;f=J}}}}while(0);if((F|0)==0&(G|0)==0){n=2<<C;h=e&(n|0-n);if((h|0)==0){q=s;break}n=(h&0-h)+ -1|0;h=n>>>12&16;f=n>>>h;n=f>>>5&8;m=f>>>n;f=m>>>2&4;t=m>>>f;m=t>>>1&2;o=t>>>m;t=o>>>1&1;K=c[11008+((n|h|f|m|t)+(o>>>t)<<2)>>2]|0}else{K=F}if((K|0)==0){L=E;M=G}else{t=E;o=K;m=G;while(1){f=(c[o+4>>2]&-8)-s|0;h=f>>>0<t>>>0;n=h?f:t;f=h?o:m;h=c[o+16>>2]|0;if((h|0)!=0){N=f;O=n;m=N;o=h;t=O;continue}h=c[o+20>>2]|0;if((h|0)==0){L=n;M=f;break}else{N=f;O=n;o=h;m=N;t=O}}}if((M|0)==0){q=s;break}if(!(L>>>0<((c[10712>>2]|0)-s|0)>>>0)){q=s;break}t=M;m=c[10720>>2]|0;if(t>>>0<m>>>0){fa()}o=t+s|0;e=o;if(!(t>>>0<o>>>0)){fa()}h=c[M+24>>2]|0;n=c[M+12>>2]|0;do{if((n|0)==(M|0)){f=M+20|0;r=c[f>>2]|0;if((r|0)==0){D=M+16|0;l=c[D>>2]|0;if((l|0)==0){P=0;break}else{Q=l;R=D}}else{Q=r;R=f}while(1){f=Q+20|0;r=c[f>>2]|0;if((r|0)!=0){R=f;Q=r;continue}r=Q+16|0;f=c[r>>2]|0;if((f|0)==0){break}else{Q=f;R=r}}if(R>>>0<m>>>0){fa()}else{c[R>>2]=0;P=Q;break}}else{r=c[M+8>>2]|0;if(r>>>0<m>>>0){fa()}f=r+12|0;if((c[f>>2]|0)!=(M|0)){fa()}D=n+8|0;if((c[D>>2]|0)==(M|0)){c[f>>2]=n;c[D>>2]=r;P=n;break}else{fa()}}}while(0);c:do{if((h|0)!=0){n=c[M+28>>2]|0;m=11008+(n<<2)|0;do{if((M|0)==(c[m>>2]|0)){c[m>>2]=P;if((P|0)!=0){break}c[10708>>2]=c[10708>>2]&~(1<<n);break c}else{if(h>>>0<(c[10720>>2]|0)>>>0){fa()}r=h+16|0;if((c[r>>2]|0)==(M|0)){c[r>>2]=P}else{c[h+20>>2]=P}if((P|0)==0){break c}}}while(0);if(P>>>0<(c[10720>>2]|0)>>>0){fa()}c[P+24>>2]=h;n=c[M+16>>2]|0;do{if((n|0)!=0){if(n>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[P+16>>2]=n;c[n+24>>2]=P;break}}}while(0);n=c[M+20>>2]|0;if((n|0)==0){break}if(n>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[P+20>>2]=n;c[n+24>>2]=P;break}}}while(0);d:do{if(L>>>0<16){h=L+s|0;c[M+4>>2]=h|3;n=t+(h+4)|0;c[n>>2]=c[n>>2]|1}else{c[M+4>>2]=s|3;c[t+(s|4)>>2]=L|1;c[t+(L+s)>>2]=L;n=L>>>3;if(L>>>0<256){h=n<<1;m=10744+(h<<2)|0;r=c[2676]|0;D=1<<n;do{if((r&D|0)==0){c[2676]=r|D;S=10744+(h+2<<2)|0;T=m}else{n=10744+(h+2<<2)|0;f=c[n>>2]|0;if(!(f>>>0<(c[10720>>2]|0)>>>0)){S=n;T=f;break}fa()}}while(0);c[S>>2]=e;c[T+12>>2]=e;c[t+(s+8)>>2]=T;c[t+(s+12)>>2]=m;break}h=o;D=L>>>8;do{if((D|0)==0){U=0}else{if(L>>>0>16777215){U=31;break}r=(D+1048320|0)>>>16&8;f=D<<r;n=(f+520192|0)>>>16&4;l=f<<n;f=(l+245760|0)>>>16&2;k=14-(n|r|f)+(l<<f>>>15)|0;U=L>>>(k+7|0)&1|k<<1}}while(0);D=11008+(U<<2)|0;c[t+(s+28)>>2]=U;c[t+(s+20)>>2]=0;c[t+(s+16)>>2]=0;m=c[10708>>2]|0;k=1<<U;if((m&k|0)==0){c[10708>>2]=m|k;c[D>>2]=h;c[t+(s+24)>>2]=D;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break}k=c[D>>2]|0;if((U|0)==31){V=0}else{V=25-(U>>>1)|0}e:do{if((c[k+4>>2]&-8|0)==(L|0)){W=k}else{D=L<<V;m=k;while(1){X=m+(D>>>31<<2)+16|0;f=c[X>>2]|0;if((f|0)==0){break}if((c[f+4>>2]&-8|0)==(L|0)){W=f;break e}else{D=D<<1;m=f}}if(X>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[X>>2]=h;c[t+(s+24)>>2]=m;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break d}}}while(0);k=W+8|0;D=c[k>>2]|0;f=c[10720>>2]|0;if(W>>>0<f>>>0){fa()}if(D>>>0<f>>>0){fa()}else{c[D+12>>2]=h;c[k>>2]=h;c[t+(s+8)>>2]=D;c[t+(s+12)>>2]=W;c[t+(s+24)>>2]=0;break}}}while(0);p=M+8|0;i=b;return p|0}}while(0);M=c[10712>>2]|0;if(!(q>>>0>M>>>0)){W=M-q|0;X=c[10724>>2]|0;if(W>>>0>15){L=X;c[10724>>2]=L+q;c[10712>>2]=W;c[L+(q+4)>>2]=W|1;c[L+M>>2]=W;c[X+4>>2]=q|3}else{c[10712>>2]=0;c[10724>>2]=0;c[X+4>>2]=M|3;W=X+(M+4)|0;c[W>>2]=c[W>>2]|1}p=X+8|0;i=b;return p|0}X=c[10716>>2]|0;if(q>>>0<X>>>0){W=X-q|0;c[10716>>2]=W;X=c[10728>>2]|0;M=X;c[10728>>2]=M+q;c[M+(q+4)>>2]=W|1;c[X+4>>2]=q|3;p=X+8|0;i=b;return p|0}do{if((c[2794]|0)==0){X=ka(30)|0;if((X+ -1&X|0)==0){c[11184>>2]=X;c[11180>>2]=X;c[11188>>2]=-1;c[11192>>2]=-1;c[11196>>2]=0;c[11148>>2]=0;c[2794]=(ia(0)|0)&-16^1431655768;break}else{fa()}}}while(0);X=q+48|0;W=c[11184>>2]|0;M=q+47|0;L=W+M|0;V=0-W|0;W=L&V;if(!(W>>>0>q>>>0)){p=0;i=b;return p|0}U=c[11144>>2]|0;do{if((U|0)!=0){T=c[11136>>2]|0;S=T+W|0;if(S>>>0<=T>>>0|S>>>0>U>>>0){p=0}else{break}i=b;return p|0}}while(0);f:do{if((c[11148>>2]&4|0)==0){U=c[10728>>2]|0;g:do{if((U|0)==0){Y=182}else{S=U;T=11152|0;while(1){Z=T;P=c[Z>>2]|0;if(!(P>>>0>S>>>0)){_=T+4|0;if((P+(c[_>>2]|0)|0)>>>0>S>>>0){break}}P=c[T+8>>2]|0;if((P|0)==0){Y=182;break g}else{T=P}}if((T|0)==0){Y=182;break}S=L-(c[10716>>2]|0)&V;if(!(S>>>0<2147483647)){$=0;break}h=ha(S|0)|0;P=(h|0)==((c[Z>>2]|0)+(c[_>>2]|0)|0);aa=h;ba=S;ca=P?h:-1;da=P?S:0;Y=191}}while(0);do{if((Y|0)==182){U=ha(0)|0;if((U|0)==(-1|0)){$=0;break}S=U;P=c[11180>>2]|0;h=P+ -1|0;if((h&S|0)==0){ea=W}else{ea=W-S+(h+S&0-P)|0}P=c[11136>>2]|0;S=P+ea|0;if(!(ea>>>0>q>>>0&ea>>>0<2147483647)){$=0;break}h=c[11144>>2]|0;if((h|0)!=0){if(S>>>0<=P>>>0|S>>>0>h>>>0){$=0;break}}h=ha(ea|0)|0;S=(h|0)==(U|0);aa=h;ba=ea;ca=S?U:-1;da=S?ea:0;Y=191}}while(0);h:do{if((Y|0)==191){S=0-ba|0;if((ca|0)!=(-1|0)){ga=ca;ja=da;Y=202;break f}do{if((aa|0)!=(-1|0)&ba>>>0<2147483647&ba>>>0<X>>>0){U=c[11184>>2]|0;h=M-ba+U&0-U;if(!(h>>>0<2147483647)){ma=ba;break}if((ha(h|0)|0)==(-1|0)){ha(S|0)|0;$=da;break h}else{ma=h+ba|0;break}}else{ma=ba}}while(0);if((aa|0)==(-1|0)){$=da}else{ga=aa;ja=ma;Y=202;break f}}}while(0);c[11148>>2]=c[11148>>2]|4;na=$;Y=199}else{na=0;Y=199}}while(0);do{if((Y|0)==199){if(!(W>>>0<2147483647)){break}$=ha(W|0)|0;ma=ha(0)|0;if(!((ma|0)!=(-1|0)&($|0)!=(-1|0)&$>>>0<ma>>>0)){break}aa=ma-$|0;ma=aa>>>0>(q+40|0)>>>0;if(ma){ga=$;ja=ma?aa:na;Y=202}}}while(0);do{if((Y|0)==202){na=(c[11136>>2]|0)+ja|0;c[11136>>2]=na;if(na>>>0>(c[11140>>2]|0)>>>0){c[11140>>2]=na}na=c[10728>>2]|0;i:do{if((na|0)==0){W=c[10720>>2]|0;if((W|0)==0|ga>>>0<W>>>0){c[10720>>2]=ga}c[11152>>2]=ga;c[11156>>2]=ja;c[11164>>2]=0;c[10740>>2]=c[2794];c[10736>>2]=-1;W=0;do{aa=W<<1;ma=10744+(aa<<2)|0;c[10744+(aa+3<<2)>>2]=ma;c[10744+(aa+2<<2)>>2]=ma;W=W+1|0;}while((W|0)!=32);W=ga+8|0;if((W&7|0)==0){oa=0}else{oa=0-W&7}W=ja+ -40-oa|0;c[10728>>2]=ga+oa;c[10716>>2]=W;c[ga+(oa+4)>>2]=W|1;c[ga+(ja+ -36)>>2]=40;c[10732>>2]=c[11192>>2]}else{W=11152|0;while(1){pa=c[W>>2]|0;qa=W+4|0;ra=c[qa>>2]|0;if((ga|0)==(pa+ra|0)){Y=214;break}ma=c[W+8>>2]|0;if((ma|0)==0){break}else{W=ma}}do{if((Y|0)==214){if((c[W+12>>2]&8|0)!=0){break}ma=na;if(!(ma>>>0>=pa>>>0&ma>>>0<ga>>>0)){break}c[qa>>2]=ra+ja;aa=(c[10716>>2]|0)+ja|0;$=na+8|0;if(($&7|0)==0){sa=0}else{sa=0-$&7}$=aa-sa|0;c[10728>>2]=ma+sa;c[10716>>2]=$;c[ma+(sa+4)>>2]=$|1;c[ma+(aa+4)>>2]=40;c[10732>>2]=c[11192>>2];break i}}while(0);if(ga>>>0<(c[10720>>2]|0)>>>0){c[10720>>2]=ga}W=ga+ja|0;aa=11152|0;while(1){ta=aa;if((c[ta>>2]|0)==(W|0)){Y=224;break}ma=c[aa+8>>2]|0;if((ma|0)==0){break}else{aa=ma}}do{if((Y|0)==224){if((c[aa+12>>2]&8|0)!=0){break}c[ta>>2]=ga;W=aa+4|0;c[W>>2]=(c[W>>2]|0)+ja;W=ga+8|0;if((W&7|0)==0){ua=0}else{ua=0-W&7}W=ga+(ja+8)|0;if((W&7|0)==0){va=0}else{va=0-W&7}W=ga+(va+ja)|0;ma=W;$=ua+q|0;da=ga+$|0;ba=da;M=W-(ga+ua)-q|0;c[ga+(ua+4)>>2]=q|3;j:do{if((ma|0)==(c[10728>>2]|0)){X=(c[10716>>2]|0)+M|0;c[10716>>2]=X;c[10728>>2]=ba;c[ga+($+4)>>2]=X|1}else{if((ma|0)==(c[10724>>2]|0)){X=(c[10712>>2]|0)+M|0;c[10712>>2]=X;c[10724>>2]=ba;c[ga+($+4)>>2]=X|1;c[ga+(X+$)>>2]=X;break}X=ja+4|0;ca=c[ga+(X+va)>>2]|0;if((ca&3|0)==1){ea=ca&-8;_=ca>>>3;k:do{if(ca>>>0<256){Z=c[ga+((va|8)+ja)>>2]|0;V=c[ga+(ja+12+va)>>2]|0;L=10744+(_<<1<<2)|0;do{if((Z|0)!=(L|0)){if(Z>>>0<(c[10720>>2]|0)>>>0){fa()}if((c[Z+12>>2]|0)==(ma|0)){break}fa()}}while(0);if((V|0)==(Z|0)){c[2676]=c[2676]&~(1<<_);break}do{if((V|0)==(L|0)){wa=V+8|0}else{if(V>>>0<(c[10720>>2]|0)>>>0){fa()}S=V+8|0;if((c[S>>2]|0)==(ma|0)){wa=S;break}fa()}}while(0);c[Z+12>>2]=V;c[wa>>2]=Z}else{L=W;S=c[ga+((va|24)+ja)>>2]|0;T=c[ga+(ja+12+va)>>2]|0;do{if((T|0)==(L|0)){h=va|16;U=ga+(X+h)|0;P=c[U>>2]|0;if((P|0)==0){Q=ga+(h+ja)|0;h=c[Q>>2]|0;if((h|0)==0){xa=0;break}else{ya=h;za=Q}}else{ya=P;za=U}while(1){U=ya+20|0;P=c[U>>2]|0;if((P|0)!=0){za=U;ya=P;continue}P=ya+16|0;U=c[P>>2]|0;if((U|0)==0){break}else{ya=U;za=P}}if(za>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[za>>2]=0;xa=ya;break}}else{P=c[ga+((va|8)+ja)>>2]|0;if(P>>>0<(c[10720>>2]|0)>>>0){fa()}U=P+12|0;if((c[U>>2]|0)!=(L|0)){fa()}Q=T+8|0;if((c[Q>>2]|0)==(L|0)){c[U>>2]=T;c[Q>>2]=P;xa=T;break}else{fa()}}}while(0);if((S|0)==0){break}T=c[ga+(ja+28+va)>>2]|0;Z=11008+(T<<2)|0;do{if((L|0)==(c[Z>>2]|0)){c[Z>>2]=xa;if((xa|0)!=0){break}c[10708>>2]=c[10708>>2]&~(1<<T);break k}else{if(S>>>0<(c[10720>>2]|0)>>>0){fa()}V=S+16|0;if((c[V>>2]|0)==(L|0)){c[V>>2]=xa}else{c[S+20>>2]=xa}if((xa|0)==0){break k}}}while(0);if(xa>>>0<(c[10720>>2]|0)>>>0){fa()}c[xa+24>>2]=S;L=va|16;T=c[ga+(L+ja)>>2]|0;do{if((T|0)!=0){if(T>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[xa+16>>2]=T;c[T+24>>2]=xa;break}}}while(0);T=c[ga+(X+L)>>2]|0;if((T|0)==0){break}if(T>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[xa+20>>2]=T;c[T+24>>2]=xa;break}}}while(0);Aa=ga+((ea|va)+ja)|0;Ba=ea+M|0}else{Aa=ma;Ba=M}X=Aa+4|0;c[X>>2]=c[X>>2]&-2;c[ga+($+4)>>2]=Ba|1;c[ga+(Ba+$)>>2]=Ba;X=Ba>>>3;if(Ba>>>0<256){_=X<<1;ca=10744+(_<<2)|0;T=c[2676]|0;S=1<<X;do{if((T&S|0)==0){c[2676]=T|S;Ca=10744+(_+2<<2)|0;Da=ca}else{X=10744+(_+2<<2)|0;Z=c[X>>2]|0;if(!(Z>>>0<(c[10720>>2]|0)>>>0)){Ca=X;Da=Z;break}fa()}}while(0);c[Ca>>2]=ba;c[Da+12>>2]=ba;c[ga+($+8)>>2]=Da;c[ga+($+12)>>2]=ca;break}_=da;S=Ba>>>8;do{if((S|0)==0){Ea=0}else{if(Ba>>>0>16777215){Ea=31;break}T=(S+1048320|0)>>>16&8;ea=S<<T;Z=(ea+520192|0)>>>16&4;X=ea<<Z;ea=(X+245760|0)>>>16&2;V=14-(Z|T|ea)+(X<<ea>>>15)|0;Ea=Ba>>>(V+7|0)&1|V<<1}}while(0);S=11008+(Ea<<2)|0;c[ga+($+28)>>2]=Ea;c[ga+($+20)>>2]=0;c[ga+($+16)>>2]=0;ca=c[10708>>2]|0;V=1<<Ea;if((ca&V|0)==0){c[10708>>2]=ca|V;c[S>>2]=_;c[ga+($+24)>>2]=S;c[ga+($+12)>>2]=_;c[ga+($+8)>>2]=_;break}V=c[S>>2]|0;if((Ea|0)==31){Fa=0}else{Fa=25-(Ea>>>1)|0}l:do{if((c[V+4>>2]&-8|0)==(Ba|0)){Ga=V}else{S=Ba<<Fa;ca=V;while(1){Ha=ca+(S>>>31<<2)+16|0;ea=c[Ha>>2]|0;if((ea|0)==0){break}if((c[ea+4>>2]&-8|0)==(Ba|0)){Ga=ea;break l}else{S=S<<1;ca=ea}}if(Ha>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[Ha>>2]=_;c[ga+($+24)>>2]=ca;c[ga+($+12)>>2]=_;c[ga+($+8)>>2]=_;break j}}}while(0);V=Ga+8|0;S=c[V>>2]|0;L=c[10720>>2]|0;if(Ga>>>0<L>>>0){fa()}if(S>>>0<L>>>0){fa()}else{c[S+12>>2]=_;c[V>>2]=_;c[ga+($+8)>>2]=S;c[ga+($+12)>>2]=Ga;c[ga+($+24)>>2]=0;break}}}while(0);p=ga+(ua|8)|0;i=b;return p|0}}while(0);aa=na;$=11152|0;while(1){Ia=c[$>>2]|0;if(!(Ia>>>0>aa>>>0)){Ja=c[$+4>>2]|0;Ka=Ia+Ja|0;if(Ka>>>0>aa>>>0){break}}$=c[$+8>>2]|0}$=Ia+(Ja+ -39)|0;if(($&7|0)==0){La=0}else{La=0-$&7}$=Ia+(Ja+ -47+La)|0;da=$>>>0<(na+16|0)>>>0?aa:$;$=da+8|0;ba=$;M=ga+8|0;if((M&7|0)==0){Ma=0}else{Ma=0-M&7}M=ja+ -40-Ma|0;c[10728>>2]=ga+Ma;c[10716>>2]=M;c[ga+(Ma+4)>>2]=M|1;c[ga+(ja+ -36)>>2]=40;c[10732>>2]=c[11192>>2];c[da+4>>2]=27;c[$+0>>2]=c[11152>>2];c[$+4>>2]=c[11156>>2];c[$+8>>2]=c[11160>>2];c[$+12>>2]=c[11164>>2];c[11152>>2]=ga;c[11156>>2]=ja;c[11164>>2]=0;c[11160>>2]=ba;ba=da+28|0;c[ba>>2]=7;if((da+32|0)>>>0<Ka>>>0){$=ba;while(1){ba=$+4|0;c[ba>>2]=7;if(($+8|0)>>>0<Ka>>>0){$=ba}else{break}}}if((da|0)==(aa|0)){break}$=da-na|0;ba=aa+($+4)|0;c[ba>>2]=c[ba>>2]&-2;c[na+4>>2]=$|1;c[aa+$>>2]=$;ba=$>>>3;if($>>>0<256){M=ba<<1;ma=10744+(M<<2)|0;W=c[2676]|0;m=1<<ba;do{if((W&m|0)==0){c[2676]=W|m;Na=10744+(M+2<<2)|0;Oa=ma}else{ba=10744+(M+2<<2)|0;S=c[ba>>2]|0;if(!(S>>>0<(c[10720>>2]|0)>>>0)){Na=ba;Oa=S;break}fa()}}while(0);c[Na>>2]=na;c[Oa+12>>2]=na;c[na+8>>2]=Oa;c[na+12>>2]=ma;break}M=na;m=$>>>8;do{if((m|0)==0){Pa=0}else{if($>>>0>16777215){Pa=31;break}W=(m+1048320|0)>>>16&8;aa=m<<W;da=(aa+520192|0)>>>16&4;S=aa<<da;aa=(S+245760|0)>>>16&2;ba=14-(da|W|aa)+(S<<aa>>>15)|0;Pa=$>>>(ba+7|0)&1|ba<<1}}while(0);m=11008+(Pa<<2)|0;c[na+28>>2]=Pa;c[na+20>>2]=0;c[na+16>>2]=0;ma=c[10708>>2]|0;ba=1<<Pa;if((ma&ba|0)==0){c[10708>>2]=ma|ba;c[m>>2]=M;c[na+24>>2]=m;c[na+12>>2]=na;c[na+8>>2]=na;break}ba=c[m>>2]|0;if((Pa|0)==31){Qa=0}else{Qa=25-(Pa>>>1)|0}m:do{if((c[ba+4>>2]&-8|0)==($|0)){Ra=ba}else{m=$<<Qa;ma=ba;while(1){Sa=ma+(m>>>31<<2)+16|0;aa=c[Sa>>2]|0;if((aa|0)==0){break}if((c[aa+4>>2]&-8|0)==($|0)){Ra=aa;break m}else{m=m<<1;ma=aa}}if(Sa>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[Sa>>2]=M;c[na+24>>2]=ma;c[na+12>>2]=na;c[na+8>>2]=na;break i}}}while(0);$=Ra+8|0;ba=c[$>>2]|0;m=c[10720>>2]|0;if(Ra>>>0<m>>>0){fa()}if(ba>>>0<m>>>0){fa()}else{c[ba+12>>2]=M;c[$>>2]=M;c[na+8>>2]=ba;c[na+12>>2]=Ra;c[na+24>>2]=0;break}}}while(0);na=c[10716>>2]|0;if(!(na>>>0>q>>>0)){break}ba=na-q|0;c[10716>>2]=ba;na=c[10728>>2]|0;$=na;c[10728>>2]=$+q;c[$+(q+4)>>2]=ba|1;c[na+4>>2]=q|3;p=na+8|0;i=b;return p|0}}while(0);c[(la()|0)>>2]=12;p=0;i=b;return p|0}function Fa(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;b=i;if((a|0)==0){i=b;return}d=a+ -8|0;e=d;f=c[10720>>2]|0;if(d>>>0<f>>>0){fa()}g=c[a+ -4>>2]|0;h=g&3;if((h|0)==1){fa()}j=g&-8;k=a+(j+ -8)|0;l=k;a:do{if((g&1|0)==0){m=c[d>>2]|0;if((h|0)==0){i=b;return}n=-8-m|0;o=a+n|0;p=o;q=m+j|0;if(o>>>0<f>>>0){fa()}if((p|0)==(c[10724>>2]|0)){r=a+(j+ -4)|0;if((c[r>>2]&3|0)!=3){s=p;t=q;break}c[10712>>2]=q;c[r>>2]=c[r>>2]&-2;c[a+(n+4)>>2]=q|1;c[k>>2]=q;i=b;return}r=m>>>3;if(m>>>0<256){m=c[a+(n+8)>>2]|0;u=c[a+(n+12)>>2]|0;v=10744+(r<<1<<2)|0;do{if((m|0)!=(v|0)){if(m>>>0<f>>>0){fa()}if((c[m+12>>2]|0)==(p|0)){break}fa()}}while(0);if((u|0)==(m|0)){c[2676]=c[2676]&~(1<<r);s=p;t=q;break}do{if((u|0)==(v|0)){w=u+8|0}else{if(u>>>0<f>>>0){fa()}x=u+8|0;if((c[x>>2]|0)==(p|0)){w=x;break}fa()}}while(0);c[m+12>>2]=u;c[w>>2]=m;s=p;t=q;break}v=o;r=c[a+(n+24)>>2]|0;x=c[a+(n+12)>>2]|0;do{if((x|0)==(v|0)){y=a+(n+20)|0;z=c[y>>2]|0;if((z|0)==0){A=a+(n+16)|0;B=c[A>>2]|0;if((B|0)==0){C=0;break}else{D=B;E=A}}else{D=z;E=y}while(1){y=D+20|0;z=c[y>>2]|0;if((z|0)!=0){E=y;D=z;continue}z=D+16|0;y=c[z>>2]|0;if((y|0)==0){break}else{D=y;E=z}}if(E>>>0<f>>>0){fa()}else{c[E>>2]=0;C=D;break}}else{z=c[a+(n+8)>>2]|0;if(z>>>0<f>>>0){fa()}y=z+12|0;if((c[y>>2]|0)!=(v|0)){fa()}A=x+8|0;if((c[A>>2]|0)==(v|0)){c[y>>2]=x;c[A>>2]=z;C=x;break}else{fa()}}}while(0);if((r|0)==0){s=p;t=q;break}x=c[a+(n+28)>>2]|0;o=11008+(x<<2)|0;do{if((v|0)==(c[o>>2]|0)){c[o>>2]=C;if((C|0)!=0){break}c[10708>>2]=c[10708>>2]&~(1<<x);s=p;t=q;break a}else{if(r>>>0<(c[10720>>2]|0)>>>0){fa()}m=r+16|0;if((c[m>>2]|0)==(v|0)){c[m>>2]=C}else{c[r+20>>2]=C}if((C|0)==0){s=p;t=q;break a}}}while(0);if(C>>>0<(c[10720>>2]|0)>>>0){fa()}c[C+24>>2]=r;v=c[a+(n+16)>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[C+16>>2]=v;c[v+24>>2]=C;break}}}while(0);v=c[a+(n+20)>>2]|0;if((v|0)==0){s=p;t=q;break}if(v>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[C+20>>2]=v;c[v+24>>2]=C;s=p;t=q;break}}else{s=e;t=j}}while(0);e=s;if(!(e>>>0<k>>>0)){fa()}C=a+(j+ -4)|0;f=c[C>>2]|0;if((f&1|0)==0){fa()}do{if((f&2|0)==0){if((l|0)==(c[10728>>2]|0)){D=(c[10716>>2]|0)+t|0;c[10716>>2]=D;c[10728>>2]=s;c[s+4>>2]=D|1;if((s|0)!=(c[10724>>2]|0)){i=b;return}c[10724>>2]=0;c[10712>>2]=0;i=b;return}if((l|0)==(c[10724>>2]|0)){D=(c[10712>>2]|0)+t|0;c[10712>>2]=D;c[10724>>2]=s;c[s+4>>2]=D|1;c[e+D>>2]=D;i=b;return}D=(f&-8)+t|0;E=f>>>3;b:do{if(f>>>0<256){w=c[a+j>>2]|0;h=c[a+(j|4)>>2]|0;d=10744+(E<<1<<2)|0;do{if((w|0)!=(d|0)){if(w>>>0<(c[10720>>2]|0)>>>0){fa()}if((c[w+12>>2]|0)==(l|0)){break}fa()}}while(0);if((h|0)==(w|0)){c[2676]=c[2676]&~(1<<E);break}do{if((h|0)==(d|0)){F=h+8|0}else{if(h>>>0<(c[10720>>2]|0)>>>0){fa()}g=h+8|0;if((c[g>>2]|0)==(l|0)){F=g;break}fa()}}while(0);c[w+12>>2]=h;c[F>>2]=w}else{d=k;g=c[a+(j+16)>>2]|0;v=c[a+(j|4)>>2]|0;do{if((v|0)==(d|0)){r=a+(j+12)|0;x=c[r>>2]|0;if((x|0)==0){o=a+(j+8)|0;m=c[o>>2]|0;if((m|0)==0){G=0;break}else{H=m;I=o}}else{H=x;I=r}while(1){r=H+20|0;x=c[r>>2]|0;if((x|0)!=0){I=r;H=x;continue}x=H+16|0;r=c[x>>2]|0;if((r|0)==0){break}else{H=r;I=x}}if(I>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[I>>2]=0;G=H;break}}else{x=c[a+j>>2]|0;if(x>>>0<(c[10720>>2]|0)>>>0){fa()}r=x+12|0;if((c[r>>2]|0)!=(d|0)){fa()}o=v+8|0;if((c[o>>2]|0)==(d|0)){c[r>>2]=v;c[o>>2]=x;G=v;break}else{fa()}}}while(0);if((g|0)==0){break}v=c[a+(j+20)>>2]|0;w=11008+(v<<2)|0;do{if((d|0)==(c[w>>2]|0)){c[w>>2]=G;if((G|0)!=0){break}c[10708>>2]=c[10708>>2]&~(1<<v);break b}else{if(g>>>0<(c[10720>>2]|0)>>>0){fa()}h=g+16|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=G}else{c[g+20>>2]=G}if((G|0)==0){break b}}}while(0);if(G>>>0<(c[10720>>2]|0)>>>0){fa()}c[G+24>>2]=g;d=c[a+(j+8)>>2]|0;do{if((d|0)!=0){if(d>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[G+16>>2]=d;c[d+24>>2]=G;break}}}while(0);d=c[a+(j+12)>>2]|0;if((d|0)==0){break}if(d>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[G+20>>2]=d;c[d+24>>2]=G;break}}}while(0);c[s+4>>2]=D|1;c[e+D>>2]=D;if((s|0)!=(c[10724>>2]|0)){J=D;break}c[10712>>2]=D;i=b;return}else{c[C>>2]=f&-2;c[s+4>>2]=t|1;c[e+t>>2]=t;J=t}}while(0);t=J>>>3;if(J>>>0<256){e=t<<1;f=10744+(e<<2)|0;C=c[2676]|0;G=1<<t;do{if((C&G|0)==0){c[2676]=C|G;K=10744+(e+2<<2)|0;L=f}else{t=10744+(e+2<<2)|0;j=c[t>>2]|0;if(!(j>>>0<(c[10720>>2]|0)>>>0)){K=t;L=j;break}fa()}}while(0);c[K>>2]=s;c[L+12>>2]=s;c[s+8>>2]=L;c[s+12>>2]=f;i=b;return}f=s;L=J>>>8;do{if((L|0)==0){M=0}else{if(J>>>0>16777215){M=31;break}K=(L+1048320|0)>>>16&8;e=L<<K;G=(e+520192|0)>>>16&4;C=e<<G;e=(C+245760|0)>>>16&2;j=14-(G|K|e)+(C<<e>>>15)|0;M=J>>>(j+7|0)&1|j<<1}}while(0);L=11008+(M<<2)|0;c[s+28>>2]=M;c[s+20>>2]=0;c[s+16>>2]=0;j=c[10708>>2]|0;e=1<<M;c:do{if((j&e|0)==0){c[10708>>2]=j|e;c[L>>2]=f;c[s+24>>2]=L;c[s+12>>2]=s;c[s+8>>2]=s}else{C=c[L>>2]|0;if((M|0)==31){N=0}else{N=25-(M>>>1)|0}d:do{if((c[C+4>>2]&-8|0)==(J|0)){O=C}else{K=J<<N;G=C;while(1){P=G+(K>>>31<<2)+16|0;t=c[P>>2]|0;if((t|0)==0){break}if((c[t+4>>2]&-8|0)==(J|0)){O=t;break d}else{K=K<<1;G=t}}if(P>>>0<(c[10720>>2]|0)>>>0){fa()}else{c[P>>2]=f;c[s+24>>2]=G;c[s+12>>2]=s;c[s+8>>2]=s;break c}}}while(0);C=O+8|0;D=c[C>>2]|0;K=c[10720>>2]|0;if(O>>>0<K>>>0){fa()}if(D>>>0<K>>>0){fa()}else{c[D+12>>2]=f;c[C>>2]=f;c[s+8>>2]=D;c[s+12>>2]=O;c[s+24>>2]=0;break}}}while(0);s=(c[10736>>2]|0)+ -1|0;c[10736>>2]=s;if((s|0)==0){Q=11160|0}else{i=b;return}while(1){s=c[Q>>2]|0;if((s|0)==0){break}else{Q=s+8|0}}c[10736>>2]=-1;i=b;return}function Ga(){}function Ha(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return ja(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function Ia(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function Ja(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nreturn{_strlen:Ja,_free:Fa,_main:Da,_memset:Ia,_malloc:Ea,_memcpy:Ha,runPostSets:Ga,stackAlloc:na,stackSave:oa,stackRestore:pa,setThrew:qa,setTempRet0:ta,setTempRet1:ua,setTempRet2:va,setTempRet3:wa,setTempRet4:xa,setTempRet5:ya,setTempRet6:za,setTempRet7:Aa,setTempRet8:Ba,setTempRet9:Ca}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"_clock\": _clock, \"_fflush\": _fflush, \"_abort\": _abort, \"___setErrNo\": ___setErrNo, \"_sbrk\": _sbrk, \"_time\": _time, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"_sysconf\": _sysconf, \"___errno_location\": ___errno_location, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"NaN\": NaN, \"Infinity\": Infinity }, buffer);\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _free = Module[\"_free\"] = asm[\"_free\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar _malloc = Module[\"_malloc\"] = asm[\"_malloc\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math = null;\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "float-mm.c", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\n\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(20195);\n/* global initializers */ __ATINIT__.push();\n\n\n/* memory initializer */ allocate([], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;\n\n \n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);\n \n function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n \n Module[\"_memset\"] = _memset;\n\n \n Module[\"_strlen\"] = _strlen;\n\n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;\n\n function _free() {\n }\n Module[\"_free\"] = _free;\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n\nvar Math_min = Math.min;\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=+env.NaN,r=+env.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.asmPrintInt;var ba=env.asmPrintFloat;var ca=env.min;var da=env._malloc;var ea=env._fflush;var fa=env._free;var ga=env._emscripten_memcpy_big;var ha=env.___setErrNo;var ia=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction ja(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function ka(){return i|0}function la(a){a=a|0;i=a}function ma(a,b){a=a|0;b=b|0;if((m|0)==0){m=a;n=b}}function na(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function oa(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function pa(a){a=a|0;B=a}function qa(a){a=a|0;C=a}function ra(a){a=a|0;D=a}function sa(a){a=a|0;E=a}function ta(a){a=a|0;F=a}function ua(a){a=a|0;G=a}function va(a){a=a|0;H=a}function wa(a){a=a|0;I=a}function xa(a){a=a|0;J=a}function ya(a){a=a|0;K=a}function za(a){a=a|0;var b=0,d=0,e=0,f=0,h=0,j=0.0;a=i;c[2]=74755;b=74755;d=1;while(1){e=b;f=1;do{e=(e*1309|0)+13849&65535;g[16+(d*164|0)+(f<<2)>>2]=+(((e>>>0)%120|0)+ -60|0)/3.0;f=f+1|0;}while((f|0)!=41);f=d+1|0;if((f|0)==41){break}else{b=e;d=f}}c[2]=e;d=e;e=1;while(1){h=d;b=1;do{h=(h*1309|0)+13849&65535;g[6744+(e*164|0)+(b<<2)>>2]=+(((h>>>0)%120|0)+ -60|0)/3.0;b=b+1|0;}while((b|0)!=41);b=e+1|0;if((b|0)==41){break}else{d=h;e=b}}c[2]=h;h=1;do{e=1;do{d=13472+(h*164|0)+(e<<2)|0;g[d>>2]=0.0;j=0.0;b=1;do{j=j+ +g[16+(h*164|0)+(b<<2)>>2]*+g[6744+(b*164|0)+(e<<2)>>2];b=b+1|0;}while((b|0)!=41);g[d>>2]=j;e=e+1|0;}while((e|0)!=41);h=h+1|0;}while((h|0)!=41);i=a;return}function Aa(){var a=0,b=0;a=i;b=0;do{za(0);b=b+1|0;}while((b|0)!=5e3);i=a;return 0}function Ba(){}function Ca(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function Da(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function Ea(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return ga(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nreturn{_strlen:Da,_memcpy:Ea,_main:Aa,_memset:Ca,runPostSets:Ba,stackAlloc:ja,stackSave:ka,stackRestore:la,setThrew:ma,setTempRet0:pa,setTempRet1:qa,setTempRet2:ra,setTempRet3:sa,setTempRet4:ta,setTempRet5:ua,setTempRet6:va,setTempRet7:wa,setTempRet8:xa,setTempRet9:ya}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"_malloc\": _malloc, \"_fflush\": _fflush, \"_free\": _free, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"___setErrNo\": ___setErrNo, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"NaN\": NaN, \"Infinity\": Infinity }, buffer);\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math = null;\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "gcc-loops.cpp", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\nvar __ZTVN10__cxxabiv117__class_type_infoE = 238440;\nvar __ZTVN10__cxxabiv120__si_class_type_infoE = 238480;\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(239307);\n/* global initializers */ __ATINIT__.push({ func: function() { __GLOBAL__I_a() } });\n\n\n/* memory initializer */ allocate([], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n/* memory initializer */ allocate([69,120,97,109,112,108,101,49,0,0,0,0,0,0,0,0,69,120,97,109,112,108,101,50,97,0,0,0,0,0,0,0,69,120,97,109,112,108,101,50,98,0,0,0,0,0,0,0,69,120,97,109,112,108,101,51,0,0,0,0,0,0,0,0,69,120,97,109,112,108,101,52,97,0,0,0,0,0,0,0,69,120,97,109,112,108,101,52,98,0,0,0,0,0,0,0,69,120,97,109,112,108,101,52,99,0,0,0,0,0,0,0,69,120,97,109,112,108,101,55,0,0,0,0,0,0,0,0,69,120,97,109,112,108,101,56,0,0,0,0,0,0,0,0,69,120,97,109,112,108,101,57,0,0,0,0,0,0,0,0,69,120,97,109,112,108,101,49,48,97,0,0,0,0,0,0,69,120,97,109,112,108,101,49,48,98,0,0,0,0,0,0,69,120,97,109,112,108,101,49,49,0,0,0,0,0,0,0,69,120,97,109,112,108,101,49,50,0,0,0,0,0,0,0,69,120,97,109,112,108,101,50,51,0,0,0,0,0,0,0,69,120,97,109,112,108,101,50,52,0,0,0,0,0,0,0,69,120,97,109,112,108,101,50,53,0,0,0,0,0,0,0,82,101,115,117,108,116,115,58,32,40,0,0,0,0,0,0,41,58,0,0,0,0,0,0,32,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,44,32,0,0,0,0,0,0,44,32,109,115,101,99,10], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+225280);\n/* memory initializer */ allocate([216,117,3,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,2,0,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,119,69,69,0,0,0,0,0,0,0,0,152,163,3,0,184,117,3,0,8,124,3,0,0,0,0,0,0,0,0,0,64,118,3,0,3,0,0,0,4,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,6,0,0,0,7,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,119,69,69,0,152,163,3,0,40,118,3,0,8,124,3,0,0,0,0,0,117,110,115,117,112,112,111,114,116,101,100,32,108,111,99,97,108,101,32,102,111,114,32,115,116,97,110,100,97,114,100,32,105,110,112,117,116,0,0,0,0,0,0,0,216,118,3,0,5,0,0,0,6,0,0,0,3,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,8,0,0,0,9,0,0,0,6,0,0,0,10,0,0,0,11,0,0,0,5,0,0,0,7,0,0,0,6,0,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,99,69,69,0,0,0,0,0,0,0,0,152,163,3,0,184,118,3,0,200,123,3,0,0,0,0,0,0,0,0,0,64,119,3,0,7,0,0,0,8,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,12,0,0,0,9,0,0,0,6,0,0,0,13,0,0,0,14,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,99,69,69,0,152,163,3,0,40,119,3,0,200,123,3,0,0,0,0,0,78,83,116,51,95,95,49,49,52,95,95,115,104,97,114,101,100,95,99,111,117,110,116,69,0,0,0,0,0,0,0,0,112,163,3,0,80,119,3,0,0,0,0,0,184,119,3,0,9,0,0,0,10,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,32,120,3,0,11,0,0,0,12,0,0,0,16,0,0,0,0,0,0,0,83,116,49,49,108,111,103,105,99,95,101,114,114,111,114,0,152,163,3,0,168,119,3,0,0,0,0,0,0,0,0,0,0,0,0,0,248,119,3,0,9,0,0,0,13,0,0,0,15,0,0,0,0,0,0,0,83,116,49,50,108,101,110,103,116,104,95,101,114,114,111,114,0,0,0,0,0,0,0,0,152,163,3,0,224,119,3,0,184,119,3,0,0,0,0,0,83,116,49,51,114,117,110,116,105,109,101,95,101,114,114,111,114,0,0,0,0,0,0,0,152,163,3,0,8,120,3,0,0,0,0,0,0,0,0,0,58,32,0,0,0,0,0,0,0,0,0,0,104,120,3,0,14,0,0,0,15,0,0,0,16,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,50,115,121,115,116,101,109,95,101,114,114,111,114,69,0,0,152,163,3,0,80,120,3,0,32,120,3,0,0,0,0,0,78,83,116,51,95,95,49,49,52,101,114,114,111,114,95,99,97,116,101,103,111,114,121,69,0,0,0,0,0,0,0,0,112,163,3,0,120,120,3,0,78,83,116,51,95,95,49,49,50,95,95,100,111,95,109,101,115,115,97,103,101,69,0,0,152,163,3,0,160,120,3,0,152,120,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,115,105,99,95,115,116,114,105,110,103,0,0,0,0,0,0,0,0,200,123,3,0,16,0,0,0,17,0,0,0,5,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,12,0,0,0,9,0,0,0,6,0,0,0,10,0,0,0,11,0,0,0,5,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,8,124,3,0,18,0,0,0,19,0,0,0,6,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,4,0,0,0,4,0,0,0,8,0,0,0,0,0,0,0,64,124,3,0,20,0,0,0,21,0,0,0,248,255,255,255,248,255,255,255,64,124,3,0,22,0,0,0,23,0,0,0,8,0,0,0,0,0,0,0,136,124,3,0,24,0,0,0,25,0,0,0,248,255,255,255,248,255,255,255,136,124,3,0,26,0,0,0,27,0,0,0,4,0,0,0,0,0,0,0,208,124,3,0,28,0,0,0,29,0,0,0,252,255,255,255,252,255,255,255,208,124,3,0,30,0,0,0,31,0,0,0,4,0,0,0,0,0,0,0,24,125,3,0,32,0,0,0,33,0,0,0,252,255,255,255,252,255,255,255,24,125,3,0,34,0,0,0,35,0,0,0,105,111,115,116,114,101,97,109,0,0,0,0,0,0,0,0,117,110,115,112,101,99,105,102,105,101,100,32,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,32,101,114,114,111,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,122,3,0,36,0,0,0,37,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,8,123,3,0,38,0,0,0,39,0,0,0,105,111,115,95,98,97,115,101,58,58,99,108,101,97,114,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,55,102,97,105,108,117,114,101,69,0,0,0,0,0,0,0,152,163,3,0,192,122,3,0,104,120,3,0,0,0,0,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,69,0,0,0,0,0,0,0,112,163,3,0,240,122,3,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,0,0,0,0,0,152,163,3,0,16,123,3,0,8,123,3,0,0,0,0,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,0,0,0,0,0,152,163,3,0,80,123,3,0,8,123,3,0,0,0,0,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,0,0,0,0,0,0,112,163,3,0,144,123,3,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,0,0,0,0,0,0,112,163,3,0,208,123,3,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,248,163,3,0,16,124,3,0,0,0,0,0,1,0,0,0,64,123,3,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,248,163,3,0,88,124,3,0,0,0,0,0,1,0,0,0,128,123,3,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,0,248,163,3,0,160,124,3,0,0,0,0,0,1,0,0,0,64,123,3,0,3,244,255,255,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,0,248,163,3,0,232,124,3,0,0,0,0,0,1,0,0,0,128,123,3,0,3,244,255,255,0,0,0,0,120,125,3,0,40,0,0,0,41,0,0,0,17,0,0,0,1,0,0,0,9,0,0,0,10,0,0,0,2,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,57,95,95,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,69,0,0,0,152,163,3,0,88,125,3,0,184,120,3,0,0,0,0,0,0,0,0,0,160,139,3,0,42,0,0,0,43,0,0,0,44,0,0,0,1,0,0,0,3,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,139,3,0,45,0,0,0,46,0,0,0,44,0,0,0,2,0,0,0,4,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,144,3,0,47,0,0,0,48,0,0,0,44,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,65,66,67,68,69,70,120,88,43,45,112,80,105,73,110,78,0,0,0,0,0,0,0,0,37,112,0,0,0,0,0,0,0,0,0,0,16,145,3,0,49,0,0,0,50,0,0,0,44,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,145,3,0,51,0,0,0,52,0,0,0,44,0,0,0,3,0,0,0,4,0,0,0,23,0,0,0,5,0,0,0,24,0,0,0,1,0,0,0,2,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,146,3,0,53,0,0,0,54,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,25,0,0,0,9,0,0,0,26,0,0,0,3,0,0,0,4,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,0,0,0,0,37,112,0,0,0,0,0,0,0,0,0,0,144,141,3,0,55,0,0,0,56,0,0,0,44,0,0,0,18,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,1,0,0,0,248,255,255,255,144,141,3,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,58,37,77,58,37,83,37,109,47,37,100,47,37,121,37,89,45,37,109,45,37,100,37,73,58,37,77,58,37,83,32,37,112,0,0,0,0,0,37,72,58,37,77,0,0,0,37,72,58,37,77,58,37,83,0,0,0,0,48,142,3,0,57,0,0,0,58,0,0,0,44,0,0,0,26,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,2,0,0,0,248,255,255,255,48,142,3,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,37,0,0,0,89,0,0,0,45,0,0,0,37,0,0,0,109,0,0,0,45,0,0,0,37,0,0,0,100,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,192,142,3,0,59,0,0,0,60,0,0,0,44,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,143,3,0,61,0,0,0,62,0,0,0,44,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,140,3,0,63,0,0,0,64,0,0,0,44,0,0,0,34,0,0,0,35,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,36,0,0,0,11,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,140,3,0,65,0,0,0,66,0,0,0,44,0,0,0,37,0,0,0,38,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,39,0,0,0,17,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,140,3,0,67,0,0,0,68,0,0,0,44,0,0,0,40,0,0,0,41,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,42,0,0,0,23,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216,140,3,0,69,0,0,0,70,0,0,0,44,0,0,0,43,0,0,0,44,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,45,0,0,0,29,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,146,3,0,71,0,0,0,72,0,0,0,44,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,0,0,0,0,0,0,37,76,102,0,0,0,0,0,109,111,110,101,121,95,103,101,116,32,101,114,114,111,114,0,0,0,0,0,136,147,3,0,73,0,0,0,74,0,0,0,44,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,0,0,0,0,0,0,0,0,0,0,24,148,3,0,75,0,0,0,76,0,0,0,44,0,0,0,1,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,46,48,76,102,0,0,0,0,0,0,0,168,148,3,0,77,0,0,0,78,0,0,0,44,0,0,0,2,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,143,3,0,79,0,0,0,80,0,0,0,44,0,0,0,13,0,0,0,11,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,143,3,0,81,0,0,0,82,0,0,0,44,0,0,0,14,0,0,0,12,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,118,101,99,116,111,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,120,139,3,0,83,0,0,0,84,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,136,3,0,85,0,0,0,86,0,0,0,44,0,0,0,9,0,0,0,15,0,0,0,10,0,0,0,16,0,0,0,11,0,0,0,1,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,137,3,0,87,0,0,0,88,0,0,0,44,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,46,0,0,0,47,0,0,0,5,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,139,3,0,89,0,0,0,90,0,0,0,44,0,0,0,49,0,0,0,50,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,0,0,0,0,80,139,3,0,91,0,0,0,92,0,0,0,44,0,0,0,51,0,0,0,52,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,116,114,117,101,0,0,0,0,116,0,0,0,114,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,102,97,108,115,101,0,0,0,102,0,0,0,97,0,0,0,108,0,0,0,115,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,109,47,37,100,47,37,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,58,37,77,58,37,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,97,32,37,98,32,37,100,32,37,72,58,37,77,58,37,83,32,37,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,97,0,0,0,32,0,0,0,37,0,0,0,98,0,0,0,32,0,0,0,37,0,0,0,100,0,0,0,32,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,73,58,37,77,58,37,83,32,37,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,108,111,99,97,108,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,0,0,0,0,0,0,0,136,135,3,0,93,0,0,0,94,0,0,0,44,0,0,0,0,0,0,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,102,97,99,101,116,69,0,0,0,152,163,3,0,112,135,3,0,112,119,3,0,0,0,0,0,0,0,0,0,24,136,3,0,93,0,0,0,95,0,0,0,44,0,0,0,18,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,12,0,0,0,19,0,0,0,13,0,0,0,20,0,0,0,14,0,0,0,5,0,0,0,21,0,0,0,6,0,0,0,0,0,0,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,119,69,69,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,48,99,116,121,112,101,95,98,97,115,101,69,0,0,0,0,112,163,3,0,248,135,3,0,248,163,3,0,224,135,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,136,3,0,2,0,0,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,99,69,69,0,0,0,0,0,0,0,248,163,3,0,56,136,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,136,3,0,2,0,0,0,0,0,0,0,232,136,3,0,93,0,0,0,96,0,0,0,44,0,0,0,3,0,0,0,4,0,0,0,7,0,0,0,53,0,0,0,54,0,0,0,8,0,0,0,55,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,99,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,0,78,83,116,51,95,95,49,49,50,99,111,100,101,99,118,116,95,98,97,115,101,69,0,0,112,163,3,0,200,136,3,0,248,163,3,0,160,136,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,224,136,3,0,2,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,119,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,0,248,163,3,0,8,137,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,224,136,3,0,2,0,0,0,0,0,0,0,168,137,3,0,93,0,0,0,97,0,0,0,44,0,0,0,5,0,0,0,6,0,0,0,9,0,0,0,56,0,0,0,57,0,0,0,10,0,0,0,58,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,115,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,248,163,3,0,128,137,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,224,136,3,0,2,0,0,0,0,0,0,0,32,138,3,0,93,0,0,0,98,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,59,0,0,0,60,0,0,0,12,0,0,0,61,0,0,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,105,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,0,0,0,0,0,248,163,3,0,248,137,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,224,136,3,0,2,0,0,0,0,0,0,0,152,138,3,0,93,0,0,0,99,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,59,0,0,0,60,0,0,0,12,0,0,0,61,0,0,0,78,83,116,51,95,95,49,49,54,95,95,110,97,114,114,111,119,95,116,111,95,117,116,102,56,73,76,106,51,50,69,69,69,0,0,0,0,0,0,0,152,163,3,0,112,138,3,0,32,138,3,0,0,0,0,0,0,0,0,0,0,139,3,0,93,0,0,0,100,0,0,0,44,0,0,0,7,0,0,0,8,0,0,0,11,0,0,0,59,0,0,0,60,0,0,0,12,0,0,0,61,0,0,0,78,83,116,51,95,95,49,49,55,95,95,119,105,100,101,110,95,102,114,111,109,95,117,116,102,56,73,76,106,51,50,69,69,69,0,0,0,0,0,0,152,163,3,0,216,138,3,0,32,138,3,0,0,0,0,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,99,69,69,0,0,0,0,152,163,3,0,16,139,3,0,136,135,3,0,0,0,0,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,119,69,69,0,0,0,0,152,163,3,0,56,139,3,0,136,135,3,0,0,0,0,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,95,95,105,109,112,69,0,0,0,152,163,3,0,96,139,3,0,136,135,3,0,0,0,0,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,99,69,69,0,0,0,0,0,152,163,3,0,136,139,3,0,136,135,3,0,0,0,0,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,119,69,69,0,0,0,0,0,152,163,3,0,176,139,3,0,136,135,3,0,0,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,48,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,95,98,97,115,101,69,0,0,0,0,112,163,3,0,248,139,3,0,248,163,3,0,216,139,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,140,3,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,49,69,69,69,0,0,0,0,0,248,163,3,0,56,140,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,140,3,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,48,69,69,69,0,0,0,0,0,248,163,3,0,120,140,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,140,3,0,2,0,0,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,49,69,69,69,0,0,0,0,0,248,163,3,0,184,140,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,140,3,0,2,0,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,57,116,105,109,101,95,98,97,115,101,69,0,0,0,0,0,0,112,163,3,0,64,141,3,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,99,69,69,0,0,0,0,0,0,0,112,163,3,0,96,141,3,0,248,163,3,0,248,140,3,0,0,0,0,0,3,0,0,0,136,135,3,0,2,0,0,0,88,141,3,0,2,0,0,0,136,141,3,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,119,69,69,0,0,0,0,0,0,0,112,163,3,0,0,142,3,0,248,163,3,0,184,141,3,0,0,0,0,0,3,0,0,0,136,135,3,0,2,0,0,0,88,141,3,0,2,0,0,0,40,142,3,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,78,83,116,51,95,95,49,49,48,95,95,116,105,109,101,95,112,117,116,69,0,0,0,0,112,163,3,0,160,142,3,0,248,163,3,0,88,142,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,184,142,3,0,0,8,0,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,248,163,3,0,224,142,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,184,142,3,0,0,8,0,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,99,69,69,0,0,0,0,78,83,116,51,95,95,49,49,51,109,101,115,115,97,103,101,115,95,98,97,115,101,69,0,112,163,3,0,96,143,3,0,248,163,3,0,72,143,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,120,143,3,0,2,0,0,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,119,69,69,0,0,0,0,248,163,3,0,160,143,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,120,143,3,0,2,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,99,69,69,0,0,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,103,101,116,95,98,97,115,101,69,0,0,0,0,0,0,0,0,112,163,3,0,56,144,3,0,248,163,3,0,32,144,3,0,0,0,0,0,1,0,0,0,88,144,3,0,0,0,0,0,248,163,3,0,216,143,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,96,144,3,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,119,69,69,0,0,0,248,163,3,0,224,144,3,0,0,0,0,0,1,0,0,0,88,144,3,0,0,0,0,0,248,163,3,0,152,144,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,248,144,3,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,99,69,69,0,0,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,112,117,116,95,98,97,115,101,69,0,0,0,0,0,0,0,0,112,163,3,0,144,145,3,0,248,163,3,0,120,145,3,0,0,0,0,0,1,0,0,0,176,145,3,0,0,0,0,0,248,163,3,0,48,145,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,184,145,3,0,0,0,0,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,0,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,119,69,69,0,0,0,248,163,3,0,56,146,3,0,0,0,0,0,1,0,0,0,176,145,3,0,0,0,0,0,248,163,3,0,240,145,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,80,146,3,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,99,69,69,0,0,0,0,0,0,0,0,112,163,3,0,208,146,3,0,248,163,3,0,136,146,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,240,146,3,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,119,69,69,0,0,0,0,0,0,0,0,112,163,3,0,96,147,3,0,248,163,3,0,24,147,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,128,147,3,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,99,69,69,0,0,0,0,0,0,0,0,112,163,3,0,240,147,3,0,248,163,3,0,168,147,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,16,148,3,0,0,0,0,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,0,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,119,69,69,0,0,0,0,0,0,0,0,112,163,3,0,128,148,3,0,248,163,3,0,56,148,3,0,0,0,0,0,2,0,0,0,136,135,3,0,2,0,0,0,160,148,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,77,0,0,0,0,0,0,80,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,114,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,99,0,0,0,104,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,105,0,0,0,108,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,117,0,0,0,115,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,116,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,111,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+226676);\n/* memory initializer */ allocate([74,97,110,117,97,114,121,0,70,101,98,114,117,97,114,121,0,0,0,0,0,0,0,0,77,97,114,99,104,0,0,0,65,112,114,105,108,0,0,0,77,97,121,0,0,0,0,0,74,117,110,101,0,0,0,0,74,117,108,121,0,0,0,0,65,117,103,117,115,116,0,0,83,101,112,116,101,109,98,101,114,0,0,0,0,0,0,0,79,99,116,111,98,101,114,0,78,111,118,101,109,98,101,114,0,0,0,0,0,0,0,0,68,101,99,101,109,98,101,114,0,0,0,0,0,0,0,0,74,97,110,0,0,0,0,0,70,101,98,0,0,0,0,0,77,97,114,0,0,0,0,0,65,112,114,0,0,0,0,0,74,117,110,0,0,0,0,0,74,117,108,0,0,0,0,0,65,117,103,0,0,0,0,0,83,101,112,0,0,0,0,0,79,99,116,0,0,0,0,0,78,111,118,0,0,0,0,0,68,101,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,110,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,114,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,117,0,0,0,114,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,117,110,100,97,121,0,0,77,111,110,100,97,121,0,0,84,117,101,115,100,97,121,0,87,101,100,110,101,115,100,97,121,0,0,0,0,0,0,0,84,104,117,114,115,100,97,121,0,0,0,0,0,0,0,0,70,114,105,100,97,121,0,0,83,97,116,117,114,100,97,121,0,0,0,0,0,0,0,0,83,117,110,0,0,0,0,0,77,111,110,0,0,0,0,0,84,117,101,0,0,0,0,0,87,101,100,0,0,0,0,0,84,104,117,0,0,0,0,0,70,114,105,0,0,0,0,0,83,97,116,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,162,3,0,101,0,0,0,102,0,0,0,62,0,0,0,0,0,0,0,115,116,100,58,58,98,97,100,95,99,97,115,116,0,0,0,83,116,57,116,121,112,101,95,105,110,102,111,0,0,0,0,112,163,3,0,192,162,3,0,83,116,56,98,97,100,95,99,97,115,116,0,0,0,0,0,152,163,3,0,216,162,3,0,0,0,0,0,0,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,0,0,0,0,152,163,3,0,248,162,3,0,208,162,3,0,0,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,0,0,0,152,163,3,0,48,163,3,0,32,163,3,0,0,0,0,0,0,0,0,0,88,163,3,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,22,0,0,0,13,0,0,0,1,0,0,0,5,0,0,0,0,0,0,0,224,163,3,0,103,0,0,0,107,0,0,0,105,0,0,0,106,0,0,0,22,0,0,0,14,0,0,0,2,0,0,0,6,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,152,163,3,0,184,163,3,0,88,163,3,0,0,0,0,0,0,0,0,0,64,164,3,0,103,0,0,0,108,0,0,0,105,0,0,0,106,0,0,0,22,0,0,0,15,0,0,0,3,0,0,0,7,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,49,95,95,118,109,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,152,163,3,0,24,164,3,0,88,163,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,166,3,0,109,0,0,0,110,0,0,0,63,0,0,0,0,0,0,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,0,83,116,57,98,97,100,95,97,108,108,111,99,0,0,0,0,152,163,3,0,112,166,3,0,0,0,0,0,0,0,0,0,105,110,102,105,110,105,116,121,0,0,0,0,0,0,0,0,110,97,110,0,0,0,0,0,95,112,137,0,255,9,47,15,10,0,0,0,100,0,0,0,232,3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+236936);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n function _llvm_lifetime_end() {}\n\n \n function _atexit(func, arg) {\n __ATEXIT__.unshift({ func: func, arg: arg });\n }var ___cxa_atexit=_atexit;\n\n \n \n Module[\"_memset\"] = _memset;var _llvm_memset_p0i8_i32=_memset;\n\n \n Module[\"_i64Subtract\"] = _i64Subtract;\n\n \n Module[\"_i64Add\"] = _i64Add;\n\n \n function __ZSt18uncaught_exceptionv() { // std::uncaught_exception()\n return !!__ZSt18uncaught_exceptionv.uncaught_exception;\n }\n \n \n \n function ___cxa_is_number_type(type) {\n var isNumber = false;\n try { if (type == __ZTIi) isNumber = true } catch(e){}\n try { if (type == __ZTIj) isNumber = true } catch(e){}\n try { if (type == __ZTIl) isNumber = true } catch(e){}\n try { if (type == __ZTIm) isNumber = true } catch(e){}\n try { if (type == __ZTIx) isNumber = true } catch(e){}\n try { if (type == __ZTIy) isNumber = true } catch(e){}\n try { if (type == __ZTIf) isNumber = true } catch(e){}\n try { if (type == __ZTId) isNumber = true } catch(e){}\n try { if (type == __ZTIe) isNumber = true } catch(e){}\n try { if (type == __ZTIc) isNumber = true } catch(e){}\n try { if (type == __ZTIa) isNumber = true } catch(e){}\n try { if (type == __ZTIh) isNumber = true } catch(e){}\n try { if (type == __ZTIs) isNumber = true } catch(e){}\n try { if (type == __ZTIt) isNumber = true } catch(e){}\n return isNumber;\n }function ___cxa_does_inherit(definiteType, possibilityType, possibility) {\n if (possibility == 0) return false;\n if (possibilityType == 0 || possibilityType == definiteType)\n return true;\n var possibility_type_info;\n if (___cxa_is_number_type(possibilityType)) {\n possibility_type_info = possibilityType;\n } else {\n var possibility_type_infoAddr = HEAP32[((possibilityType)>>2)] - 8;\n possibility_type_info = HEAP32[((possibility_type_infoAddr)>>2)];\n }\n switch (possibility_type_info) {\n case 0: // possibility is a pointer\n // See if definite type is a pointer\n var definite_type_infoAddr = HEAP32[((definiteType)>>2)] - 8;\n var definite_type_info = HEAP32[((definite_type_infoAddr)>>2)];\n if (definite_type_info == 0) {\n // Also a pointer; compare base types of pointers\n var defPointerBaseAddr = definiteType+8;\n var defPointerBaseType = HEAP32[((defPointerBaseAddr)>>2)];\n var possPointerBaseAddr = possibilityType+8;\n var possPointerBaseType = HEAP32[((possPointerBaseAddr)>>2)];\n return ___cxa_does_inherit(defPointerBaseType, possPointerBaseType, possibility);\n } else\n return false; // one pointer and one non-pointer\n case 1: // class with no base class\n return false;\n case 2: // class with base class\n var parentTypeAddr = possibilityType + 8;\n var parentType = HEAP32[((parentTypeAddr)>>2)];\n return ___cxa_does_inherit(definiteType, parentType, possibility);\n default:\n return false; // some unencountered type\n }\n }\n \n \n \n var ___cxa_last_thrown_exception=0;function ___resumeException(ptr) {\n if (!___cxa_last_thrown_exception) { ___cxa_last_thrown_exception = ptr; }\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n \n var ___cxa_exception_header_size=8;function ___cxa_find_matching_catch(thrown, throwntype) {\n if (thrown == -1) thrown = ___cxa_last_thrown_exception;\n header = thrown - ___cxa_exception_header_size;\n if (throwntype == -1) throwntype = HEAP32[((header)>>2)];\n var typeArray = Array.prototype.slice.call(arguments, 2);\n \n // If throwntype is a pointer, this means a pointer has been\n // thrown. When a pointer is thrown, actually what's thrown\n // is a pointer to the pointer. We'll dereference it.\n if (throwntype != 0 && !___cxa_is_number_type(throwntype)) {\n var throwntypeInfoAddr= HEAP32[((throwntype)>>2)] - 8;\n var throwntypeInfo= HEAP32[((throwntypeInfoAddr)>>2)];\n if (throwntypeInfo == 0)\n thrown = HEAP32[((thrown)>>2)];\n }\n // The different catch blocks are denoted by different types.\n // Due to inheritance, those types may not precisely match the\n // type of the thrown object. Find one which matches, and\n // return the type of the catch block which should be called.\n for (var i = 0; i < typeArray.length; i++) {\n if (___cxa_does_inherit(typeArray[i], throwntype, thrown))\n return ((asm[\"setTempRet0\"](typeArray[i]),thrown)|0);\n }\n // Shouldn't happen unless we have bogus data in typeArray\n // or encounter a type for which emscripten doesn't have suitable\n // typeinfo defined. Best-efforts match just in case.\n return ((asm[\"setTempRet0\"](throwntype),thrown)|0);\n }function ___cxa_throw(ptr, type, destructor) {\n if (!___cxa_throw.initialized) {\n try {\n HEAP32[((__ZTVN10__cxxabiv119__pointer_type_infoE)>>2)]=0; // Workaround for libcxxabi integration bug\n } catch(e){}\n try {\n HEAP32[((__ZTVN10__cxxabiv117__class_type_infoE)>>2)]=1; // Workaround for libcxxabi integration bug\n } catch(e){}\n try {\n HEAP32[((__ZTVN10__cxxabiv120__si_class_type_infoE)>>2)]=2; // Workaround for libcxxabi integration bug\n } catch(e){}\n ___cxa_throw.initialized = true;\n }\n var header = ptr - ___cxa_exception_header_size;\n HEAP32[((header)>>2)]=type;\n HEAP32[(((header)+(4))>>2)]=destructor;\n ___cxa_last_thrown_exception = ptr;\n if (!(\"uncaught_exception\" in __ZSt18uncaught_exceptionv)) {\n __ZSt18uncaught_exceptionv.uncaught_exception = 1;\n } else {\n __ZSt18uncaught_exceptionv.uncaught_exception++;\n }\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n\n function _pthread_mutex_lock() {}\n\n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }\n\n \n \n \n function _isspace(chr) {\n return (chr == 32) || (chr >= 9 && chr <= 13);\n }\n function __parseInt64(str, endptr, base, min, max, unsign) {\n var isNegative = false;\n // Skip space.\n while (_isspace(HEAP8[(str)])) str++;\n \n // Check for a plus/minus sign.\n if (HEAP8[(str)] == 45) {\n str++;\n isNegative = true;\n } else if (HEAP8[(str)] == 43) {\n str++;\n }\n \n // Find base.\n var ok = false;\n var finalBase = base;\n if (!finalBase) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n finalBase = 16;\n str += 2;\n } else {\n finalBase = 8;\n ok = true; // we saw an initial zero, perhaps the entire thing is just \"0\"\n }\n }\n } else if (finalBase==16) {\n if (HEAP8[(str)] == 48) {\n if (HEAP8[((str+1)|0)] == 120 ||\n HEAP8[((str+1)|0)] == 88) {\n str += 2;\n }\n }\n }\n if (!finalBase) finalBase = 10;\n var start = str;\n \n // Get digits.\n var chr;\n while ((chr = HEAP8[(str)]) != 0) {\n var digit = parseInt(String.fromCharCode(chr), finalBase);\n if (isNaN(digit)) {\n break;\n } else {\n str++;\n ok = true;\n }\n }\n \n if (!ok) {\n ___setErrNo(ERRNO_CODES.EINVAL);\n return ((asm[\"setTempRet0\"](0),0)|0);\n }\n \n // Set end pointer.\n if (endptr) {\n HEAP32[((endptr)>>2)]=str;\n }\n \n try {\n var numberString = isNegative ? '-'+Pointer_stringify(start, str - start) : Pointer_stringify(start, str - start);\n i64Math.fromString(numberString, finalBase, min, max, unsign);\n } catch(e) {\n ___setErrNo(ERRNO_CODES.ERANGE); // not quite correct\n }\n \n return ((asm[\"setTempRet0\"](((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)),((HEAP32[((tempDoublePtr)>>2)])|0))|0);\n }function _strtoull(str, endptr, base) {\n return __parseInt64(str, endptr, base, 0, '18446744073709551615', true); // ULONG_MAX.\n }function _strtoull_l(str, endptr, base) {\n return _strtoull(str, endptr, base); // no locale support yet\n }\n\n function _sysconf(name) {\n // long sysconf(int name);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html\n switch(name) {\n case 30: return PAGE_SIZE;\n case 132:\n case 133:\n case 12:\n case 137:\n case 138:\n case 15:\n case 235:\n case 16:\n case 17:\n case 18:\n case 19:\n case 20:\n case 149:\n case 13:\n case 10:\n case 236:\n case 153:\n case 9:\n case 21:\n case 22:\n case 159:\n case 154:\n case 14:\n case 77:\n case 78:\n case 139:\n case 80:\n case 81:\n case 79:\n case 82:\n case 68:\n case 67:\n case 164:\n case 11:\n case 29:\n case 47:\n case 48:\n case 95:\n case 52:\n case 51:\n case 46:\n return 200809;\n case 27:\n case 246:\n case 127:\n case 128:\n case 23:\n case 24:\n case 160:\n case 161:\n case 181:\n case 182:\n case 242:\n case 183:\n case 184:\n case 243:\n case 244:\n case 245:\n case 165:\n case 178:\n case 179:\n case 49:\n case 50:\n case 168:\n case 169:\n case 175:\n case 170:\n case 171:\n case 172:\n case 97:\n case 76:\n case 32:\n case 173:\n case 35:\n return -1;\n case 176:\n case 177:\n case 7:\n case 155:\n case 8:\n case 157:\n case 125:\n case 126:\n case 92:\n case 93:\n case 129:\n case 130:\n case 131:\n case 94:\n case 91:\n return 1;\n case 74:\n case 60:\n case 69:\n case 70:\n case 4:\n return 1024;\n case 31:\n case 42:\n case 72:\n return 32;\n case 87:\n case 26:\n case 33:\n return 2147483647;\n case 34:\n case 1:\n return 47839;\n case 38:\n case 36:\n return 99;\n case 43:\n case 37:\n return 2048;\n case 0: return 2097152;\n case 3: return 65536;\n case 28: return 32768;\n case 44: return 32767;\n case 75: return 16384;\n case 39: return 1000;\n case 89: return 700;\n case 71: return 256;\n case 40: return 255;\n case 2: return 100;\n case 180: return 64;\n case 25: return 20;\n case 5: return 16;\n case 6: return 6;\n case 73: return 4;\n case 84: return 1;\n }\n ___setErrNo(ERRNO_CODES.EINVAL);\n return -1;\n }\n\n \n \n \n \n function _mkport() { throw 'TODO' }var SOCKFS={mount:function (mount) {\n return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createSocket:function (family, type, protocol) {\n var streaming = type == 1;\n if (protocol) {\n assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp\n }\n \n // create our internal socket structure\n var sock = {\n family: family,\n type: type,\n protocol: protocol,\n server: null,\n peers: {},\n pending: [],\n recv_queue: [],\n sock_ops: SOCKFS.websocket_sock_ops\n };\n \n // create the filesystem node to store the socket structure\n var name = SOCKFS.nextname();\n var node = FS.createNode(SOCKFS.root, name, 49152, 0);\n node.sock = sock;\n \n // and the wrapping stream that enables library functions such\n // as read and write to indirectly interact with the socket\n var stream = FS.createStream({\n path: name,\n node: node,\n flags: FS.modeStringToFlags('r+'),\n seekable: false,\n stream_ops: SOCKFS.stream_ops\n });\n \n // map the new stream to the socket structure (sockets have a 1:1\n // relationship with a stream)\n sock.stream = stream;\n \n return sock;\n },getSocket:function (fd) {\n var stream = FS.getStream(fd);\n if (!stream || !FS.isSocket(stream.node.mode)) {\n return null;\n }\n return stream.node.sock;\n },stream_ops:{poll:function (stream) {\n var sock = stream.node.sock;\n return sock.sock_ops.poll(sock);\n },ioctl:function (stream, request, varargs) {\n var sock = stream.node.sock;\n return sock.sock_ops.ioctl(sock, request, varargs);\n },read:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n var msg = sock.sock_ops.recvmsg(sock, length);\n if (!msg) {\n // socket is closed\n return 0;\n }\n buffer.set(msg.buffer, offset);\n return msg.buffer.length;\n },write:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n return sock.sock_ops.sendmsg(sock, buffer, offset, length);\n },close:function (stream) {\n var sock = stream.node.sock;\n sock.sock_ops.close(sock);\n }},nextname:function () {\n if (!SOCKFS.nextname.current) {\n SOCKFS.nextname.current = 0;\n }\n return 'socket[' + (SOCKFS.nextname.current++) + ']';\n },websocket_sock_ops:{createPeer:function (sock, addr, port) {\n var ws;\n \n if (typeof addr === 'object') {\n ws = addr;\n addr = null;\n port = null;\n }\n \n if (ws) {\n // for sockets that've already connected (e.g. we're the server)\n // we can inspect the _socket property for the address\n if (ws._socket) {\n addr = ws._socket.remoteAddress;\n port = ws._socket.remotePort;\n }\n // if we're just now initializing a connection to the remote,\n // inspect the url property\n else {\n var result = /ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);\n if (!result) {\n throw new Error('WebSocket URL must be in the format ws(s)://address:port');\n }\n addr = result[1];\n port = parseInt(result[2], 10);\n }\n } else {\n // create the actual websocket object and connect\n try {\n var url = 'ws://' + addr + ':' + port;\n // the node ws library API is slightly different than the browser's\n var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];\n // If node we use the ws library.\n var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];\n ws = new WebSocket(url, opts);\n ws.binaryType = 'arraybuffer';\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);\n }\n }\n \n \n var peer = {\n addr: addr,\n port: port,\n socket: ws,\n dgram_send_queue: []\n };\n \n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);\n \n // if this is a bound dgram socket, send the port number first to allow\n // us to override the ephemeral port reported to us by remotePort on the\n // remote end.\n if (sock.type === 2 && typeof sock.sport !== 'undefined') {\n peer.dgram_send_queue.push(new Uint8Array([\n 255, 255, 255, 255,\n 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),\n ((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)\n ]));\n }\n \n return peer;\n },getPeer:function (sock, addr, port) {\n return sock.peers[addr + ':' + port];\n },addPeer:function (sock, peer) {\n sock.peers[peer.addr + ':' + peer.port] = peer;\n },removePeer:function (sock, peer) {\n delete sock.peers[peer.addr + ':' + peer.port];\n },handlePeerEvents:function (sock, peer) {\n var first = true;\n \n var handleOpen = function () {\n try {\n var queued = peer.dgram_send_queue.shift();\n while (queued) {\n peer.socket.send(queued);\n queued = peer.dgram_send_queue.shift();\n }\n } catch (e) {\n // not much we can do here in the way of proper error handling as we've already\n // lied and said this data was sent. shut it down.\n peer.socket.close();\n }\n };\n \n function handleMessage(data) {\n assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer\n data = new Uint8Array(data); // make a typed array view on the array buffer\n \n \n // if this is the port message, override the peer's port with it\n var wasfirst = first;\n first = false;\n if (wasfirst &&\n data.length === 10 &&\n data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&\n data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {\n // update the peer's port and it's key in the peer map\n var newport = ((data[8] << 8) | data[9]);\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n peer.port = newport;\n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n return;\n }\n \n sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });\n };\n \n if (ENVIRONMENT_IS_NODE) {\n peer.socket.on('open', handleOpen);\n peer.socket.on('message', function(data, flags) {\n if (!flags.binary) {\n return;\n }\n handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer\n });\n peer.socket.on('error', function() {\n // don't throw\n });\n } else {\n peer.socket.onopen = handleOpen;\n peer.socket.onmessage = function peer_socket_onmessage(event) {\n handleMessage(event.data);\n };\n }\n },poll:function (sock) {\n if (sock.type === 1 && sock.server) {\n // listen sockets should only say they're available for reading\n // if there are pending clients.\n return sock.pending.length ? (64 | 1) : 0;\n }\n \n var mask = 0;\n var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets\n SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :\n null;\n \n if (sock.recv_queue.length ||\n !dest || // connection-less sockets are always ready to read\n (dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed\n mask |= (64 | 1);\n }\n \n if (!dest || // connection-less sockets are always ready to write\n (dest && dest.socket.readyState === dest.socket.OPEN)) {\n mask |= 4;\n }\n \n if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) {\n mask |= 16;\n }\n \n return mask;\n },ioctl:function (sock, request, arg) {\n switch (request) {\n case 21531:\n var bytes = 0;\n if (sock.recv_queue.length) {\n bytes = sock.recv_queue[0].data.length;\n }\n HEAP32[((arg)>>2)]=bytes;\n return 0;\n default:\n return ERRNO_CODES.EINVAL;\n }\n },close:function (sock) {\n // if we've spawned a listen server, close it\n if (sock.server) {\n try {\n sock.server.close();\n } catch (e) {\n }\n sock.server = null;\n }\n // close any peer connections\n var peers = Object.keys(sock.peers);\n for (var i = 0; i < peers.length; i++) {\n var peer = sock.peers[peers[i]];\n try {\n peer.socket.close();\n } catch (e) {\n }\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n }\n return 0;\n },bind:function (sock, addr, port) {\n if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound\n }\n sock.saddr = addr;\n sock.sport = port || _mkport();\n // in order to emulate dgram sockets, we need to launch a listen server when\n // binding on a connection-less socket\n // note: this is only required on the server side\n if (sock.type === 2) {\n // close the existing server if it exists\n if (sock.server) {\n sock.server.close();\n sock.server = null;\n }\n // swallow error operation not supported error that occurs when binding in the\n // browser where this isn't supported\n try {\n sock.sock_ops.listen(sock, 0);\n } catch (e) {\n if (!(e instanceof FS.ErrnoError)) throw e;\n if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;\n }\n }\n },connect:function (sock, addr, port) {\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);\n }\n \n // TODO autobind\n // if (!sock.addr && sock.type == 2) {\n // }\n \n // early out if we're already connected / in the middle of connecting\n if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n if (dest) {\n if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EALREADY);\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EISCONN);\n }\n }\n }\n \n // add the socket to our peer list and set our\n // destination address / port to match\n var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n sock.daddr = peer.addr;\n sock.dport = peer.port;\n \n // always \"fail\" in non-blocking mode\n throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);\n },listen:function (sock, backlog) {\n if (!ENVIRONMENT_IS_NODE) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening\n }\n var WebSocketServer = require('ws').Server;\n var host = sock.saddr;\n sock.server = new WebSocketServer({\n host: host,\n port: sock.sport\n // TODO support backlog\n });\n \n sock.server.on('connection', function(ws) {\n if (sock.type === 1) {\n var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);\n \n // create a peer on the new socket\n var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);\n newsock.daddr = peer.addr;\n newsock.dport = peer.port;\n \n // push to queue for accept to pick up\n sock.pending.push(newsock);\n } else {\n // create a peer on the listen socket so calling sendto\n // with the listen socket and an address will resolve\n // to the correct client\n SOCKFS.websocket_sock_ops.createPeer(sock, ws);\n }\n });\n sock.server.on('closed', function() {\n sock.server = null;\n });\n sock.server.on('error', function() {\n // don't throw\n });\n },accept:function (listensock) {\n if (!listensock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var newsock = listensock.pending.shift();\n newsock.stream.flags = listensock.stream.flags;\n return newsock;\n },getname:function (sock, peer) {\n var addr, port;\n if (peer) {\n if (sock.daddr === undefined || sock.dport === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n addr = sock.daddr;\n port = sock.dport;\n } else {\n // TODO saddr and sport will be set for bind()'d UDP sockets, but what\n // should we be returning for TCP sockets that've been connect()'d?\n addr = sock.saddr || 0;\n port = sock.sport || 0;\n }\n return { addr: addr, port: port };\n },sendmsg:function (sock, buffer, offset, length, addr, port) {\n if (sock.type === 2) {\n // connection-less sockets will honor the message address,\n // and otherwise fall back to the bound destination address\n if (addr === undefined || port === undefined) {\n addr = sock.daddr;\n port = sock.dport;\n }\n // if there was no address to fall back to, error out\n if (addr === undefined || port === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);\n }\n } else {\n // connection-based sockets will only use the bound\n addr = sock.daddr;\n port = sock.dport;\n }\n \n // find the peer for the destination address\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);\n \n // early out if not connected with a connection-based socket\n if (sock.type === 1) {\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n } else if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // create a copy of the incoming data to send, as the WebSocket API\n // doesn't work entirely with an ArrayBufferView, it'll just send\n // the entire underlying buffer\n var data;\n if (buffer instanceof Array || buffer instanceof ArrayBuffer) {\n data = buffer.slice(offset, offset + length);\n } else { // ArrayBufferView\n data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);\n }\n \n // if we're emulating a connection-less dgram socket and don't have\n // a cached connection, queue the buffer to send upon connect and\n // lie, saying the data was sent now.\n if (sock.type === 2) {\n if (!dest || dest.socket.readyState !== dest.socket.OPEN) {\n // if we're not connected, open a new connection\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n }\n dest.dgram_send_queue.push(data);\n return length;\n }\n }\n \n try {\n // send the actual data\n dest.socket.send(data);\n return length;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n },recvmsg:function (sock, length) {\n // http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html\n if (sock.type === 1 && sock.server) {\n // tcp servers should not be recv()'ing on the listen socket\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n \n var queued = sock.recv_queue.shift();\n if (!queued) {\n if (sock.type === 1) {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n \n if (!dest) {\n // if we have a destination address but are not connected, error out\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n // return null if the socket has closed\n return null;\n }\n else {\n // else, our socket is in a valid state but truly has nothing available\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // queued.data will be an ArrayBuffer if it's unadulterated, but if it's\n // requeued TCP data it'll be an ArrayBufferView\n var queuedLength = queued.data.byteLength || queued.data.length;\n var queuedOffset = queued.data.byteOffset || 0;\n var queuedBuffer = queued.data.buffer || queued.data;\n var bytesRead = Math.min(length, queuedLength);\n var res = {\n buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),\n addr: queued.addr,\n port: queued.port\n };\n \n \n // push back any unread data for TCP connections\n if (sock.type === 1 && bytesRead < queuedLength) {\n var bytesRemaining = queuedLength - bytesRead;\n queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);\n sock.recv_queue.unshift(queued);\n }\n \n return res;\n }}};function _send(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _write(fd, buf, len);\n }\n \n function _pwrite(fildes, buf, nbyte, offset) {\n // ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _write(fildes, buf, nbyte) {\n // ssize_t write(int fildes, const void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }\n \n function _fileno(stream) {\n // int fileno(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) return -1;\n return stream.fd;\n }function _fwrite(ptr, size, nitems, stream) {\n // size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html\n var bytesToWrite = nitems * size;\n if (bytesToWrite == 0) return 0;\n var fd = _fileno(stream);\n var bytesWritten = _write(fd, ptr, bytesToWrite);\n if (bytesWritten == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return 0;\n } else {\n return Math.floor(bytesWritten / size);\n }\n }\n\n \n function _strtoll(str, endptr, base) {\n return __parseInt64(str, endptr, base, '-9223372036854775808', '9223372036854775807'); // LLONG_MIN, LLONG_MAX.\n }function _strtoll_l(str, endptr, base) {\n return _strtoll(str, endptr, base); // no locale support yet\n }\n\n\n \n \n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy; \n Module[\"_memmove\"] = _memmove;var _llvm_memmove_p0i8_p0i8_i32=_memmove;\n\n function _pthread_cond_broadcast() {\n return 0;\n }\n\n \n \n function __exit(status) {\n // void _exit(int status);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html\n Module['exit'](status);\n }function _exit(status) {\n __exit(status);\n }function __ZSt9terminatev() {\n _exit(-1234);\n }\n\n function _gettimeofday(ptr) {\n var now = Date.now();\n HEAP32[((ptr)>>2)]=Math.floor(now/1000); // seconds\n HEAP32[(((ptr)+(4))>>2)]=Math.floor((now-1000*Math.floor(now/1000))*1000); // microseconds\n return 0;\n }\n\n function _pthread_mutex_unlock() {}\n\n \n function _isxdigit(chr) {\n return (chr >= 48 && chr <= 57) ||\n (chr >= 97 && chr <= 102) ||\n (chr >= 65 && chr <= 70);\n }function _isxdigit_l(chr) {\n return _isxdigit(chr); // no locale support yet\n }\n\n\n function _sbrk(bytes) {\n // Implement a Linux-like 'memory area' for our 'process'.\n // Changes the size of the memory area by |bytes|; returns the\n // address of the previous top ('break') of the memory area\n // We control the \"dynamic\" memory - DYNAMIC_BASE to DYNAMICTOP\n var self = _sbrk;\n if (!self.called) {\n DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned\n self.called = true;\n assert(Runtime.dynamicAlloc);\n self.alloc = Runtime.dynamicAlloc;\n Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };\n }\n var ret = DYNAMICTOP;\n if (bytes != 0) self.alloc(bytes);\n return ret; // Previous break location.\n }\n\n\n \n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;function _newlocale(mask, locale, base) {\n return _malloc(4);\n }\n\n\n function ___errno_location() {\n return ___errno_state;\n }\n\n var _BItoD=true;\n\n function _catclose(catd) {\n // int catclose (nl_catd catd)\n return 0;\n }\n\n \n \n \n function _free() {\n }\n Module[\"_free\"] = _free;function ___cxa_free_exception(ptr) {\n try {\n return _free(ptr - ___cxa_exception_header_size);\n } catch(e) { // XXX FIXME\n }\n }\n \n var ___cxa_caught_exceptions=[];function ___cxa_end_catch() {\n if (___cxa_end_catch.rethrown) {\n ___cxa_end_catch.rethrown = false;\n return;\n }\n // Clear state flag.\n asm['setThrew'](0);\n // Call destructor if one is registered then clear it.\n var ptr = ___cxa_caught_exceptions.pop();\n if (ptr) {\n header = ptr - ___cxa_exception_header_size;\n var destructor = HEAP32[(((header)+(4))>>2)];\n if (destructor) {\n Runtime.dynCall('vi', destructor, [ptr]);\n HEAP32[(((header)+(4))>>2)]=0;\n }\n ___cxa_free_exception(ptr);\n ___cxa_last_thrown_exception = 0;\n }\n }function ___cxa_rethrow() {\n ___cxa_end_catch.rethrown = true;\n var ptr = ___cxa_caught_exceptions.pop();\n throw ptr + \" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.\";\n }\n\n function _abort() {\n Module['abort']();\n }\n\n function _fmod(x, y) {\n return x % y;\n }\n\n function ___cxa_guard_release() {}\n\n function _ungetc(c, stream) {\n // int ungetc(int c, FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/ungetc.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) {\n return -1;\n }\n if (c === -1) {\n // do nothing for EOF character\n return c;\n }\n c = unSign(c & 0xFF);\n stream.ungotten.push(c);\n stream.eof = false;\n return c;\n }\n\n function _uselocale(locale) {\n return 0;\n }\n\n \n \n \n \n Module[\"_strlen\"] = _strlen;\n \n function __reallyNegative(x) {\n return x < 0 || (x === 0 && (1/x) === -Infinity);\n }function __formatString(format, varargs) {\n var textIndex = format;\n var argIndex = 0;\n function getNextArg(type) {\n // NOTE: Explicitly ignoring type safety. Otherwise this fails:\n // int x = 4; printf(\"%c\\n\", (char)x);\n var ret;\n if (type === 'double') {\n ret = (HEAP32[((tempDoublePtr)>>2)]=HEAP32[(((varargs)+(argIndex))>>2)],HEAP32[(((tempDoublePtr)+(4))>>2)]=HEAP32[(((varargs)+((argIndex)+(4)))>>2)],(+(HEAPF64[(tempDoublePtr)>>3])));\n } else if (type == 'i64') {\n ret = [HEAP32[(((varargs)+(argIndex))>>2)],\n HEAP32[(((varargs)+(argIndex+4))>>2)]];\n \n } else {\n type = 'i32'; // varargs are always i32, i64, or double\n ret = HEAP32[(((varargs)+(argIndex))>>2)];\n }\n argIndex += Runtime.getNativeFieldSize(type);\n return ret;\n }\n \n var ret = [];\n var curr, next, currArg;\n while(1) {\n var startTextIndex = textIndex;\n curr = HEAP8[(textIndex)];\n if (curr === 0) break;\n next = HEAP8[((textIndex+1)|0)];\n if (curr == 37) {\n // Handle flags.\n var flagAlwaysSigned = false;\n var flagLeftAlign = false;\n var flagAlternative = false;\n var flagZeroPad = false;\n var flagPadSign = false;\n flagsLoop: while (1) {\n switch (next) {\n case 43:\n flagAlwaysSigned = true;\n break;\n case 45:\n flagLeftAlign = true;\n break;\n case 35:\n flagAlternative = true;\n break;\n case 48:\n if (flagZeroPad) {\n break flagsLoop;\n } else {\n flagZeroPad = true;\n break;\n }\n case 32:\n flagPadSign = true;\n break;\n default:\n break flagsLoop;\n }\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n \n // Handle width.\n var width = 0;\n if (next == 42) {\n width = getNextArg('i32');\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n } else {\n while (next >= 48 && next <= 57) {\n width = width * 10 + (next - 48);\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n }\n \n // Handle precision.\n var precisionSet = false, precision = -1;\n if (next == 46) {\n precision = 0;\n precisionSet = true;\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n if (next == 42) {\n precision = getNextArg('i32');\n textIndex++;\n } else {\n while(1) {\n var precisionChr = HEAP8[((textIndex+1)|0)];\n if (precisionChr < 48 ||\n precisionChr > 57) break;\n precision = precision * 10 + (precisionChr - 48);\n textIndex++;\n }\n }\n next = HEAP8[((textIndex+1)|0)];\n }\n if (precision < 0) {\n precision = 6; // Standard default.\n precisionSet = false;\n }\n \n // Handle integer sizes. WARNING: These assume a 32-bit architecture!\n var argSize;\n switch (String.fromCharCode(next)) {\n case 'h':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 104) {\n textIndex++;\n argSize = 1; // char (actually i32 in varargs)\n } else {\n argSize = 2; // short (actually i32 in varargs)\n }\n break;\n case 'l':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 108) {\n textIndex++;\n argSize = 8; // long long\n } else {\n argSize = 4; // long\n }\n break;\n case 'L': // long long\n case 'q': // int64_t\n case 'j': // intmax_t\n argSize = 8;\n break;\n case 'z': // size_t\n case 't': // ptrdiff_t\n case 'I': // signed ptrdiff_t or unsigned size_t\n argSize = 4;\n break;\n default:\n argSize = null;\n }\n if (argSize) textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n \n // Handle type specifier.\n switch (String.fromCharCode(next)) {\n case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {\n // Integer.\n var signed = next == 100 || next == 105;\n argSize = argSize || 4;\n var currArg = getNextArg('i' + (argSize * 8));\n var origArg = currArg;\n var argText;\n // Flatten i64-1 [low, high] into a (slightly rounded) double\n if (argSize == 8) {\n currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);\n }\n // Truncate to requested size.\n if (argSize <= 4) {\n var limit = Math.pow(256, argSize) - 1;\n currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);\n }\n // Format the number.\n var currAbsArg = Math.abs(currArg);\n var prefix = '';\n if (next == 100 || next == 105) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else\n argText = reSign(currArg, 8 * argSize, 1).toString(10);\n } else if (next == 117) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else\n argText = unSign(currArg, 8 * argSize, 1).toString(10);\n currArg = Math.abs(currArg);\n } else if (next == 111) {\n argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);\n } else if (next == 120 || next == 88) {\n prefix = (flagAlternative && currArg != 0) ? '0x' : '';\n if (argSize == 8 && i64Math) {\n if (origArg[1]) {\n argText = (origArg[1]>>>0).toString(16);\n var lower = (origArg[0]>>>0).toString(16);\n while (lower.length < 8) lower = '0' + lower;\n argText += lower;\n } else {\n argText = (origArg[0]>>>0).toString(16);\n }\n } else\n if (currArg < 0) {\n // Represent negative numbers in hex as 2's complement.\n currArg = -currArg;\n argText = (currAbsArg - 1).toString(16);\n var buffer = [];\n for (var i = 0; i < argText.length; i++) {\n buffer.push((0xF - parseInt(argText[i], 16)).toString(16));\n }\n argText = buffer.join('');\n while (argText.length < argSize * 2) argText = 'f' + argText;\n } else {\n argText = currAbsArg.toString(16);\n }\n if (next == 88) {\n prefix = prefix.toUpperCase();\n argText = argText.toUpperCase();\n }\n } else if (next == 112) {\n if (currAbsArg === 0) {\n argText = '(nil)';\n } else {\n prefix = '0x';\n argText = currAbsArg.toString(16);\n }\n }\n if (precisionSet) {\n while (argText.length < precision) {\n argText = '0' + argText;\n }\n }\n \n // Add sign if needed\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n prefix = '+' + prefix;\n } else if (flagPadSign) {\n prefix = ' ' + prefix;\n }\n }\n \n // Move sign to prefix so we zero-pad after the sign\n if (argText.charAt(0) == '-') {\n prefix = '-' + prefix;\n argText = argText.substr(1);\n }\n \n // Add padding.\n while (prefix.length + argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad) {\n argText = '0' + argText;\n } else {\n prefix = ' ' + prefix;\n }\n }\n }\n \n // Insert the result into the buffer.\n argText = prefix + argText;\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {\n // Float.\n var currArg = getNextArg('double');\n var argText;\n if (isNaN(currArg)) {\n argText = 'nan';\n flagZeroPad = false;\n } else if (!isFinite(currArg)) {\n argText = (currArg < 0 ? '-' : '') + 'inf';\n flagZeroPad = false;\n } else {\n var isGeneral = false;\n var effectivePrecision = Math.min(precision, 20);\n \n // Convert g/G to f/F or e/E, as per:\n // http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html\n if (next == 103 || next == 71) {\n isGeneral = true;\n precision = precision || 1;\n var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);\n if (precision > exponent && exponent >= -4) {\n next = ((next == 103) ? 'f' : 'F').charCodeAt(0);\n precision -= exponent + 1;\n } else {\n next = ((next == 103) ? 'e' : 'E').charCodeAt(0);\n precision--;\n }\n effectivePrecision = Math.min(precision, 20);\n }\n \n if (next == 101 || next == 69) {\n argText = currArg.toExponential(effectivePrecision);\n // Make sure the exponent has at least 2 digits.\n if (/[eE][-+]\\d$/.test(argText)) {\n argText = argText.slice(0, -1) + '0' + argText.slice(-1);\n }\n } else if (next == 102 || next == 70) {\n argText = currArg.toFixed(effectivePrecision);\n if (currArg === 0 && __reallyNegative(currArg)) {\n argText = '-' + argText;\n }\n }\n \n var parts = argText.split('e');\n if (isGeneral && !flagAlternative) {\n // Discard trailing zeros and periods.\n while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&\n (parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {\n parts[0] = parts[0].slice(0, -1);\n }\n } else {\n // Make sure we have a period in alternative mode.\n if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';\n // Zero pad until required precision.\n while (precision > effectivePrecision++) parts[0] += '0';\n }\n argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');\n \n // Capitalize 'E' if needed.\n if (next == 69) argText = argText.toUpperCase();\n \n // Add sign.\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n argText = '+' + argText;\n } else if (flagPadSign) {\n argText = ' ' + argText;\n }\n }\n }\n \n // Add padding.\n while (argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {\n argText = argText[0] + '0' + argText.slice(1);\n } else {\n argText = (flagZeroPad ? '0' : ' ') + argText;\n }\n }\n }\n \n // Adjust case.\n if (next < 97) argText = argText.toUpperCase();\n \n // Insert the result into the buffer.\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 's': {\n // String.\n var arg = getNextArg('i8*');\n var argLength = arg ? _strlen(arg) : '(null)'.length;\n if (precisionSet) argLength = Math.min(argLength, precision);\n if (!flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n if (arg) {\n for (var i = 0; i < argLength; i++) {\n ret.push(HEAPU8[((arg++)|0)]);\n }\n } else {\n ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));\n }\n if (flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n break;\n }\n case 'c': {\n // Character.\n if (flagLeftAlign) ret.push(getNextArg('i8'));\n while (--width > 0) {\n ret.push(32);\n }\n if (!flagLeftAlign) ret.push(getNextArg('i8'));\n break;\n }\n case 'n': {\n // Write the length written so far to the next parameter.\n var ptr = getNextArg('i32*');\n HEAP32[((ptr)>>2)]=ret.length;\n break;\n }\n case '%': {\n // Literal percent sign.\n ret.push(curr);\n break;\n }\n default: {\n // Unknown specifiers remain untouched.\n for (var i = startTextIndex; i < textIndex + 2; i++) {\n ret.push(HEAP8[(i)]);\n }\n }\n }\n textIndex += 2;\n // TODO: Support a/A (hex float) and m (last error) specifiers.\n // TODO: Support %1${specifier} for arg selection.\n } else {\n ret.push(curr);\n textIndex += 1;\n }\n }\n return ret;\n }function _snprintf(s, n, format, varargs) {\n // int snprintf(char *restrict s, size_t n, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var result = __formatString(format, varargs);\n var limit = (n === undefined) ? result.length\n : Math.min(result.length, Math.max(n - 1, 0));\n if (s < 0) {\n s = -s;\n var buf = _malloc(limit+1);\n HEAP32[((s)>>2)]=buf;\n s = buf;\n }\n for (var i = 0; i < limit; i++) {\n HEAP8[(((s)+(i))|0)]=result[i];\n }\n if (limit < n || (n === undefined)) HEAP8[(((s)+(i))|0)]=0;\n return result.length;\n }function _vsnprintf(s, n, format, va_arg) {\n return _snprintf(s, n, format, HEAP32[((va_arg)>>2)]);\n }\n\n \n \n \n function __getFloat(text) {\n return /^[+-]?[0-9]*\\.?[0-9]+([eE][+-]?[0-9]+)?/.exec(text);\n }function __scanString(format, get, unget, varargs) {\n if (!__scanString.whiteSpace) {\n __scanString.whiteSpace = {};\n __scanString.whiteSpace[32] = 1;\n __scanString.whiteSpace[9] = 1;\n __scanString.whiteSpace[10] = 1;\n __scanString.whiteSpace[11] = 1;\n __scanString.whiteSpace[12] = 1;\n __scanString.whiteSpace[13] = 1;\n }\n // Supports %x, %4x, %d.%d, %lld, %s, %f, %lf.\n // TODO: Support all format specifiers.\n format = Pointer_stringify(format);\n var soFar = 0;\n if (format.indexOf('%n') >= 0) {\n // need to track soFar\n var _get = get;\n get = function get() {\n soFar++;\n return _get();\n }\n var _unget = unget;\n unget = function unget() {\n soFar--;\n return _unget();\n }\n }\n var formatIndex = 0;\n var argsi = 0;\n var fields = 0;\n var argIndex = 0;\n var next;\n \n mainLoop:\n for (var formatIndex = 0; formatIndex < format.length;) {\n if (format[formatIndex] === '%' && format[formatIndex+1] == 'n') {\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n HEAP32[((argPtr)>>2)]=soFar;\n formatIndex += 2;\n continue;\n }\n \n if (format[formatIndex] === '%') {\n var nextC = format.indexOf('c', formatIndex+1);\n if (nextC > 0) {\n var maxx = 1;\n if (nextC > formatIndex+1) {\n var sub = format.substring(formatIndex+1, nextC);\n maxx = parseInt(sub);\n if (maxx != sub) maxx = 0;\n }\n if (maxx) {\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n fields++;\n for (var i = 0; i < maxx; i++) {\n next = get();\n HEAP8[((argPtr++)|0)]=next;\n if (next === 0) return i > 0 ? fields : fields-1; // we failed to read the full length of this field\n }\n formatIndex += nextC - formatIndex + 1;\n continue;\n }\n }\n }\n \n // handle %[...]\n if (format[formatIndex] === '%' && format.indexOf('[', formatIndex+1) > 0) {\n var match = /\\%([0-9]*)\\[(\\^)?(\\]?[^\\]]*)\\]/.exec(format.substring(formatIndex));\n if (match) {\n var maxNumCharacters = parseInt(match[1]) || Infinity;\n var negateScanList = (match[2] === '^');\n var scanList = match[3];\n \n // expand \"middle\" dashs into character sets\n var middleDashMatch;\n while ((middleDashMatch = /([^\\-])\\-([^\\-])/.exec(scanList))) {\n var rangeStartCharCode = middleDashMatch[1].charCodeAt(0);\n var rangeEndCharCode = middleDashMatch[2].charCodeAt(0);\n for (var expanded = ''; rangeStartCharCode <= rangeEndCharCode; expanded += String.fromCharCode(rangeStartCharCode++));\n scanList = scanList.replace(middleDashMatch[1] + '-' + middleDashMatch[2], expanded);\n }\n \n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n fields++;\n \n for (var i = 0; i < maxNumCharacters; i++) {\n next = get();\n if (negateScanList) {\n if (scanList.indexOf(String.fromCharCode(next)) < 0) {\n HEAP8[((argPtr++)|0)]=next;\n } else {\n unget();\n break;\n }\n } else {\n if (scanList.indexOf(String.fromCharCode(next)) >= 0) {\n HEAP8[((argPtr++)|0)]=next;\n } else {\n unget();\n break;\n }\n }\n }\n \n // write out null-terminating character\n HEAP8[((argPtr++)|0)]=0;\n formatIndex += match[0].length;\n \n continue;\n }\n } \n // remove whitespace\n while (1) {\n next = get();\n if (next == 0) return fields;\n if (!(next in __scanString.whiteSpace)) break;\n }\n unget();\n \n if (format[formatIndex] === '%') {\n formatIndex++;\n var suppressAssignment = false;\n if (format[formatIndex] == '*') {\n suppressAssignment = true;\n formatIndex++;\n }\n var maxSpecifierStart = formatIndex;\n while (format[formatIndex].charCodeAt(0) >= 48 &&\n format[formatIndex].charCodeAt(0) <= 57) {\n formatIndex++;\n }\n var max_;\n if (formatIndex != maxSpecifierStart) {\n max_ = parseInt(format.slice(maxSpecifierStart, formatIndex), 10);\n }\n var long_ = false;\n var half = false;\n var longLong = false;\n if (format[formatIndex] == 'l') {\n long_ = true;\n formatIndex++;\n if (format[formatIndex] == 'l') {\n longLong = true;\n formatIndex++;\n }\n } else if (format[formatIndex] == 'h') {\n half = true;\n formatIndex++;\n }\n var type = format[formatIndex];\n formatIndex++;\n var curr = 0;\n var buffer = [];\n // Read characters according to the format. floats are trickier, they may be in an unfloat state in the middle, then be a valid float later\n if (type == 'f' || type == 'e' || type == 'g' ||\n type == 'F' || type == 'E' || type == 'G') {\n next = get();\n while (next > 0 && (!(next in __scanString.whiteSpace))) {\n buffer.push(String.fromCharCode(next));\n next = get();\n }\n var m = __getFloat(buffer.join(''));\n var last = m ? m[0].length : 0;\n for (var i = 0; i < buffer.length - last + 1; i++) {\n unget();\n }\n buffer.length = last;\n } else {\n next = get();\n var first = true;\n \n // Strip the optional 0x prefix for %x.\n if ((type == 'x' || type == 'X') && (next == 48)) {\n var peek = get();\n if (peek == 120 || peek == 88) {\n next = get();\n } else {\n unget();\n }\n }\n \n while ((curr < max_ || isNaN(max_)) && next > 0) {\n if (!(next in __scanString.whiteSpace) && // stop on whitespace\n (type == 's' ||\n ((type === 'd' || type == 'u' || type == 'i') && ((next >= 48 && next <= 57) ||\n (first && next == 45))) ||\n ((type === 'x' || type === 'X') && (next >= 48 && next <= 57 ||\n next >= 97 && next <= 102 ||\n next >= 65 && next <= 70))) &&\n (formatIndex >= format.length || next !== format[formatIndex].charCodeAt(0))) { // Stop when we read something that is coming up\n buffer.push(String.fromCharCode(next));\n next = get();\n curr++;\n first = false;\n } else {\n break;\n }\n }\n unget();\n }\n if (buffer.length === 0) return 0; // Failure.\n if (suppressAssignment) continue;\n \n var text = buffer.join('');\n var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];\n argIndex += Runtime.getAlignSize('void*', null, true);\n switch (type) {\n case 'd': case 'u': case 'i':\n if (half) {\n HEAP16[((argPtr)>>1)]=parseInt(text, 10);\n } else if (longLong) {\n (tempI64 = [parseInt(text, 10)>>>0,(tempDouble=parseInt(text, 10),(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((argPtr)>>2)]=tempI64[0],HEAP32[(((argPtr)+(4))>>2)]=tempI64[1]);\n } else {\n HEAP32[((argPtr)>>2)]=parseInt(text, 10);\n }\n break;\n case 'X':\n case 'x':\n HEAP32[((argPtr)>>2)]=parseInt(text, 16);\n break;\n case 'F':\n case 'f':\n case 'E':\n case 'e':\n case 'G':\n case 'g':\n case 'E':\n // fallthrough intended\n if (long_) {\n HEAPF64[((argPtr)>>3)]=parseFloat(text);\n } else {\n HEAPF32[((argPtr)>>2)]=parseFloat(text);\n }\n break;\n case 's':\n var array = intArrayFromString(text);\n for (var j = 0; j < array.length; j++) {\n HEAP8[(((argPtr)+(j))|0)]=array[j];\n }\n break;\n }\n fields++;\n } else if (format[formatIndex].charCodeAt(0) in __scanString.whiteSpace) {\n next = get();\n while (next in __scanString.whiteSpace) {\n if (next <= 0) break mainLoop; // End of input.\n next = get();\n }\n unget(next);\n formatIndex++;\n } else {\n // Not a specifier.\n next = get();\n if (format[formatIndex].charCodeAt(0) !== next) {\n unget(next);\n break mainLoop;\n }\n formatIndex++;\n }\n }\n return fields;\n }function _sscanf(s, format, varargs) {\n // int sscanf(const char *restrict s, const char *restrict format, ... );\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/scanf.html\n var index = 0;\n function get() { return HEAP8[(((s)+(index++))|0)]; };\n function unget() { index--; };\n return __scanString(format, get, unget, varargs);\n }function _vsscanf(s, format, va_arg) {\n return _sscanf(s, format, HEAP32[((va_arg)>>2)]);\n }\n\n\n\n \n \n \n function _recv(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _read(fd, buf, len);\n }\n \n function _pread(fildes, buf, nbyte, offset) {\n // ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.read(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _read(fildes, buf, nbyte) {\n // ssize_t read(int fildes, void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.read(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _fread(ptr, size, nitems, stream) {\n // size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fread.html\n var bytesToRead = nitems * size;\n if (bytesToRead == 0) {\n return 0;\n }\n var bytesRead = 0;\n var streamObj = FS.getStreamFromPtr(stream);\n if (!streamObj) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return 0;\n }\n while (streamObj.ungotten.length && bytesToRead > 0) {\n HEAP8[((ptr++)|0)]=streamObj.ungotten.pop();\n bytesToRead--;\n bytesRead++;\n }\n var err = _read(streamObj.fd, ptr, bytesToRead);\n if (err == -1) {\n if (streamObj) streamObj.error = true;\n return 0;\n }\n bytesRead += err;\n if (bytesRead < bytesToRead) streamObj.eof = true;\n return Math.floor(bytesRead / size);\n }function _fgetc(stream) {\n // int fgetc(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fgetc.html\n var streamObj = FS.getStreamFromPtr(stream);\n if (!streamObj) return -1;\n if (streamObj.eof || streamObj.error) return -1;\n var ret = _fread(_fgetc.ret, 1, 1, stream);\n if (ret == 0) {\n return -1;\n } else if (ret == -1) {\n streamObj.error = true;\n return -1;\n } else {\n return HEAPU8[((_fgetc.ret)|0)];\n }\n }\n\n\n \n function _strerror_r(errnum, strerrbuf, buflen) {\n if (errnum in ERRNO_MESSAGES) {\n if (ERRNO_MESSAGES[errnum].length > buflen - 1) {\n return ___setErrNo(ERRNO_CODES.ERANGE);\n } else {\n var msg = ERRNO_MESSAGES[errnum];\n writeAsciiToMemory(msg, strerrbuf);\n return 0;\n }\n } else {\n return ___setErrNo(ERRNO_CODES.EINVAL);\n }\n }function _strerror(errnum) {\n if (!_strerror.buffer) _strerror.buffer = _malloc(256);\n _strerror_r(errnum, _strerror.buffer, 256);\n return _strerror.buffer;\n }\n\n \n \n function __isLeapYear(year) {\n return year%4 === 0 && (year%100 !== 0 || year%400 === 0);\n }\n \n function __arraySum(array, index) {\n var sum = 0;\n for (var i = 0; i <= index; sum += array[i++]);\n return sum;\n }\n \n \n var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];\n \n var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date, days) {\n var newDate = new Date(date.getTime());\n while(days > 0) {\n var leap = __isLeapYear(newDate.getFullYear());\n var currentMonth = newDate.getMonth();\n var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth];\n \n if (days > daysInCurrentMonth-newDate.getDate()) {\n // we spill over to next month\n days -= (daysInCurrentMonth-newDate.getDate()+1);\n newDate.setDate(1);\n if (currentMonth < 11) {\n newDate.setMonth(currentMonth+1)\n } else {\n newDate.setMonth(0);\n newDate.setFullYear(newDate.getFullYear()+1);\n }\n } else {\n // we stay in current month \n newDate.setDate(newDate.getDate()+days);\n return newDate;\n }\n }\n \n return newDate;\n }function _strftime(s, maxsize, format, tm) {\n // size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);\n // http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html\n \n var date = {\n tm_sec: HEAP32[((tm)>>2)],\n tm_min: HEAP32[(((tm)+(4))>>2)],\n tm_hour: HEAP32[(((tm)+(8))>>2)],\n tm_mday: HEAP32[(((tm)+(12))>>2)],\n tm_mon: HEAP32[(((tm)+(16))>>2)],\n tm_year: HEAP32[(((tm)+(20))>>2)],\n tm_wday: HEAP32[(((tm)+(24))>>2)],\n tm_yday: HEAP32[(((tm)+(28))>>2)],\n tm_isdst: HEAP32[(((tm)+(32))>>2)]\n };\n \n var pattern = Pointer_stringify(format);\n \n // expand format\n var EXPANSION_RULES_1 = {\n '%c': '%a %b %d %H:%M:%S %Y', // Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013\n '%D': '%m/%d/%y', // Equivalent to %m / %d / %y\n '%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d\n '%h': '%b', // Equivalent to %b\n '%r': '%I:%M:%S %p', // Replaced by the time in a.m. and p.m. notation\n '%R': '%H:%M', // Replaced by the time in 24-hour notation\n '%T': '%H:%M:%S', // Replaced by the time\n '%x': '%m/%d/%y', // Replaced by the locale's appropriate date representation\n '%X': '%H:%M:%S', // Replaced by the locale's appropriate date representation\n };\n for (var rule in EXPANSION_RULES_1) {\n pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_1[rule]);\n }\n \n var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n var MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n \n function leadingSomething(value, digits, character) {\n var str = typeof value === 'number' ? value.toString() : (value || '');\n while (str.length < digits) {\n str = character[0]+str;\n }\n return str;\n };\n \n function leadingNulls(value, digits) {\n return leadingSomething(value, digits, '0');\n };\n \n function compareByDay(date1, date2) {\n function sgn(value) {\n return value < 0 ? -1 : (value > 0 ? 1 : 0);\n };\n \n var compare;\n if ((compare = sgn(date1.getFullYear()-date2.getFullYear())) === 0) {\n if ((compare = sgn(date1.getMonth()-date2.getMonth())) === 0) {\n compare = sgn(date1.getDate()-date2.getDate());\n }\n }\n return compare;\n };\n \n function getFirstWeekStartDate(janFourth) {\n switch (janFourth.getDay()) {\n case 0: // Sunday\n return new Date(janFourth.getFullYear()-1, 11, 29);\n case 1: // Monday\n return janFourth;\n case 2: // Tuesday\n return new Date(janFourth.getFullYear(), 0, 3);\n case 3: // Wednesday\n return new Date(janFourth.getFullYear(), 0, 2);\n case 4: // Thursday\n return new Date(janFourth.getFullYear(), 0, 1);\n case 5: // Friday\n return new Date(janFourth.getFullYear()-1, 11, 31);\n case 6: // Saturday\n return new Date(janFourth.getFullYear()-1, 11, 30);\n }\n };\n \n function getWeekBasedYear(date) {\n var thisDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);\n \n var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);\n var janFourthNextYear = new Date(thisDate.getFullYear()+1, 0, 4);\n \n var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);\n var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);\n \n if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) {\n // this date is after the start of the first week of this year\n if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) {\n return thisDate.getFullYear()+1;\n } else {\n return thisDate.getFullYear();\n }\n } else { \n return thisDate.getFullYear()-1;\n }\n };\n \n var EXPANSION_RULES_2 = {\n '%a': function(date) {\n return WEEKDAYS[date.tm_wday].substring(0,3);\n },\n '%A': function(date) {\n return WEEKDAYS[date.tm_wday];\n },\n '%b': function(date) {\n return MONTHS[date.tm_mon].substring(0,3);\n },\n '%B': function(date) {\n return MONTHS[date.tm_mon];\n },\n '%C': function(date) {\n var year = date.tm_year+1900;\n return leadingNulls(Math.floor(year/100),2);\n },\n '%d': function(date) {\n return leadingNulls(date.tm_mday, 2);\n },\n '%e': function(date) {\n return leadingSomething(date.tm_mday, 2, ' ');\n },\n '%g': function(date) {\n // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. \n // In this system, weeks begin on a Monday and week 1 of the year is the week that includes \n // January 4th, which is also the week that includes the first Thursday of the year, and \n // is also the first week that contains at least four days in the year. \n // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of \n // the last week of the preceding year; thus, for Saturday 2nd January 1999, \n // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th, \n // or 31st is a Monday, it and any following days are part of week 1 of the following year. \n // Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.\n \n return getWeekBasedYear(date).toString().substring(2);\n },\n '%G': function(date) {\n return getWeekBasedYear(date);\n },\n '%H': function(date) {\n return leadingNulls(date.tm_hour, 2);\n },\n '%I': function(date) {\n return leadingNulls(date.tm_hour < 13 ? date.tm_hour : date.tm_hour-12, 2);\n },\n '%j': function(date) {\n // Day of the year (001-366)\n return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date.tm_mon-1), 3);\n },\n '%m': function(date) {\n return leadingNulls(date.tm_mon+1, 2);\n },\n '%M': function(date) {\n return leadingNulls(date.tm_min, 2);\n },\n '%n': function() {\n return '\\n';\n },\n '%p': function(date) {\n if (date.tm_hour > 0 && date.tm_hour < 13) {\n return 'AM';\n } else {\n return 'PM';\n }\n },\n '%S': function(date) {\n return leadingNulls(date.tm_sec, 2);\n },\n '%t': function() {\n return '\\t';\n },\n '%u': function(date) {\n var day = new Date(date.tm_year+1900, date.tm_mon+1, date.tm_mday, 0, 0, 0, 0);\n return day.getDay() || 7;\n },\n '%U': function(date) {\n // Replaced by the week number of the year as a decimal number [00,53]. \n // The first Sunday of January is the first day of week 1; \n // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]\n var janFirst = new Date(date.tm_year+1900, 0, 1);\n var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7-janFirst.getDay());\n var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);\n \n // is target date after the first Sunday?\n if (compareByDay(firstSunday, endDate) < 0) {\n // calculate difference in days between first Sunday and endDate\n var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;\n var firstSundayUntilEndJanuary = 31-firstSunday.getDate();\n var days = firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();\n return leadingNulls(Math.ceil(days/7), 2);\n }\n \n return compareByDay(firstSunday, janFirst) === 0 ? '01': '00';\n },\n '%V': function(date) {\n // Replaced by the week number of the year (Monday as the first day of the week) \n // as a decimal number [01,53]. If the week containing 1 January has four \n // or more days in the new year, then it is considered week 1. \n // Otherwise, it is the last week of the previous year, and the next week is week 1. \n // Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]\n var janFourthThisYear = new Date(date.tm_year+1900, 0, 4);\n var janFourthNextYear = new Date(date.tm_year+1901, 0, 4);\n \n var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);\n var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);\n \n var endDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);\n \n if (compareByDay(endDate, firstWeekStartThisYear) < 0) {\n // if given date is before this years first week, then it belongs to the 53rd week of last year\n return '53';\n } \n \n if (compareByDay(firstWeekStartNextYear, endDate) <= 0) {\n // if given date is after next years first week, then it belongs to the 01th week of next year\n return '01';\n }\n \n // given date is in between CW 01..53 of this calendar year\n var daysDifference;\n if (firstWeekStartThisYear.getFullYear() < date.tm_year+1900) {\n // first CW of this year starts last year\n daysDifference = date.tm_yday+32-firstWeekStartThisYear.getDate()\n } else {\n // first CW of this year starts this year\n daysDifference = date.tm_yday+1-firstWeekStartThisYear.getDate();\n }\n return leadingNulls(Math.ceil(daysDifference/7), 2);\n },\n '%w': function(date) {\n var day = new Date(date.tm_year+1900, date.tm_mon+1, date.tm_mday, 0, 0, 0, 0);\n return day.getDay();\n },\n '%W': function(date) {\n // Replaced by the week number of the year as a decimal number [00,53]. \n // The first Monday of January is the first day of week 1; \n // days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]\n var janFirst = new Date(date.tm_year, 0, 1);\n var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7-janFirst.getDay()+1);\n var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);\n \n // is target date after the first Monday?\n if (compareByDay(firstMonday, endDate) < 0) {\n var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;\n var firstMondayUntilEndJanuary = 31-firstMonday.getDate();\n var days = firstMondayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();\n return leadingNulls(Math.ceil(days/7), 2);\n }\n return compareByDay(firstMonday, janFirst) === 0 ? '01': '00';\n },\n '%y': function(date) {\n // Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]\n return (date.tm_year+1900).toString().substring(2);\n },\n '%Y': function(date) {\n // Replaced by the year as a decimal number (for example, 1997). [ tm_year]\n return date.tm_year+1900;\n },\n '%z': function(date) {\n // Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ),\n // or by no characters if no timezone is determinable. \n // For example, \"-0430\" means 4 hours 30 minutes behind UTC (west of Greenwich). \n // If tm_isdst is zero, the standard time offset is used. \n // If tm_isdst is greater than zero, the daylight savings time offset is used. \n // If tm_isdst is negative, no characters are returned. \n // FIXME: we cannot determine time zone (or can we?)\n return '';\n },\n '%Z': function(date) {\n // Replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. [ tm_isdst]\n // FIXME: we cannot determine time zone (or can we?)\n return '';\n },\n '%%': function() {\n return '%';\n }\n };\n for (var rule in EXPANSION_RULES_2) {\n if (pattern.indexOf(rule) >= 0) {\n pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_2[rule](date));\n }\n }\n \n var bytes = intArrayFromString(pattern, false);\n if (bytes.length > maxsize) {\n return 0;\n } \n \n writeArrayToMemory(bytes, s);\n return bytes.length-1;\n }function _strftime_l(s, maxsize, format, tm) {\n return _strftime(s, maxsize, format, tm); // no locale support yet\n }\n\n var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;\n\n\n function _pthread_cond_wait() {\n return 0;\n }\n\n \n function _isdigit(chr) {\n return chr >= 48 && chr <= 57;\n }function _isdigit_l(chr) {\n return _isdigit(chr); // no locale support yet\n }\n\n var _fabs=Math_abs;\n\n function _llvm_lifetime_start() {}\n\n var _getc=_fgetc;\n\n var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n function ___ctype_b_loc() {\n // http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/baselib---ctype-b-loc.html\n var me = ___ctype_b_loc;\n if (!me.ret) {\n var values = [\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,8195,8194,8194,8194,8194,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,24577,49156,49156,49156,\n 49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,49156,55304,55304,55304,55304,55304,55304,55304,55304,\n 55304,55304,49156,49156,49156,49156,49156,49156,49156,54536,54536,54536,54536,54536,54536,50440,50440,50440,50440,50440,\n 50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,50440,49156,49156,49156,49156,49156,\n 49156,54792,54792,54792,54792,54792,54792,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,50696,\n 50696,50696,50696,50696,50696,50696,50696,49156,49156,49156,49156,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n ];\n var i16size = 2;\n var arr = _malloc(values.length * i16size);\n for (var i = 0; i < values.length; i++) {\n HEAP16[(((arr)+(i * i16size))>>1)]=values[i];\n }\n me.ret = allocate([arr + 128 * i16size], 'i16*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function _freelocale(locale) {\n _free(locale);\n }\n\n function ___cxa_allocate_exception(size) {\n var ptr = _malloc(size + ___cxa_exception_header_size);\n return ptr + ___cxa_exception_header_size;\n }\n\n var _fmodl=_fmod;\n\n function _catopen(name, oflag) {\n // nl_catd catopen (const char *name, int oflag)\n return -1;\n }\n\n function _catgets(catd, set_id, msg_id, s) {\n // char *catgets (nl_catd catd, int set_id, int msg_id, const char *s)\n return s;\n }\n\n \n \n function _sprintf(s, format, varargs) {\n // int sprintf(char *restrict s, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n return _snprintf(s, undefined, format, varargs);\n }function _asprintf(s, format, varargs) {\n return _sprintf(-s, format, varargs);\n }function _vasprintf(s, format, va_arg) {\n return _asprintf(s, format, HEAP32[((va_arg)>>2)]);\n }\n\n function _time(ptr) {\n var ret = Math.floor(Date.now()/1000);\n if (ptr) {\n HEAP32[((ptr)>>2)]=ret;\n }\n return ret;\n }\n\n function _copysign(a, b) {\n return __reallyNegative(a) === __reallyNegative(b) ? a : -a;\n }\n\n function ___ctype_toupper_loc() {\n // http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-toupper-loc.html\n var me = ___ctype_toupper_loc;\n if (!me.ret) {\n var values = [\n 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,\n 158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,\n 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,\n 218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,\n 248,249,250,251,252,253,254,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,\n 73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,\n 81,82,83,84,85,86,87,88,89,90,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,\n 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,\n 175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,\n 205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,\n 235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255\n ];\n var i32size = 4;\n var arr = _malloc(values.length * i32size);\n for (var i = 0; i < values.length; i++) {\n HEAP32[(((arr)+(i * i32size))>>2)]=values[i];\n }\n me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function ___cxa_guard_acquire(variable) {\n if (!HEAP8[(variable)]) { // ignore SAFE_HEAP stuff because llvm mixes i64 and i8 here\n HEAP8[(variable)]=1;\n return 1;\n }\n return 0;\n }\n\n function ___ctype_tolower_loc() {\n // http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-tolower-loc.html\n var me = ___ctype_tolower_loc;\n if (!me.ret) {\n var values = [\n 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,\n 158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,\n 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,\n 218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,\n 248,249,250,251,252,253,254,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,97,98,99,100,101,102,103,\n 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,96,97,98,99,100,101,102,103,\n 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,\n 134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,\n 164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,\n 194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,\n 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,\n 254,255\n ];\n var i32size = 4;\n var arr = _malloc(values.length * i32size);\n for (var i = 0; i < values.length; i++) {\n HEAP32[(((arr)+(i * i32size))>>2)]=values[i];\n }\n me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);\n }\n return me.ret;\n }\n\n function ___cxa_begin_catch(ptr) {\n __ZSt18uncaught_exceptionv.uncaught_exception--;\n ___cxa_caught_exceptions.push(___cxa_last_thrown_exception);\n return ptr;\n }\n\n \n Module[\"_bitshift64Shl\"] = _bitshift64Shl;\n\n\n function __ZNSt9exceptionD2Ev() {}\n\n var _copysignl=_copysign;\n\n var __ZTISt9exception=allocate([allocate([1,0,0,0,0,0,0], \"i8\", ALLOC_STATIC)+8, 0], \"i32\", ALLOC_STATIC);\n\n var ___dso_handle=allocate(1, \"i32*\", ALLOC_STATIC);\n\n\n\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\n__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });\n_fgetc.ret = allocate([0], \"i8\", ALLOC_STATIC);\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n var ctlz_i8 = allocate([8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], \"i8\", ALLOC_DYNAMIC);\n var cttz_i8 = allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0], \"i8\", ALLOC_DYNAMIC);\n\nvar Math_min = Math.min;\nfunction invoke_iiii(index,a1,a2,a3) {\n try {\n return Module[\"dynCall_iiii\"](index,a1,a2,a3);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {\n try {\n Module[\"dynCall_viiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiii(index,a1,a2,a3,a4,a5) {\n try {\n Module[\"dynCall_viiiii\"](index,a1,a2,a3,a4,a5);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_vi(index,a1) {\n try {\n Module[\"dynCall_vi\"](index,a1);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_vii(index,a1,a2) {\n try {\n Module[\"dynCall_vii\"](index,a1,a2);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {\n try {\n Module[\"dynCall_viiiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_ii(index,a1) {\n try {\n return Module[\"dynCall_ii\"](index,a1);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiid(index,a1,a2,a3,a4,a5,a6,a7) {\n try {\n Module[\"dynCall_viiiiiid\"](index,a1,a2,a3,a4,a5,a6,a7);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viii(index,a1,a2,a3) {\n try {\n Module[\"dynCall_viii\"](index,a1,a2,a3);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiid(index,a1,a2,a3,a4,a5,a6) {\n try {\n Module[\"dynCall_viiiiid\"](index,a1,a2,a3,a4,a5,a6);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_v(index) {\n try {\n Module[\"dynCall_v\"](index);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {\n try {\n return Module[\"dynCall_iiiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiii(index,a1,a2,a3,a4) {\n try {\n return Module[\"dynCall_iiiii\"](index,a1,a2,a3,a4);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {\n try {\n Module[\"dynCall_viiiiiiii\"](index,a1,a2,a3,a4,a5,a6,a7,a8);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {\n try {\n Module[\"dynCall_viiiiii\"](index,a1,a2,a3,a4,a5,a6);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iii(index,a1,a2) {\n try {\n return Module[\"dynCall_iii\"](index,a1,a2);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_iiiiii(index,a1,a2,a3,a4,a5) {\n try {\n return Module[\"dynCall_iiiiii\"](index,a1,a2,a3,a4,a5);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction invoke_viiii(index,a1,a2,a3,a4) {\n try {\n Module[\"dynCall_viiii\"](index,a1,a2,a3,a4);\n } catch(e) {\n if (typeof e !== 'number' && e !== 'longjmp') throw e;\n asm[\"setThrew\"](1, 0);\n }\n}\n\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=env.ctlz_i8|0;var o=env.__ZTISt9exception|0;var p=env.___dso_handle|0;var q=env._stderr|0;var r=env._stdin|0;var s=env._stdout|0;var t=0;var u=0;var v=0;var w=0;var x=+env.NaN,y=+env.Infinity;var z=0,A=0,B=0,C=0,D=0.0,E=0,F=0,G=0,H=0.0;var I=0;var J=0;var K=0;var L=0;var M=0;var N=0;var O=0;var P=0;var Q=0;var R=0;var S=global.Math.floor;var T=global.Math.abs;var U=global.Math.sqrt;var V=global.Math.pow;var W=global.Math.cos;var X=global.Math.sin;var Y=global.Math.tan;var Z=global.Math.acos;var _=global.Math.asin;var $=global.Math.atan;var aa=global.Math.atan2;var ba=global.Math.exp;var ca=global.Math.log;var da=global.Math.ceil;var ea=global.Math.imul;var fa=env.abort;var ga=env.assert;var ha=env.asmPrintInt;var ia=env.asmPrintFloat;var ja=env.min;var ka=env.invoke_iiii;var la=env.invoke_viiiiiii;var ma=env.invoke_viiiii;var na=env.invoke_vi;var oa=env.invoke_vii;var pa=env.invoke_viiiiiiiii;var qa=env.invoke_ii;var ra=env.invoke_viiiiiid;var sa=env.invoke_viii;var ta=env.invoke_viiiiid;var ua=env.invoke_v;var va=env.invoke_iiiiiiiii;var wa=env.invoke_iiiii;var xa=env.invoke_viiiiiiii;var ya=env.invoke_viiiiii;var za=env.invoke_iii;var Aa=env.invoke_iiiiii;var Ba=env.invoke_viiii;var Ca=env._fabs;var Da=env._pthread_cond_wait;var Ea=env._freelocale;var Fa=env.__formatString;var Ga=env._asprintf;var Ha=env._send;var Ia=env._strtoll_l;var Ja=env._vsscanf;var Ka=env.___ctype_b_loc;var La=env.__ZSt9terminatev;var Ma=env._fmod;var Na=env.___cxa_guard_acquire;var Oa=env._isspace;var Pa=env.___setErrNo;var Qa=env.___cxa_is_number_type;var Ra=env._atexit;var Sa=env._copysign;var Ta=env._ungetc;var Ua=env.___cxa_free_exception;var Va=env.___cxa_allocate_exception;var Wa=env.__ZSt18uncaught_exceptionv;var Xa=env._isxdigit_l;var Ya=env.___ctype_toupper_loc;var Za=env._fflush;var _a=env.___cxa_guard_release;var $a=env.__addDays;var ab=env.___errno_location;var bb=env._strtoll;var cb=env._strerror_r;var db=env._strftime_l;var eb=env._llvm_lifetime_start;var fb=env._isdigit;var gb=env._sscanf;var hb=env._sbrk;var ib=env._uselocale;var jb=env._catgets;var kb=env._newlocale;var lb=env._snprintf;var mb=env.___cxa_begin_catch;var nb=env._emscripten_memcpy_big;var ob=env._fileno;var pb=env._pread;var qb=env.___resumeException;var rb=env.___cxa_find_matching_catch;var sb=env.__exit;var tb=env._strtoull;var ub=env._isdigit_l;var vb=env._strftime;var wb=env.__arraySum;var xb=env.___cxa_throw;var yb=env.___ctype_tolower_loc;var zb=env.___cxa_end_catch;var Ab=env._pthread_mutex_unlock;var Bb=env._fread;var Cb=env._pthread_cond_broadcast;var Db=env._isxdigit;var Eb=env._sprintf;var Fb=env.__reallyNegative;var Gb=env._vasprintf;var Hb=env._write;var Ib=env.__isLeapYear;var Jb=env.__scanString;var Kb=env._recv;var Lb=env._vsnprintf;var Mb=env.__ZNSt9exceptionD2Ev;var Nb=env._fgetc;var Ob=env._strtoull_l;var Pb=env._mkport;var Qb=env.___cxa_does_inherit;var Rb=env._sysconf;var Sb=env._read;var Tb=env.___cxa_rethrow;var Ub=env.__parseInt64;var Vb=env._abort;var Wb=env._catclose;var Xb=env._fwrite;var Yb=env._time;var Zb=env._pthread_mutex_lock;var _b=env._strerror;var $b=env._gettimeofday;var ac=env._llvm_lifetime_end;var bc=env._pwrite;var cc=env._catopen;var dc=env._exit;var ec=env.__getFloat;var fc=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction yc(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function zc(){return i|0}function Ac(a){a=a|0;i=a}function Bc(a,b){a=a|0;b=b|0;if((t|0)==0){t=a;u=b}}function Cc(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function Dc(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function Ec(a){a=a|0;I=a}function Fc(a){a=a|0;J=a}function Gc(a){a=a|0;K=a}function Hc(a){a=a|0;L=a}function Ic(a){a=a|0;M=a}function Jc(a){a=a|0;N=a}function Kc(a){a=a|0;O=a}function Lc(a){a=a|0;P=a}function Mc(a){a=a|0;Q=a}function Nc(a){a=a|0;R=a}function Oc(){var a=0,b=0;a=i;b=0;do{c[61448+(b<<2)>>2]=(c[77832+(b<<2)>>2]|0)+(c[69640+(b<<2)>>2]|0);b=b+1|0;}while((b|0)!=256);i=a;return}function Pc(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;if((a|0)>0){e=0}else{i=d;return}do{c[69640+(e<<2)>>2]=b;e=e+1|0;}while((e|0)!=(a|0));i=d;return}function Qc(a,b){a=a|0;b=b|0;var d=0,e=0;b=i;if((a|0)==0){i=b;return}else{d=a;e=0}while(1){a=d+ -1|0;c[61448+(e<<2)>>2]=c[77832+(e<<2)>>2]&c[69640+(e<<2)>>2];if((a|0)==0){break}else{e=e+1|0;d=a}}i=b;return}function Rc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;if((a|0)==0){i=e;return}else{f=b;g=a;h=d}while(1){d=g+ -1|0;c[f>>2]=c[h>>2];if((d|0)==0){break}else{h=h+4|0;g=d;f=f+4|0}}i=e;return}function Sc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;if((a|0)==0){i=e;return}else{f=b;g=a;h=d}while(1){d=g+ -1|0;c[f>>2]=(c[h>>2]|0)+5;if((d|0)==0){break}else{h=h+4|0;g=d;f=f+4|0}}i=e;return}function Tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;d=i;if((a|0)>0){e=0}else{i=d;return}while(1){b=e+1|0;c[61448+(e<<2)>>2]=(c[77832+(e+3<<2)>>2]|0)+(c[69640+(b<<2)>>2]|0);if((b|0)==(a|0)){break}else{e=b}}i=d;return}function Uc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;d=i;if((a|0)>0){e=0}else{i=d;return}do{c[69640+(e<<2)>>2]=(c[61448+(e<<2)>>2]|0)>4?4:0;e=e+1|0;}while((e|0)!=(a|0));i=d;return}function Vc(a){a=a|0;var b=0;b=i;$m(61448,69640+(a<<2)|0,4096)|0;i=b;return}function Wc(a){a=a|0;var b=0,d=0,e=0;b=i;d=0;do{e=0;do{c[94216+(d<<12)+(e<<2)>>2]=a;e=e+1|0;}while((e|0)!=1024);d=d+1|0;}while((d|0)!=32);i=b;return}function Xc(a){a=a|0;var b=0,d=0,e=0;b=i;d=0;e=0;do{d=(c[24584+(e<<2)>>2]|0)+d-(c[28680+(e<<2)>>2]|0)|0;e=e+1|0;}while((e|0)!=1024);c[a>>2]=d;i=b;return}function Yc(a,d,f,g,h,j){a=a|0;d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;k=i;l=0;do{c[g+(l<<2)>>2]=(c[j+(l<<2)>>2]|0)+(c[h+(l<<2)>>2]|0);b[a+(l<<1)>>1]=(e[f+(l<<1)>>1]|0)+(e[d+(l<<1)>>1]|0);l=l+1|0;}while((l|0)!=1024);i=k;return}function Zc(a,d,e,f,g,h){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;h=i;g=0;do{c[f+(g<<2)>>2]=b[d+(g<<1)>>1]|0;g=g+1|0;}while((g|0)!=1024);i=h;return}function _c(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,j=0;a=i;b=0;do{d=b<<1;e=d|1;f=c[69640+(e<<2)>>2]|0;g=c[77832+(e<<2)>>2]|0;e=ea(g,f)|0;h=c[69640+(d<<2)>>2]|0;j=c[77832+(d<<2)>>2]|0;c[61448+(b<<2)>>2]=e-(ea(j,h)|0);c[86024+(b<<2)>>2]=(ea(j,f)|0)+(ea(g,h)|0);b=b+1|0;}while((b|0)!=512);i=a;return}function $c(){var a=0,b=0;a=i;b=0;do{c[61448+(b<<2)>>2]=b;b=b+1|0;}while((b|0)!=1024);i=a;return}function ad(a,b){a=a|0;b=b|0;var d=0,f=0,g=0;d=i;f=a;a=b;b=0;while(1){c[a>>2]=(e[f>>1]|0)<<7;g=b+1|0;if((g|0)==256){break}else{b=g;a=a+4|0;f=f+2|0}}i=d;return}function bd(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;e=0;do{c[20488+(e<<2)>>2]=(+g[32776+(e<<2)>>2]<+g[36872+(e<<2)>>2]?a:b)<<16>>16;e=e+1|0;}while((e|0)!=1024);i=d;return}function cd(){var a=0,b=0;a=i;b=0;do{c[57352+(b<<2)>>2]=+g[40968+(b<<2)>>2]<+g[45064+(b<<2)>>2]&+g[49160+(b<<2)>>2]<+g[53256+(b<<2)>>2]&1;b=b+1|0;}while((b|0)!=1024);i=a;return}function dd(b,e){b=b|0;e=e|0;var f=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0.0,aa=0.0,ba=0,ca=0.0,da=0,ea=0.0,fa=0,ga=0.0,ha=0,ia=0.0,ja=0,ka=0.0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0,oc=0;e=i;i=i+416|0;b=e;f=e+8|0;h=e+32|0;j=e+56|0;k=e+80|0;l=e+104|0;m=e+128|0;n=e+152|0;o=e+176|0;p=e+200|0;q=e+224|0;r=e+248|0;s=e+272|0;t=e+296|0;u=e+320|0;v=e+344|0;w=e+368|0;x=e+392|0;c[b>>2]=0;y=12296;z=1;while(1){A=((z&255)*7&255^39)+1|0;a[y]=A;B=y+1|0;if((B|0)==(16392|0)){C=16392;D=1;break}else{z=A;y=B}}while(1){y=((D&255)*7&255^39)+1|0;a[C]=y;z=C+1|0;if((z|0)==(20488|0)){E=20488;F=1;break}else{D=y;C=z}}while(1){C=((F&255)*7&255^39)+1|0;a[E]=C;D=E+1|0;if((D|0)==(24584|0)){G=2056;H=1;break}else{F=C;E=D}}while(1){E=((H&255)*7&255^39)+1|0;a[G]=E;F=G+1|0;if((F|0)==(4104|0)){I=4104;J=1;break}else{H=E;G=F}}while(1){G=((J&255)*7&255^39)+1|0;a[I]=G;H=I+1|0;if((H|0)==(6152|0)){K=6152;L=1;break}else{J=G;I=H}}while(1){I=((L&255)*7&255^39)+1|0;a[K]=I;J=K+1|0;if((J|0)==(8200|0)){M=61448;N=1;break}else{L=I;K=J}}while(1){K=((N&255)*7&255^39)+1|0;a[M]=K;L=M+1|0;if((L|0)==(69640|0)){O=69640;P=1;break}else{N=K;M=L}}while(1){M=((P&255)*7&255^39)+1|0;a[O]=M;N=O+1|0;if((N|0)==(77832|0)){Q=77832;R=1;break}else{P=M;O=N}}while(1){O=((R&255)*7&255^39)+1|0;a[Q]=O;P=Q+1|0;if((P|0)==(86024|0)){S=8200;T=1;break}else{R=O;Q=P}}while(1){Q=((T&255)*7&255^39)+1|0;a[S]=Q;R=S+1|0;if((R|0)==(12296|0)){U=24584;V=1;break}else{T=Q;S=R}}while(1){S=((V&255)*7&255^39)+1|0;a[U]=S;T=U+1|0;if((T|0)==(28680|0)){W=28680;X=1;break}else{V=S;U=T}}while(1){U=((X&255)*7&255^39)+1|0;a[W]=U;V=W+1|0;if((V|0)==(32776|0)){Y=94216;Z=1;break}else{X=U;W=V}}while(1){W=((Z&255)*7&255^39)+1|0;a[Y]=W;X=Y+1|0;if((X|0)==(98312|0)){_=32776;$=1.0;break}else{Z=W;Y=X}}while(1){aa=$*1.1;g[_>>2]=aa;Y=_+4|0;if((Y|0)==(36872|0)){ba=36872;ca=1.0;break}else{$=aa;_=Y}}while(1){$=ca*1.1;g[ba>>2]=$;_=ba+4|0;if((_|0)==(40968|0)){da=40968;ea=1.0;break}else{ca=$;ba=_}}while(1){ca=ea*1.1;g[da>>2]=ca;ba=da+4|0;if((ba|0)==(45064|0)){fa=45064;ga=1.0;break}else{ea=ca;da=ba}}while(1){ea=ga*1.1;g[fa>>2]=ea;da=fa+4|0;if((da|0)==(49160|0)){ha=49160;ia=1.0;break}else{ga=ea;fa=da}}while(1){ga=ia*1.1;g[ha>>2]=ga;fa=ha+4|0;if((fa|0)==(53256|0)){ja=53256;ka=1.0;break}else{ia=ga;ha=fa}}do{ka=ka*1.1;g[ja>>2]=ka;ja=ja+4|0;}while((ja|0)!=(57352|0));Oc();c[f>>2]=225288;a[f+4|0]=1;$b(f+8|0,0)|0;ja=0;while(1){Oc();ha=ja+1|0;if((ha|0)==655360){la=61448;ma=1;break}else{ja=ha}}do{ja=ma*3|0;ma=((d[la]|0)^ja)<<8^ja>>>8;la=la+1|0;}while((la|0)!=(62472|0));la=Gm(4)|0;ja=la;ha=(la|0)==0;if(!ha){c[ja>>2]=ma}hd(f);Pc(1024,2);c[h>>2]=225304;a[h+4|0]=1;$b(h+8|0,0)|0;f=0;while(1){Pc(1024,2);ma=f+1|0;if((ma|0)==262144){na=69640;oa=1;break}else{f=ma}}do{f=oa*3|0;oa=((d[na]|0)^f)<<8^f>>>8;na=na+1|0;}while((na|0)!=(73736|0));na=Gm(8)|0;c[na+4>>2]=oa;c[na>>2]=c[ja>>2];if(!ha){Im(la)}hd(h);Qc(1024,0);c[j>>2]=225320;a[j+4|0]=1;$b(j+8|0,0)|0;h=0;while(1){Qc(1024,0);la=h+1|0;if((la|0)==131072){pa=61448;qa=1;break}else{h=la}}do{h=qa*3|0;qa=((d[pa]|0)^h)<<8^h>>>8;pa=pa+1|0;}while((pa|0)!=(65544|0));pa=Gm(16)|0;h=pa;la=pa+16|0;c[pa+8>>2]=qa;qa=pa+12|0;ha=na;ja=c[ha+4>>2]|0;oa=pa;c[oa>>2]=c[ha>>2];c[oa+4>>2]=ja;if((na|0)!=0){Im(na)}hd(j);Rc(1024,12296,16392);c[k>>2]=225336;a[k+4|0]=1;$b(k+8|0,0)|0;j=0;while(1){Rc(1024,12296,16392);na=j+1|0;if((na|0)==131072){ra=12296;sa=1;break}else{j=na}}do{j=sa*3|0;sa=((d[ra]|0)^j)<<8^j>>>8;ra=ra+1|0;}while((ra|0)!=(16392|0));c[qa>>2]=sa;sa=pa+16|0;hd(k);Sc(1024,12296,16392);c[l>>2]=225352;a[l+4|0]=1;$b(l+8|0,0)|0;k=0;while(1){Sc(1024,12296,16392);pa=k+1|0;if((pa|0)==131072){ta=12296;ua=1;break}else{k=pa}}do{k=ua*3|0;ua=((d[ta]|0)^k)<<8^k>>>8;ta=ta+1|0;}while((ta|0)!=(16392|0));do{if((sa|0)==(la|0)){ta=la-h|0;k=ta>>2;pa=k+1|0;if(pa>>>0>1073741823){Ij(0)}if(k>>>0<536870911){qa=ta>>1;ra=qa>>>0<pa>>>0?pa:qa;if((ra|0)==0){va=0;wa=0}else{xa=ra;ya=50}}else{xa=1073741823;ya=50}if((ya|0)==50){va=xa;wa=Gm(xa<<2)|0}ra=wa+(k<<2)|0;k=wa+(va<<2)|0;if((ra|0)!=0){c[ra>>2]=ua}ra=wa+(pa<<2)|0;pa=h;$m(wa|0,pa|0,ta|0)|0;if((h|0)==0){za=k;Aa=ra;Ba=wa;break}Im(pa);za=k;Aa=ra;Ba=wa}else{if((sa|0)!=0){c[sa>>2]=ua}za=la;Aa=sa+4|0;Ba=h}}while(0);hd(l);Tc(1014,0,0);c[m>>2]=225368;a[m+4|0]=1;$b(m+8|0,0)|0;l=0;while(1){Tc(1014,0,0);h=l+1|0;if((h|0)==131072){Ca=12296;Da=1;break}else{l=h}}do{l=Da*3|0;Da=((d[Ca]|0)^l)<<8^l>>>8;Ca=Ca+1|0;}while((Ca|0)!=(16392|0));do{if((Aa|0)==(za|0)){Ca=za-Ba|0;l=Ca>>2;h=l+1|0;if(h>>>0>1073741823){Ij(0)}if(l>>>0<536870911){sa=Ca>>1;la=sa>>>0<h>>>0?h:sa;if((la|0)==0){Ea=0;Fa=0}else{Ga=la;ya=66}}else{Ga=1073741823;ya=66}if((ya|0)==66){Ea=Ga;Fa=Gm(Ga<<2)|0}la=Fa+(l<<2)|0;l=Fa+(Ea<<2)|0;if((la|0)!=0){c[la>>2]=Da}la=Fa+(h<<2)|0;h=Ba;$m(Fa|0,h|0,Ca|0)|0;if((Ba|0)==0){Ha=l;Ia=la;Ja=Fa;break}Im(h);Ha=l;Ia=la;Ja=Fa}else{if((Aa|0)!=0){c[Aa>>2]=Da}Ha=za;Ia=Aa+4|0;Ja=Ba}}while(0);hd(m);Uc(1024,0,0);c[n>>2]=225384;a[n+4|0]=1;$b(n+8|0,0)|0;m=0;while(1){Uc(1024,0,0);Ba=m+1|0;if((Ba|0)==131072){Ka=16392;La=1;break}else{m=Ba}}do{m=La*3|0;La=((d[Ka]|0)^m)<<8^m>>>8;Ka=Ka+1|0;}while((Ka|0)!=(20488|0));do{if((Ia|0)==(Ha|0)){Ka=Ha-Ja|0;m=Ka>>2;Ba=m+1|0;if(Ba>>>0>1073741823){Ij(0)}if(m>>>0<536870911){Aa=Ka>>1;za=Aa>>>0<Ba>>>0?Ba:Aa;if((za|0)==0){Ma=0;Na=0}else{Oa=za;ya=82}}else{Oa=1073741823;ya=82}if((ya|0)==82){Ma=Oa;Na=Gm(Oa<<2)|0}za=Na+(m<<2)|0;m=Na+(Ma<<2)|0;if((za|0)!=0){c[za>>2]=La}za=Na+(Ba<<2)|0;Ba=Ja;$m(Na|0,Ba|0,Ka|0)|0;if((Ja|0)==0){Pa=m;Qa=za;Ra=Na;break}Im(Ba);Pa=m;Qa=za;Ra=Na}else{if((Ia|0)!=0){c[Ia>>2]=La}Pa=Ha;Qa=Ia+4|0;Ra=Ja}}while(0);hd(n);Vc(4);c[o>>2]=225400;a[o+4|0]=1;$b(o+8|0,0)|0;n=0;while(1){Vc(4);Ja=n+1|0;if((Ja|0)==262144){Sa=61448;Ta=1;break}else{n=Ja}}do{n=Ta*3|0;Ta=((d[Sa]|0)^n)<<8^n>>>8;Sa=Sa+1|0;}while((Sa|0)!=(65544|0));do{if((Qa|0)==(Pa|0)){Sa=Pa-Ra|0;n=Sa>>2;Ja=n+1|0;if(Ja>>>0>1073741823){Ij(0)}if(n>>>0<536870911){Ia=Sa>>1;Ha=Ia>>>0<Ja>>>0?Ja:Ia;if((Ha|0)==0){Ua=0;Va=0}else{Wa=Ha;ya=98}}else{Wa=1073741823;ya=98}if((ya|0)==98){Ua=Wa;Va=Gm(Wa<<2)|0}Ha=Va+(n<<2)|0;n=Va+(Ua<<2)|0;if((Ha|0)!=0){c[Ha>>2]=Ta}Ha=Va+(Ja<<2)|0;Ja=Ra;$m(Va|0,Ja|0,Sa|0)|0;if((Ra|0)==0){Xa=n;Ya=Ha;Za=Va;break}Im(Ja);Xa=n;Ya=Ha;Za=Va}else{if((Qa|0)!=0){c[Qa>>2]=Ta}Xa=Pa;Ya=Qa+4|0;Za=Ra}}while(0);hd(o);Wc(8);c[p>>2]=225416;a[p+4|0]=1;$b(p+8|0,0)|0;o=0;while(1){Wc(8);Ra=o+1|0;if((Ra|0)==16384){_a=94216;$a=1;break}else{o=Ra}}do{o=$a*3|0;$a=((d[_a]|0)^o)<<8^o>>>8;_a=_a+1|0;}while((_a|0)!=(98312|0));do{if((Ya|0)==(Xa|0)){_a=Xa-Za|0;o=_a>>2;Ra=o+1|0;if(Ra>>>0>1073741823){Ij(0)}if(o>>>0<536870911){Qa=_a>>1;Pa=Qa>>>0<Ra>>>0?Ra:Qa;if((Pa|0)==0){ab=0;bb=0}else{cb=Pa;ya=114}}else{cb=1073741823;ya=114}if((ya|0)==114){ab=cb;bb=Gm(cb<<2)|0}Pa=bb+(o<<2)|0;o=bb+(ab<<2)|0;if((Pa|0)!=0){c[Pa>>2]=$a}Pa=bb+(Ra<<2)|0;Ra=Za;$m(bb|0,Ra|0,_a|0)|0;if((Za|0)==0){db=o;eb=Pa;fb=bb;break}Im(Ra);db=o;eb=Pa;fb=bb}else{if((Ya|0)!=0){c[Ya>>2]=$a}db=Xa;eb=Ya+4|0;fb=Za}}while(0);hd(p);Xc(b);c[q>>2]=225432;a[q+4|0]=1;$b(q+8|0,0)|0;p=0;do{Xc(b);p=p+1|0;}while((p|0)!=131072);p=c[b>>2]|0;do{if((eb|0)==(db|0)){b=db-fb|0;Za=b>>2;Ya=Za+1|0;if(Ya>>>0>1073741823){Ij(0)}if(Za>>>0<536870911){Xa=b>>1;$a=Xa>>>0<Ya>>>0?Ya:Xa;if(($a|0)==0){gb=0;hb=0}else{ib=$a;ya=129}}else{ib=1073741823;ya=129}if((ya|0)==129){gb=ib;hb=Gm(ib<<2)|0}$a=hb+(Za<<2)|0;Za=hb+(gb<<2)|0;if(($a|0)!=0){c[$a>>2]=p}$a=hb+(Ya<<2)|0;Ya=fb;$m(hb|0,Ya|0,b|0)|0;if((fb|0)==0){jb=Za;kb=$a;lb=hb;break}Im(Ya);jb=Za;kb=$a;lb=hb}else{if((eb|0)!=0){c[eb>>2]=p}jb=db;kb=eb+4|0;lb=fb}}while(0);hd(q);Yc(2056,4104,6152,12296,16392,20488);c[r>>2]=225448;a[r+4|0]=1;$b(r+8|0,0)|0;q=0;while(1){Yc(2056,4104,6152,12296,16392,20488);fb=q+1|0;if((fb|0)==131072){mb=12296;nb=1;break}else{q=fb}}while(1){q=nb*3|0;ob=((d[mb]|0)^q)<<8^q>>>8;q=mb+1|0;if((q|0)==(16392|0)){pb=2056;qb=1;break}else{nb=ob;mb=q}}do{mb=qb*3|0;qb=((d[pb]|0)^mb)<<8^mb>>>8;pb=pb+1|0;}while((pb|0)!=(4104|0));pb=qb+ob|0;do{if((kb|0)==(jb|0)){ob=jb-lb|0;qb=ob>>2;mb=qb+1|0;if(mb>>>0>1073741823){Ij(0)}if(qb>>>0<536870911){nb=ob>>1;q=nb>>>0<mb>>>0?mb:nb;if((q|0)==0){rb=0;sb=0}else{tb=q;ya=146}}else{tb=1073741823;ya=146}if((ya|0)==146){rb=tb;sb=Gm(tb<<2)|0}q=sb+(qb<<2)|0;qb=sb+(rb<<2)|0;if((q|0)!=0){c[q>>2]=pb}q=sb+(mb<<2)|0;mb=lb;$m(sb|0,mb|0,ob|0)|0;if((lb|0)==0){ub=qb;vb=q;wb=sb;break}Im(mb);ub=qb;vb=q;wb=sb}else{if((kb|0)!=0){c[kb>>2]=pb}ub=jb;vb=kb+4|0;wb=lb}}while(0);hd(r);Zc(0,4104,0,12296,0,0);c[s>>2]=225464;a[s+4|0]=1;$b(s+8|0,0)|0;r=0;while(1){Zc(0,4104,0,12296,0,0);lb=r+1|0;if((lb|0)==262144){xb=12296;yb=1;break}else{r=lb}}do{r=yb*3|0;yb=((d[xb]|0)^r)<<8^r>>>8;xb=xb+1|0;}while((xb|0)!=(16392|0));do{if((vb|0)==(ub|0)){xb=ub-wb|0;r=xb>>2;lb=r+1|0;if(lb>>>0>1073741823){Ij(0)}if(r>>>0<536870911){kb=xb>>1;jb=kb>>>0<lb>>>0?lb:kb;if((jb|0)==0){zb=0;Ab=0}else{Bb=jb;ya=162}}else{Bb=1073741823;ya=162}if((ya|0)==162){zb=Bb;Ab=Gm(Bb<<2)|0}jb=Ab+(r<<2)|0;r=Ab+(zb<<2)|0;if((jb|0)!=0){c[jb>>2]=yb}jb=Ab+(lb<<2)|0;lb=wb;$m(Ab|0,lb|0,xb|0)|0;if((wb|0)==0){Cb=r;Db=jb;Eb=Ab;break}Im(lb);Cb=r;Db=jb;Eb=Ab}else{if((vb|0)!=0){c[vb>>2]=yb}Cb=ub;Db=vb+4|0;Eb=wb}}while(0);hd(s);_c();c[t>>2]=225480;a[t+4|0]=1;$b(t+8|0,0)|0;s=0;while(1){_c();wb=s+1|0;if((wb|0)==131072){Fb=86024;Gb=1;break}else{s=wb}}do{s=Gb*3|0;Gb=((d[Fb]|0)^s)<<8^s>>>8;Fb=Fb+1|0;}while((Fb|0)!=(90120|0));do{if((Db|0)==(Cb|0)){Fb=Cb-Eb|0;s=Fb>>2;wb=s+1|0;if(wb>>>0>1073741823){Ij(0)}if(s>>>0<536870911){vb=Fb>>1;ub=vb>>>0<wb>>>0?wb:vb;if((ub|0)==0){Hb=0;Ib=0}else{Jb=ub;ya=178}}else{Jb=1073741823;ya=178}if((ya|0)==178){Hb=Jb;Ib=Gm(Jb<<2)|0}ub=Ib+(s<<2)|0;s=Ib+(Hb<<2)|0;if((ub|0)!=0){c[ub>>2]=Gb}ub=Ib+(wb<<2)|0;wb=Eb;$m(Ib|0,wb|0,Fb|0)|0;if((Eb|0)==0){Kb=s;Lb=ub;Mb=Ib;break}Im(wb);Kb=s;Lb=ub;Mb=Ib}else{if((Db|0)!=0){c[Db>>2]=Gb}Kb=Cb;Lb=Db+4|0;Mb=Eb}}while(0);hd(t);$c();c[u>>2]=225496;a[u+4|0]=1;$b(u+8|0,0)|0;t=0;while(1){$c();Eb=t+1|0;if((Eb|0)==262144){Nb=61448;Ob=1;break}else{t=Eb}}do{t=Ob*3|0;Ob=((d[Nb]|0)^t)<<8^t>>>8;Nb=Nb+1|0;}while((Nb|0)!=(65544|0));do{if((Lb|0)==(Kb|0)){Nb=Kb-Mb|0;t=Nb>>2;Eb=t+1|0;if(Eb>>>0>1073741823){Ij(0)}if(t>>>0<536870911){Db=Nb>>1;Cb=Db>>>0<Eb>>>0?Eb:Db;if((Cb|0)==0){Pb=0;Qb=0}else{Rb=Cb;ya=194}}else{Rb=1073741823;ya=194}if((ya|0)==194){Pb=Rb;Qb=Gm(Rb<<2)|0}Cb=Qb+(t<<2)|0;t=Qb+(Pb<<2)|0;if((Cb|0)!=0){c[Cb>>2]=Ob}Cb=Qb+(Eb<<2)|0;Eb=Mb;$m(Qb|0,Eb|0,Nb|0)|0;if((Mb|0)==0){Sb=t;Tb=Cb;Ub=Qb;break}Im(Eb);Sb=t;Tb=Cb;Ub=Qb}else{if((Lb|0)!=0){c[Lb>>2]=Ob}Sb=Kb;Tb=Lb+4|0;Ub=Mb}}while(0);hd(u);ad(8,8200);c[v>>2]=225512;a[v+4|0]=1;$b(v+8|0,0)|0;u=0;while(1){ad(8,8200);Mb=u+1|0;if((Mb|0)==524288){Vb=8;Wb=1;break}else{u=Mb}}do{u=Wb*3|0;Wb=((d[Vb]|0)^u)<<8^u>>>8;Vb=Vb+1|0;}while((Vb|0)!=(520|0));do{if((Tb|0)==(Sb|0)){Vb=Sb-Ub|0;u=Vb>>2;Mb=u+1|0;if(Mb>>>0>1073741823){Ij(0)}if(u>>>0<536870911){Lb=Vb>>1;Kb=Lb>>>0<Mb>>>0?Mb:Lb;if((Kb|0)==0){Xb=0;Yb=0}else{Zb=Kb;ya=210}}else{Zb=1073741823;ya=210}if((ya|0)==210){Xb=Zb;Yb=Gm(Zb<<2)|0}Kb=Yb+(u<<2)|0;u=Yb+(Xb<<2)|0;if((Kb|0)!=0){c[Kb>>2]=Wb}Kb=Yb+(Mb<<2)|0;Mb=Ub;$m(Yb|0,Mb|0,Vb|0)|0;if((Ub|0)==0){_b=u;ac=Kb;bc=Yb;break}Im(Mb);_b=u;ac=Kb;bc=Yb}else{if((Tb|0)!=0){c[Tb>>2]=Wb}_b=Sb;ac=Tb+4|0;bc=Ub}}while(0);hd(v);bd(2,4);c[w>>2]=225528;a[w+4|0]=1;$b(w+8|0,0)|0;v=0;do{bd(2,4);v=v+1|0;}while((v|0)!=131072);do{if((ac|0)==(_b|0)){v=_b-bc|0;Ub=v>>2;Tb=Ub+1|0;if(Tb>>>0>1073741823){Ij(0)}if(Ub>>>0<536870911){Sb=v>>1;Wb=Sb>>>0<Tb>>>0?Tb:Sb;if((Wb|0)==0){cc=0;dc=0}else{ec=Wb;ya=225}}else{ec=1073741823;ya=225}if((ya|0)==225){cc=ec;dc=Gm(ec<<2)|0}Wb=dc+(Ub<<2)|0;Ub=dc+(cc<<2)|0;if((Wb|0)!=0){c[Wb>>2]=0}Wb=dc+(Tb<<2)|0;Tb=bc;$m(dc|0,Tb|0,v|0)|0;if((bc|0)==0){fc=Ub;gc=Wb;hc=dc;break}Im(Tb);fc=Ub;gc=Wb;hc=dc}else{if((ac|0)!=0){c[ac>>2]=0}fc=_b;gc=ac+4|0;hc=bc}}while(0);hd(w);cd();c[x>>2]=225544;a[x+4|0]=1;$b(x+8|0,0)|0;w=0;while(1){cd();bc=w+1|0;if((bc|0)==131072){ic=57352;jc=1;break}else{w=bc}}do{w=jc*3|0;jc=((d[ic]|0)^w)<<8^w>>>8;ic=ic+1|0;}while((ic|0)!=(61448|0));do{if((gc|0)==(fc|0)){ic=fc-hc|0;w=ic>>2;bc=w+1|0;if(bc>>>0>1073741823){Ij(0)}if(w>>>0<536870911){ac=ic>>1;_b=ac>>>0<bc>>>0?bc:ac;if((_b|0)==0){kc=0}else{lc=_b;ya=241}}else{lc=1073741823;ya=241}if((ya|0)==241){kc=Gm(lc<<2)|0}_b=kc+(w<<2)|0;if((_b|0)!=0){c[_b>>2]=jc}_b=kc+(bc<<2)|0;bc=hc;$m(kc|0,bc|0,ic|0)|0;if((hc|0)==0){mc=_b;nc=kc;break}Im(bc);mc=_b;nc=kc}else{if((gc|0)!=0){c[gc>>2]=jc}mc=gc+4|0;nc=hc}}while(0);hd(x);x=(c[(c[56426]|0)+ -12>>2]|0)+225708|0;c[x>>2]=c[x>>2]&-75|8;x=fd(225704,225560)|0;if((nc|0)==(mc|0)){oc=0}else{hc=0;gc=nc;while(1){jc=(c[gc>>2]|0)+hc|0;kc=gc+4|0;if((kc|0)==(mc|0)){oc=jc;break}else{gc=kc;hc=jc}}}fd(zf(x,oc)|0,225576)|0;oc=mc-nc>>2;if((oc|0)!=0){mc=0;do{x=fd(225704,225584)|0;Af(x,c[nc+(mc<<2)>>2]|0)|0;mc=mc+1|0;}while(mc>>>0<oc>>>0)}fd(225704,225592)|0;if((nc|0)==0){i=e;return 0}Im(nc);i=e;return 0}function ed(a){a=a|0;mb(a|0)|0;La()}function fd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+40|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=h;a[l]=0;c[h+4>>2]=b;m=b;n=c[(c[m>>2]|0)+ -12>>2]|0;o=b;if((c[o+(n+16)>>2]|0)!=0){yf(h);i=e;return b|0}p=c[o+(n+72)>>2]|0;if((p|0)==0){q=n}else{nf(p)|0;q=c[(c[m>>2]|0)+ -12>>2]|0}a[l]=1;l=bn(d|0)|0;c[j>>2]=c[o+(q+24)>>2];if((c[o+(q+4)>>2]&176|0)==32){r=d+l|0}else{r=d}p=o+q|0;n=o+(q+76)|0;q=c[n>>2]|0;if((q|0)==-1){s=p;Ge(g,s);t=Rj(g,230352)|0;u=vc[c[(c[t>>2]|0)+28>>2]&15](t,32)|0;Qj(g);g=u<<24>>24;c[n>>2]=g;v=s;w=g}else{v=p;w=q}q=w&255;w=d+l|0;l=f;p=j;c[l+0>>2]=c[p+0>>2];gd(k,f,d,r,w,v,q);if((c[k>>2]|0)!=0){yf(h);i=e;return b|0}k=c[(c[m>>2]|0)+ -12>>2]|0;Ee(o+k|0,c[o+(k+16)>>2]|5);yf(h);i=e;return b|0}function gd(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;k=i;i=i+16|0;l=k;m=d;d=c[m>>2]|0;if((d|0)==0){c[b>>2]=0;i=k;return}n=g;g=e;o=n-g|0;p=h+12|0;h=c[p>>2]|0;q=(h|0)>(o|0)?h-o|0:0;o=f;h=o-g|0;do{if((h|0)>0){if((gc[c[(c[d>>2]|0)+48>>2]&31](d,e,h)|0)==(h|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);do{if((q|0)>0){if(q>>>0<11){h=q<<1&255;e=l;a[e]=h;r=e;s=h;t=l+1|0}else{h=q+16&-16;e=Gm(h)|0;c[l+8>>2]=e;g=h|1;c[l>>2]=g;c[l+4>>2]=q;r=l;s=g&255;t=e}Ym(t|0,j|0,q|0)|0;a[t+q|0]=0;if((s&1)==0){u=l+1|0}else{u=c[l+8>>2]|0}if((gc[c[(c[d>>2]|0)+48>>2]&31](d,u,q)|0)==(q|0)){if((a[r]&1)==0){break}Im(c[l+8>>2]|0);break}c[m>>2]=0;c[b>>2]=0;if((a[r]&1)==0){i=k;return}Im(c[l+8>>2]|0);i=k;return}}while(0);l=n-o|0;do{if((l|0)>0){if((gc[c[(c[d>>2]|0)+48>>2]&31](d,f,l)|0)==(l|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);c[p>>2]=0;c[b>>2]=d;i=k;return}function hd(b){b=b|0;var d=0,e=0,f=0;d=i;e=b+16|0;$b(e|0,0)|0;if((a[b+4|0]|0)==0){i=d;return}f=~~(+((c[b+20>>2]|0)-(c[b+12>>2]|0)|0)/1.0e3+ +(((c[e>>2]|0)-(c[b+8>>2]|0)|0)*1e3|0)+.5);fd(Bf(fd(fd(225704,c[b>>2]|0)|0,225600)|0,f)|0,225608)|0;i=d;return}function id(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;b=i;i=i+32|0;d=b;e=b+8|0;f=b+16|0;g=b+24|0;h=c[r>>2]|0;Ed(226328,h,226384);c[56404]=227756;c[225624>>2]=227776;c[225620>>2]=0;He(225624|0,226328);c[225696>>2]=0;c[225700>>2]=-1;j=c[s>>2]|0;c[56608]=227624;Oj(226436|0);c[226440>>2]=0;c[226444>>2]=0;c[226448>>2]=0;c[226452>>2]=0;c[226456>>2]=0;c[226460>>2]=0;c[56608]=226944;c[226464>>2]=j;Pj(g,226436|0);k=Rj(g,230416)|0;l=k;Qj(g);c[226468>>2]=l;c[226472>>2]=226392;a[226476|0]=(mc[c[(c[k>>2]|0)+28>>2]&63](l)|0)&1;c[56426]=227836;c[225708>>2]=227856;He(225708|0,226432);c[225780>>2]=0;c[225784>>2]=-1;l=c[q>>2]|0;c[56620]=227624;Oj(226484|0);c[226488>>2]=0;c[226492>>2]=0;c[226496>>2]=0;c[226500>>2]=0;c[226504>>2]=0;c[226508>>2]=0;c[56620]=226944;c[226512>>2]=l;Pj(f,226484|0);k=Rj(f,230416)|0;g=k;Qj(f);c[226516>>2]=g;c[226520>>2]=226400;a[226524|0]=(mc[c[(c[k>>2]|0)+28>>2]&63](g)|0)&1;c[56448]=227836;c[225796>>2]=227856;He(225796|0,226480);c[225868>>2]=0;c[225872>>2]=-1;g=c[(c[(c[56448]|0)+ -12>>2]|0)+225816>>2]|0;c[56470]=227836;c[225884>>2]=227856;He(225884|0,g);c[225956>>2]=0;c[225960>>2]=-1;c[(c[(c[56404]|0)+ -12>>2]|0)+225688>>2]=225704;g=(c[(c[56448]|0)+ -12>>2]|0)+225796|0;c[g>>2]=c[g>>2]|8192;c[(c[(c[56448]|0)+ -12>>2]|0)+225864>>2]=225704;qd(226528,h,226408|0);c[56492]=227796;c[225976>>2]=227816;c[225972>>2]=0;He(225976|0,226528);c[226048>>2]=0;c[226052>>2]=-1;c[56646]=227688;Oj(226588|0);c[226592>>2]=0;c[226596>>2]=0;c[226600>>2]=0;c[226604>>2]=0;c[226608>>2]=0;c[226612>>2]=0;c[56646]=226688;c[226616>>2]=j;Pj(e,226588|0);j=Rj(e,230424)|0;h=j;Qj(e);c[226620>>2]=h;c[226624>>2]=226416;a[226628|0]=(mc[c[(c[j>>2]|0)+28>>2]&63](h)|0)&1;c[56514]=227876;c[226060>>2]=227896;He(226060|0,226584);c[226132>>2]=0;c[226136>>2]=-1;c[56658]=227688;Oj(226636|0);c[226640>>2]=0;c[226644>>2]=0;c[226648>>2]=0;c[226652>>2]=0;c[226656>>2]=0;c[226660>>2]=0;c[56658]=226688;c[226664>>2]=l;Pj(d,226636|0);l=Rj(d,230424)|0;h=l;Qj(d);c[226668>>2]=h;c[226672>>2]=226424;a[226676|0]=(mc[c[(c[l>>2]|0)+28>>2]&63](h)|0)&1;c[56536]=227876;c[226148>>2]=227896;He(226148|0,226632);c[226220>>2]=0;c[226224>>2]=-1;h=c[(c[(c[56536]|0)+ -12>>2]|0)+226168>>2]|0;c[56558]=227876;c[226236>>2]=227896;He(226236|0,h);c[226308>>2]=0;c[226312>>2]=-1;c[(c[(c[56492]|0)+ -12>>2]|0)+226040>>2]=226056;h=(c[(c[56536]|0)+ -12>>2]|0)+226148|0;c[h>>2]=c[h>>2]|8192;c[(c[(c[56536]|0)+ -12>>2]|0)+226216>>2]=226056;i=b;return}function jd(a){a=a|0;a=i;nf(225704)|0;nf(225880)|0;tf(226056)|0;tf(226232)|0;i=a;return}function kd(a){a=a|0;var b=0;b=i;c[a>>2]=227688;Qj(a+4|0);i=b;return}function ld(a){a=a|0;var b=0;b=i;c[a>>2]=227688;Qj(a+4|0);Im(a);i=b;return}function md(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;mc[c[(c[b>>2]|0)+24>>2]&63](b)|0;f=Rj(d,230424)|0;d=f;c[b+36>>2]=d;a[b+44|0]=(mc[c[(c[f>>2]|0)+28>>2]&63](d)|0)&1;i=e;return}function nd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;i=i+16|0;d=b;e=b+8|0;f=a+36|0;g=a+40|0;h=d;j=d+8|0;k=d;d=a+32|0;while(1){a=c[f>>2]|0;l=wc[c[(c[a>>2]|0)+20>>2]&15](a,c[g>>2]|0,h,j,e)|0;a=(c[e>>2]|0)-k|0;if((Xb(h|0,1,a|0,c[d>>2]|0)|0)!=(a|0)){m=-1;n=5;break}if((l|0)==2){m=-1;n=5;break}else if((l|0)!=1){n=4;break}}if((n|0)==4){m=((Za(c[d>>2]|0)|0)!=0)<<31>>31;i=b;return m|0}else if((n|0)==5){i=b;return m|0}return 0}function od(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;if((a[b+44|0]|0)!=0){g=Xb(d|0,4,e|0,c[b+32>>2]|0)|0;i=f;return g|0}h=b;if((e|0)>0){j=d;k=0}else{g=0;i=f;return g|0}while(1){if((vc[c[(c[h>>2]|0)+52>>2]&15](b,c[j>>2]|0)|0)==-1){g=k;l=6;break}d=k+1|0;if((d|0)<(e|0)){j=j+4|0;k=d}else{g=d;l=6;break}}if((l|0)==6){i=f;return g|0}return 0}function pd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=(d|0)==-1;a:do{if(!k){c[g>>2]=d;if((a[b+44|0]|0)!=0){if((Xb(g|0,4,1,c[b+32>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}m=f;c[h>>2]=m;n=g+4|0;o=b+36|0;p=b+40|0;q=f+8|0;r=f;s=b+32|0;t=g;while(1){u=c[o>>2]|0;v=rc[c[(c[u>>2]|0)+12>>2]&15](u,c[p>>2]|0,t,n,j,m,q,h)|0;if((c[j>>2]|0)==(t|0)){l=-1;w=12;break}if((v|0)==3){w=7;break}u=(v|0)==1;if(!(v>>>0<2)){l=-1;w=12;break}v=(c[h>>2]|0)-r|0;if((Xb(m|0,1,v|0,c[s>>2]|0)|0)!=(v|0)){l=-1;w=12;break}if(u){t=u?c[j>>2]|0:t}else{break a}}if((w|0)==7){if((Xb(t|0,1,1,c[s>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}else if((w|0)==12){i=e;return l|0}}}while(0);l=k?0:d;i=e;return l|0}function qd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+8|0;g=f;h=b;c[h>>2]=227688;j=b+4|0;Oj(j);k=b+8|0;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[h>>2]=226800;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=-1;a[b+52|0]=0;Pj(g,j);j=Rj(g,230424)|0;e=j;d=b+36|0;c[d>>2]=e;h=b+44|0;c[h>>2]=mc[c[(c[j>>2]|0)+24>>2]&63](e)|0;e=c[d>>2]|0;a[b+53|0]=(mc[c[(c[e>>2]|0)+28>>2]&63](e)|0)&1;if((c[h>>2]|0)>8){$i(226896)}else{Qj(g);i=f;return}}function rd(a){a=a|0;var b=0;b=i;c[a>>2]=227688;Qj(a+4|0);i=b;return}function sd(a){a=a|0;var b=0;b=i;c[a>>2]=227688;Qj(a+4|0);Im(a);i=b;return}function td(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;f=Rj(d,230424)|0;d=f;g=b+36|0;c[g>>2]=d;h=b+44|0;c[h>>2]=mc[c[(c[f>>2]|0)+24>>2]&63](d)|0;d=c[g>>2]|0;a[b+53|0]=(mc[c[(c[d>>2]|0)+28>>2]&63](d)|0)&1;if((c[h>>2]|0)>8){$i(226896)}else{i=e;return}}function ud(a){a=a|0;var b=0,c=0;b=i;c=xd(a,0)|0;i=b;return c|0}function vd(a){a=a|0;var b=0,c=0;b=i;c=xd(a,1)|0;i=b;return c|0}function wd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;l=(a[k]|0)!=0;if((d|0)==-1){if(l){m=-1;i=e;return m|0}n=c[b+48>>2]|0;a[k]=(n|0)!=-1|0;m=n;i=e;return m|0}n=b+48|0;a:do{if(l){c[h>>2]=c[n>>2];o=c[b+36>>2]|0;p=f;q=rc[c[(c[o>>2]|0)+12>>2]&15](o,c[b+40>>2]|0,h,h+4|0,j,p,f+8|0,g)|0;if((q|0)==3){a[p]=c[n>>2];c[g>>2]=f+1}else if((q|0)==1|(q|0)==2){m=-1;i=e;return m|0}q=b+32|0;while(1){o=c[g>>2]|0;if(!(o>>>0>p>>>0)){break a}r=o+ -1|0;c[g>>2]=r;if((Ta(a[r]|0,c[q>>2]|0)|0)==-1){m=-1;break}}i=e;return m|0}}while(0);c[n>>2]=d;a[k]=1;m=d;i=e;return m|0}function xd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;if((a[k]|0)!=0){l=b+48|0;m=c[l>>2]|0;if(!d){n=m;i=e;return n|0}c[l>>2]=-1;a[k]=0;n=m;i=e;return n|0}m=c[b+44>>2]|0;k=(m|0)>1?m:1;a:do{if((k|0)>0){m=b+32|0;l=0;while(1){o=Nb(c[m>>2]|0)|0;if((o|0)==-1){n=-1;break}a[f+l|0]=o;l=l+1|0;if((l|0)>=(k|0)){break a}}i=e;return n|0}}while(0);b:do{if((a[b+53|0]|0)==0){l=b+40|0;m=b+36|0;o=f;p=g+4|0;q=b+32|0;r=k;while(1){s=c[l>>2]|0;t=s;u=c[t>>2]|0;v=c[t+4>>2]|0;t=c[m>>2]|0;w=f+r|0;x=rc[c[(c[t>>2]|0)+16>>2]&15](t,s,o,w,h,g,p,j)|0;if((x|0)==3){y=14;break}else if((x|0)==2){n=-1;y=22;break}else if((x|0)!=1){z=r;break b}x=c[l>>2]|0;c[x>>2]=u;c[x+4>>2]=v;if((r|0)==8){n=-1;y=22;break}v=Nb(c[q>>2]|0)|0;if((v|0)==-1){n=-1;y=22;break}a[w]=v;r=r+1|0}if((y|0)==14){c[g>>2]=a[o]|0;z=r;break}else if((y|0)==22){i=e;return n|0}}else{c[g>>2]=a[f]|0;z=k}}while(0);if(d){d=c[g>>2]|0;c[b+48>>2]=d;n=d;i=e;return n|0}d=b+32|0;b=z;while(1){if((b|0)<=0){break}z=b+ -1|0;if((Ta(a[f+z|0]|0,c[d>>2]|0)|0)==-1){n=-1;y=22;break}else{b=z}}if((y|0)==22){i=e;return n|0}n=c[g>>2]|0;i=e;return n|0}function yd(a){a=a|0;var b=0;b=i;c[a>>2]=227624;Qj(a+4|0);i=b;return}function zd(a){a=a|0;var b=0;b=i;c[a>>2]=227624;Qj(a+4|0);Im(a);i=b;return}function Ad(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;mc[c[(c[b>>2]|0)+24>>2]&63](b)|0;f=Rj(d,230416)|0;d=f;c[b+36>>2]=d;a[b+44|0]=(mc[c[(c[f>>2]|0)+28>>2]&63](d)|0)&1;i=e;return}function Bd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;i=i+16|0;d=b;e=b+8|0;f=a+36|0;g=a+40|0;h=d;j=d+8|0;k=d;d=a+32|0;while(1){a=c[f>>2]|0;l=wc[c[(c[a>>2]|0)+20>>2]&15](a,c[g>>2]|0,h,j,e)|0;a=(c[e>>2]|0)-k|0;if((Xb(h|0,1,a|0,c[d>>2]|0)|0)!=(a|0)){m=-1;n=5;break}if((l|0)==2){m=-1;n=5;break}else if((l|0)!=1){n=4;break}}if((n|0)==4){m=((Za(c[d>>2]|0)|0)!=0)<<31>>31;i=b;return m|0}else if((n|0)==5){i=b;return m|0}return 0}function Cd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;if((a[b+44|0]|0)!=0){h=Xb(e|0,1,f|0,c[b+32>>2]|0)|0;i=g;return h|0}j=b;if((f|0)>0){k=e;l=0}else{h=0;i=g;return h|0}while(1){if((vc[c[(c[j>>2]|0)+52>>2]&15](b,d[k]|0)|0)==-1){h=l;m=6;break}e=l+1|0;if((e|0)<(f|0)){k=k+1|0;l=e}else{h=e;m=6;break}}if((m|0)==6){i=g;return h|0}return 0}function Dd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=(d|0)==-1;a:do{if(!k){a[g]=d;if((a[b+44|0]|0)!=0){if((Xb(g|0,1,1,c[b+32>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}m=f;c[h>>2]=m;n=g+1|0;o=b+36|0;p=b+40|0;q=f+8|0;r=f;s=b+32|0;t=g;while(1){u=c[o>>2]|0;v=rc[c[(c[u>>2]|0)+12>>2]&15](u,c[p>>2]|0,t,n,j,m,q,h)|0;if((c[j>>2]|0)==(t|0)){l=-1;w=12;break}if((v|0)==3){w=7;break}u=(v|0)==1;if(!(v>>>0<2)){l=-1;w=12;break}v=(c[h>>2]|0)-r|0;if((Xb(m|0,1,v|0,c[s>>2]|0)|0)!=(v|0)){l=-1;w=12;break}if(u){t=u?c[j>>2]|0:t}else{break a}}if((w|0)==7){if((Xb(t|0,1,1,c[s>>2]|0)|0)==1){break}else{l=-1}i=e;return l|0}else if((w|0)==12){i=e;return l|0}}}while(0);l=k?0:d;i=e;return l|0}function Ed(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+8|0;g=f;h=b;c[h>>2]=227624;j=b+4|0;Oj(j);k=b+8|0;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[h>>2]=227056;c[b+32>>2]=d;c[b+40>>2]=e;c[b+48>>2]=-1;a[b+52|0]=0;Pj(g,j);j=Rj(g,230416)|0;e=j;d=b+36|0;c[d>>2]=e;h=b+44|0;c[h>>2]=mc[c[(c[j>>2]|0)+24>>2]&63](e)|0;e=c[d>>2]|0;a[b+53|0]=(mc[c[(c[e>>2]|0)+28>>2]&63](e)|0)&1;if((c[h>>2]|0)>8){$i(226896)}else{Qj(g);i=f;return}}function Fd(a){a=a|0;var b=0;b=i;c[a>>2]=227624;Qj(a+4|0);i=b;return}function Gd(a){a=a|0;var b=0;b=i;c[a>>2]=227624;Qj(a+4|0);Im(a);i=b;return}function Hd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;f=Rj(d,230416)|0;d=f;g=b+36|0;c[g>>2]=d;h=b+44|0;c[h>>2]=mc[c[(c[f>>2]|0)+24>>2]&63](d)|0;d=c[g>>2]|0;a[b+53|0]=(mc[c[(c[d>>2]|0)+28>>2]&63](d)|0)&1;if((c[h>>2]|0)>8){$i(226896)}else{i=e;return}}function Id(a){a=a|0;var b=0,c=0;b=i;c=Ld(a,0)|0;i=b;return c|0}function Jd(a){a=a|0;var b=0,c=0;b=i;c=Ld(a,1)|0;i=b;return c|0}function Kd(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+32|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=b+52|0;l=(a[k]|0)!=0;if((d|0)==-1){if(l){m=-1;i=e;return m|0}n=c[b+48>>2]|0;a[k]=(n|0)!=-1|0;m=n;i=e;return m|0}n=b+48|0;a:do{if(l){a[h]=c[n>>2];o=c[b+36>>2]|0;p=f;q=rc[c[(c[o>>2]|0)+12>>2]&15](o,c[b+40>>2]|0,h,h+1|0,j,p,f+8|0,g)|0;if((q|0)==3){a[p]=c[n>>2];c[g>>2]=f+1}else if((q|0)==1|(q|0)==2){m=-1;i=e;return m|0}q=b+32|0;while(1){o=c[g>>2]|0;if(!(o>>>0>p>>>0)){break a}r=o+ -1|0;c[g>>2]=r;if((Ta(a[r]|0,c[q>>2]|0)|0)==-1){m=-1;break}}i=e;return m|0}}while(0);c[n>>2]=d;a[k]=1;m=d;i=e;return m|0}function Ld(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;f=i;i=i+32|0;g=f;h=f+8|0;j=f+16|0;k=f+24|0;l=b+52|0;if((a[l]|0)!=0){m=b+48|0;n=c[m>>2]|0;if(!e){o=n;i=f;return o|0}c[m>>2]=-1;a[l]=0;o=n;i=f;return o|0}n=c[b+44>>2]|0;l=(n|0)>1?n:1;a:do{if((l|0)>0){n=b+32|0;m=0;while(1){p=Nb(c[n>>2]|0)|0;if((p|0)==-1){o=-1;break}a[g+m|0]=p;m=m+1|0;if((m|0)>=(l|0)){break a}}i=f;return o|0}}while(0);b:do{if((a[b+53|0]|0)==0){m=b+40|0;n=b+36|0;p=g;q=h+1|0;r=b+32|0;s=l;while(1){t=c[m>>2]|0;u=t;v=c[u>>2]|0;w=c[u+4>>2]|0;u=c[n>>2]|0;x=g+s|0;y=rc[c[(c[u>>2]|0)+16>>2]&15](u,t,p,x,j,h,q,k)|0;if((y|0)==3){z=14;break}else if((y|0)==2){o=-1;z=23;break}else if((y|0)!=1){A=s;break b}y=c[m>>2]|0;c[y>>2]=v;c[y+4>>2]=w;if((s|0)==8){o=-1;z=23;break}w=Nb(c[r>>2]|0)|0;if((w|0)==-1){o=-1;z=23;break}a[x]=w;s=s+1|0}if((z|0)==14){a[h]=a[p]|0;A=s;break}else if((z|0)==23){i=f;return o|0}}else{a[h]=a[g]|0;A=l}}while(0);do{if(e){l=a[h]|0;c[b+48>>2]=l&255;B=l}else{l=b+32|0;k=A;while(1){if((k|0)<=0){z=21;break}j=k+ -1|0;if((Ta(d[g+j|0]|0,c[l>>2]|0)|0)==-1){o=-1;z=23;break}else{k=j}}if((z|0)==21){B=a[h]|0;break}else if((z|0)==23){i=f;return o|0}}}while(0);o=B&255;i=f;return o|0}function Md(){var a=0;a=i;id(0);Ra(111,226320,p|0)|0;i=a;return}function Nd(a){a=a|0;i=i;return}function Od(a){a=a|0;var b=0;b=a+4|0;c[b>>2]=(c[b>>2]|0)+1;i=i;return}function Pd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;e=c[d>>2]|0;c[d>>2]=e+ -1;if((e|0)!=0){f=0;i=b;return f|0}jc[c[(c[a>>2]|0)+8>>2]&127](a);f=1;i=b;return f|0}function Qd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a>>2]=227200;e=bn(b|0)|0;f=Hm(e+13|0)|0;c[f+4>>2]=e;c[f>>2]=e;g=f+12|0;c[a+4>>2]=g;c[f+8>>2]=0;$m(g|0,b|0,e+1|0)|0;i=d;return}function Rd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=227200;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Jm((c[d>>2]|0)+ -12|0)}Mb(a|0);Im(a);i=b;return}function Sd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=227200;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)>=0){g=a;Mb(g|0);i=b;return}Jm((c[d>>2]|0)+ -12|0);g=a;Mb(g|0);i=b;return}function Td(a){a=a|0;i=i;return c[a+4>>2]|0}function Ud(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;c[b>>2]=227224;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=bn(f|0)|0;g=Hm(d+13|0)|0;c[g+4>>2]=d;c[g>>2]=d;h=g+12|0;c[b+4>>2]=h;c[g+8>>2]=0;$m(h|0,f|0,d+1|0)|0;i=e;return}function Vd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a>>2]=227224;e=bn(b|0)|0;f=Hm(e+13|0)|0;c[f+4>>2]=e;c[f>>2]=e;g=f+12|0;c[a+4>>2]=g;c[f+8>>2]=0;$m(g|0,b|0,e+1|0)|0;i=d;return}function Wd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=227224;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Jm((c[d>>2]|0)+ -12|0)}Mb(a|0);Im(a);i=b;return}function Xd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=227224;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)>=0){g=a;Mb(g|0);i=b;return}Jm((c[d>>2]|0)+ -12|0);g=a;Mb(g|0);i=b;return}function Yd(a){a=a|0;i=i;return c[a+4>>2]|0}function Zd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;c[a>>2]=227200;d=a+4|0;e=(c[d>>2]|0)+ -4|0;f=c[e>>2]|0;c[e>>2]=f+ -1;if((f+ -1|0)<0){Jm((c[d>>2]|0)+ -12|0)}Mb(a|0);Im(a);i=b;return}function _d(a){a=a|0;i=i;return}function $d(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=d;c[a+4>>2]=b;i=i;return}function ae(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+8|0;f=e;oc[c[(c[a>>2]|0)+12>>2]&3](f,a,b);if((c[f+4>>2]|0)!=(c[d+4>>2]|0)){g=0;i=e;return g|0}g=(c[f>>2]|0)==(c[d>>2]|0);i=e;return g|0}function be(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b+4>>2]|0)!=(a|0)){f=0;i=e;return f|0}f=(c[b>>2]|0)==(d|0);i=e;return f|0}function ce(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;d=i;f=_b(e|0)|0;e=bn(f|0)|0;if(e>>>0>4294967279){ie(0)}if(e>>>0<11){a[b]=e<<1;g=b+1|0;$m(g|0,f|0,e|0)|0;h=g+e|0;a[h]=0;i=d;return}else{j=e+16&-16;k=Gm(j)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=e;g=k;$m(g|0,f|0,e|0)|0;h=g+e|0;a[h]=0;i=d;return}}function de(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+16|0;g=f;h=d;j=c[h>>2]|0;k=e;do{if((j|0)!=0){l=a[k]|0;if((l&1)==0){m=(l&255)>>>1}else{m=c[e+4>>2]|0}if((m|0)==0){n=j}else{se(e,227376,2)|0;n=c[h>>2]|0}l=c[d+4>>2]|0;oc[c[(c[l>>2]|0)+24>>2]&3](g,l,n);l=g;o=a[l]|0;if((o&1)==0){p=g+1|0;q=(o&255)>>>1}else{p=c[g+8>>2]|0;q=c[g+4>>2]|0}se(e,p,q)|0;if((a[l]&1)==0){break}Im(c[g+8>>2]|0)}}while(0);g=b;c[g+0>>2]=c[k+0>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;i=f;return}function ee(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;g=f;h=f+16|0;j=bn(e|0)|0;if(j>>>0>4294967279){ie(0)}if(j>>>0<11){a[h]=j<<1;k=h+1|0}else{l=j+16&-16;m=Gm(l)|0;c[h+8>>2]=m;c[h>>2]=l|1;c[h+4>>2]=j;k=m}$m(k|0,e|0,j|0)|0;a[k+j|0]=0;de(g,d,h);Ud(b,g);if(!((a[g]&1)==0)){Im(c[g+8>>2]|0)}if(!((a[h]&1)==0)){Im(c[h+8>>2]|0)}c[b>>2]=227392;h=d;d=c[h+4>>2]|0;g=b+8|0;c[g>>2]=c[h>>2];c[g+4>>2]=d;i=f;return}function fe(a){a=a|0;var b=0;b=i;Xd(a);Im(a);i=b;return}function ge(a){a=a|0;var b=0;b=i;Xd(a);i=b;return}function he(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;Zb(227528)|0;if((c[a>>2]|0)==1){do{Da(227552,227528)|0;}while((c[a>>2]|0)==1)}if((c[a>>2]|0)==0){c[a>>2]=1;Ab(227528)|0;jc[d&127](b);Zb(227528)|0;c[a>>2]=-1;Ab(227528)|0;Cb(227552)|0;i=e;return}else{Ab(227528)|0;i=e;return}}function ie(a){a=a|0;a=Va(8)|0;Qd(a,227600);c[a>>2]=227280;xb(a|0,227320,9)}function je(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;f=d;if((a[f]&1)==0){g=b;c[g+0>>2]=c[f+0>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];i=e;return}f=c[d+8>>2]|0;g=c[d+4>>2]|0;if(g>>>0>4294967279){ie(0)}if(g>>>0<11){a[b]=g<<1;h=b+1|0}else{d=g+16&-16;j=Gm(d)|0;c[b+8>>2]=j;c[b>>2]=d|1;c[b+4>>2]=g;h=j}$m(h|0,f|0,g|0)|0;a[h+g|0]=0;i=e;return}function ke(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;if(e>>>0>4294967279){ie(0)}if(e>>>0<11){a[b]=e<<1;g=b+1|0}else{h=e+16&-16;j=Gm(h)|0;c[b+8>>2]=j;c[b>>2]=h|1;c[b+4>>2]=e;g=j}$m(g|0,d|0,e|0)|0;a[g+e|0]=0;i=f;return}function le(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;if(d>>>0>4294967279){ie(0)}if(d>>>0<11){a[b]=d<<1;g=b+1|0}else{h=d+16&-16;j=Gm(h)|0;c[b+8>>2]=j;c[b>>2]=h|1;c[b+4>>2]=d;g=j}Ym(g|0,e|0,d|0)|0;a[g+d|0]=0;i=f;return}function me(b){b=b|0;var d=0;d=i;if((a[b]&1)==0){i=d;return}Im(c[b+8>>2]|0);i=d;return}function ne(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;f=bn(d|0)|0;g=b;h=a[g]|0;if((h&1)==0){j=h;k=10}else{h=c[b>>2]|0;j=h&255;k=(h&-2)+ -1|0}h=(j&1)==0;if(k>>>0<f>>>0){if(h){l=(j&255)>>>1}else{l=c[b+4>>2]|0}te(b,k,f-k|0,l,0,l,f,d);i=e;return b|0}if(h){m=b+1|0}else{m=c[b+8>>2]|0}an(m|0,d|0,f|0)|0;a[m+f|0]=0;if((a[g]&1)==0){a[g]=f<<1;i=e;return b|0}else{c[b+4>>2]=f;i=e;return b|0}return 0}function oe(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;g=b;h=a[g]|0;j=(h&1)==0;if(j){k=(h&255)>>>1}else{k=c[b+4>>2]|0}if(k>>>0<d>>>0){pe(b,d-k|0,e)|0;i=f;return}if(j){a[b+d+1|0]=0;a[g]=d<<1;i=f;return}else{a[(c[b+8>>2]|0)+d|0]=0;c[b+4>>2]=d;i=f;return}}function pe(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;if((d|0)==0){i=f;return b|0}g=b;h=a[g]|0;if((h&1)==0){j=h;k=10}else{h=c[b>>2]|0;j=h&255;k=(h&-2)+ -1|0}if((j&1)==0){l=(j&255)>>>1}else{l=c[b+4>>2]|0}if((k-l|0)>>>0<d>>>0){ue(b,k,d-k+l|0,l,l,0,0);m=a[g]|0}else{m=j}if((m&1)==0){n=b+1|0}else{n=c[b+8>>2]|0}Ym(n+l|0,e|0,d|0)|0;e=l+d|0;if((a[g]&1)==0){a[g]=e<<1}else{c[b+4>>2]=e}a[n+e|0]=0;i=f;return b|0}function qe(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;if(d>>>0>4294967279){ie(0)}f=b;g=a[f]|0;if((g&1)==0){h=g;j=10}else{g=c[b>>2]|0;h=g&255;j=(g&-2)+ -1|0}if((h&1)==0){k=(h&255)>>>1}else{k=c[b+4>>2]|0}g=k>>>0>d>>>0?k:d;if(g>>>0<11){l=10}else{l=(g+16&-16)+ -1|0}if((l|0)==(j|0)){i=e;return}do{if((l|0)==10){m=b+1|0;n=0;o=c[b+8>>2]|0;p=1}else{g=l+1|0;if(l>>>0>j>>>0){q=Gm(g)|0}else{q=Gm(g)|0}if((h&1)==0){m=q;n=1;o=b+1|0;p=0;break}else{m=q;n=1;o=c[b+8>>2]|0;p=1;break}}}while(0);if((h&1)==0){r=(h&255)>>>1}else{r=c[b+4>>2]|0}$m(m|0,o|0,r+1|0)|0;if(p){Im(o)}if(n){c[b>>2]=l+1|1;c[b+4>>2]=k;c[b+8>>2]=m;i=e;return}else{a[f]=k<<1;i=e;return}}function re(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b;g=a[f]|0;h=(g&1)!=0;if(h){j=(c[b>>2]&-2)+ -1|0;k=c[b+4>>2]|0}else{j=10;k=(g&255)>>>1}if((k|0)==(j|0)){ue(b,j,1,j,j,0,0);if((a[f]&1)==0){l=7}else{l=8}}else{if(h){l=8}else{l=7}}if((l|0)==7){a[f]=(k<<1)+2;m=b+1|0;n=k+1|0;o=m+k|0;a[o]=d;p=m+n|0;a[p]=0;i=e;return}else if((l|0)==8){l=c[b+8>>2]|0;f=k+1|0;c[b+4>>2]=f;m=l;n=f;o=m+k|0;a[o]=d;p=m+n|0;a[p]=0;i=e;return}}function se(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;g=b;h=a[g]|0;if((h&1)==0){j=10;k=h}else{h=c[b>>2]|0;j=(h&-2)+ -1|0;k=h&255}if((k&1)==0){l=(k&255)>>>1}else{l=c[b+4>>2]|0}if((j-l|0)>>>0<e>>>0){te(b,j,e-j+l|0,l,l,0,e,d);i=f;return b|0}if((e|0)==0){i=f;return b|0}if((k&1)==0){m=b+1|0}else{m=c[b+8>>2]|0}$m(m+l|0,d|0,e|0)|0;d=l+e|0;if((a[g]&1)==0){a[g]=d<<1}else{c[b+4>>2]=d}a[m+d|0]=0;i=f;return b|0}function te(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;l=i;if((-18-d|0)>>>0<e>>>0){ie(0)}if((a[b]&1)==0){m=b+1|0}else{m=c[b+8>>2]|0}do{if(d>>>0<2147483623){n=e+d|0;o=d<<1;p=n>>>0<o>>>0?o:n;if(p>>>0<11){q=11;break}q=p+16&-16}else{q=-17}}while(0);e=Gm(q)|0;if((g|0)!=0){$m(e|0,m|0,g|0)|0}if((j|0)!=0){$m(e+g|0,k|0,j|0)|0}k=f-h|0;if((k|0)!=(g|0)){$m(e+(j+g)|0,m+(h+g)|0,k-g|0)|0}if((d|0)==10){r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+u|0;a[w]=0;i=l;return}Im(m);r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+u|0;a[w]=0;i=l;return}function ue(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;if((-17-d|0)>>>0<e>>>0){ie(0)}if((a[b]&1)==0){l=b+1|0}else{l=c[b+8>>2]|0}do{if(d>>>0<2147483623){m=e+d|0;n=d<<1;o=m>>>0<n>>>0?n:m;if(o>>>0<11){p=11;break}p=o+16&-16}else{p=-17}}while(0);e=Gm(p)|0;if((g|0)!=0){$m(e|0,l|0,g|0)|0}o=f-h|0;if((o|0)!=(g|0)){$m(e+(j+g)|0,l+(h+g)|0,o-g|0)|0}if((d|0)==10){q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}Im(l);q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}function ve(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;if(e>>>0>1073741807){ie(0)}if(e>>>0<2){a[b]=e<<1;g=b+4|0;cm(g,d,e)|0;h=g+(e<<2)|0;c[h>>2]=0;i=f;return}else{j=e+4&-4;k=Gm(j<<2)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=e;g=k;cm(g,d,e)|0;h=g+(e<<2)|0;c[h>>2]=0;i=f;return}}function we(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;if(d>>>0>1073741807){ie(0)}if(d>>>0<2){a[b]=d<<1;g=b+4|0;em(g,e,d)|0;h=g+(d<<2)|0;c[h>>2]=0;i=f;return}else{j=d+4&-4;k=Gm(j<<2)|0;c[b+8>>2]=k;c[b>>2]=j|1;c[b+4>>2]=d;g=k;em(g,e,d)|0;h=g+(d<<2)|0;c[h>>2]=0;i=f;return}}function xe(b){b=b|0;var d=0;d=i;if((a[b]&1)==0){i=d;return}Im(c[b+8>>2]|0);i=d;return}function ye(a,b){a=a|0;b=b|0;var c=0,d=0;c=i;d=ze(a,b,bm(b)|0)|0;i=c;return d|0}function ze(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;g=b;h=a[g]|0;if((h&1)==0){j=1;k=h}else{h=c[b>>2]|0;j=(h&-2)+ -1|0;k=h&255}h=(k&1)==0;if(j>>>0<e>>>0){if(h){l=(k&255)>>>1}else{l=c[b+4>>2]|0}Ce(b,j,e-j|0,l,0,l,e,d);i=f;return b|0}if(h){m=b+4|0}else{m=c[b+8>>2]|0}dm(m,d,e)|0;c[m+(e<<2)>>2]=0;if((a[g]&1)==0){a[g]=e<<1;i=f;return b|0}else{c[b+4>>2]=e;i=f;return b|0}return 0}function Ae(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;if(d>>>0>1073741807){ie(0)}f=b;g=a[f]|0;if((g&1)==0){h=g;j=1}else{g=c[b>>2]|0;h=g&255;j=(g&-2)+ -1|0}if((h&1)==0){k=(h&255)>>>1}else{k=c[b+4>>2]|0}g=k>>>0>d>>>0?k:d;if(g>>>0<2){l=1}else{l=(g+4&-4)+ -1|0}if((l|0)==(j|0)){i=e;return}do{if((l|0)==1){m=b+4|0;n=0;o=c[b+8>>2]|0;p=1}else{g=(l<<2)+4|0;if(l>>>0>j>>>0){q=Gm(g)|0}else{q=Gm(g)|0}g=q;if((h&1)==0){m=g;n=1;o=b+4|0;p=0;break}else{m=g;n=1;o=c[b+8>>2]|0;p=1;break}}}while(0);if((h&1)==0){r=(h&255)>>>1}else{r=c[b+4>>2]|0}cm(m,o,r+1|0)|0;if(p){Im(o)}if(n){c[b>>2]=l+1|1;c[b+4>>2]=k;c[b+8>>2]=m;i=e;return}else{a[f]=k<<1;i=e;return}}function Be(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=b;g=a[f]|0;h=(g&1)!=0;if(h){j=(c[b>>2]&-2)+ -1|0;k=c[b+4>>2]|0}else{j=1;k=(g&255)>>>1}if((k|0)==(j|0)){De(b,j,1,j,j,0,0);if((a[f]&1)==0){l=7}else{l=8}}else{if(h){l=8}else{l=7}}if((l|0)==7){a[f]=(k<<1)+2;m=b+4|0;n=k+1|0;o=m+(k<<2)|0;c[o>>2]=d;p=m+(n<<2)|0;c[p>>2]=0;i=e;return}else if((l|0)==8){l=c[b+8>>2]|0;f=k+1|0;c[b+4>>2]=f;m=l;n=f;o=m+(k<<2)|0;c[o>>2]=d;p=m+(n<<2)|0;c[p>>2]=0;i=e;return}}function Ce(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;l=i;if((1073741806-d|0)>>>0<e>>>0){ie(0)}if((a[b]&1)==0){m=b+4|0}else{m=c[b+8>>2]|0}do{if(d>>>0<536870887){n=e+d|0;o=d<<1;p=n>>>0<o>>>0?o:n;if(p>>>0<2){q=2;break}q=p+4&-4}else{q=1073741807}}while(0);e=Gm(q<<2)|0;if((g|0)!=0){cm(e,m,g)|0}if((j|0)!=0){cm(e+(g<<2)|0,k,j)|0}k=f-h|0;if((k|0)!=(g|0)){cm(e+(j+g<<2)|0,m+(h+g<<2)|0,k-g|0)|0}if((d|0)==1){r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+(u<<2)|0;c[w>>2]=0;i=l;return}Im(m);r=b+8|0;c[r>>2]=e;s=q|1;t=b;c[t>>2]=s;u=k+j|0;v=b+4|0;c[v>>2]=u;w=e+(u<<2)|0;c[w>>2]=0;i=l;return}function De(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;if((1073741807-d|0)>>>0<e>>>0){ie(0)}if((a[b]&1)==0){l=b+4|0}else{l=c[b+8>>2]|0}do{if(d>>>0<536870887){m=e+d|0;n=d<<1;o=m>>>0<n>>>0?n:m;if(o>>>0<2){p=2;break}p=o+4&-4}else{p=1073741807}}while(0);e=Gm(p<<2)|0;if((g|0)!=0){cm(e,l,g)|0}o=f-h|0;if((o|0)!=(g|0)){cm(e+(j+g<<2)|0,l+(h+g<<2)|0,o-g|0)|0}if((d|0)==1){q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}Im(l);q=b+8|0;c[q>>2]=e;r=p|1;s=b;c[s>>2]=r;i=k;return}function Ee(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e;g=e+8|0;h=(c[b+24>>2]|0)==0;if(h){c[b+16>>2]=d|1}else{c[b+16>>2]=d}if(((h&1|d)&c[b+20>>2]|0)==0){i=e;return}e=Va(16)|0;do{if((a[227968]|0)==0){if((Na(227968)|0)==0){break}c[56990]=228664;Ra(40,227960,p|0)|0;_a(227968)}}while(0);b=e;d=g;c[d>>2]=1;c[d+4>>2]=227960;d=f;h=g;c[d+0>>2]=c[h+0>>2];c[d+4>>2]=c[h+4>>2];ee(b,f,228016);c[e>>2]=227984;xb(e|0,228064,36)}function Fe(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;c[a>>2]=228008;d=c[a+40>>2]|0;e=a+32|0;f=a+36|0;if((d|0)!=0){g=d;do{g=g+ -1|0;oc[c[(c[e>>2]|0)+(g<<2)>>2]&3](0,a,c[(c[f>>2]|0)+(g<<2)>>2]|0);}while((g|0)!=0)}Qj(a+28|0);Cm(c[e>>2]|0);Cm(c[f>>2]|0);Cm(c[a+48>>2]|0);Cm(c[a+60>>2]|0);i=b;return}function Ge(a,b){a=a|0;b=b|0;var c=0;c=i;Pj(a,b+28|0);i=c;return}function He(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;c[a+24>>2]=b;c[a+16>>2]=(b|0)==0;c[a+20>>2]=0;c[a+4>>2]=4098;c[a+12>>2]=0;c[a+8>>2]=6;b=a+28|0;e=a+32|0;a=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(a|0));Oj(b);i=d;return}function Ie(a){a=a|0;var b=0;b=i;c[a>>2]=227624;Qj(a+4|0);Im(a);i=b;return}function Je(a){a=a|0;var b=0;b=i;c[a>>2]=227624;Qj(a+4|0);i=b;return}function Ke(a,b){a=a|0;b=b|0;i=i;return}function Le(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return a|0}function Me(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;g=a;c[g>>2]=0;c[g+4>>2]=0;g=a+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=i;return}function Ne(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a;c[e>>2]=0;c[e+4>>2]=0;e=a+8|0;c[e>>2]=-1;c[e+4>>2]=-1;i=i;return}function Oe(a){a=a|0;i=i;return 0}function Pe(a){a=a|0;i=i;return 0}function Qe(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;g=b;if((e|0)<=0){h=0;i=f;return h|0}j=b+12|0;k=b+16|0;l=d;d=0;while(1){m=c[j>>2]|0;if(m>>>0<(c[k>>2]|0)>>>0){c[j>>2]=m+1;n=a[m]|0}else{m=mc[c[(c[g>>2]|0)+40>>2]&63](b)|0;if((m|0)==-1){h=d;o=8;break}n=m&255}a[l]=n;m=d+1|0;if((m|0)<(e|0)){l=l+1|0;d=m}else{h=m;o=8;break}}if((o|0)==8){i=f;return h|0}return 0}function Re(a){a=a|0;i=i;return-1}function Se(a){a=a|0;var b=0,e=0,f=0;b=i;if((mc[c[(c[a>>2]|0)+36>>2]&63](a)|0)==-1){e=-1;i=b;return e|0}f=a+12|0;a=c[f>>2]|0;c[f>>2]=a+1;e=d[a]|0;i=b;return e|0}function Te(a,b){a=a|0;b=b|0;i=i;return-1}function Ue(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;h=b;if((f|0)<=0){j=0;i=g;return j|0}k=b+24|0;l=b+28|0;m=e;e=0;while(1){n=c[k>>2]|0;if(n>>>0<(c[l>>2]|0)>>>0){o=a[m]|0;c[k>>2]=n+1;a[n]=o}else{if((vc[c[(c[h>>2]|0)+52>>2]&15](b,d[m]|0)|0)==-1){j=e;p=7;break}}o=e+1|0;if((o|0)<(f|0)){m=m+1|0;e=o}else{j=o;p=7;break}}if((p|0)==7){i=g;return j|0}return 0}function Ve(a,b){a=a|0;b=b|0;i=i;return-1}function We(a){a=a|0;var b=0;b=i;c[a>>2]=227688;Qj(a+4|0);Im(a);i=b;return}function Xe(a){a=a|0;var b=0;b=i;c[a>>2]=227688;Qj(a+4|0);i=b;return}function Ye(a,b){a=a|0;b=b|0;i=i;return}function Ze(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return a|0}function _e(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;g=a;c[g>>2]=0;c[g+4>>2]=0;g=a+8|0;c[g>>2]=-1;c[g+4>>2]=-1;i=i;return}function $e(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=a;c[e>>2]=0;c[e+4>>2]=0;e=a+8|0;c[e>>2]=-1;c[e+4>>2]=-1;i=i;return}function af(a){a=a|0;i=i;return 0}function bf(a){a=a|0;i=i;return 0}function cf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=a;if((d|0)<=0){g=0;i=e;return g|0}h=a+12|0;j=a+16|0;k=b;b=0;while(1){l=c[h>>2]|0;if(l>>>0<(c[j>>2]|0)>>>0){c[h>>2]=l+4;m=c[l>>2]|0}else{l=mc[c[(c[f>>2]|0)+40>>2]&63](a)|0;if((l|0)==-1){g=b;n=8;break}else{m=l}}c[k>>2]=m;l=b+1|0;if((l|0)>=(d|0)){g=l;n=8;break}k=k+4|0;b=l}if((n|0)==8){i=e;return g|0}return 0}function df(a){a=a|0;i=i;return-1}function ef(a){a=a|0;var b=0,d=0,e=0;b=i;if((mc[c[(c[a>>2]|0)+36>>2]&63](a)|0)==-1){d=-1;i=b;return d|0}e=a+12|0;a=c[e>>2]|0;c[e>>2]=a+4;d=c[a>>2]|0;i=b;return d|0}function ff(a,b){a=a|0;b=b|0;i=i;return-1}function gf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=a;if((d|0)<=0){g=0;i=e;return g|0}h=a+24|0;j=a+28|0;k=b;b=0;while(1){l=c[h>>2]|0;if(l>>>0<(c[j>>2]|0)>>>0){m=c[k>>2]|0;c[h>>2]=l+4;c[l>>2]=m}else{if((vc[c[(c[f>>2]|0)+52>>2]&15](a,c[k>>2]|0)|0)==-1){g=b;n=8;break}}m=b+1|0;if((m|0)>=(d|0)){g=m;n=8;break}k=k+4|0;b=m}if((n|0)==8){i=e;return g|0}return 0}function hf(a,b){a=a|0;b=b|0;i=i;return-1}function jf(a){a=a|0;var b=0;b=i;Fe(a+8|0);Im(a);i=b;return}function kf(a){a=a|0;var b=0;b=i;Fe(a+8|0);i=b;return}function lf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Fe(d+(e+8)|0);Im(d+e|0);i=b;return}function mf(a){a=a|0;var b=0;b=i;Fe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+8)|0);i=b;return}function nf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+8|0;e=d;f=b;g=c[(c[f>>2]|0)+ -12>>2]|0;h=b;if((c[h+(g+24)>>2]|0)==0){i=d;return b|0}j=e;a[j]=0;c[e+4>>2]=b;do{if((c[h+(g+16)>>2]|0)==0){k=c[h+(g+72)>>2]|0;if((k|0)==0){l=g}else{nf(k)|0;l=c[(c[f>>2]|0)+ -12>>2]|0}a[j]=1;k=c[h+(l+24)>>2]|0;if(!((mc[c[(c[k>>2]|0)+24>>2]&63](k)|0)==-1)){break}k=c[(c[f>>2]|0)+ -12>>2]|0;Ee(h+k|0,c[h+(k+16)>>2]|1)}}while(0);yf(e);i=d;return b|0}function of(a){a=a|0;var b=0;b=a+16|0;c[b>>2]=c[b>>2]|1;if((c[a+20>>2]&1|0)==0){i=i;return}else{Tb()}}function pf(a){a=a|0;var b=0;b=i;Fe(a+8|0);Im(a);i=b;return}function qf(a){a=a|0;var b=0;b=i;Fe(a+8|0);i=b;return}function rf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Fe(d+(e+8)|0);Im(d+e|0);i=b;return}function sf(a){a=a|0;var b=0;b=i;Fe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+8)|0);i=b;return}function tf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+8|0;e=d;f=b;g=c[(c[f>>2]|0)+ -12>>2]|0;h=b;if((c[h+(g+24)>>2]|0)==0){i=d;return b|0}j=e;a[j]=0;c[e+4>>2]=b;do{if((c[h+(g+16)>>2]|0)==0){k=c[h+(g+72)>>2]|0;if((k|0)==0){l=g}else{tf(k)|0;l=c[(c[f>>2]|0)+ -12>>2]|0}a[j]=1;k=c[h+(l+24)>>2]|0;if(!((mc[c[(c[k>>2]|0)+24>>2]&63](k)|0)==-1)){break}k=c[(c[f>>2]|0)+ -12>>2]|0;Ee(h+k|0,c[h+(k+16)>>2]|1)}}while(0);Gf(e);i=d;return b|0}function uf(a){a=a|0;var b=0;b=i;Fe(a+4|0);Im(a);i=b;return}function vf(a){a=a|0;var b=0;b=i;Fe(a+4|0);i=b;return}function wf(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Fe(d+(e+4)|0);Im(d+e|0);i=b;return}function xf(a){a=a|0;var b=0;b=i;Fe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+4)|0);i=b;return}function yf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;a=c[d>>2]|0;e=c[(c[a>>2]|0)+ -12>>2]|0;f=a;if((c[f+(e+24)>>2]|0)==0){i=b;return}if((c[f+(e+16)>>2]|0)!=0){i=b;return}if((c[f+(e+4)>>2]&8192|0)==0){i=b;return}if(Wa()|0){i=b;return}e=c[d>>2]|0;f=c[e+((c[(c[e>>2]|0)+ -12>>2]|0)+24)>>2]|0;if(!((mc[c[(c[f>>2]|0)+24>>2]&63](f)|0)==-1)){i=b;return}f=c[d>>2]|0;d=c[(c[f>>2]|0)+ -12>>2]|0;e=f;Ee(e+d|0,c[e+(d+16)>>2]|1);i=b;return}function zf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+48|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=e+40|0;m=j;a[m]=0;c[j+4>>2]=b;n=b;o=c[(c[n>>2]|0)+ -12>>2]|0;p=b;if((c[p+(o+16)>>2]|0)!=0){yf(j);i=e;return b|0}q=c[p+(o+72)>>2]|0;if((q|0)==0){r=o}else{nf(q)|0;r=c[(c[n>>2]|0)+ -12>>2]|0}a[m]=1;Pj(k,p+(r+28)|0);r=Rj(k,229072)|0;m=r;Qj(k);k=c[(c[n>>2]|0)+ -12>>2]|0;q=c[p+(k+24)>>2]|0;o=p+(k+76)|0;s=c[o>>2]|0;if((s|0)==-1){Pj(h,p+(k+28)|0);t=Rj(h,230352)|0;u=vc[c[(c[t>>2]|0)+28>>2]&15](t,32)|0;Qj(h);h=u<<24>>24;c[o>>2]=h;v=h}else{v=s}s=v&255;v=p+k|0;k=c[(c[r>>2]|0)+16>>2]|0;c[g>>2]=q;q=f;r=g;c[q+0>>2]=c[r+0>>2];uc[k&15](l,m,f,v,s,d);if((c[l>>2]|0)!=0){yf(j);i=e;return b|0}l=c[(c[n>>2]|0)+ -12>>2]|0;Ee(p+l|0,c[p+(l+16)>>2]|5);yf(j);i=e;return b|0}function Af(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+48|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=e+40|0;m=j;a[m]=0;c[j+4>>2]=b;n=b;o=c[(c[n>>2]|0)+ -12>>2]|0;p=b;if((c[p+(o+16)>>2]|0)!=0){yf(j);i=e;return b|0}q=c[p+(o+72)>>2]|0;if((q|0)==0){r=o}else{nf(q)|0;r=c[(c[n>>2]|0)+ -12>>2]|0}a[m]=1;Pj(k,p+(r+28)|0);r=Rj(k,229072)|0;m=r;Qj(k);k=c[(c[n>>2]|0)+ -12>>2]|0;q=c[p+(k+24)>>2]|0;o=p+(k+76)|0;s=c[o>>2]|0;if((s|0)==-1){Pj(h,p+(k+28)|0);t=Rj(h,230352)|0;u=vc[c[(c[t>>2]|0)+28>>2]&15](t,32)|0;Qj(h);h=u<<24>>24;c[o>>2]=h;v=h}else{v=s}s=v&255;v=p+k|0;k=c[(c[r>>2]|0)+24>>2]|0;c[g>>2]=q;q=f;r=g;c[q+0>>2]=c[r+0>>2];uc[k&15](l,m,f,v,s,d);if((c[l>>2]|0)!=0){yf(j);i=e;return b|0}l=c[(c[n>>2]|0)+ -12>>2]|0;Ee(p+l|0,c[p+(l+16)>>2]|5);yf(j);i=e;return b|0}function Bf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+48|0;f=e;g=e+8|0;h=e+16|0;j=e+24|0;k=e+32|0;l=e+40|0;m=j;a[m]=0;c[j+4>>2]=b;n=b;o=c[(c[n>>2]|0)+ -12>>2]|0;p=b;if((c[p+(o+16)>>2]|0)!=0){yf(j);i=e;return b|0}q=c[p+(o+72)>>2]|0;if((q|0)==0){r=o}else{nf(q)|0;r=c[(c[n>>2]|0)+ -12>>2]|0}a[m]=1;Pj(k,p+(r+28)|0);r=Rj(k,229072)|0;m=r;Qj(k);k=c[(c[n>>2]|0)+ -12>>2]|0;q=c[p+(k+24)>>2]|0;o=p+(k+76)|0;s=c[o>>2]|0;if((s|0)==-1){Pj(h,p+(k+28)|0);t=Rj(h,230352)|0;u=vc[c[(c[t>>2]|0)+28>>2]&15](t,32)|0;Qj(h);h=u<<24>>24;c[o>>2]=h;v=h}else{v=s}s=v&255;v=p+k|0;k=c[(c[r>>2]|0)+16>>2]|0;c[g>>2]=q;q=f;r=g;c[q+0>>2]=c[r+0>>2];uc[k&15](l,m,f,v,s,d);if((c[l>>2]|0)!=0){yf(j);i=e;return b|0}l=c[(c[n>>2]|0)+ -12>>2]|0;Ee(p+l|0,c[p+(l+16)>>2]|5);yf(j);i=e;return b|0}function Cf(a){a=a|0;var b=0;b=i;Fe(a+4|0);Im(a);i=b;return}function Df(a){a=a|0;var b=0;b=i;Fe(a+4|0);i=b;return}function Ef(a){a=a|0;var b=0,d=0,e=0;b=i;d=a;e=c[(c[a>>2]|0)+ -12>>2]|0;Fe(d+(e+4)|0);Im(d+e|0);i=b;return}function Ff(a){a=a|0;var b=0;b=i;Fe(a+((c[(c[a>>2]|0)+ -12>>2]|0)+4)|0);i=b;return}function Gf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+4|0;a=c[d>>2]|0;e=c[(c[a>>2]|0)+ -12>>2]|0;f=a;if((c[f+(e+24)>>2]|0)==0){i=b;return}if((c[f+(e+16)>>2]|0)!=0){i=b;return}if((c[f+(e+4)>>2]&8192|0)==0){i=b;return}if(Wa()|0){i=b;return}e=c[d>>2]|0;f=c[e+((c[(c[e>>2]|0)+ -12>>2]|0)+24)>>2]|0;if(!((mc[c[(c[f>>2]|0)+24>>2]&63](f)|0)==-1)){i=b;return}f=c[d>>2]|0;d=c[(c[f>>2]|0)+ -12>>2]|0;e=f;Ee(e+d|0,c[e+(d+16)>>2]|1);i=b;return}function Hf(a){a=a|0;i=i;return 227904}function If(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=i;if((c|0)==1){ke(a,227920,35);i=d;return}else{ce(a,b,c);i=d;return}}function Jf(a){a=a|0;i=i;return}function Kf(a){a=a|0;var b=0;b=i;ge(a);Im(a);i=b;return}function Lf(a){a=a|0;var b=0;b=i;ge(a);i=b;return}function Mf(a){a=a|0;var b=0;b=i;Fe(a);Im(a);i=b;return}function Nf(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Of(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Pf(a){a=a|0;i=i;return}function Qf(a){a=a|0;i=i;return}function Rf(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;a:do{if((e|0)==(f|0)){g=c;h=6}else{j=e;k=c;while(1){if((k|0)==(d|0)){l=-1;break a}m=a[k]|0;n=a[j]|0;if(m<<24>>24<n<<24>>24){l=-1;break a}if(n<<24>>24<m<<24>>24){l=1;break a}m=k+1|0;n=j+1|0;if((n|0)==(f|0)){g=m;h=6;break}else{j=n;k=m}}}}while(0);if((h|0)==6){l=(g|0)!=(d|0)|0}i=b;return l|0}function Sf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;d=i;g=e;h=f-g|0;if(h>>>0>4294967279){ie(b)}if(h>>>0<11){a[b]=h<<1;j=b+1|0}else{k=h+16&-16;l=Gm(k)|0;c[b+8>>2]=l;c[b>>2]=k|1;c[b+4>>2]=h;j=l}if((e|0)==(f|0)){m=j;a[m]=0;i=d;return}else{n=e;o=j}while(1){a[o]=a[n]|0;e=n+1|0;if((e|0)==(f|0)){break}else{o=o+1|0;n=e}}m=j+(f+(0-g))|0;a[m]=0;i=d;return}function Tf(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;b=i;if((c|0)==(d|0)){e=0;i=b;return e|0}else{f=0;g=c}while(1){c=(a[g]|0)+(f<<4)|0;h=c&-268435456;j=(h>>>24|h)^c;c=g+1|0;if((c|0)==(d|0)){e=j;break}else{g=c;f=j}}i=b;return e|0}function Uf(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Vf(a){a=a|0;i=i;return}function Wf(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;a=i;a:do{if((e|0)==(f|0)){g=b;h=6}else{j=e;k=b;while(1){if((k|0)==(d|0)){l=-1;break a}m=c[k>>2]|0;n=c[j>>2]|0;if((m|0)<(n|0)){l=-1;break a}if((n|0)<(m|0)){l=1;break a}m=k+4|0;n=j+4|0;if((n|0)==(f|0)){g=m;h=6;break}else{j=n;k=m}}}}while(0);if((h|0)==6){l=(g|0)!=(d|0)|0}i=a;return l|0}function Xf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;d=i;g=e;h=f-g|0;j=h>>2;if(j>>>0>1073741807){ie(b)}if(j>>>0<2){a[b]=h>>>1;k=b+4|0}else{h=j+4&-4;l=Gm(h<<2)|0;c[b+8>>2]=l;c[b>>2]=h|1;c[b+4>>2]=j;k=l}if((e|0)==(f|0)){m=k;c[m>>2]=0;i=d;return}l=f+ -4+(0-g)|0;g=e;e=k;while(1){c[e>>2]=c[g>>2];j=g+4|0;if((j|0)==(f|0)){break}else{e=e+4|0;g=j}}m=k+((l>>>2)+1<<2)|0;c[m>>2]=0;i=d;return}function Yf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;a=i;if((b|0)==(d|0)){e=0;i=a;return e|0}else{f=0;g=b}while(1){b=(c[g>>2]|0)+(f<<4)|0;h=b&-268435456;j=(h>>>24|h)^b;b=g+4|0;if((b|0)==(d|0)){e=j;break}else{g=b;f=j}}i=a;return e|0}function Zf(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function _f(a){a=a|0;i=i;return}function $f(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+136|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=k+40|0;q=k+56|0;r=k+64|0;s=k+72|0;t=k+80|0;u=k+88|0;v=k+96|0;w=k+104|0;x=k+128|0;if((c[g+4>>2]&1|0)==0){c[q>>2]=-1;y=c[(c[d>>2]|0)+16>>2]|0;z=e;c[s>>2]=c[z>>2];c[t>>2]=c[f>>2];A=n;B=s;c[A+0>>2]=c[B+0>>2];B=m;A=t;c[B+0>>2]=c[A+0>>2];hc[y&63](r,d,n,m,g,h,q);m=c[r>>2]|0;c[z>>2]=m;z=c[q>>2]|0;if((z|0)==0){a[j]=0}else if((z|0)==1){a[j]=1}else{a[j]=1;c[h>>2]=4}c[b>>2]=m;i=k;return}Ge(u,g);m=u;u=c[m>>2]|0;if(!((c[57588]|0)==-1)){c[p>>2]=230352;c[p+4>>2]=112;c[p+8>>2]=0;he(230352,p,113)}p=(c[230356>>2]|0)+ -1|0;z=c[u+8>>2]|0;if(!((c[u+12>>2]|0)-z>>2>>>0>p>>>0)){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}u=c[z+(p<<2)>>2]|0;if((u|0)==0){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}C=u;Pd(c[m>>2]|0)|0;Ge(v,g);g=v;v=c[g>>2]|0;if(!((c[57624]|0)==-1)){c[o>>2]=230496;c[o+4>>2]=112;c[o+8>>2]=0;he(230496,o,113)}o=(c[230500>>2]|0)+ -1|0;m=c[v+8>>2]|0;if(!((c[v+12>>2]|0)-m>>2>>>0>o>>>0)){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}v=c[m+(o<<2)>>2]|0;if((v|0)==0){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}E=v;Pd(c[g>>2]|0)|0;g=w;F=v;kc[c[(c[F>>2]|0)+24>>2]&63](g,E);kc[c[(c[F>>2]|0)+28>>2]&63](w+12|0,E);c[x>>2]=c[f>>2];f=w+24|0;E=l;F=x;c[E+0>>2]=c[F+0>>2];F=ag(e,l,g,f,C,h,1)|0;a[j]=(F|0)==(g|0)|0;c[b>>2]=c[e>>2];me(w+12|0);me(w);i=k;return}function ag(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;l=i;i=i+104|0;m=(g-f|0)/12|0;n=l;do{if(m>>>0>100){o=Bm(m)|0;if((o|0)!=0){p=o;q=o;break}Nm()}else{p=0;q=n}}while(0);n=(f|0)==(g|0);if(n){r=0;s=m}else{o=f;t=0;u=m;m=q;while(1){v=a[o]|0;if((v&1)==0){w=(v&255)>>>1}else{w=c[o+4>>2]|0}if((w|0)==0){a[m]=2;x=t+1|0;y=u+ -1|0}else{a[m]=1;x=t;y=u}v=o+12|0;if((v|0)==(g|0)){r=x;s=y;break}else{o=v;t=x;u=y;m=m+1|0}}}m=b;b=e;e=h;y=0;u=r;r=s;a:while(1){s=c[m>>2]|0;do{if((s|0)==0){z=0}else{if((c[s+12>>2]|0)!=(c[s+16>>2]|0)){z=s;break}if((mc[c[(c[s>>2]|0)+36>>2]&63](s)|0)==-1){c[m>>2]=0;z=0;break}else{z=c[m>>2]|0;break}}}while(0);s=(z|0)==0;x=c[b>>2]|0;do{if((x|0)==0){A=0}else{if((c[x+12>>2]|0)!=(c[x+16>>2]|0)){A=x;break}if(!((mc[c[(c[x>>2]|0)+36>>2]&63](x)|0)==-1)){A=x;break}c[b>>2]=0;A=0}}while(0);B=(A|0)==0;C=c[m>>2]|0;if(!((s^B)&(r|0)!=0)){break}x=c[C+12>>2]|0;if((x|0)==(c[C+16>>2]|0)){D=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{D=d[x]|0}x=D&255;if(k){E=x}else{E=vc[c[(c[e>>2]|0)+12>>2]&15](h,x)|0}x=y+1|0;if(n){y=x;r=r;u=u;continue}b:do{if(k){t=0;o=f;w=u;v=r;F=q;while(1){do{if((a[F]|0)==1){G=a[o]|0;H=(G&1)==0;if(H){I=o+1|0}else{I=c[o+8>>2]|0}if(!(E<<24>>24==(a[I+y|0]|0))){a[F]=0;J=t;K=w;L=v+ -1|0;break}if(H){M=(G&255)>>>1}else{M=c[o+4>>2]|0}if((M|0)!=(x|0)){J=1;K=w;L=v;break}a[F]=2;J=1;K=w+1|0;L=v+ -1|0}else{J=t;K=w;L=v}}while(0);G=o+12|0;if((G|0)==(g|0)){N=J;O=K;P=L;break b}t=J;o=G;w=K;v=L;F=F+1|0}}else{F=0;v=f;w=u;o=r;t=q;while(1){do{if((a[t]|0)==1){G=v;if((a[G]&1)==0){Q=v+1|0}else{Q=c[v+8>>2]|0}if(!(E<<24>>24==(vc[c[(c[e>>2]|0)+12>>2]&15](h,a[Q+y|0]|0)|0)<<24>>24)){a[t]=0;R=F;S=w;T=o+ -1|0;break}H=a[G]|0;if((H&1)==0){U=(H&255)>>>1}else{U=c[v+4>>2]|0}if((U|0)!=(x|0)){R=1;S=w;T=o;break}a[t]=2;R=1;S=w+1|0;T=o+ -1|0}else{R=F;S=w;T=o}}while(0);H=v+12|0;if((H|0)==(g|0)){N=R;O=S;P=T;break b}F=R;v=H;w=S;o=T;t=t+1|0}}}while(0);if(!N){y=x;u=O;r=P;continue}s=c[m>>2]|0;t=s+12|0;o=c[t>>2]|0;if((o|0)==(c[s+16>>2]|0)){mc[c[(c[s>>2]|0)+40>>2]&63](s)|0}else{c[t>>2]=o+1}if((P+O|0)>>>0<2){y=x;u=O;r=P;continue}else{V=f;W=O;X=q}while(1){do{if((a[X]|0)==2){o=a[V]|0;if((o&1)==0){Y=(o&255)>>>1}else{Y=c[V+4>>2]|0}if((Y|0)==(x|0)){Z=W;break}a[X]=0;Z=W+ -1|0}else{Z=W}}while(0);o=V+12|0;if((o|0)==(g|0)){y=x;u=Z;r=P;continue a}else{V=o;W=Z;X=X+1|0}}}do{if((C|0)==0){_=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){_=C;break}if((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1){c[m>>2]=0;_=0;break}else{_=c[m>>2]|0;break}}}while(0);m=(_|0)==0;do{if(B){$=78}else{if((c[A+12>>2]|0)!=(c[A+16>>2]|0)){if(m){break}else{$=80;break}}if((mc[c[(c[A>>2]|0)+36>>2]&63](A)|0)==-1){c[b>>2]=0;$=78;break}else{if(m){break}else{$=80;break}}}}while(0);if(($|0)==78){if(m){$=80}}if(($|0)==80){c[j>>2]=c[j>>2]|2}c:do{if(n){$=85}else{if((a[q]|0)==2){aa=f;break}else{ba=f;ca=q}while(1){m=ba+12|0;b=ca+1|0;if((m|0)==(g|0)){$=85;break c}if((a[b]|0)==2){aa=m;break}else{ca=b;ba=m}}}}while(0);if(($|0)==85){c[j>>2]=c[j>>2]|4;aa=g}if((p|0)==0){i=l;return aa|0}Cm(p);i=l;return aa|0}function bg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];cg(a,0,k,j,f,g,h);i=b;return}function cg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==8){u=16}else if((t|0)==0){u=0}else{u=10}t=l;Ug(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((mc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}oe(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}oe(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{Q=d[I]|0}if((ug(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){mc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Ml(H,c[p>>2]|0,j,u)|0;dj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;me(o);me(n);i=e;return}function dg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];eg(a,0,k,j,f,g,h);i=b;return}function eg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;Ug(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((mc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;J=(D&1)==0;if(J){K=(D&255)>>>1}else{K=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(K|0)){if(J){L=(D&255)>>>1;M=(D&255)>>>1}else{D=c[z>>2]|0;L=D;M=D}oe(o,M<<1,0);if((a[h]&1)==0){N=10}else{N=(c[g>>2]&-2)+ -1|0}oe(o,N,0);if((a[h]&1)==0){O=v}else{O=c[w>>2]|0}c[p>>2]=O+L;P=O}else{P=B}D=C+12|0;J=c[D>>2]|0;Q=C+16|0;if((J|0)==(c[Q>>2]|0)){R=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{R=d[J]|0}if((ug(R&255,u,P,p,s,A,n,l,r,t)|0)!=0){G=F;H=P;break}J=c[D>>2]|0;if((J|0)==(c[Q>>2]|0)){mc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=P;continue}else{c[D>>2]=J+1;m=C;B=P;continue}}P=a[n]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[n+4>>2]|0}do{if((S|0)!=0){P=c[r>>2]|0;if((P-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=P+4;c[P>>2]=B}}while(0);s=Ll(H,c[p>>2]|0,j,u)|0;u=k;c[u>>2]=s;c[u+4>>2]=I;dj(n,l,c[r>>2]|0,j);do{if((C|0)==0){T=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){T=C;break}if(!((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){T=C;break}c[y>>2]=0;T=0}}while(0);y=(T|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}U=b;c[U>>2]=T;me(o);me(n);i=e;return}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}U=b;c[U>>2]=T;me(o);me(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}U=b;c[U>>2]=T;me(o);me(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;U=b;c[U>>2]=T;me(o);me(n);i=e;return}function fg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];gg(a,0,k,j,f,g,h);i=b;return}function gg(e,f,g,h,j,k,l){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;f=i;i=i+256|0;m=f;n=f+32|0;o=f+40|0;p=f+56|0;q=f+72|0;r=f+80|0;s=f+240|0;t=f+248|0;u=c[j+4>>2]&74;if((u|0)==0){v=0}else if((u|0)==8){v=16}else if((u|0)==64){v=8}else{v=10}u=m;Ug(o,j,u,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;oe(p,10,0);if((a[j]&1)==0){m=p+1|0;w=m;x=p+8|0;y=m}else{m=p+8|0;w=p+1|0;x=m;y=c[m>>2]|0}c[q>>2]=y;m=r;c[s>>2]=m;c[t>>2]=0;z=g;g=h;h=p;A=p+4|0;B=a[n]|0;n=c[z>>2]|0;C=y;a:while(1){do{if((n|0)==0){D=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){D=n;break}if(!((mc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){D=n;break}c[z>>2]=0;D=0}}while(0);y=(D|0)==0;E=c[g>>2]|0;do{if((E|0)==0){F=18}else{if((c[E+12>>2]|0)!=(c[E+16>>2]|0)){if(y){G=E;break}else{H=E;I=C;break a}}if((mc[c[(c[E>>2]|0)+36>>2]&63](E)|0)==-1){c[g>>2]=0;F=18;break}else{if(y){G=E;break}else{H=E;I=C;break a}}}}while(0);if((F|0)==18){F=0;if(y){H=0;I=C;break}else{G=0}}E=a[j]|0;J=(E&1)==0;if(J){K=(E&255)>>>1}else{K=c[A>>2]|0}if(((c[q>>2]|0)-C|0)==(K|0)){if(J){L=(E&255)>>>1;M=(E&255)>>>1}else{E=c[A>>2]|0;L=E;M=E}oe(p,M<<1,0);if((a[j]&1)==0){N=10}else{N=(c[h>>2]&-2)+ -1|0}oe(p,N,0);if((a[j]&1)==0){O=w}else{O=c[x>>2]|0}c[q>>2]=O+L;P=O}else{P=C}E=D+12|0;J=c[E>>2]|0;Q=D+16|0;if((J|0)==(c[Q>>2]|0)){R=mc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{R=d[J]|0}if((ug(R&255,v,P,q,t,B,o,m,s,u)|0)!=0){H=G;I=P;break}J=c[E>>2]|0;if((J|0)==(c[Q>>2]|0)){mc[c[(c[D>>2]|0)+40>>2]&63](D)|0;n=D;C=P;continue}else{c[E>>2]=J+1;n=D;C=P;continue}}P=a[o]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[o+4>>2]|0}do{if((S|0)!=0){P=c[s>>2]|0;if((P-r|0)>=160){break}C=c[t>>2]|0;c[s>>2]=P+4;c[P>>2]=C}}while(0);b[l>>1]=Kl(I,c[q>>2]|0,k,v)|0;dj(o,m,c[s>>2]|0,k);do{if((D|0)==0){T=0}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){T=D;break}if(!((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1)){T=D;break}c[z>>2]=0;T=0}}while(0);z=(T|0)==0;do{if((H|0)==0){F=54}else{if((c[H+12>>2]|0)!=(c[H+16>>2]|0)){if(!z){break}U=e;c[U>>2]=T;me(p);me(o);i=f;return}if((mc[c[(c[H>>2]|0)+36>>2]&63](H)|0)==-1){c[g>>2]=0;F=54;break}if(!(z^(H|0)==0)){break}U=e;c[U>>2]=T;me(p);me(o);i=f;return}}while(0);do{if((F|0)==54){if(z){break}U=e;c[U>>2]=T;me(p);me(o);i=f;return}}while(0);c[k>>2]=c[k>>2]|2;U=e;c[U>>2]=T;me(p);me(o);i=f;return}function hg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];ig(a,0,k,j,f,g,h);i=b;return}function ig(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;Ug(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((mc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}oe(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}oe(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{Q=d[I]|0}if((ug(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){mc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Jl(H,c[p>>2]|0,j,u)|0;dj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;me(o);me(n);i=e;return}function jg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];kg(a,0,k,j,f,g,h);i=b;return}function kg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;Ug(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((mc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;I=(D&1)==0;if(I){J=(D&255)>>>1}else{J=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(J|0)){if(I){K=(D&255)>>>1;L=(D&255)>>>1}else{D=c[z>>2]|0;K=D;L=D}oe(o,L<<1,0);if((a[h]&1)==0){M=10}else{M=(c[g>>2]&-2)+ -1|0}oe(o,M,0);if((a[h]&1)==0){N=v}else{N=c[w>>2]|0}c[p>>2]=N+K;O=N}else{O=B}D=C+12|0;I=c[D>>2]|0;P=C+16|0;if((I|0)==(c[P>>2]|0)){Q=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{Q=d[I]|0}if((ug(Q&255,u,O,p,s,A,n,l,r,t)|0)!=0){G=F;H=O;break}I=c[D>>2]|0;if((I|0)==(c[P>>2]|0)){mc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=O;continue}else{c[D>>2]=I+1;m=C;B=O;continue}}O=a[n]|0;if((O&1)==0){R=(O&255)>>>1}else{R=c[n+4>>2]|0}do{if((R|0)!=0){O=c[r>>2]|0;if((O-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=O+4;c[O>>2]=B}}while(0);c[k>>2]=Il(H,c[p>>2]|0,j,u)|0;dj(n,l,c[r>>2]|0,j);do{if((C|0)==0){S=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){S=C;break}if(!((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){S=C;break}c[y>>2]=0;S=0}}while(0);y=(S|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}T=b;c[T>>2]=S;me(o);me(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;T=b;c[T>>2]=S;me(o);me(n);i=e;return}function lg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];mg(a,0,k,j,f,g,h);i=b;return}function mg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;e=i;i=i+256|0;l=e;m=e+32|0;n=e+40|0;o=e+56|0;p=e+72|0;q=e+80|0;r=e+240|0;s=e+248|0;t=c[h+4>>2]&74;if((t|0)==64){u=8}else if((t|0)==0){u=0}else if((t|0)==8){u=16}else{u=10}t=l;Ug(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=a[m]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0}else{if((c[m+12>>2]|0)!=(c[m+16>>2]|0)){C=m;break}if(!((mc[c[(c[m>>2]|0)+36>>2]&63](m)|0)==-1)){C=m;break}c[y>>2]=0;C=0}}while(0);x=(C|0)==0;D=c[f>>2]|0;do{if((D|0)==0){E=18}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){if(x){F=D;break}else{G=D;H=B;break a}}if((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[f>>2]=0;E=18;break}else{if(x){F=D;break}else{G=D;H=B;break a}}}}while(0);if((E|0)==18){E=0;if(x){G=0;H=B;break}else{F=0}}D=a[h]|0;J=(D&1)==0;if(J){K=(D&255)>>>1}else{K=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(K|0)){if(J){L=(D&255)>>>1;M=(D&255)>>>1}else{D=c[z>>2]|0;L=D;M=D}oe(o,M<<1,0);if((a[h]&1)==0){N=10}else{N=(c[g>>2]&-2)+ -1|0}oe(o,N,0);if((a[h]&1)==0){O=v}else{O=c[w>>2]|0}c[p>>2]=O+L;P=O}else{P=B}D=C+12|0;J=c[D>>2]|0;Q=C+16|0;if((J|0)==(c[Q>>2]|0)){R=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{R=d[J]|0}if((ug(R&255,u,P,p,s,A,n,l,r,t)|0)!=0){G=F;H=P;break}J=c[D>>2]|0;if((J|0)==(c[Q>>2]|0)){mc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=P;continue}else{c[D>>2]=J+1;m=C;B=P;continue}}P=a[n]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[n+4>>2]|0}do{if((S|0)!=0){P=c[r>>2]|0;if((P-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=P+4;c[P>>2]=B}}while(0);s=Hl(H,c[p>>2]|0,j,u)|0;u=k;c[u>>2]=s;c[u+4>>2]=I;dj(n,l,c[r>>2]|0,j);do{if((C|0)==0){T=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){T=C;break}if(!((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){T=C;break}c[y>>2]=0;T=0}}while(0);y=(T|0)==0;do{if((G|0)==0){E=54}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(!y){break}U=b;c[U>>2]=T;me(o);me(n);i=e;return}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;E=54;break}if(!(y^(G|0)==0)){break}U=b;c[U>>2]=T;me(o);me(n);i=e;return}}while(0);do{if((E|0)==54){if(y){break}U=b;c[U>>2]=T;me(o);me(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;U=b;c[U>>2]=T;me(o);me(n);i=e;return}function ng(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];og(a,0,k,j,f,g,h);i=b;return}function og(b,e,f,h,j,k,l){b=b|0;e=e|0;f=f|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;Vg(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;oe(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=h;h=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((mc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}oe(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[h>>2]&-2)+ -1|0}oe(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=mc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=d[L]|0}if((Wg(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){mc[c[(c[F>>2]|0)+40>>2]&63](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);g[l>>2]=+Gl(K,c[q>>2]|0,k);dj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((mc[c[(c[F>>2]|0)+36>>2]&63](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}if((mc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;me(p);me(o);i=e;return}function pg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];qg(a,0,k,j,f,g,h);i=b;return}function qg(b,e,f,g,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;Vg(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;oe(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=g;g=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((mc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}oe(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[g>>2]&-2)+ -1|0}oe(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=mc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=d[L]|0}if((Wg(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){mc[c[(c[F>>2]|0)+40>>2]&63](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);h[l>>3]=+Fl(K,c[q>>2]|0,k);dj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((mc[c[(c[F>>2]|0)+36>>2]&63](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}if((mc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;me(p);me(o);i=e;return}function rg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];sg(a,0,k,j,f,g,h);i=b;return}function sg(b,e,f,g,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=i;i=i+280|0;m=e+32|0;n=e+40|0;o=e+48|0;p=e+64|0;q=e+80|0;r=e+88|0;s=e+248|0;t=e+256|0;u=e+264|0;v=e+272|0;w=e;Vg(o,j,w,m,n);j=p;c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;oe(p,10,0);if((a[j]&1)==0){x=p+1|0;y=x;z=p+8|0;A=x}else{x=p+8|0;y=p+1|0;z=x;A=c[x>>2]|0}c[q>>2]=A;x=r;c[s>>2]=x;c[t>>2]=0;a[u]=1;a[v]=69;B=f;f=g;g=p;C=p+4|0;D=a[m]|0;m=a[n]|0;n=c[B>>2]|0;E=A;a:while(1){do{if((n|0)==0){F=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){F=n;break}if(!((mc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1)){F=n;break}c[B>>2]=0;F=0}}while(0);A=(F|0)==0;G=c[f>>2]|0;do{if((G|0)==0){H=14}else{if((c[G+12>>2]|0)!=(c[G+16>>2]|0)){if(A){I=G;break}else{J=G;K=E;break a}}if((mc[c[(c[G>>2]|0)+36>>2]&63](G)|0)==-1){c[f>>2]=0;H=14;break}else{if(A){I=G;break}else{J=G;K=E;break a}}}}while(0);if((H|0)==14){H=0;if(A){J=0;K=E;break}else{I=0}}G=a[j]|0;L=(G&1)==0;if(L){M=(G&255)>>>1}else{M=c[C>>2]|0}if(((c[q>>2]|0)-E|0)==(M|0)){if(L){N=(G&255)>>>1;O=(G&255)>>>1}else{G=c[C>>2]|0;N=G;O=G}oe(p,O<<1,0);if((a[j]&1)==0){P=10}else{P=(c[g>>2]&-2)+ -1|0}oe(p,P,0);if((a[j]&1)==0){Q=y}else{Q=c[z>>2]|0}c[q>>2]=Q+N;R=Q}else{R=E}G=F+12|0;L=c[G>>2]|0;S=F+16|0;if((L|0)==(c[S>>2]|0)){T=mc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=d[L]|0}if((Wg(T&255,u,v,R,q,D,m,o,x,s,t,w)|0)!=0){J=I;K=R;break}L=c[G>>2]|0;if((L|0)==(c[S>>2]|0)){mc[c[(c[F>>2]|0)+40>>2]&63](F)|0;n=F;E=R;continue}else{c[G>>2]=L+1;n=F;E=R;continue}}R=a[o]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[o+4>>2]|0}do{if((U|0)!=0){if((a[u]|0)==0){break}R=c[s>>2]|0;if((R-r|0)>=160){break}E=c[t>>2]|0;c[s>>2]=R+4;c[R>>2]=E}}while(0);h[l>>3]=+El(K,c[q>>2]|0,k);dj(o,x,c[s>>2]|0,k);do{if((F|0)==0){V=0}else{if((c[F+12>>2]|0)!=(c[F+16>>2]|0)){V=F;break}if(!((mc[c[(c[F>>2]|0)+36>>2]&63](F)|0)==-1)){V=F;break}c[B>>2]=0;V=0}}while(0);B=(V|0)==0;do{if((J|0)==0){H=51}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){if(!B){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}if((mc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1){c[f>>2]=0;H=51;break}if(!(B^(J|0)==0)){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}}while(0);do{if((H|0)==51){if(B){break}W=b;c[W>>2]=V;me(p);me(o);i=e;return}}while(0);c[k>>2]=c[k>>2]|2;W=b;c[W>>2]=V;me(p);me(o);i=e;return}function tg(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0;e=i;i=i+8|0;l=e;m=i;i=i+16|0;n=i;i=i+32|0;o=i;i=i+16|0;p=i;i=i+8|0;q=i;i=i+16|0;r=i;i=i+160|0;s=o;c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;Ge(p,h);h=p;p=c[h>>2]|0;if(!((c[57588]|0)==-1)){c[m>>2]=230352;c[m+4>>2]=112;c[m+8>>2]=0;he(230352,m,113)}m=(c[230356>>2]|0)+ -1|0;t=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-t>>2>>>0>m>>>0)){u=Va(4)|0;v=u;gm(v);xb(u|0,238312,101)}p=c[t+(m<<2)>>2]|0;if((p|0)==0){u=Va(4)|0;v=u;gm(v);xb(u|0,238312,101)}u=n;sc[c[(c[p>>2]|0)+32>>2]&7](p,228896,228922|0,u)|0;Pd(c[h>>2]|0)|0;h=q;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(q,10,0);if((a[h]&1)==0){p=q+1|0;w=p;x=q+8|0;y=p}else{p=q+8|0;w=q+1|0;x=p;y=c[p>>2]|0}p=f;f=g;g=q;v=q+4|0;m=n+24|0;t=n+25|0;z=r;A=n+26|0;B=n;n=o+4|0;C=c[p>>2]|0;D=y;E=r;r=0;F=y;a:while(1){do{if((C|0)==0){G=0}else{if((c[C+12>>2]|0)!=(c[C+16>>2]|0)){G=C;break}if(!((mc[c[(c[C>>2]|0)+36>>2]&63](C)|0)==-1)){G=C;break}c[p>>2]=0;G=0}}while(0);y=(G|0)==0;H=c[f>>2]|0;do{if((H|0)==0){I=19}else{if((c[H+12>>2]|0)!=(c[H+16>>2]|0)){if(y){break}else{J=F;break a}}if((mc[c[(c[H>>2]|0)+36>>2]&63](H)|0)==-1){c[f>>2]=0;I=19;break}else{if(y){break}else{J=F;break a}}}}while(0);if((I|0)==19){I=0;if(y){J=F;break}}H=a[h]|0;K=(H&1)==0;if(K){L=(H&255)>>>1}else{L=c[v>>2]|0}if((D-F|0)==(L|0)){if(K){M=(H&255)>>>1;N=(H&255)>>>1}else{H=c[v>>2]|0;M=H;N=H}oe(q,N<<1,0);if((a[h]&1)==0){O=10}else{O=(c[g>>2]&-2)+ -1|0}oe(q,O,0);if((a[h]&1)==0){P=w}else{P=c[x>>2]|0}Q=P+M|0;R=P}else{Q=D;R=F}H=c[G+12>>2]|0;if((H|0)==(c[G+16>>2]|0)){S=mc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{S=d[H]|0}H=S&255;K=(Q|0)==(R|0);do{if(K){T=(a[m]|0)==H<<24>>24;if(!T){if(!((a[t]|0)==H<<24>>24)){I=40;break}}a[Q]=T?43:45;U=Q+1|0;V=E;W=0}else{I=40}}while(0);do{if((I|0)==40){I=0;y=a[s]|0;if((y&1)==0){X=(y&255)>>>1}else{X=c[n>>2]|0}if((X|0)!=0&H<<24>>24==0){if((E-z|0)>=160){U=Q;V=E;W=r;break}c[E>>2]=r;U=Q;V=E+4|0;W=0;break}else{Y=u}while(1){y=Y+1|0;if((a[Y]|0)==H<<24>>24){Z=Y;break}if((y|0)==(A|0)){Z=A;break}else{Y=y}}y=Z-B|0;if((y|0)>23){J=R;break a}if((y|0)<22){a[Q]=a[228896+y|0]|0;U=Q+1|0;V=E;W=r+1|0;break}if(K){J=Q;break a}if((Q-R|0)>=3){J=R;break a}if((a[Q+ -1|0]|0)!=48){J=R;break a}a[Q]=a[228896+y|0]|0;U=Q+1|0;V=E;W=0}}while(0);K=c[p>>2]|0;H=K+12|0;y=c[H>>2]|0;if((y|0)==(c[K+16>>2]|0)){mc[c[(c[K>>2]|0)+40>>2]&63](K)|0;C=K;D=U;E=V;r=W;F=R;continue}else{c[H>>2]=y+1;C=K;D=U;E=V;r=W;F=R;continue}}a[J+3|0]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);R=c[57560]|0;c[l>>2]=k;if((vg(J,R,228936,l)|0)!=1){c[j>>2]=4}l=c[p>>2]|0;do{if((l|0)==0){_=0}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){_=l;break}if(!((mc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1)){_=l;break}c[p>>2]=0;_=0}}while(0);p=(_|0)==0;l=c[f>>2]|0;do{if((l|0)==0){I=72}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){if(!p){break}$=b;c[$>>2]=_;me(q);me(o);i=e;return}if((mc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1){c[f>>2]=0;I=72;break}if(!(p^(l|0)==0)){break}$=b;c[$>>2]=_;me(q);me(o);i=e;return}}while(0);do{if((I|0)==72){if(p){break}$=b;c[$>>2]=_;me(q);me(o);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;$=b;c[$>>2]=_;me(q);me(o);i=e;return}function ug(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;o=c[f>>2]|0;p=(o|0)==(e|0);do{if(p){q=(a[m+24|0]|0)==b<<24>>24;if(!q){if(!((a[m+25|0]|0)==b<<24>>24)){break}}c[f>>2]=e+1;a[e]=q?43:45;c[g>>2]=0;r=0;i=n;return r|0}}while(0);q=a[j]|0;if((q&1)==0){s=(q&255)>>>1}else{s=c[j+4>>2]|0}if((s|0)!=0&b<<24>>24==h<<24>>24){h=c[l>>2]|0;if((h-k|0)>=160){r=0;i=n;return r|0}k=c[g>>2]|0;c[l>>2]=h+4;c[h>>2]=k;c[g>>2]=0;r=0;i=n;return r|0}k=m+26|0;h=m;while(1){l=h+1|0;if((a[h]|0)==b<<24>>24){t=h;break}if((l|0)==(k|0)){t=k;break}else{h=l}}h=t-m|0;if((h|0)>23){r=-1;i=n;return r|0}do{if((d|0)==16){if((h|0)<22){break}if(p){r=-1;i=n;return r|0}if((o-e|0)>=3){r=-1;i=n;return r|0}if((a[o+ -1|0]|0)!=48){r=-1;i=n;return r|0}c[g>>2]=0;m=a[228896+h|0]|0;c[f>>2]=o+1;a[o]=m;r=0;i=n;return r|0}else if((d|0)==10|(d|0)==8){if((h|0)<(d|0)){break}else{r=-1}i=n;return r|0}}while(0);d=a[228896+h|0]|0;c[f>>2]=o+1;a[o]=d;c[g>>2]=(c[g>>2]|0)+1;r=0;i=n;return r|0}function vg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;e=ib(b|0)|0;b=Ja(a|0,d|0,g|0)|0;if((e|0)==0){i=f;return b|0}ib(e|0)|0;i=f;return b|0}function wg(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function xg(a){a=a|0;i=i;return}function yg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+136|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=k+40|0;q=k+56|0;r=k+64|0;s=k+72|0;t=k+80|0;u=k+88|0;v=k+96|0;w=k+104|0;x=k+128|0;if((c[g+4>>2]&1|0)==0){c[q>>2]=-1;y=c[(c[d>>2]|0)+16>>2]|0;z=e;c[s>>2]=c[z>>2];c[t>>2]=c[f>>2];A=n;B=s;c[A+0>>2]=c[B+0>>2];B=m;A=t;c[B+0>>2]=c[A+0>>2];hc[y&63](r,d,n,m,g,h,q);m=c[r>>2]|0;c[z>>2]=m;z=c[q>>2]|0;if((z|0)==0){a[j]=0}else if((z|0)==1){a[j]=1}else{a[j]=1;c[h>>2]=4}c[b>>2]=m;i=k;return}Ge(u,g);m=u;u=c[m>>2]|0;if(!((c[57586]|0)==-1)){c[p>>2]=230344;c[p+4>>2]=112;c[p+8>>2]=0;he(230344,p,113)}p=(c[230348>>2]|0)+ -1|0;z=c[u+8>>2]|0;if(!((c[u+12>>2]|0)-z>>2>>>0>p>>>0)){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}u=c[z+(p<<2)>>2]|0;if((u|0)==0){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}C=u;Pd(c[m>>2]|0)|0;Ge(v,g);g=v;v=c[g>>2]|0;if(!((c[57626]|0)==-1)){c[o>>2]=230504;c[o+4>>2]=112;c[o+8>>2]=0;he(230504,o,113)}o=(c[230508>>2]|0)+ -1|0;m=c[v+8>>2]|0;if(!((c[v+12>>2]|0)-m>>2>>>0>o>>>0)){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}v=c[m+(o<<2)>>2]|0;if((v|0)==0){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}E=v;Pd(c[g>>2]|0)|0;g=w;F=v;kc[c[(c[F>>2]|0)+24>>2]&63](g,E);kc[c[(c[F>>2]|0)+28>>2]&63](w+12|0,E);c[x>>2]=c[f>>2];f=w+24|0;E=l;F=x;c[E+0>>2]=c[F+0>>2];F=zg(e,l,g,f,C,h,1)|0;a[j]=(F|0)==(g|0)|0;c[b>>2]=c[e>>2];xe(w+12|0);xe(w);i=k;return}function zg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0;k=i;i=i+104|0;l=(f-e|0)/12|0;m=k;do{if(l>>>0>100){n=Bm(l)|0;if((n|0)!=0){o=n;p=n;break}Nm()}else{o=0;p=m}}while(0);m=(e|0)==(f|0);if(m){q=0;r=l}else{n=e;s=0;t=l;l=p;while(1){u=a[n]|0;if((u&1)==0){v=(u&255)>>>1}else{v=c[n+4>>2]|0}if((v|0)==0){a[l]=2;w=s+1|0;x=t+ -1|0}else{a[l]=1;w=s;x=t}u=n+12|0;if((u|0)==(f|0)){q=w;r=x;break}else{n=u;s=w;t=x;l=l+1|0}}}l=b;b=d;d=g;x=0;t=q;q=r;a:while(1){r=c[l>>2]|0;do{if((r|0)==0){y=1}else{w=c[r+12>>2]|0;if((w|0)==(c[r+16>>2]|0)){z=mc[c[(c[r>>2]|0)+36>>2]&63](r)|0}else{z=c[w>>2]|0}if((z|0)==-1){c[l>>2]=0;y=1;break}else{y=(c[l>>2]|0)==0;break}}}while(0);r=c[b>>2]|0;do{if((r|0)==0){A=0;B=1}else{w=c[r+12>>2]|0;if((w|0)==(c[r+16>>2]|0)){C=mc[c[(c[r>>2]|0)+36>>2]&63](r)|0}else{C=c[w>>2]|0}if(!((C|0)==-1)){A=r;B=0;break}c[b>>2]=0;A=0;B=1}}while(0);D=c[l>>2]|0;if(!((y^B)&(q|0)!=0)){break}r=c[D+12>>2]|0;if((r|0)==(c[D+16>>2]|0)){E=mc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{E=c[r>>2]|0}if(j){F=E}else{F=vc[c[(c[d>>2]|0)+28>>2]&15](g,E)|0}r=x+1|0;if(m){x=r;q=q;t=t;continue}b:do{if(j){w=0;s=e;n=t;v=q;u=p;while(1){do{if((a[u]|0)==1){G=a[s]|0;H=(G&1)==0;if(H){I=s+4|0}else{I=c[s+8>>2]|0}if((F|0)!=(c[I+(x<<2)>>2]|0)){a[u]=0;J=w;K=n;L=v+ -1|0;break}if(H){M=(G&255)>>>1}else{M=c[s+4>>2]|0}if((M|0)!=(r|0)){J=1;K=n;L=v;break}a[u]=2;J=1;K=n+1|0;L=v+ -1|0}else{J=w;K=n;L=v}}while(0);G=s+12|0;if((G|0)==(f|0)){N=J;O=K;P=L;break b}w=J;s=G;n=K;v=L;u=u+1|0}}else{u=0;v=e;n=t;s=q;w=p;while(1){do{if((a[w]|0)==1){G=v;if((a[G]&1)==0){Q=v+4|0}else{Q=c[v+8>>2]|0}if((F|0)!=(vc[c[(c[d>>2]|0)+28>>2]&15](g,c[Q+(x<<2)>>2]|0)|0)){a[w]=0;R=u;S=n;T=s+ -1|0;break}H=a[G]|0;if((H&1)==0){U=(H&255)>>>1}else{U=c[v+4>>2]|0}if((U|0)!=(r|0)){R=1;S=n;T=s;break}a[w]=2;R=1;S=n+1|0;T=s+ -1|0}else{R=u;S=n;T=s}}while(0);H=v+12|0;if((H|0)==(f|0)){N=R;O=S;P=T;break b}u=R;v=H;n=S;s=T;w=w+1|0}}}while(0);if(!N){x=r;t=O;q=P;continue}w=c[l>>2]|0;s=w+12|0;n=c[s>>2]|0;if((n|0)==(c[w+16>>2]|0)){mc[c[(c[w>>2]|0)+40>>2]&63](w)|0}else{c[s>>2]=n+4}if((P+O|0)>>>0<2){x=r;t=O;q=P;continue}else{V=e;W=O;X=p}while(1){do{if((a[X]|0)==2){n=a[V]|0;if((n&1)==0){Y=(n&255)>>>1}else{Y=c[V+4>>2]|0}if((Y|0)==(r|0)){Z=W;break}a[X]=0;Z=W+ -1|0}else{Z=W}}while(0);n=V+12|0;if((n|0)==(f|0)){x=r;t=Z;q=P;continue a}else{V=n;W=Z;X=X+1|0}}}do{if((D|0)==0){_=1}else{X=c[D+12>>2]|0;if((X|0)==(c[D+16>>2]|0)){$=mc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{$=c[X>>2]|0}if(($|0)==-1){c[l>>2]=0;_=1;break}else{_=(c[l>>2]|0)==0;break}}}while(0);do{if((A|0)==0){aa=85}else{l=c[A+12>>2]|0;if((l|0)==(c[A+16>>2]|0)){ba=mc[c[(c[A>>2]|0)+36>>2]&63](A)|0}else{ba=c[l>>2]|0}if((ba|0)==-1){c[b>>2]=0;aa=85;break}else{if(_){break}else{aa=87;break}}}}while(0);if((aa|0)==85){if(_){aa=87}}if((aa|0)==87){c[h>>2]=c[h>>2]|2}c:do{if(m){aa=92}else{if((a[p]|0)==2){ca=e;break}else{da=e;ea=p}while(1){_=da+12|0;b=ea+1|0;if((_|0)==(f|0)){aa=92;break c}if((a[b]|0)==2){ca=_;break}else{ea=b;da=_}}}}while(0);if((aa|0)==92){c[h>>2]=c[h>>2]|4;ca=f}if((o|0)==0){i=k;return ca|0}Cm(o);i=k;return ca|0}function Ag(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Bg(a,0,k,j,f,g,h);i=b;return}function Bg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==0){t=0}else if((s|0)==64){t=8}else if((s|0)==8){t=16}else{t=10}s=k;Xg(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=mc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=mc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}oe(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}oe(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{R=c[F>>2]|0}if((Tg(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){mc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Ml(J,c[o>>2]|0,h,t)|0;dj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=mc[c[(c[I>>2]|0)+36>>2]&63](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;me(n);me(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;me(n);me(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;me(n);me(m);i=d;return}function Cg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Dg(a,0,k,j,f,g,h);i=b;return}function Dg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==0){t=0}else if((s|0)==8){t=16}else if((s|0)==64){t=8}else{t=10}s=k;Xg(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=mc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=mc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{J=w;K=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){J=0;K=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){L=(w&255)>>>1}else{L=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(L|0)){if(F){M=(w&255)>>>1;N=(w&255)>>>1}else{w=c[y>>2]|0;M=w;N=w}oe(n,N<<1,0);if((a[g]&1)==0){O=10}else{O=(c[f>>2]&-2)+ -1|0}oe(n,O,0);if((a[g]&1)==0){P=u}else{P=c[v>>2]|0}c[o>>2]=P+M;Q=P}else{Q=A}w=B+12|0;F=c[w>>2]|0;R=B+16|0;if((F|0)==(c[R>>2]|0)){S=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{S=c[F>>2]|0}if((Tg(S,t,Q,o,r,z,m,k,q,s)|0)!=0){J=H;K=Q;break}F=c[w>>2]|0;if((F|0)==(c[R>>2]|0)){mc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=Q;continue}else{c[w>>2]=F+4;l=B;A=Q;continue}}Q=a[m]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[m+4>>2]|0}do{if((T|0)!=0){Q=c[q>>2]|0;if((Q-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=Q+4;c[Q>>2]=A}}while(0);r=Ll(K,c[o>>2]|0,h,t)|0;t=j;c[t>>2]=r;c[t+4>>2]=I;dj(m,k,c[q>>2]|0,h);do{if((B|0)==0){U=0;V=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){W=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{W=c[q>>2]|0}if(!((W|0)==-1)){U=B;V=0;break}c[x>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){E=60}else{x=c[J+12>>2]|0;if((x|0)==(c[J+16>>2]|0)){X=mc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{X=c[x>>2]|0}if((X|0)==-1){c[e>>2]=0;E=60;break}if(!V){break}Y=b;c[Y>>2]=U;me(n);me(m);i=d;return}}while(0);do{if((E|0)==60){if(V){break}Y=b;c[Y>>2]=U;me(n);me(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;Y=b;c[Y>>2]=U;me(n);me(m);i=d;return}function Eg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Fg(a,0,k,j,f,g,h);i=b;return}function Fg(d,e,f,g,h,j,k){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;e=i;i=i+328|0;l=e;m=e+104|0;n=e+112|0;o=e+128|0;p=e+144|0;q=e+152|0;r=e+312|0;s=e+320|0;t=c[h+4>>2]&74;if((t|0)==0){u=0}else if((t|0)==64){u=8}else if((t|0)==8){u=16}else{u=10}t=l;Xg(n,h,t,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){l=o+1|0;v=l;w=o+8|0;x=l}else{l=o+8|0;v=o+1|0;w=l;x=c[l>>2]|0}c[p>>2]=x;l=q;c[r>>2]=l;c[s>>2]=0;y=f;f=g;g=o;z=o+4|0;A=c[m>>2]|0;m=c[y>>2]|0;B=x;a:while(1){do{if((m|0)==0){C=0;D=1}else{x=c[m+12>>2]|0;if((x|0)==(c[m+16>>2]|0)){E=mc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{E=c[x>>2]|0}if(!((E|0)==-1)){C=m;D=0;break}c[y>>2]=0;C=0;D=1}}while(0);x=c[f>>2]|0;do{if((x|0)==0){F=21}else{G=c[x+12>>2]|0;if((G|0)==(c[x+16>>2]|0)){H=mc[c[(c[x>>2]|0)+36>>2]&63](x)|0}else{H=c[G>>2]|0}if((H|0)==-1){c[f>>2]=0;F=21;break}else{if(D){I=x;break}else{J=x;K=B;break a}}}}while(0);if((F|0)==21){F=0;if(D){J=0;K=B;break}else{I=0}}x=a[h]|0;G=(x&1)==0;if(G){L=(x&255)>>>1}else{L=c[z>>2]|0}if(((c[p>>2]|0)-B|0)==(L|0)){if(G){M=(x&255)>>>1;N=(x&255)>>>1}else{x=c[z>>2]|0;M=x;N=x}oe(o,N<<1,0);if((a[h]&1)==0){O=10}else{O=(c[g>>2]&-2)+ -1|0}oe(o,O,0);if((a[h]&1)==0){P=v}else{P=c[w>>2]|0}c[p>>2]=P+M;Q=P}else{Q=B}x=C+12|0;G=c[x>>2]|0;R=C+16|0;if((G|0)==(c[R>>2]|0)){S=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{S=c[G>>2]|0}if((Tg(S,u,Q,p,s,A,n,l,r,t)|0)!=0){J=I;K=Q;break}G=c[x>>2]|0;if((G|0)==(c[R>>2]|0)){mc[c[(c[C>>2]|0)+40>>2]&63](C)|0;m=C;B=Q;continue}else{c[x>>2]=G+4;m=C;B=Q;continue}}Q=a[n]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[n+4>>2]|0}do{if((T|0)!=0){Q=c[r>>2]|0;if((Q-q|0)>=160){break}B=c[s>>2]|0;c[r>>2]=Q+4;c[Q>>2]=B}}while(0);b[k>>1]=Kl(K,c[p>>2]|0,j,u)|0;dj(n,l,c[r>>2]|0,j);do{if((C|0)==0){U=0;V=1}else{r=c[C+12>>2]|0;if((r|0)==(c[C+16>>2]|0)){W=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{W=c[r>>2]|0}if(!((W|0)==-1)){U=C;V=0;break}c[y>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){F=60}else{y=c[J+12>>2]|0;if((y|0)==(c[J+16>>2]|0)){X=mc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{X=c[y>>2]|0}if((X|0)==-1){c[f>>2]=0;F=60;break}if(!V){break}Y=d;c[Y>>2]=U;me(o);me(n);i=e;return}}while(0);do{if((F|0)==60){if(V){break}Y=d;c[Y>>2]=U;me(o);me(n);i=e;return}}while(0);c[j>>2]=c[j>>2]|2;Y=d;c[Y>>2]=U;me(o);me(n);i=e;return}function Gg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Hg(a,0,k,j,f,g,h);i=b;return}function Hg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==0){t=0}else if((s|0)==64){t=8}else{t=10}s=k;Xg(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=mc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=mc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}oe(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}oe(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{R=c[F>>2]|0}if((Tg(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){mc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Jl(J,c[o>>2]|0,h,t)|0;dj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=mc[c[(c[I>>2]|0)+36>>2]&63](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;me(n);me(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;me(n);me(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;me(n);me(m);i=d;return}function Ig(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Jg(a,0,k,j,f,g,h);i=b;return}function Jg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==8){t=16}else if((s|0)==0){t=0}else if((s|0)==64){t=8}else{t=10}s=k;Xg(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=mc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=mc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{I=w;J=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){I=0;J=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){K=(w&255)>>>1}else{K=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(K|0)){if(F){L=(w&255)>>>1;M=(w&255)>>>1}else{w=c[y>>2]|0;L=w;M=w}oe(n,M<<1,0);if((a[g]&1)==0){N=10}else{N=(c[f>>2]&-2)+ -1|0}oe(n,N,0);if((a[g]&1)==0){O=u}else{O=c[v>>2]|0}c[o>>2]=O+L;P=O}else{P=A}w=B+12|0;F=c[w>>2]|0;Q=B+16|0;if((F|0)==(c[Q>>2]|0)){R=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{R=c[F>>2]|0}if((Tg(R,t,P,o,r,z,m,k,q,s)|0)!=0){I=H;J=P;break}F=c[w>>2]|0;if((F|0)==(c[Q>>2]|0)){mc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=P;continue}else{c[w>>2]=F+4;l=B;A=P;continue}}P=a[m]|0;if((P&1)==0){S=(P&255)>>>1}else{S=c[m+4>>2]|0}do{if((S|0)!=0){P=c[q>>2]|0;if((P-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=P+4;c[P>>2]=A}}while(0);c[j>>2]=Il(J,c[o>>2]|0,h,t)|0;dj(m,k,c[q>>2]|0,h);do{if((B|0)==0){T=0;U=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){V=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{V=c[q>>2]|0}if(!((V|0)==-1)){T=B;U=0;break}c[x>>2]=0;T=0;U=1}}while(0);do{if((I|0)==0){E=60}else{x=c[I+12>>2]|0;if((x|0)==(c[I+16>>2]|0)){W=mc[c[(c[I>>2]|0)+36>>2]&63](I)|0}else{W=c[x>>2]|0}if((W|0)==-1){c[e>>2]=0;E=60;break}if(!U){break}X=b;c[X>>2]=T;me(n);me(m);i=d;return}}while(0);do{if((E|0)==60){if(U){break}X=b;c[X>>2]=T;me(n);me(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;X=b;c[X>>2]=T;me(n);me(m);i=d;return}function Kg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Lg(a,0,k,j,f,g,h);i=b;return}function Lg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;d=i;i=i+328|0;k=d;l=d+104|0;m=d+112|0;n=d+128|0;o=d+144|0;p=d+152|0;q=d+312|0;r=d+320|0;s=c[g+4>>2]&74;if((s|0)==64){t=8}else if((s|0)==0){t=0}else if((s|0)==8){t=16}else{t=10}s=k;Xg(m,g,s,l);g=n;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(n,10,0);if((a[g]&1)==0){k=n+1|0;u=k;v=n+8|0;w=k}else{k=n+8|0;u=n+1|0;v=k;w=c[k>>2]|0}c[o>>2]=w;k=p;c[q>>2]=k;c[r>>2]=0;x=e;e=f;f=n;y=n+4|0;z=c[l>>2]|0;l=c[x>>2]|0;A=w;a:while(1){do{if((l|0)==0){B=0;C=1}else{w=c[l+12>>2]|0;if((w|0)==(c[l+16>>2]|0)){D=mc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{D=c[w>>2]|0}if(!((D|0)==-1)){B=l;C=0;break}c[x>>2]=0;B=0;C=1}}while(0);w=c[e>>2]|0;do{if((w|0)==0){E=21}else{F=c[w+12>>2]|0;if((F|0)==(c[w+16>>2]|0)){G=mc[c[(c[w>>2]|0)+36>>2]&63](w)|0}else{G=c[F>>2]|0}if((G|0)==-1){c[e>>2]=0;E=21;break}else{if(C){H=w;break}else{J=w;K=A;break a}}}}while(0);if((E|0)==21){E=0;if(C){J=0;K=A;break}else{H=0}}w=a[g]|0;F=(w&1)==0;if(F){L=(w&255)>>>1}else{L=c[y>>2]|0}if(((c[o>>2]|0)-A|0)==(L|0)){if(F){M=(w&255)>>>1;N=(w&255)>>>1}else{w=c[y>>2]|0;M=w;N=w}oe(n,N<<1,0);if((a[g]&1)==0){O=10}else{O=(c[f>>2]&-2)+ -1|0}oe(n,O,0);if((a[g]&1)==0){P=u}else{P=c[v>>2]|0}c[o>>2]=P+M;Q=P}else{Q=A}w=B+12|0;F=c[w>>2]|0;R=B+16|0;if((F|0)==(c[R>>2]|0)){S=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{S=c[F>>2]|0}if((Tg(S,t,Q,o,r,z,m,k,q,s)|0)!=0){J=H;K=Q;break}F=c[w>>2]|0;if((F|0)==(c[R>>2]|0)){mc[c[(c[B>>2]|0)+40>>2]&63](B)|0;l=B;A=Q;continue}else{c[w>>2]=F+4;l=B;A=Q;continue}}Q=a[m]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[m+4>>2]|0}do{if((T|0)!=0){Q=c[q>>2]|0;if((Q-p|0)>=160){break}A=c[r>>2]|0;c[q>>2]=Q+4;c[Q>>2]=A}}while(0);r=Hl(K,c[o>>2]|0,h,t)|0;t=j;c[t>>2]=r;c[t+4>>2]=I;dj(m,k,c[q>>2]|0,h);do{if((B|0)==0){U=0;V=1}else{q=c[B+12>>2]|0;if((q|0)==(c[B+16>>2]|0)){W=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{W=c[q>>2]|0}if(!((W|0)==-1)){U=B;V=0;break}c[x>>2]=0;U=0;V=1}}while(0);do{if((J|0)==0){E=60}else{x=c[J+12>>2]|0;if((x|0)==(c[J+16>>2]|0)){X=mc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{X=c[x>>2]|0}if((X|0)==-1){c[e>>2]=0;E=60;break}if(!V){break}Y=b;c[Y>>2]=U;me(n);me(m);i=d;return}}while(0);do{if((E|0)==60){if(V){break}Y=b;c[Y>>2]=U;me(n);me(m);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;Y=b;c[Y>>2]=U;me(n);me(m);i=d;return}function Mg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Ng(a,0,k,j,f,g,h);i=b;return}function Ng(b,d,e,f,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;Yg(n,h,v,l,m);h=o;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;oe(o,10,0);if((a[h]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=mc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=mc[c[(c[z>>2]|0)+36>>2]&63](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[h]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}oe(o,P<<1,0);if((a[h]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}oe(o,Q,0);if((a[h]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=mc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{U=c[I>>2]|0}if((Zg(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){mc[c[(c[E>>2]|0)+40>>2]&63](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);g[k>>2]=+Gl(M,c[p>>2]|0,j);dj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=mc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=mc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;me(o);me(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;me(o);me(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;me(o);me(n);i=d;return}function Og(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Pg(a,0,k,j,f,g,h);i=b;return}function Pg(b,d,e,f,g,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;Yg(n,g,v,l,m);g=o;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(o,10,0);if((a[g]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=mc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=mc[c[(c[z>>2]|0)+36>>2]&63](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[g]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}oe(o,P<<1,0);if((a[g]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}oe(o,Q,0);if((a[g]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=mc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{U=c[I>>2]|0}if((Zg(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){mc[c[(c[E>>2]|0)+40>>2]&63](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);h[k>>3]=+Fl(M,c[p>>2]|0,j);dj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=mc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=mc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;me(o);me(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;me(o);me(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;me(o);me(n);i=d;return}function Qg(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;b=i;i=i+32|0;j=b;k=b+8|0;l=b+16|0;m=b+24|0;c[l>>2]=c[d>>2];c[m>>2]=c[e>>2];e=k;d=l;c[e+0>>2]=c[d+0>>2];d=j;e=m;c[d+0>>2]=c[e+0>>2];Rg(a,0,k,j,f,g,h);i=b;return}function Rg(b,d,e,f,g,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;d=i;i=i+376|0;l=d+128|0;m=d+136|0;n=d+144|0;o=d+160|0;p=d+176|0;q=d+184|0;r=d+344|0;s=d+352|0;t=d+360|0;u=d+368|0;v=d;Yg(n,g,v,l,m);g=o;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(o,10,0);if((a[g]&1)==0){w=o+1|0;x=w;y=o+8|0;z=w}else{w=o+8|0;x=o+1|0;y=w;z=c[w>>2]|0}c[p>>2]=z;w=q;c[r>>2]=w;c[s>>2]=0;a[t]=1;a[u]=69;A=e;e=f;f=o;B=o+4|0;C=c[l>>2]|0;l=c[m>>2]|0;m=c[A>>2]|0;D=z;a:while(1){do{if((m|0)==0){E=0;F=1}else{z=c[m+12>>2]|0;if((z|0)==(c[m+16>>2]|0)){G=mc[c[(c[m>>2]|0)+36>>2]&63](m)|0}else{G=c[z>>2]|0}if(!((G|0)==-1)){E=m;F=0;break}c[A>>2]=0;E=0;F=1}}while(0);z=c[e>>2]|0;do{if((z|0)==0){H=17}else{I=c[z+12>>2]|0;if((I|0)==(c[z+16>>2]|0)){J=mc[c[(c[z>>2]|0)+36>>2]&63](z)|0}else{J=c[I>>2]|0}if((J|0)==-1){c[e>>2]=0;H=17;break}else{if(F){K=z;break}else{L=z;M=D;break a}}}}while(0);if((H|0)==17){H=0;if(F){L=0;M=D;break}else{K=0}}z=a[g]|0;I=(z&1)==0;if(I){N=(z&255)>>>1}else{N=c[B>>2]|0}if(((c[p>>2]|0)-D|0)==(N|0)){if(I){O=(z&255)>>>1;P=(z&255)>>>1}else{z=c[B>>2]|0;O=z;P=z}oe(o,P<<1,0);if((a[g]&1)==0){Q=10}else{Q=(c[f>>2]&-2)+ -1|0}oe(o,Q,0);if((a[g]&1)==0){R=x}else{R=c[y>>2]|0}c[p>>2]=R+O;S=R}else{S=D}z=E+12|0;I=c[z>>2]|0;T=E+16|0;if((I|0)==(c[T>>2]|0)){U=mc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{U=c[I>>2]|0}if((Zg(U,t,u,S,p,C,l,n,w,r,s,v)|0)!=0){L=K;M=S;break}I=c[z>>2]|0;if((I|0)==(c[T>>2]|0)){mc[c[(c[E>>2]|0)+40>>2]&63](E)|0;m=E;D=S;continue}else{c[z>>2]=I+4;m=E;D=S;continue}}S=a[n]|0;if((S&1)==0){V=(S&255)>>>1}else{V=c[n+4>>2]|0}do{if((V|0)!=0){if((a[t]|0)==0){break}S=c[r>>2]|0;if((S-q|0)>=160){break}D=c[s>>2]|0;c[r>>2]=S+4;c[S>>2]=D}}while(0);h[k>>3]=+El(M,c[p>>2]|0,j);dj(n,w,c[r>>2]|0,j);do{if((E|0)==0){W=0;X=1}else{r=c[E+12>>2]|0;if((r|0)==(c[E+16>>2]|0)){Y=mc[c[(c[E>>2]|0)+36>>2]&63](E)|0}else{Y=c[r>>2]|0}if(!((Y|0)==-1)){W=E;X=0;break}c[A>>2]=0;W=0;X=1}}while(0);do{if((L|0)==0){H=57}else{A=c[L+12>>2]|0;if((A|0)==(c[L+16>>2]|0)){Z=mc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{Z=c[A>>2]|0}if((Z|0)==-1){c[e>>2]=0;H=57;break}if(!X){break}_=b;c[_>>2]=W;me(o);me(n);i=d;return}}while(0);do{if((H|0)==57){if(X){break}_=b;c[_>>2]=W;me(o);me(n);i=d;return}}while(0);c[j>>2]=c[j>>2]|2;_=b;c[_>>2]=W;me(o);me(n);i=d;return}function Sg(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0;d=i;i=i+8|0;k=d;l=i;i=i+16|0;m=i;i=i+104|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+160|0;r=n;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;Ge(o,g);g=o;o=c[g>>2]|0;if(!((c[57586]|0)==-1)){c[l>>2]=230344;c[l+4>>2]=112;c[l+8>>2]=0;he(230344,l,113)}l=(c[230348>>2]|0)+ -1|0;s=c[o+8>>2]|0;if(!((c[o+12>>2]|0)-s>>2>>>0>l>>>0)){t=Va(4)|0;u=t;gm(u);xb(t|0,238312,101)}o=c[s+(l<<2)>>2]|0;if((o|0)==0){t=Va(4)|0;u=t;gm(u);xb(t|0,238312,101)}t=m;sc[c[(c[o>>2]|0)+48>>2]&7](o,228896,228922|0,t)|0;Pd(c[g>>2]|0)|0;g=p;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;oe(p,10,0);if((a[g]&1)==0){o=p+1|0;v=o;w=p+8|0;x=o}else{o=p+8|0;v=p+1|0;w=o;x=c[o>>2]|0}o=e;e=f;f=p;u=p+4|0;l=m+96|0;s=m+100|0;y=q;z=m+104|0;A=m;m=n+4|0;B=c[o>>2]|0;C=x;D=q;q=0;E=x;a:while(1){do{if((B|0)==0){F=0;G=1}else{x=c[B+12>>2]|0;if((x|0)==(c[B+16>>2]|0)){H=mc[c[(c[B>>2]|0)+36>>2]&63](B)|0}else{H=c[x>>2]|0}if(!((H|0)==-1)){F=B;G=0;break}c[o>>2]=0;F=0;G=1}}while(0);x=c[e>>2]|0;do{if((x|0)==0){I=22}else{J=c[x+12>>2]|0;if((J|0)==(c[x+16>>2]|0)){K=mc[c[(c[x>>2]|0)+36>>2]&63](x)|0}else{K=c[J>>2]|0}if((K|0)==-1){c[e>>2]=0;I=22;break}else{if(G){break}else{L=E;break a}}}}while(0);if((I|0)==22){I=0;if(G){L=E;break}}x=a[g]|0;J=(x&1)==0;if(J){M=(x&255)>>>1}else{M=c[u>>2]|0}if((C-E|0)==(M|0)){if(J){N=(x&255)>>>1;O=(x&255)>>>1}else{x=c[u>>2]|0;N=x;O=x}oe(p,O<<1,0);if((a[g]&1)==0){P=10}else{P=(c[f>>2]&-2)+ -1|0}oe(p,P,0);if((a[g]&1)==0){Q=v}else{Q=c[w>>2]|0}R=Q+N|0;S=Q}else{R=C;S=E}x=c[F+12>>2]|0;if((x|0)==(c[F+16>>2]|0)){T=mc[c[(c[F>>2]|0)+36>>2]&63](F)|0}else{T=c[x>>2]|0}x=(R|0)==(S|0);do{if(x){J=(c[l>>2]|0)==(T|0);if(!J){if((c[s>>2]|0)!=(T|0)){I=43;break}}a[R]=J?43:45;U=R+1|0;V=D;W=0}else{I=43}}while(0);do{if((I|0)==43){I=0;J=a[r]|0;if((J&1)==0){X=(J&255)>>>1}else{X=c[m>>2]|0}if((X|0)!=0&(T|0)==0){if((D-y|0)>=160){U=R;V=D;W=q;break}c[D>>2]=q;U=R;V=D+4|0;W=0;break}else{Y=t}while(1){J=Y+4|0;if((c[Y>>2]|0)==(T|0)){Z=Y;break}if((J|0)==(z|0)){Z=z;break}else{Y=J}}J=Z-A|0;_=J>>2;if((J|0)>92){L=S;break a}if((J|0)<88){a[R]=a[228896+_|0]|0;U=R+1|0;V=D;W=q+1|0;break}if(x){L=R;break a}if((R-S|0)>=3){L=S;break a}if((a[R+ -1|0]|0)!=48){L=S;break a}a[R]=a[228896+_|0]|0;U=R+1|0;V=D;W=0}}while(0);x=c[o>>2]|0;_=x+12|0;J=c[_>>2]|0;if((J|0)==(c[x+16>>2]|0)){mc[c[(c[x>>2]|0)+40>>2]&63](x)|0;B=x;C=U;D=V;q=W;E=S;continue}else{c[_>>2]=J+4;B=x;C=U;D=V;q=W;E=S;continue}}a[L+3|0]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);S=c[57560]|0;c[k>>2]=j;if((vg(L,S,228936,k)|0)!=1){c[h>>2]=4}k=c[o>>2]|0;do{if((k|0)==0){$=0;aa=1}else{S=c[k+12>>2]|0;if((S|0)==(c[k+16>>2]|0)){ba=mc[c[(c[k>>2]|0)+36>>2]&63](k)|0}else{ba=c[S>>2]|0}if(!((ba|0)==-1)){$=k;aa=0;break}c[o>>2]=0;$=0;aa=1}}while(0);o=c[e>>2]|0;do{if((o|0)==0){I=78}else{k=c[o+12>>2]|0;if((k|0)==(c[o+16>>2]|0)){ca=mc[c[(c[o>>2]|0)+36>>2]&63](o)|0}else{ca=c[k>>2]|0}if((ca|0)==-1){c[e>>2]=0;I=78;break}if(!aa){break}da=b;c[da>>2]=$;me(p);me(n);i=d;return}}while(0);do{if((I|0)==78){if(aa){break}da=b;c[da>>2]=$;me(p);me(n);i=d;return}}while(0);c[h>>2]=c[h>>2]|2;da=b;c[da>>2]=$;me(p);me(n);i=d;return}\n\n\n\nfunction Tg(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;o=c[f>>2]|0;p=(o|0)==(e|0);do{if(p){q=(c[m+96>>2]|0)==(b|0);if(!q){if((c[m+100>>2]|0)!=(b|0)){break}}c[f>>2]=e+1;a[e]=q?43:45;c[g>>2]=0;r=0;i=n;return r|0}}while(0);q=a[j]|0;if((q&1)==0){s=(q&255)>>>1}else{s=c[j+4>>2]|0}if((s|0)!=0&(b|0)==(h|0)){h=c[l>>2]|0;if((h-k|0)>=160){r=0;i=n;return r|0}k=c[g>>2]|0;c[l>>2]=h+4;c[h>>2]=k;c[g>>2]=0;r=0;i=n;return r|0}k=m+104|0;h=m;while(1){l=h+4|0;if((c[h>>2]|0)==(b|0)){t=h;break}if((l|0)==(k|0)){t=k;break}else{h=l}}h=t-m|0;m=h>>2;if((h|0)>92){r=-1;i=n;return r|0}do{if((d|0)==10|(d|0)==8){if((m|0)<(d|0)){break}else{r=-1}i=n;return r|0}else if((d|0)==16){if((h|0)<88){break}if(p){r=-1;i=n;return r|0}if((o-e|0)>=3){r=-1;i=n;return r|0}if((a[o+ -1|0]|0)!=48){r=-1;i=n;return r|0}c[g>>2]=0;t=a[228896+m|0]|0;c[f>>2]=o+1;a[o]=t;r=0;i=n;return r|0}}while(0);e=a[228896+m|0]|0;c[f>>2]=o+1;a[o]=e;c[g>>2]=(c[g>>2]|0)+1;r=0;i=n;return r|0}function Ug(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+40|0;h=g;j=g+16|0;k=g+32|0;Ge(k,d);d=k;k=c[d>>2]|0;if(!((c[57588]|0)==-1)){c[j>>2]=230352;c[j+4>>2]=112;c[j+8>>2]=0;he(230352,j,113)}j=(c[230356>>2]|0)+ -1|0;l=c[k+8>>2]|0;if(!((c[k+12>>2]|0)-l>>2>>>0>j>>>0)){m=Va(4)|0;n=m;gm(n);xb(m|0,238312,101)}k=c[l+(j<<2)>>2]|0;if((k|0)==0){m=Va(4)|0;n=m;gm(n);xb(m|0,238312,101)}sc[c[(c[k>>2]|0)+32>>2]&7](k,228896,228922|0,e)|0;e=c[d>>2]|0;if(!((c[57624]|0)==-1)){c[h>>2]=230496;c[h+4>>2]=112;c[h+8>>2]=0;he(230496,h,113)}h=(c[230500>>2]|0)+ -1|0;k=c[e+8>>2]|0;if(!((c[e+12>>2]|0)-k>>2>>>0>h>>>0)){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}e=c[k+(h<<2)>>2]|0;if((e|0)==0){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}else{o=e;a[f]=mc[c[(c[e>>2]|0)+16>>2]&63](o)|0;kc[c[(c[e>>2]|0)+20>>2]&63](b,o);Pd(c[d>>2]|0)|0;i=g;return}}function Vg(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+40|0;j=h;k=h+16|0;l=h+32|0;Ge(l,d);d=l;l=c[d>>2]|0;if(!((c[57588]|0)==-1)){c[k>>2]=230352;c[k+4>>2]=112;c[k+8>>2]=0;he(230352,k,113)}k=(c[230356>>2]|0)+ -1|0;m=c[l+8>>2]|0;if(!((c[l+12>>2]|0)-m>>2>>>0>k>>>0)){n=Va(4)|0;o=n;gm(o);xb(n|0,238312,101)}l=c[m+(k<<2)>>2]|0;if((l|0)==0){n=Va(4)|0;o=n;gm(o);xb(n|0,238312,101)}sc[c[(c[l>>2]|0)+32>>2]&7](l,228896,228928|0,e)|0;e=c[d>>2]|0;if(!((c[57624]|0)==-1)){c[j>>2]=230496;c[j+4>>2]=112;c[j+8>>2]=0;he(230496,j,113)}j=(c[230500>>2]|0)+ -1|0;l=c[e+8>>2]|0;if(!((c[e+12>>2]|0)-l>>2>>>0>j>>>0)){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}e=c[l+(j<<2)>>2]|0;if((e|0)==0){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}else{p=e;q=e;a[f]=mc[c[(c[q>>2]|0)+12>>2]&63](p)|0;a[g]=mc[c[(c[q>>2]|0)+16>>2]&63](p)|0;kc[c[(c[e>>2]|0)+20>>2]&63](b,p);Pd(c[d>>2]|0)|0;i=h;return}}function Wg(b,d,e,f,g,h,j,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0;p=i;if(b<<24>>24==h<<24>>24){if((a[d]|0)==0){q=-1;i=p;return q|0}a[d]=0;h=c[g>>2]|0;c[g>>2]=h+1;a[h]=46;h=a[k]|0;if((h&1)==0){r=(h&255)>>>1}else{r=c[k+4>>2]|0}if((r|0)==0){q=0;i=p;return q|0}r=c[m>>2]|0;if((r-l|0)>=160){q=0;i=p;return q|0}h=c[n>>2]|0;c[m>>2]=r+4;c[r>>2]=h;q=0;i=p;return q|0}do{if(b<<24>>24==j<<24>>24){h=a[k]|0;if((h&1)==0){s=(h&255)>>>1}else{s=c[k+4>>2]|0}if((s|0)==0){break}if((a[d]|0)==0){q=-1;i=p;return q|0}h=c[m>>2]|0;if((h-l|0)>=160){q=0;i=p;return q|0}r=c[n>>2]|0;c[m>>2]=h+4;c[h>>2]=r;c[n>>2]=0;q=0;i=p;return q|0}}while(0);s=o+32|0;j=o;while(1){r=j+1|0;if((a[j]|0)==b<<24>>24){t=j;break}if((r|0)==(s|0)){t=s;break}else{j=r}}j=t-o|0;if((j|0)>31){q=-1;i=p;return q|0}o=a[228896+j|0]|0;if((j|0)==23|(j|0)==22){a[e]=80;t=c[g>>2]|0;c[g>>2]=t+1;a[t]=o;q=0;i=p;return q|0}else if((j|0)==24|(j|0)==25){t=c[g>>2]|0;do{if((t|0)!=(f|0)){if((a[t+ -1|0]&95|0)==(a[e]&127|0)){break}else{q=-1}i=p;return q|0}}while(0);c[g>>2]=t+1;a[t]=o;q=0;i=p;return q|0}else{t=o&95;do{if((t|0)==(a[e]|0)){a[e]=t|128;if((a[d]|0)==0){break}a[d]=0;f=a[k]|0;if((f&1)==0){u=(f&255)>>>1}else{u=c[k+4>>2]|0}if((u|0)==0){break}f=c[m>>2]|0;if((f-l|0)>=160){break}s=c[n>>2]|0;c[m>>2]=f+4;c[f>>2]=s}}while(0);m=c[g>>2]|0;c[g>>2]=m+1;a[m]=o;if((j|0)>21){q=0;i=p;return q|0}c[n>>2]=(c[n>>2]|0)+1;q=0;i=p;return q|0}return 0}function Xg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+40|0;g=f;h=f+16|0;j=f+32|0;Ge(j,b);b=j;j=c[b>>2]|0;if(!((c[57586]|0)==-1)){c[h>>2]=230344;c[h+4>>2]=112;c[h+8>>2]=0;he(230344,h,113)}h=(c[230348>>2]|0)+ -1|0;k=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-k>>2>>>0>h>>>0)){l=Va(4)|0;m=l;gm(m);xb(l|0,238312,101)}j=c[k+(h<<2)>>2]|0;if((j|0)==0){l=Va(4)|0;m=l;gm(m);xb(l|0,238312,101)}sc[c[(c[j>>2]|0)+48>>2]&7](j,228896,228922|0,d)|0;d=c[b>>2]|0;if(!((c[57626]|0)==-1)){c[g>>2]=230504;c[g+4>>2]=112;c[g+8>>2]=0;he(230504,g,113)}g=(c[230508>>2]|0)+ -1|0;j=c[d+8>>2]|0;if(!((c[d+12>>2]|0)-j>>2>>>0>g>>>0)){n=Va(4)|0;o=n;gm(o);xb(n|0,238312,101)}d=c[j+(g<<2)>>2]|0;if((d|0)==0){n=Va(4)|0;o=n;gm(o);xb(n|0,238312,101)}else{n=d;c[e>>2]=mc[c[(c[d>>2]|0)+16>>2]&63](n)|0;kc[c[(c[d>>2]|0)+20>>2]&63](a,n);Pd(c[b>>2]|0)|0;i=f;return}}function Yg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+40|0;h=g;j=g+16|0;k=g+32|0;Ge(k,b);b=k;k=c[b>>2]|0;if(!((c[57586]|0)==-1)){c[j>>2]=230344;c[j+4>>2]=112;c[j+8>>2]=0;he(230344,j,113)}j=(c[230348>>2]|0)+ -1|0;l=c[k+8>>2]|0;if(!((c[k+12>>2]|0)-l>>2>>>0>j>>>0)){m=Va(4)|0;n=m;gm(n);xb(m|0,238312,101)}k=c[l+(j<<2)>>2]|0;if((k|0)==0){m=Va(4)|0;n=m;gm(n);xb(m|0,238312,101)}sc[c[(c[k>>2]|0)+48>>2]&7](k,228896,228928|0,d)|0;d=c[b>>2]|0;if(!((c[57626]|0)==-1)){c[h>>2]=230504;c[h+4>>2]=112;c[h+8>>2]=0;he(230504,h,113)}h=(c[230508>>2]|0)+ -1|0;k=c[d+8>>2]|0;if(!((c[d+12>>2]|0)-k>>2>>>0>h>>>0)){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}d=c[k+(h<<2)>>2]|0;if((d|0)==0){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}else{o=d;p=d;c[e>>2]=mc[c[(c[p>>2]|0)+12>>2]&63](o)|0;c[f>>2]=mc[c[(c[p>>2]|0)+16>>2]&63](o)|0;kc[c[(c[d>>2]|0)+20>>2]&63](a,o);Pd(c[b>>2]|0)|0;i=g;return}}function Zg(b,d,e,f,g,h,j,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0;p=i;if((b|0)==(h|0)){if((a[d]|0)==0){q=-1;i=p;return q|0}a[d]=0;h=c[g>>2]|0;c[g>>2]=h+1;a[h]=46;h=a[k]|0;if((h&1)==0){r=(h&255)>>>1}else{r=c[k+4>>2]|0}if((r|0)==0){q=0;i=p;return q|0}r=c[m>>2]|0;if((r-l|0)>=160){q=0;i=p;return q|0}h=c[n>>2]|0;c[m>>2]=r+4;c[r>>2]=h;q=0;i=p;return q|0}do{if((b|0)==(j|0)){h=a[k]|0;if((h&1)==0){s=(h&255)>>>1}else{s=c[k+4>>2]|0}if((s|0)==0){break}if((a[d]|0)==0){q=-1;i=p;return q|0}h=c[m>>2]|0;if((h-l|0)>=160){q=0;i=p;return q|0}r=c[n>>2]|0;c[m>>2]=h+4;c[h>>2]=r;c[n>>2]=0;q=0;i=p;return q|0}}while(0);s=o+128|0;j=o;while(1){r=j+4|0;if((c[j>>2]|0)==(b|0)){t=j;break}if((r|0)==(s|0)){t=s;break}else{j=r}}j=t-o|0;o=j>>2;if((j|0)>124){q=-1;i=p;return q|0}t=a[228896+o|0]|0;do{if((o|0)==23|(o|0)==22){a[e]=80}else if((o|0)==24|(o|0)==25){s=c[g>>2]|0;do{if((s|0)!=(f|0)){if((a[s+ -1|0]&95|0)==(a[e]&127|0)){break}else{q=-1}i=p;return q|0}}while(0);c[g>>2]=s+1;a[s]=t;q=0;i=p;return q|0}else{b=t&95;if((b|0)!=(a[e]|0)){break}a[e]=b|128;if((a[d]|0)==0){break}a[d]=0;b=a[k]|0;if((b&1)==0){u=(b&255)>>>1}else{u=c[k+4>>2]|0}if((u|0)==0){break}b=c[m>>2]|0;if((b-l|0)>=160){break}r=c[n>>2]|0;c[m>>2]=b+4;c[b>>2]=r}}while(0);m=c[g>>2]|0;c[g>>2]=m+1;a[m]=t;if((j|0)>84){q=0;i=p;return q|0}c[n>>2]=(c[n>>2]|0)+1;q=0;i=p;return q|0}function _g(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function $g(a){a=a|0;i=i;return}function ah(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;j=i;i=i+56|0;k=j;l=j+8|0;m=j+24|0;n=j+32|0;o=j+40|0;if((c[f+4>>2]&1|0)==0){p=c[(c[d>>2]|0)+24>>2]|0;c[m>>2]=c[e>>2];q=h&1;r=k;s=m;c[r+0>>2]=c[s+0>>2];uc[p&15](b,d,k,f,g,q);i=j;return}Ge(n,f);f=n;n=c[f>>2]|0;if(!((c[57624]|0)==-1)){c[l>>2]=230496;c[l+4>>2]=112;c[l+8>>2]=0;he(230496,l,113)}l=(c[230500>>2]|0)+ -1|0;q=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-q>>2>>>0>l>>>0)){t=Va(4)|0;u=t;gm(u);xb(t|0,238312,101)}n=c[q+(l<<2)>>2]|0;if((n|0)==0){t=Va(4)|0;u=t;gm(u);xb(t|0,238312,101)}t=n;Pd(c[f>>2]|0)|0;f=c[n>>2]|0;if(h){kc[c[f+24>>2]&63](o,t)}else{kc[c[f+28>>2]&63](o,t)}t=o;f=a[t]|0;if((f&1)==0){h=o+1|0;v=h;w=h;x=o+8|0}else{h=o+8|0;v=c[h>>2]|0;w=o+1|0;x=h}h=e;e=o+4|0;n=f;f=v;while(1){if((n&1)==0){y=w;z=(n&255)>>>1}else{y=c[x>>2]|0;z=c[e>>2]|0}if((f|0)==(y+z|0)){break}v=a[f]|0;u=c[h>>2]|0;do{if((u|0)!=0){l=u+24|0;q=c[l>>2]|0;if((q|0)!=(c[u+28>>2]|0)){c[l>>2]=q+1;a[q]=v;break}if(!((vc[c[(c[u>>2]|0)+52>>2]&15](u,v&255)|0)==-1)){break}c[h>>2]=0}}while(0);n=a[t]|0;f=f+1|0}c[b>>2]=c[h>>2];me(o);i=j;return}function bh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+24|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[229144|0]|0;a[s+1|0]=a[229145|0]|0;a[s+2|0]=a[229146|0]|0;a[s+3|0]=a[229147|0]|0;a[s+4|0]=a[229148|0]|0;a[s+5|0]=a[229149|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=m;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);v=c[57560]|0;c[k>>2]=h;h=ch(w,12,v,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==32){y=k}else if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Ge(q,f);dh(w,y,k,z,o,p,q);Pd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];gd(b,j,z,e,o,f,g);i=d;return}function ch(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+16|0;h=g;c[h>>2]=f;f=ib(d|0)|0;d=Lb(a|0,b|0,e|0,h|0)|0;if((f|0)==0){i=g;return d|0}ib(f|0)|0;i=g;return d|0}function dh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[57588]|0)==-1)){c[m>>2]=230352;c[m+4>>2]=112;c[m+8>>2]=0;he(230352,m,113)}m=(c[230356>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}q=j;r=c[o>>2]|0;if(!((c[57624]|0)==-1)){c[l>>2]=230496;c[l+4>>2]=112;c[l+8>>2]=0;he(230496,l,113)}l=(c[230500>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}s=r;kc[c[(c[r>>2]|0)+20>>2]&63](n,s);t=n;l=a[t]|0;if((l&1)==0){u=(l&255)>>>1}else{u=c[n+4>>2]|0}do{if((u|0)==0){sc[c[(c[j>>2]|0)+32>>2]&7](q,b,e,f)|0;c[h>>2]=f+(e-b)}else{c[h>>2]=f;l=a[b]|0;if(l<<24>>24==43|l<<24>>24==45){o=vc[c[(c[j>>2]|0)+28>>2]&15](q,l)|0;l=c[h>>2]|0;c[h>>2]=l+1;a[l]=o;v=b+1|0}else{v=b}do{if((e-v|0)>1){if((a[v]|0)!=48){w=v;break}o=v+1|0;l=a[o]|0;if(!(l<<24>>24==88|l<<24>>24==120)){w=v;break}l=j;m=vc[c[(c[l>>2]|0)+28>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=m;m=vc[c[(c[l>>2]|0)+28>>2]&15](q,a[o]|0)|0;o=c[h>>2]|0;c[h>>2]=o+1;a[o]=m;w=v+2|0}else{w=v}}while(0);do{if((w|0)!=(e|0)){m=e+ -1|0;if(m>>>0>w>>>0){x=w;y=m}else{break}do{m=a[x]|0;a[x]=a[y]|0;a[y]=m;x=x+1|0;y=y+ -1|0;}while(x>>>0<y>>>0)}}while(0);m=mc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(w>>>0<e>>>0){o=n+1|0;l=j;p=n+4|0;z=n+8|0;A=0;B=0;C=w;while(1){D=(a[t]&1)==0;do{if((a[(D?o:c[z>>2]|0)+B|0]|0)==0){E=A;F=B}else{if((A|0)!=(a[(D?o:c[z>>2]|0)+B|0]|0)){E=A;F=B;break}G=c[h>>2]|0;c[h>>2]=G+1;a[G]=m;G=a[t]|0;if((G&1)==0){H=(G&255)>>>1}else{H=c[p>>2]|0}E=0;F=(B>>>0<(H+ -1|0)>>>0)+B|0}}while(0);D=vc[c[(c[l>>2]|0)+28>>2]&15](q,a[C]|0)|0;G=c[h>>2]|0;c[h>>2]=G+1;a[G]=D;D=C+1|0;if(D>>>0<e>>>0){A=E+1|0;B=F;C=D}else{break}}}C=f+(w-b)|0;B=c[h>>2]|0;if((C|0)==(B|0)){break}A=B+ -1|0;if(A>>>0>C>>>0){I=C;J=A}else{break}do{A=a[I]|0;a[I]=a[J]|0;a[J]=A;I=I+1|0;J=J+ -1|0;}while(I>>>0<J>>>0)}}while(0);if((d|0)==(e|0)){K=c[h>>2]|0;c[g>>2]=K;me(n);i=k;return}else{K=f+(d-b)|0;c[g>>2]=K;me(n);i=k;return}}function eh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+48|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=100}}while(0);w=n;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);x=c[57560]|0;v=l;c[v>>2]=h;c[v+4>>2]=j;j=ch(w,22,x,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else if((t|0)==32){y=l}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Ge(r,f);dh(w,y,l,z,p,q,r);Pd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];gd(b,k,z,e,p,f,g);i=d;return}function fh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+24|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[229144|0]|0;a[s+1|0]=a[229145|0]|0;a[s+2|0]=a[229146|0]|0;a[s+3|0]=a[229147|0]|0;a[s+4|0]=a[229148|0]|0;a[s+5|0]=a[229149|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=117}}while(0);w=m;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);v=c[57560]|0;c[k>>2]=h;h=ch(w,12,v,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==32){y=k}else if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Ge(q,f);dh(w,y,k,z,o,p,q);Pd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];gd(b,j,z,e,o,f,g);i=d;return}function gh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+48|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=n;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);x=c[57560]|0;v=l;c[v>>2]=h;c[v+4>>2]=j;j=ch(w,23,x,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Ge(r,f);dh(w,y,l,z,p,q,r);Pd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];gd(b,k,z,e,p,f,g);i=d;return}function hh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+24|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+64|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){if((q&1|0)==0){a[D]=97;E=0;break}else{a[D]=65;E=0;break}}else{a[D]=46;B=D+2|0;a[D+1|0]=42;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=ch(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=ch(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[230248]|0)==0;if(E){do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=ih(s,r,z,n)|0}else{do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);o=c[57560]|0;c[m>>2]=c[f+8>>2];r=m+4|0;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=ih(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Nm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Bm(J<<1)|0;if((L|0)!=0){M=H;N=L;O=L;break}Nm()}}while(0);Ge(w,f);jh(M,K,F,O,u,v,w);Pd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];gd(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Cm(N)}if((I|0)==0){i=d;return}Cm(I);i=d;return}function ih(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;e=ib(b|0)|0;b=Gb(a|0,d|0,g|0)|0;if((e|0)==0){i=f;return b|0}ib(e|0)|0;i=f;return b|0}function jh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[57588]|0)==-1)){c[m>>2]=230352;c[m+4>>2]=112;c[m+8>>2]=0;he(230352,m,113)}m=(c[230356>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}q=j;r=c[o>>2]|0;if(!((c[57624]|0)==-1)){c[l>>2]=230496;c[l+4>>2]=112;c[l+8>>2]=0;he(230496,l,113)}l=(c[230500>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}s=r;kc[c[(c[r>>2]|0)+20>>2]&63](n,s);c[h>>2]=f;t=a[b]|0;if(t<<24>>24==43|t<<24>>24==45){l=vc[c[(c[j>>2]|0)+28>>2]&15](q,t)|0;t=c[h>>2]|0;c[h>>2]=t+1;a[t]=l;u=b+1|0}else{u=b}l=e;a:do{if((l-u|0)>1){if((a[u]|0)!=48){v=14;break}t=u+1|0;o=a[t]|0;if(!(o<<24>>24==88|o<<24>>24==120)){v=14;break}o=j;m=vc[c[(c[o>>2]|0)+28>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=m;m=u+2|0;p=vc[c[(c[o>>2]|0)+28>>2]&15](q,a[t]|0)|0;t=c[h>>2]|0;c[h>>2]=t+1;a[t]=p;if(m>>>0<e>>>0){w=m}else{x=m;y=m;break}while(1){p=a[w]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);t=w+1|0;if((Xa(p<<24>>24|0,c[57560]|0)|0)==0){x=m;y=w;break a}if(t>>>0<e>>>0){w=t}else{x=m;y=t;break}}}else{v=14}}while(0);b:do{if((v|0)==14){if(u>>>0<e>>>0){z=u}else{x=u;y=u;break}while(1){w=a[z]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);p=z+1|0;if((ub(w<<24>>24|0,c[57560]|0)|0)==0){x=u;y=z;break b}if(p>>>0<e>>>0){z=p}else{x=u;y=p;break}}}}while(0);u=n;z=a[u]|0;if((z&1)==0){A=(z&255)>>>1}else{A=c[n+4>>2]|0}do{if((A|0)==0){sc[c[(c[j>>2]|0)+32>>2]&7](q,x,y,c[h>>2]|0)|0;c[h>>2]=(c[h>>2]|0)+(y-x)}else{do{if((x|0)!=(y|0)){z=y+ -1|0;if(z>>>0>x>>>0){B=x;C=z}else{break}do{z=a[B]|0;a[B]=a[C]|0;a[C]=z;B=B+1|0;C=C+ -1|0;}while(B>>>0<C>>>0)}}while(0);w=mc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(x>>>0<y>>>0){z=n+1|0;v=n+4|0;p=n+8|0;m=j;t=0;o=0;D=x;while(1){E=(a[u]&1)==0;do{if((a[(E?z:c[p>>2]|0)+o|0]|0)>0){if((t|0)!=(a[(E?z:c[p>>2]|0)+o|0]|0)){F=t;G=o;break}H=c[h>>2]|0;c[h>>2]=H+1;a[H]=w;H=a[u]|0;if((H&1)==0){I=(H&255)>>>1}else{I=c[v>>2]|0}F=0;G=(o>>>0<(I+ -1|0)>>>0)+o|0}else{F=t;G=o}}while(0);E=vc[c[(c[m>>2]|0)+28>>2]&15](q,a[D]|0)|0;H=c[h>>2]|0;c[h>>2]=H+1;a[H]=E;E=D+1|0;if(E>>>0<y>>>0){t=F+1|0;o=G;D=E}else{break}}}D=f+(x-b)|0;o=c[h>>2]|0;if((D|0)==(o|0)){break}t=o+ -1|0;if(t>>>0>D>>>0){J=D;K=t}else{break}do{t=a[J]|0;a[J]=a[K]|0;a[K]=t;J=J+1|0;K=K+ -1|0;}while(J>>>0<K>>>0)}}while(0);c:do{if(y>>>0<e>>>0){K=j;J=y;while(1){x=a[J]|0;if(x<<24>>24==46){break}G=vc[c[(c[K>>2]|0)+28>>2]&15](q,x)|0;x=c[h>>2]|0;c[h>>2]=x+1;a[x]=G;G=J+1|0;if(G>>>0<e>>>0){J=G}else{L=G;break c}}K=mc[c[(c[r>>2]|0)+12>>2]&63](s)|0;G=c[h>>2]|0;c[h>>2]=G+1;a[G]=K;L=J+1|0}else{L=y}}while(0);sc[c[(c[j>>2]|0)+32>>2]&7](q,L,e,c[h>>2]|0)|0;q=(c[h>>2]|0)+(l-L)|0;c[h>>2]=q;if((d|0)==(e|0)){M=q;c[g>>2]=M;me(n);i=k;return}M=f+(d-b)|0;c[g>>2]=M;me(n);i=k;return}function kh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+64|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){a[D]=76;B=D+1|0;if((q&1|0)==0){a[B]=97;E=0;break}else{a[B]=65;E=0;break}}else{a[D]=46;a[D+1|0]=42;a[D+2|0]=76;B=D+3|0;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=ch(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=ch(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[230248]|0)==0;if(E){do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=ih(s,r,z,n)|0}else{do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);o=c[57560]|0;r=m;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=ih(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Nm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==32){K=F}else if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Bm(J<<1)|0;if((L|0)!=0){M=H;N=L;O=L;break}Nm()}}while(0);Ge(w,f);jh(M,K,F,O,u,v,w);Pd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];gd(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Cm(N)}if((I|0)==0){i=d;return}Cm(I);i=d;return}function lh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+16|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+40|0;p=i;i=i+8|0;q=i;i=i+8|0;r=m;a[r+0|0]=a[229152|0]|0;a[r+1|0]=a[229153|0]|0;a[r+2|0]=a[229154|0]|0;a[r+3|0]=a[229155|0]|0;a[r+4|0]=a[229156|0]|0;a[r+5|0]=a[229157|0]|0;m=n;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);s=c[57560]|0;c[k>>2]=h;h=ch(m,20,s,r,k)|0;k=n+h|0;r=c[f+4>>2]&176;do{if((r|0)==32){t=k}else if((r|0)==16){s=a[m]|0;if(s<<24>>24==43|s<<24>>24==45){t=n+1|0;break}if(!((h|0)>1&s<<24>>24==48)){u=10;break}s=a[n+1|0]|0;if(!(s<<24>>24==88|s<<24>>24==120)){u=10;break}t=n+2|0}else{u=10}}while(0);if((u|0)==10){t=m}u=o;Ge(p,f);r=p;p=c[r>>2]|0;if(!((c[57588]|0)==-1)){c[l>>2]=230352;c[l+4>>2]=112;c[l+8>>2]=0;he(230352,l,113)}l=(c[230356>>2]|0)+ -1|0;s=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-s>>2>>>0>l>>>0)){v=Va(4)|0;w=v;gm(w);xb(v|0,238312,101)}p=c[s+(l<<2)>>2]|0;if((p|0)==0){v=Va(4)|0;w=v;gm(w);xb(v|0,238312,101)}Pd(c[r>>2]|0)|0;sc[c[(c[p>>2]|0)+32>>2]&7](p,m,k,u)|0;m=o+h|0;if((t|0)==(k|0)){x=m;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];gd(b,j,u,x,m,f,g);E=j;i=d;return}x=o+(t-n)|0;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];gd(b,j,u,x,m,f,g);E=j;i=d;return}function mh(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function nh(a){a=a|0;i=i;return}function oh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;j=i;i=i+56|0;k=j;l=j+8|0;m=j+24|0;n=j+32|0;o=j+40|0;if((c[f+4>>2]&1|0)==0){p=c[(c[d>>2]|0)+24>>2]|0;c[m>>2]=c[e>>2];q=h&1;r=k;s=m;c[r+0>>2]=c[s+0>>2];uc[p&15](b,d,k,f,g,q);i=j;return}Ge(n,f);f=n;n=c[f>>2]|0;if(!((c[57626]|0)==-1)){c[l>>2]=230504;c[l+4>>2]=112;c[l+8>>2]=0;he(230504,l,113)}l=(c[230508>>2]|0)+ -1|0;q=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-q>>2>>>0>l>>>0)){t=Va(4)|0;u=t;gm(u);xb(t|0,238312,101)}n=c[q+(l<<2)>>2]|0;if((n|0)==0){t=Va(4)|0;u=t;gm(u);xb(t|0,238312,101)}t=n;Pd(c[f>>2]|0)|0;f=c[n>>2]|0;if(h){kc[c[f+24>>2]&63](o,t)}else{kc[c[f+28>>2]&63](o,t)}t=o;f=a[t]|0;if((f&1)==0){h=o+4|0;v=h;w=o+8|0;x=h}else{h=o+8|0;v=c[h>>2]|0;w=h;x=o+4|0}h=e;e=f;f=v;while(1){if((e&1)==0){y=x;z=(e&255)>>>1}else{y=c[w>>2]|0;z=c[x>>2]|0}if((f|0)==(y+(z<<2)|0)){break}v=c[f>>2]|0;n=c[h>>2]|0;do{if((n|0)!=0){u=n+24|0;l=c[u>>2]|0;if((l|0)==(c[n+28>>2]|0)){A=vc[c[(c[n>>2]|0)+52>>2]&15](n,v)|0}else{c[u>>2]=l+4;c[l>>2]=v;A=v}if(!((A|0)==-1)){break}c[h>>2]=0}}while(0);e=a[t]|0;f=f+4|0}c[b>>2]=c[h>>2];xe(o);i=j;return}function ph(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+88|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[229144|0]|0;a[s+1|0]=a[229145|0]|0;a[s+2|0]=a[229146|0]|0;a[s+3|0]=a[229147|0]|0;a[s+4|0]=a[229148|0]|0;a[s+5|0]=a[229149|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==64){a[w]=111}else if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else{a[w]=100}}while(0);w=m;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);v=c[57560]|0;c[k>>2]=h;h=ch(w,12,v,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==32){y=k}else if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Ge(q,f);qh(w,y,k,z,o,p,q);Pd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];rh(b,j,z,e,o,f,g);i=d;return}function qh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[57586]|0)==-1)){c[m>>2]=230344;c[m+4>>2]=112;c[m+8>>2]=0;he(230344,m,113)}m=(c[230348>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}q=j;r=c[o>>2]|0;if(!((c[57626]|0)==-1)){c[l>>2]=230504;c[l+4>>2]=112;c[l+8>>2]=0;he(230504,l,113)}l=(c[230508>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}s=r;kc[c[(c[r>>2]|0)+20>>2]&63](n,s);t=n;l=a[t]|0;if((l&1)==0){u=(l&255)>>>1}else{u=c[n+4>>2]|0}do{if((u|0)==0){sc[c[(c[j>>2]|0)+48>>2]&7](q,b,e,f)|0;l=f+(e-b<<2)|0;c[h>>2]=l;v=l}else{c[h>>2]=f;l=a[b]|0;if(l<<24>>24==43|l<<24>>24==45){o=vc[c[(c[j>>2]|0)+44>>2]&15](q,l)|0;l=c[h>>2]|0;c[h>>2]=l+4;c[l>>2]=o;w=b+1|0}else{w=b}do{if((e-w|0)>1){if((a[w]|0)!=48){x=w;break}o=w+1|0;l=a[o]|0;if(!(l<<24>>24==88|l<<24>>24==120)){x=w;break}l=j;m=vc[c[(c[l>>2]|0)+44>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=m;m=vc[c[(c[l>>2]|0)+44>>2]&15](q,a[o]|0)|0;o=c[h>>2]|0;c[h>>2]=o+4;c[o>>2]=m;x=w+2|0}else{x=w}}while(0);do{if((x|0)!=(e|0)){m=e+ -1|0;if(m>>>0>x>>>0){y=x;z=m}else{break}do{m=a[y]|0;a[y]=a[z]|0;a[z]=m;y=y+1|0;z=z+ -1|0;}while(y>>>0<z>>>0)}}while(0);m=mc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(x>>>0<e>>>0){o=n+1|0;l=j;p=n+4|0;A=n+8|0;B=0;C=0;D=x;while(1){E=(a[t]&1)==0;do{if((a[(E?o:c[A>>2]|0)+C|0]|0)==0){F=B;G=C}else{if((B|0)!=(a[(E?o:c[A>>2]|0)+C|0]|0)){F=B;G=C;break}H=c[h>>2]|0;c[h>>2]=H+4;c[H>>2]=m;H=a[t]|0;if((H&1)==0){I=(H&255)>>>1}else{I=c[p>>2]|0}F=0;G=(C>>>0<(I+ -1|0)>>>0)+C|0}}while(0);E=vc[c[(c[l>>2]|0)+44>>2]&15](q,a[D]|0)|0;H=c[h>>2]|0;J=H+4|0;c[h>>2]=J;c[H>>2]=E;E=D+1|0;if(E>>>0<e>>>0){B=F+1|0;C=G;D=E}else{K=J;break}}}else{K=c[h>>2]|0}D=f+(x-b<<2)|0;if((D|0)==(K|0)){v=K;break}C=K+ -4|0;if(C>>>0>D>>>0){L=D;M=C}else{v=K;break}while(1){C=c[L>>2]|0;c[L>>2]=c[M>>2];c[M>>2]=C;C=L+4|0;D=M+ -4|0;if(C>>>0<D>>>0){M=D;L=C}else{v=K;break}}}}while(0);if((d|0)==(e|0)){N=v;c[g>>2]=N;me(n);i=k;return}N=f+(d-b<<2)|0;c[g>>2]=N;me(n);i=k;return}function rh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;k=i;i=i+16|0;l=k;m=d;d=c[m>>2]|0;if((d|0)==0){c[b>>2]=0;i=k;return}n=g;g=e;o=n-g>>2;p=h+12|0;h=c[p>>2]|0;q=(h|0)>(o|0)?h-o|0:0;o=f;h=o-g|0;g=h>>2;do{if((h|0)>0){if((gc[c[(c[d>>2]|0)+48>>2]&31](d,e,g)|0)==(g|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);do{if((q|0)>0){we(l,q,j);if((a[l]&1)==0){r=l+4|0}else{r=c[l+8>>2]|0}if((gc[c[(c[d>>2]|0)+48>>2]&31](d,r,q)|0)==(q|0)){xe(l);break}c[m>>2]=0;c[b>>2]=0;xe(l);i=k;return}}while(0);l=n-o|0;o=l>>2;do{if((l|0)>0){if((gc[c[(c[d>>2]|0)+48>>2]&31](d,f,o)|0)==(o|0)){break}c[m>>2]=0;c[b>>2]=0;i=k;return}}while(0);c[p>>2]=0;c[b>>2]=d;i=k;return}function sh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+168|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=100}}while(0);w=n;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);x=c[57560]|0;v=l;c[v>>2]=h;c[v+4>>2]=j;j=ch(w,22,x,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Ge(r,f);qh(w,y,l,z,p,q,r);Pd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];rh(b,k,z,e,p,f,g);i=d;return}function th(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+8|0;m=i;i=i+16|0;n=i;i=i+88|0;o=i;i=i+8|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=l;a[s+0|0]=a[229144|0]|0;a[s+1|0]=a[229145|0]|0;a[s+2|0]=a[229146|0]|0;a[s+3|0]=a[229147|0]|0;a[s+4|0]=a[229148|0]|0;a[s+5|0]=a[229149|0]|0;t=l+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=t}else{a[t]=43;w=l+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}a[x]=108;w=x+1|0;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=m;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);x=c[57560]|0;c[k>>2]=h;h=ch(w,12,x,s,k)|0;k=m+h|0;s=c[u>>2]&176;do{if((s|0)==32){y=k}else if((s|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=m+1|0;break}if(!((h|0)>1&u<<24>>24==48)){z=20;break}u=a[m+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=m+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=n;Ge(q,f);qh(w,y,k,z,o,p,q);Pd(c[q>>2]|0)|0;c[r>>2]=c[e>>2];e=c[o>>2]|0;o=c[p>>2]|0;p=j;q=r;c[p+0>>2]=c[q+0>>2];rh(b,j,z,e,o,f,g);i=d;return}function uh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+16|0;k=d;l=d+8|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+176|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=m;c[t>>2]=37;c[t+4>>2]=0;t=m;m=t+1|0;u=f+4|0;v=c[u>>2]|0;if((v&2048|0)==0){w=m}else{a[m]=43;w=t+2|0}if((v&512|0)==0){x=w}else{a[w]=35;x=w+1|0}w=x+2|0;a[x]=108;a[x+1|0]=108;x=v&74;do{if((x|0)==8){if((v&16384|0)==0){a[w]=120;break}else{a[w]=88;break}}else if((x|0)==64){a[w]=111}else{a[w]=117}}while(0);w=n;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);x=c[57560]|0;v=l;c[v>>2]=h;c[v+4>>2]=j;j=ch(w,23,x,t,l)|0;l=n+j|0;t=c[u>>2]&176;do{if((t|0)==32){y=l}else if((t|0)==16){u=a[w]|0;if(u<<24>>24==43|u<<24>>24==45){y=n+1|0;break}if(!((j|0)>1&u<<24>>24==48)){z=20;break}u=a[n+1|0]|0;if(!(u<<24>>24==88|u<<24>>24==120)){z=20;break}y=n+2|0}else{z=20}}while(0);if((z|0)==20){y=w}z=o;Ge(r,f);qh(w,y,l,z,p,q,r);Pd(c[r>>2]|0)|0;c[s>>2]=c[e>>2];e=c[p>>2]|0;p=c[q>>2]|0;q=k;r=s;c[q+0>>2]=c[r+0>>2];rh(b,k,z,e,p,f,g);i=d;return}function vh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+24|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+232|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){if((q&1|0)==0){a[D]=97;E=0;break}else{a[D]=65;E=0;break}}else{a[D]=46;B=D+2|0;a[D+1|0]=42;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=ch(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=ch(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[230248]|0)==0;if(E){do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=ih(s,r,z,n)|0}else{do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);o=c[57560]|0;c[m>>2]=c[f+8>>2];r=m+4|0;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=ih(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Nm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else if((s|0)==32){K=F}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Bm(J<<3)|0;s=L;if((L|0)!=0){M=H;N=s;O=s;break}Nm()}}while(0);Ge(w,f);wh(M,K,F,O,u,v,w);Pd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];rh(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Cm(N)}if((I|0)==0){i=d;return}Cm(I);i=d;return}function wh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;k=i;i=i+48|0;l=k;m=k+16|0;n=k+32|0;o=j;j=c[o>>2]|0;if(!((c[57586]|0)==-1)){c[m>>2]=230344;c[m+4>>2]=112;c[m+8>>2]=0;he(230344,m,113)}m=(c[230348>>2]|0)+ -1|0;p=c[j+8>>2]|0;if(!((c[j+12>>2]|0)-p>>2>>>0>m>>>0)){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}j=c[p+(m<<2)>>2]|0;if((j|0)==0){q=Va(4)|0;r=q;gm(r);xb(q|0,238312,101)}q=j;r=c[o>>2]|0;if(!((c[57626]|0)==-1)){c[l>>2]=230504;c[l+4>>2]=112;c[l+8>>2]=0;he(230504,l,113)}l=(c[230508>>2]|0)+ -1|0;o=c[r+8>>2]|0;if(!((c[r+12>>2]|0)-o>>2>>>0>l>>>0)){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}r=c[o+(l<<2)>>2]|0;if((r|0)==0){s=Va(4)|0;t=s;gm(t);xb(s|0,238312,101)}s=r;kc[c[(c[r>>2]|0)+20>>2]&63](n,s);c[h>>2]=f;t=a[b]|0;if(t<<24>>24==43|t<<24>>24==45){l=vc[c[(c[j>>2]|0)+44>>2]&15](q,t)|0;t=c[h>>2]|0;c[h>>2]=t+4;c[t>>2]=l;u=b+1|0}else{u=b}l=e;a:do{if((l-u|0)>1){if((a[u]|0)!=48){v=14;break}t=u+1|0;o=a[t]|0;if(!(o<<24>>24==88|o<<24>>24==120)){v=14;break}o=j;m=vc[c[(c[o>>2]|0)+44>>2]&15](q,48)|0;p=c[h>>2]|0;c[h>>2]=p+4;c[p>>2]=m;m=u+2|0;p=vc[c[(c[o>>2]|0)+44>>2]&15](q,a[t]|0)|0;t=c[h>>2]|0;c[h>>2]=t+4;c[t>>2]=p;if(m>>>0<e>>>0){w=m}else{x=m;y=m;break}while(1){p=a[w]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);t=w+1|0;if((Xa(p<<24>>24|0,c[57560]|0)|0)==0){x=m;y=w;break a}if(t>>>0<e>>>0){w=t}else{x=m;y=t;break}}}else{v=14}}while(0);b:do{if((v|0)==14){if(u>>>0<e>>>0){z=u}else{x=u;y=u;break}while(1){w=a[z]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);p=z+1|0;if((ub(w<<24>>24|0,c[57560]|0)|0)==0){x=u;y=z;break b}if(p>>>0<e>>>0){z=p}else{x=u;y=p;break}}}}while(0);u=n;z=a[u]|0;if((z&1)==0){A=(z&255)>>>1}else{A=c[n+4>>2]|0}do{if((A|0)==0){sc[c[(c[j>>2]|0)+48>>2]&7](q,x,y,c[h>>2]|0)|0;z=(c[h>>2]|0)+(y-x<<2)|0;c[h>>2]=z;B=z}else{do{if((x|0)!=(y|0)){z=y+ -1|0;if(z>>>0>x>>>0){C=x;D=z}else{break}do{z=a[C]|0;a[C]=a[D]|0;a[D]=z;C=C+1|0;D=D+ -1|0;}while(C>>>0<D>>>0)}}while(0);w=mc[c[(c[r>>2]|0)+16>>2]&63](s)|0;if(x>>>0<y>>>0){z=n+1|0;v=n+4|0;p=n+8|0;m=j;t=0;o=0;E=x;while(1){F=(a[u]&1)==0;do{if((a[(F?z:c[p>>2]|0)+o|0]|0)>0){if((t|0)!=(a[(F?z:c[p>>2]|0)+o|0]|0)){G=t;H=o;break}I=c[h>>2]|0;c[h>>2]=I+4;c[I>>2]=w;I=a[u]|0;if((I&1)==0){J=(I&255)>>>1}else{J=c[v>>2]|0}G=0;H=(o>>>0<(J+ -1|0)>>>0)+o|0}else{G=t;H=o}}while(0);F=vc[c[(c[m>>2]|0)+44>>2]&15](q,a[E]|0)|0;I=c[h>>2]|0;K=I+4|0;c[h>>2]=K;c[I>>2]=F;F=E+1|0;if(F>>>0<y>>>0){t=G+1|0;o=H;E=F}else{L=K;break}}}else{L=c[h>>2]|0}E=f+(x-b<<2)|0;if((E|0)==(L|0)){B=L;break}o=L+ -4|0;if(o>>>0>E>>>0){M=E;N=o}else{B=L;break}while(1){o=c[M>>2]|0;c[M>>2]=c[N>>2];c[N>>2]=o;o=M+4|0;E=N+ -4|0;if(o>>>0<E>>>0){N=E;M=o}else{B=L;break}}}}while(0);c:do{if(y>>>0<e>>>0){L=j;M=y;while(1){N=a[M]|0;if(N<<24>>24==46){break}x=vc[c[(c[L>>2]|0)+44>>2]&15](q,N)|0;N=c[h>>2]|0;H=N+4|0;c[h>>2]=H;c[N>>2]=x;x=M+1|0;if(x>>>0<e>>>0){M=x}else{O=H;P=x;break c}}L=mc[c[(c[r>>2]|0)+12>>2]&63](s)|0;x=c[h>>2]|0;H=x+4|0;c[h>>2]=H;c[x>>2]=L;O=H;P=M+1|0}else{O=B;P=y}}while(0);sc[c[(c[j>>2]|0)+48>>2]&7](q,P,e,O)|0;O=(c[h>>2]|0)+(l-P<<2)|0;c[h>>2]=O;if((d|0)==(e|0)){Q=O;c[g>>2]=Q;me(n);i=k;return}Q=f+(d-b<<2)|0;c[g>>2]=Q;me(n);i=k;return}function xh(b,d,e,f,g,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=+j;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+8|0;r=i;i=i+32|0;s=i;i=i+8|0;t=i;i=i+232|0;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;z=q;c[z>>2]=37;c[z+4>>2]=0;z=q;q=z+1|0;A=f+4|0;B=c[A>>2]|0;if((B&2048|0)==0){C=q}else{a[q]=43;C=z+2|0}if((B&1024|0)==0){D=C}else{a[C]=35;D=C+1|0}C=B&260;q=B>>>14;do{if((C|0)==260){a[D]=76;B=D+1|0;if((q&1|0)==0){a[B]=97;E=0;break}else{a[B]=65;E=0;break}}else{a[D]=46;a[D+1|0]=42;a[D+2|0]=76;B=D+3|0;if((C|0)==256){if((q&1|0)==0){a[B]=101;E=1;break}else{a[B]=69;E=1;break}}else if((C|0)==4){if((q&1|0)==0){a[B]=102;E=1;break}else{a[B]=70;E=1;break}}else{if((q&1|0)==0){a[B]=103;E=1;break}else{a[B]=71;E=1;break}}}}while(0);q=r;c[s>>2]=q;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;if(E){c[p>>2]=c[f+8>>2];C=p+4|0;h[k>>3]=j;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];F=ch(q,30,r,z,p)|0}else{p=o;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];F=ch(q,30,r,z,o)|0}do{if((F|0)>29){o=(a[230248]|0)==0;if(E){do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);r=c[57560]|0;c[n>>2]=c[f+8>>2];p=n+4|0;h[k>>3]=j;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];G=ih(s,r,z,n)|0}else{do{if(o){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);o=c[57560]|0;r=m;h[k>>3]=j;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];G=ih(s,o,z,m)|0}o=c[s>>2]|0;if((o|0)!=0){H=o;I=o;J=G;break}Nm()}else{H=c[s>>2]|0;I=0;J=F}}while(0);F=H+J|0;s=c[A>>2]&176;do{if((s|0)==16){A=a[H]|0;if(A<<24>>24==43|A<<24>>24==45){K=H+1|0;break}if(!((J|0)>1&A<<24>>24==48)){L=44;break}A=a[H+1|0]|0;if(!(A<<24>>24==88|A<<24>>24==120)){L=44;break}K=H+2|0}else if((s|0)==32){K=F}else{L=44}}while(0);if((L|0)==44){K=H}do{if((H|0)==(q|0)){M=q;N=0;O=t}else{L=Bm(J<<3)|0;s=L;if((L|0)!=0){M=H;N=s;O=s;break}Nm()}}while(0);Ge(w,f);wh(M,K,F,O,u,v,w);Pd(c[w>>2]|0)|0;w=e;c[y>>2]=c[w>>2];e=c[u>>2]|0;u=c[v>>2]|0;v=l;F=y;c[v+0>>2]=c[F+0>>2];rh(x,l,O,e,u,f,g);g=c[x>>2]|0;c[w>>2]=g;c[b>>2]=g;if((N|0)!=0){Cm(N)}if((I|0)==0){i=d;return}Cm(I);i=d;return}function yh(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+16|0;j=d;k=d+8|0;l=i;i=i+16|0;m=i;i=i+8|0;n=i;i=i+24|0;o=i;i=i+152|0;p=i;i=i+8|0;q=i;i=i+8|0;r=m;a[r+0|0]=a[229152|0]|0;a[r+1|0]=a[229153|0]|0;a[r+2|0]=a[229154|0]|0;a[r+3|0]=a[229155|0]|0;a[r+4|0]=a[229156|0]|0;a[r+5|0]=a[229157|0]|0;m=n;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);s=c[57560]|0;c[k>>2]=h;h=ch(m,20,s,r,k)|0;k=n+h|0;r=c[f+4>>2]&176;do{if((r|0)==32){t=k}else if((r|0)==16){s=a[m]|0;if(s<<24>>24==43|s<<24>>24==45){t=n+1|0;break}if(!((h|0)>1&s<<24>>24==48)){u=10;break}s=a[n+1|0]|0;if(!(s<<24>>24==88|s<<24>>24==120)){u=10;break}t=n+2|0}else{u=10}}while(0);if((u|0)==10){t=m}Ge(p,f);u=p;p=c[u>>2]|0;if(!((c[57586]|0)==-1)){c[l>>2]=230344;c[l+4>>2]=112;c[l+8>>2]=0;he(230344,l,113)}l=(c[230348>>2]|0)+ -1|0;r=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-r>>2>>>0>l>>>0)){v=Va(4)|0;w=v;gm(w);xb(v|0,238312,101)}p=c[r+(l<<2)>>2]|0;if((p|0)==0){v=Va(4)|0;w=v;gm(w);xb(v|0,238312,101)}Pd(c[u>>2]|0)|0;u=o;sc[c[(c[p>>2]|0)+48>>2]&7](p,m,k,u)|0;m=o+(h<<2)|0;if((t|0)==(k|0)){x=m;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];rh(b,j,u,x,m,f,g);E=j;i=d;return}x=o+(t-n<<2)|0;y=e;z=c[y>>2]|0;A=q;c[A>>2]=z;B=j;C=j;D=q;c[C+0>>2]=c[D+0>>2];rh(b,j,u,x,m,f,g);E=j;i=d;return}function zh(e,f,g,h,j,k,l,m,n){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0;o=i;i=i+64|0;p=o;q=o+8|0;r=o+16|0;s=o+32|0;t=o+40|0;u=o+48|0;v=o+56|0;Ge(s,j);w=s;s=c[w>>2]|0;if(!((c[57588]|0)==-1)){c[r>>2]=230352;c[r+4>>2]=112;c[r+8>>2]=0;he(230352,r,113)}r=(c[230356>>2]|0)+ -1|0;x=c[s+8>>2]|0;if(!((c[s+12>>2]|0)-x>>2>>>0>r>>>0)){y=Va(4)|0;z=y;gm(z);xb(y|0,238312,101)}s=c[x+(r<<2)>>2]|0;if((s|0)==0){y=Va(4)|0;z=y;gm(z);xb(y|0,238312,101)}y=s;Pd(c[w>>2]|0)|0;c[k>>2]=0;w=g;a:do{if((m|0)==(n|0)){A=65}else{z=h;r=s;x=s+8|0;B=s;C=f;D=u;E=v;F=t;G=m;H=0;b:while(1){I=H;while(1){if((I|0)!=0){A=65;break a}J=c[w>>2]|0;do{if((J|0)==0){K=0}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){K=J;break}if(!((mc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1)){K=J;break}c[w>>2]=0;K=0}}while(0);J=(K|0)==0;L=c[z>>2]|0;c:do{if((L|0)==0){A=19}else{do{if((c[L+12>>2]|0)==(c[L+16>>2]|0)){if(!((mc[c[(c[L>>2]|0)+36>>2]&63](L)|0)==-1)){break}c[z>>2]=0;A=19;break c}}while(0);if(J){M=L}else{A=20;break b}}}while(0);if((A|0)==19){A=0;if(J){A=20;break b}else{M=0}}if((gc[c[(c[r>>2]|0)+36>>2]&31](y,a[G]|0,0)|0)<<24>>24==37){A=22;break}L=a[G]|0;if(L<<24>>24>-1){N=c[x>>2]|0;if(!((b[N+(L<<24>>24<<1)>>1]&8192)==0)){O=G;A=33;break}}P=K+12|0;L=c[P>>2]|0;Q=K+16|0;if((L|0)==(c[Q>>2]|0)){R=mc[c[(c[K>>2]|0)+36>>2]&63](K)|0}else{R=d[L]|0}L=vc[c[(c[B>>2]|0)+12>>2]&15](y,R&255)|0;if(L<<24>>24==(vc[c[(c[B>>2]|0)+12>>2]&15](y,a[G]|0)|0)<<24>>24){A=60;break}c[k>>2]=4;I=4}d:do{if((A|0)==22){A=0;I=G+1|0;if((I|0)==(n|0)){A=23;break b}L=gc[c[(c[r>>2]|0)+36>>2]&31](y,a[I]|0,0)|0;if(L<<24>>24==48|L<<24>>24==69){S=G+2|0;if((S|0)==(n|0)){A=26;break b}T=S;U=gc[c[(c[r>>2]|0)+36>>2]&31](y,a[S]|0,0)|0;V=L}else{T=I;U=L;V=0}L=c[(c[C>>2]|0)+36>>2]|0;c[D>>2]=K;c[E>>2]=M;I=q;S=u;c[I+0>>2]=c[S+0>>2];S=p;I=v;c[S+0>>2]=c[I+0>>2];lc[L&3](t,f,q,p,j,k,l,U,V);c[w>>2]=c[F>>2];W=T+1|0}else if((A|0)==33){while(1){A=0;L=O+1|0;if((L|0)==(n|0)){X=n;break}I=a[L]|0;if(!(I<<24>>24>-1)){X=L;break}if((b[N+(I<<24>>24<<1)>>1]&8192)==0){X=L;break}else{O=L;A=33}}J=K;L=M;I=M;while(1){do{if((J|0)==0){Y=0}else{if((c[J+12>>2]|0)!=(c[J+16>>2]|0)){Y=J;break}if(!((mc[c[(c[J>>2]|0)+36>>2]&63](J)|0)==-1)){Y=J;break}c[w>>2]=0;Y=0}}while(0);S=(Y|0)==0;do{if((I|0)==0){Z=L;A=46}else{if((c[I+12>>2]|0)!=(c[I+16>>2]|0)){if(S){_=L;$=I;break}else{W=X;break d}}if((mc[c[(c[I>>2]|0)+36>>2]&63](I)|0)==-1){c[z>>2]=0;Z=0;A=46;break}else{if(S^(L|0)==0){_=L;$=L;break}else{W=X;break d}}}}while(0);if((A|0)==46){A=0;if(S){W=X;break d}else{_=Z;$=0}}aa=Y+12|0;ba=c[aa>>2]|0;ca=Y+16|0;if((ba|0)==(c[ca>>2]|0)){da=mc[c[(c[Y>>2]|0)+36>>2]&63](Y)|0}else{da=d[ba]|0}if(!((da&255)<<24>>24>-1)){W=X;break d}if((b[(c[x>>2]|0)+(da<<24>>24<<1)>>1]&8192)==0){W=X;break d}ba=c[aa>>2]|0;if((ba|0)==(c[ca>>2]|0)){mc[c[(c[Y>>2]|0)+40>>2]&63](Y)|0;J=Y;L=_;I=$;continue}else{c[aa>>2]=ba+1;J=Y;L=_;I=$;continue}}}else if((A|0)==60){A=0;I=c[P>>2]|0;if((I|0)==(c[Q>>2]|0)){mc[c[(c[K>>2]|0)+40>>2]&63](K)|0}else{c[P>>2]=I+1}W=G+1|0}}while(0);if((W|0)==(n|0)){A=65;break a}G=W;H=c[k>>2]|0}if((A|0)==20){c[k>>2]=4;ea=K;break}else if((A|0)==23){c[k>>2]=4;ea=K;break}else if((A|0)==26){c[k>>2]=4;ea=K;break}}}while(0);if((A|0)==65){ea=c[w>>2]|0}w=g;do{if((ea|0)==0){fa=0}else{if((c[ea+12>>2]|0)!=(c[ea+16>>2]|0)){fa=ea;break}if(!((mc[c[(c[ea>>2]|0)+36>>2]&63](ea)|0)==-1)){fa=ea;break}c[w>>2]=0;fa=0}}while(0);w=(fa|0)==0;ea=h;h=c[ea>>2]|0;e:do{if((h|0)==0){A=75}else{do{if((c[h+12>>2]|0)==(c[h+16>>2]|0)){if(!((mc[c[(c[h>>2]|0)+36>>2]&63](h)|0)==-1)){break}c[ea>>2]=0;A=75;break e}}while(0);if(!w){break}ga=e;c[ga>>2]=fa;i=o;return}}while(0);do{if((A|0)==75){if(w){break}ga=e;c[ga>>2]=fa;i=o;return}}while(0);c[k>>2]=c[k>>2]|2;ga=e;c[ga>>2]=fa;i=o;return}function Ah(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Bh(a){a=a|0;i=i;return}function Ch(a){a=a|0;i=i;return 2}function Dh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;k=j;l=j+8|0;m=j+16|0;n=j+24|0;c[m>>2]=c[d>>2];c[n>>2]=c[e>>2];e=l;d=m;c[e+0>>2]=c[d+0>>2];d=k;e=n;c[d+0>>2]=c[e+0>>2];zh(a,b,l,k,f,g,h,229256,229264|0);i=j;return}function Eh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=d+8|0;q=mc[c[(c[p>>2]|0)+20>>2]&63](p)|0;c[n>>2]=c[e>>2];c[o>>2]=c[f>>2];f=a[q]|0;if((f&1)==0){r=q+1|0;s=q+1|0;t=(f&255)>>>1}else{f=c[q+8>>2]|0;r=f;s=f;t=c[q+4>>2]|0}q=r+t|0;t=m;r=n;c[t+0>>2]=c[r+0>>2];r=l;t=o;c[r+0>>2]=c[t+0>>2];zh(b,d,m,l,g,h,j,s,q);i=k;return}function Fh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Ge(n,f);f=n;n=c[f>>2]|0;if(!((c[57588]|0)==-1)){c[m>>2]=230352;c[m+4>>2]=112;c[m+8>>2]=0;he(230352,m,113)}m=(c[230356>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}p=n;Pd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=mc[c[c[e>>2]>>2]&63](e)|0;c[l>>2]=f;f=b+168|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=ag(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=168){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+24>>2]=((g|0)/12|0|0)%7|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Gh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Ge(n,f);f=n;n=c[f>>2]|0;if(!((c[57588]|0)==-1)){c[m>>2]=230352;c[m+4>>2]=112;c[m+8>>2]=0;he(230352,m,113)}m=(c[230356>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}p=n;Pd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=mc[c[(c[e>>2]|0)+4>>2]&63](e)|0;c[l>>2]=f;f=b+288|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=ag(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=288){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+16>>2]=((g|0)/12|0|0)%12|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Hh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;b=i;i=i+40|0;j=b;k=b+8|0;l=b+16|0;m=b+32|0;Ge(m,f);f=m;m=c[f>>2]|0;if(!((c[57588]|0)==-1)){c[l>>2]=230352;c[l+4>>2]=112;c[l+8>>2]=0;he(230352,l,113)}l=(c[230356>>2]|0)+ -1|0;n=c[m+8>>2]|0;if(!((c[m+12>>2]|0)-n>>2>>>0>l>>>0)){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}m=c[n+(l<<2)>>2]|0;if((m|0)==0){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}o=m;Pd(c[f>>2]|0)|0;f=h+20|0;c[k>>2]=c[e>>2];e=j;h=k;c[e+0>>2]=c[h+0>>2];h=Lh(d,j,g,o,4)|0;if((c[g>>2]&4|0)!=0){q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}if((h|0)<69){t=h+2e3|0}else{t=(h+ -69|0)>>>0<31?h+1900|0:h}c[f>>2]=t+ -1900;q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}function Ih(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;l=i;i=i+576|0;m=l;n=l+8|0;o=l+16|0;p=l+24|0;q=l+32|0;r=l+40|0;s=l+48|0;t=l+56|0;u=l+64|0;v=l+72|0;w=l+80|0;x=l+88|0;y=l+96|0;z=l+104|0;A=l+112|0;B=l+120|0;C=l+128|0;D=l+136|0;E=l+144|0;F=l+152|0;G=l+160|0;H=l+168|0;I=l+176|0;J=l+184|0;K=l+192|0;L=l+200|0;M=l+208|0;N=l+216|0;O=l+224|0;P=l+232|0;Q=l+240|0;R=l+248|0;S=l+256|0;T=l+264|0;U=l+272|0;V=l+280|0;W=l+288|0;X=l+296|0;Y=l+304|0;Z=l+312|0;_=l+320|0;$=l+328|0;aa=l+336|0;ba=l+344|0;ca=l+352|0;da=l+368|0;ea=l+376|0;fa=l+384|0;ga=l+392|0;ha=l+400|0;ia=l+408|0;ja=l+416|0;ka=l+424|0;la=l+432|0;ma=l+440|0;na=l+448|0;oa=l+456|0;pa=l+464|0;qa=l+472|0;ra=l+480|0;sa=l+488|0;ta=l+496|0;ua=l+504|0;va=l+512|0;wa=l+520|0;xa=l+528|0;ya=l+536|0;za=l+544|0;Aa=l+552|0;Ba=l+560|0;Ca=l+568|0;c[h>>2]=0;Ge(da,g);Da=da;da=c[Da>>2]|0;if(!((c[57588]|0)==-1)){c[ca>>2]=230352;c[ca+4>>2]=112;c[ca+8>>2]=0;he(230352,ca,113)}ca=(c[230356>>2]|0)+ -1|0;Ea=c[da+8>>2]|0;if(!((c[da+12>>2]|0)-Ea>>2>>>0>ca>>>0)){Fa=Va(4)|0;Ga=Fa;gm(Ga);xb(Fa|0,238312,101)}da=c[Ea+(ca<<2)>>2]|0;if((da|0)==0){Fa=Va(4)|0;Ga=Fa;gm(Ga);xb(Fa|0,238312,101)}Fa=da;Pd(c[Da>>2]|0)|0;a:do{switch(k<<24>>24|0){case 99:{Da=d+8|0;da=mc[c[(c[Da>>2]|0)+12>>2]&63](Da)|0;Da=e;c[fa>>2]=c[Da>>2];c[ga>>2]=c[f>>2];Ga=a[da]|0;if((Ga&1)==0){Ha=da+1|0;Ia=da+1|0;Ja=(Ga&255)>>>1}else{Ga=c[da+8>>2]|0;Ha=Ga;Ia=Ga;Ja=c[da+4>>2]|0}c[O+0>>2]=c[fa+0>>2];c[N+0>>2]=c[ga+0>>2];zh(ea,d,O,N,g,h,j,Ia,Ha+Ja|0);c[Da>>2]=c[ea>>2];break};case 101:case 100:{Da=j+12|0;c[$>>2]=c[f>>2];c[M+0>>2]=c[$+0>>2];da=Lh(e,M,h,Fa,2)|0;Ga=c[h>>2]|0;do{if((Ga&4|0)==0){if(!((da+ -1|0)>>>0<31)){break}c[Da>>2]=da;break a}}while(0);c[h>>2]=Ga|4;break};case 73:{da=j+8|0;c[Z>>2]=c[f>>2];c[G+0>>2]=c[Z+0>>2];Da=Lh(e,G,h,Fa,2)|0;ca=c[h>>2]|0;do{if((ca&4|0)==0){if(!((Da+ -1|0)>>>0<12)){break}c[da>>2]=Da;break a}}while(0);c[h>>2]=ca|4;break};case 106:{c[Y>>2]=c[f>>2];c[F+0>>2]=c[Y+0>>2];Da=Lh(e,F,h,Fa,3)|0;da=c[h>>2]|0;if((da&4|0)==0&(Da|0)<366){c[j+28>>2]=Da;break a}else{c[h>>2]=da|4;break a}break};case 65:case 97:{da=c[f>>2]|0;Da=d+8|0;Ga=mc[c[c[Da>>2]>>2]&63](Da)|0;c[ba>>2]=da;c[Q+0>>2]=c[ba+0>>2];da=(ag(e,Q,Ga,Ga+168|0,Fa,h,0)|0)-Ga|0;if((da|0)>=168){break a}c[j+24>>2]=((da|0)/12|0|0)%7|0;break};case 104:case 66:case 98:{da=c[f>>2]|0;Ga=d+8|0;Da=mc[c[(c[Ga>>2]|0)+4>>2]&63](Ga)|0;c[aa>>2]=da;c[P+0>>2]=c[aa+0>>2];da=(ag(e,P,Da,Da+288|0,Fa,h,0)|0)-Da|0;if((da|0)>=288){break a}c[j+16>>2]=((da|0)/12|0|0)%12|0;break};case 68:{da=e;c[ia>>2]=c[da>>2];c[ja>>2]=c[f>>2];c[L+0>>2]=c[ia+0>>2];c[K+0>>2]=c[ja+0>>2];zh(ha,d,L,K,g,h,j,229264,229272|0);c[da>>2]=c[ha>>2];break};case 72:{c[_>>2]=c[f>>2];c[H+0>>2]=c[_+0>>2];da=Lh(e,H,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<24){c[j+8>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 70:{Da=e;c[la>>2]=c[Da>>2];c[ma>>2]=c[f>>2];c[J+0>>2]=c[la+0>>2];c[I+0>>2]=c[ma+0>>2];zh(ka,d,J,I,g,h,j,229272,229280|0);c[Da>>2]=c[ka>>2];break};case 109:{c[X>>2]=c[f>>2];c[E+0>>2]=c[X+0>>2];Da=Lh(e,E,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(Da|0)<13){c[j+16>>2]=Da+ -1;break a}else{c[h>>2]=da|4;break a}break};case 77:{c[W>>2]=c[f>>2];c[D+0>>2]=c[W+0>>2];da=Lh(e,D,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(da|0)<60){c[j+4>>2]=da;break a}else{c[h>>2]=Da|4;break a}break};case 116:case 110:{c[na>>2]=c[f>>2];c[C+0>>2]=c[na+0>>2];Jh(0,e,C,h,Fa);break};case 112:{Da=j+8|0;da=c[f>>2]|0;Ga=d+8|0;Ea=mc[c[(c[Ga>>2]|0)+8>>2]&63](Ga)|0;Ga=a[Ea]|0;if((Ga&1)==0){Ka=(Ga&255)>>>1}else{Ka=c[Ea+4>>2]|0}Ga=a[Ea+12|0]|0;if((Ga&1)==0){La=(Ga&255)>>>1}else{La=c[Ea+16>>2]|0}if((Ka|0)==(0-La|0)){c[h>>2]=c[h>>2]|4;break a}c[V>>2]=da;c[B+0>>2]=c[V+0>>2];da=ag(e,B,Ea,Ea+24|0,Fa,h,0)|0;Ga=da-Ea|0;do{if((da|0)==(Ea|0)){if((c[Da>>2]|0)!=12){break}c[Da>>2]=0;break a}}while(0);if((Ga|0)!=12){break a}Ea=c[Da>>2]|0;if((Ea|0)>=12){break a}c[Da>>2]=Ea+12;break};case 114:{Ea=e;c[pa>>2]=c[Ea>>2];c[qa>>2]=c[f>>2];c[A+0>>2]=c[pa+0>>2];c[z+0>>2]=c[qa+0>>2];zh(oa,d,A,z,g,h,j,229280,229291|0);c[Ea>>2]=c[oa>>2];break};case 82:{Ea=e;c[sa>>2]=c[Ea>>2];c[ta>>2]=c[f>>2];c[y+0>>2]=c[sa+0>>2];c[x+0>>2]=c[ta+0>>2];zh(ra,d,y,x,g,h,j,229296,229301|0);c[Ea>>2]=c[ra>>2];break};case 83:{c[U>>2]=c[f>>2];c[w+0>>2]=c[U+0>>2];Ea=Lh(e,w,h,Fa,2)|0;da=c[h>>2]|0;if((da&4|0)==0&(Ea|0)<61){c[j>>2]=Ea;break a}else{c[h>>2]=da|4;break a}break};case 84:{da=e;c[va>>2]=c[da>>2];c[wa>>2]=c[f>>2];c[v+0>>2]=c[va+0>>2];c[u+0>>2]=c[wa+0>>2];zh(ua,d,v,u,g,h,j,229304,229312|0);c[da>>2]=c[ua>>2];break};case 119:{c[T>>2]=c[f>>2];c[t+0>>2]=c[T+0>>2];da=Lh(e,t,h,Fa,1)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(da|0)<7){c[j+24>>2]=da;break a}else{c[h>>2]=Ea|4;break a}break};case 120:{Ea=c[(c[d>>2]|0)+20>>2]|0;c[xa>>2]=c[e>>2];c[ya>>2]=c[f>>2];c[s+0>>2]=c[xa+0>>2];c[r+0>>2]=c[ya+0>>2];hc[Ea&63](b,d,s,r,g,h,j);i=l;return};case 88:{Ea=d+8|0;da=mc[c[(c[Ea>>2]|0)+24>>2]&63](Ea)|0;Ea=e;c[Aa>>2]=c[Ea>>2];c[Ba>>2]=c[f>>2];ca=a[da]|0;if((ca&1)==0){Ma=da+1|0;Na=da+1|0;Oa=(ca&255)>>>1}else{ca=c[da+8>>2]|0;Ma=ca;Na=ca;Oa=c[da+4>>2]|0}c[q+0>>2]=c[Aa+0>>2];c[p+0>>2]=c[Ba+0>>2];zh(za,d,q,p,g,h,j,Na,Ma+Oa|0);c[Ea>>2]=c[za>>2];break};case 121:{c[S>>2]=c[f>>2];c[o+0>>2]=c[S+0>>2];Ea=Lh(e,o,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}if((Ea|0)<69){Pa=Ea+2e3|0}else{Pa=(Ea+ -69|0)>>>0<31?Ea+1900|0:Ea}c[j+20>>2]=Pa+ -1900;break};case 89:{c[R>>2]=c[f>>2];c[n+0>>2]=c[R+0>>2];Ea=Lh(e,n,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}c[j+20>>2]=Ea+ -1900;break};case 37:{c[Ca>>2]=c[f>>2];c[m+0>>2]=c[Ca+0>>2];Kh(0,e,m,h,Fa);break};default:{c[h>>2]=c[h>>2]|4}}}while(0);c[b>>2]=c[e>>2];i=l;return}function Jh(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;a=i;j=e;e=f;f=h+8|0;a:while(1){h=c[j>>2]|0;do{if((h|0)==0){k=0}else{if((c[h+12>>2]|0)!=(c[h+16>>2]|0)){k=h;break}if((mc[c[(c[h>>2]|0)+36>>2]&63](h)|0)==-1){c[j>>2]=0;k=0;break}else{k=c[j>>2]|0;break}}}while(0);h=(k|0)==0;l=c[e>>2]|0;do{if((l|0)==0){m=12}else{if((c[l+12>>2]|0)!=(c[l+16>>2]|0)){if(h){n=l;break}else{o=l;break a}}if((mc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1){c[e>>2]=0;m=12;break}else{if(h){n=l;break}else{o=l;break a}}}}while(0);if((m|0)==12){m=0;if(h){o=0;break}else{n=0}}l=c[j>>2]|0;p=c[l+12>>2]|0;if((p|0)==(c[l+16>>2]|0)){q=mc[c[(c[l>>2]|0)+36>>2]&63](l)|0}else{q=d[p]|0}if(!((q&255)<<24>>24>-1)){o=n;break}if((b[(c[f>>2]|0)+(q<<24>>24<<1)>>1]&8192)==0){o=n;break}p=c[j>>2]|0;l=p+12|0;r=c[l>>2]|0;if((r|0)==(c[p+16>>2]|0)){mc[c[(c[p>>2]|0)+40>>2]&63](p)|0;continue}else{c[l>>2]=r+1;continue}}n=c[j>>2]|0;do{if((n|0)==0){s=0}else{if((c[n+12>>2]|0)!=(c[n+16>>2]|0)){s=n;break}if((mc[c[(c[n>>2]|0)+36>>2]&63](n)|0)==-1){c[j>>2]=0;s=0;break}else{s=c[j>>2]|0;break}}}while(0);j=(s|0)==0;b:do{if((o|0)==0){m=32}else{do{if((c[o+12>>2]|0)==(c[o+16>>2]|0)){if(!((mc[c[(c[o>>2]|0)+36>>2]&63](o)|0)==-1)){break}c[e>>2]=0;m=32;break b}}while(0);if(!j){break}i=a;return}}while(0);do{if((m|0)==32){if(j){break}i=a;return}}while(0);c[g>>2]=c[g>>2]|2;i=a;return}function Kh(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;a=i;h=b;b=c[h>>2]|0;do{if((b|0)==0){j=0}else{if((c[b+12>>2]|0)!=(c[b+16>>2]|0)){j=b;break}if((mc[c[(c[b>>2]|0)+36>>2]&63](b)|0)==-1){c[h>>2]=0;j=0;break}else{j=c[h>>2]|0;break}}}while(0);b=(j|0)==0;j=e;e=c[j>>2]|0;a:do{if((e|0)==0){k=11}else{do{if((c[e+12>>2]|0)==(c[e+16>>2]|0)){if(!((mc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){break}c[j>>2]=0;k=11;break a}}while(0);if(b){l=e}else{k=12}}}while(0);if((k|0)==11){if(b){k=12}else{l=0}}if((k|0)==12){c[f>>2]=c[f>>2]|6;i=a;return}b=c[h>>2]|0;e=c[b+12>>2]|0;if((e|0)==(c[b+16>>2]|0)){m=mc[c[(c[b>>2]|0)+36>>2]&63](b)|0}else{m=d[e]|0}if(!((gc[c[(c[g>>2]|0)+36>>2]&31](g,m&255,0)|0)<<24>>24==37)){c[f>>2]=c[f>>2]|4;i=a;return}m=c[h>>2]|0;g=m+12|0;e=c[g>>2]|0;if((e|0)==(c[m+16>>2]|0)){mc[c[(c[m>>2]|0)+40>>2]&63](m)|0}else{c[g>>2]=e+1}e=c[h>>2]|0;do{if((e|0)==0){n=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){n=e;break}if((mc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1){c[h>>2]=0;n=0;break}else{n=c[h>>2]|0;break}}}while(0);h=(n|0)==0;b:do{if((l|0)==0){k=31}else{do{if((c[l+12>>2]|0)==(c[l+16>>2]|0)){if(!((mc[c[(c[l>>2]|0)+36>>2]&63](l)|0)==-1)){break}c[j>>2]=0;k=31;break b}}while(0);if(!h){break}i=a;return}}while(0);do{if((k|0)==31){if(h){break}i=a;return}}while(0);c[f>>2]=c[f>>2]|2;i=a;return}function Lh(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;j=i;k=a;a=c[k>>2]|0;do{if((a|0)==0){l=0}else{if((c[a+12>>2]|0)!=(c[a+16>>2]|0)){l=a;break}if((mc[c[(c[a>>2]|0)+36>>2]&63](a)|0)==-1){c[k>>2]=0;l=0;break}else{l=c[k>>2]|0;break}}}while(0);a=(l|0)==0;l=e;e=c[l>>2]|0;a:do{if((e|0)==0){m=11}else{do{if((c[e+12>>2]|0)==(c[e+16>>2]|0)){if(!((mc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){break}c[l>>2]=0;m=11;break a}}while(0);if(a){n=e}else{m=12}}}while(0);if((m|0)==11){if(a){m=12}else{n=0}}if((m|0)==12){c[f>>2]=c[f>>2]|6;o=0;i=j;return o|0}a=c[k>>2]|0;e=c[a+12>>2]|0;if((e|0)==(c[a+16>>2]|0)){p=mc[c[(c[a>>2]|0)+36>>2]&63](a)|0}else{p=d[e]|0}e=p&255;do{if(e<<24>>24>-1){a=g+8|0;if((b[(c[a>>2]|0)+(p<<24>>24<<1)>>1]&2048)==0){break}q=g;r=(gc[c[(c[q>>2]|0)+36>>2]&31](g,e,0)|0)<<24>>24;s=c[k>>2]|0;t=s+12|0;u=c[t>>2]|0;if((u|0)==(c[s+16>>2]|0)){mc[c[(c[s>>2]|0)+40>>2]&63](s)|0;v=h;w=n;x=n;y=r}else{c[t>>2]=u+1;v=h;w=n;x=n;y=r}while(1){z=y+ -48|0;r=v+ -1|0;u=c[k>>2]|0;do{if((u|0)==0){A=0}else{if((c[u+12>>2]|0)!=(c[u+16>>2]|0)){A=u;break}if((mc[c[(c[u>>2]|0)+36>>2]&63](u)|0)==-1){c[k>>2]=0;A=0;break}else{A=c[k>>2]|0;break}}}while(0);u=(A|0)==0;do{if((x|0)==0){B=w;C=0}else{if((c[x+12>>2]|0)!=(c[x+16>>2]|0)){B=w;C=x;break}if(!((mc[c[(c[x>>2]|0)+36>>2]&63](x)|0)==-1)){B=w;C=w;break}c[l>>2]=0;B=0;C=0}}while(0);D=c[k>>2]|0;if(!((u^(C|0)==0)&(r|0)>0)){m=40;break}t=c[D+12>>2]|0;if((t|0)==(c[D+16>>2]|0)){E=mc[c[(c[D>>2]|0)+36>>2]&63](D)|0}else{E=d[t]|0}t=E&255;if(!(t<<24>>24>-1)){o=z;m=52;break}if((b[(c[a>>2]|0)+(E<<24>>24<<1)>>1]&2048)==0){o=z;m=52;break}s=((gc[c[(c[q>>2]|0)+36>>2]&31](g,t,0)|0)<<24>>24)+(z*10|0)|0;t=c[k>>2]|0;F=t+12|0;G=c[F>>2]|0;if((G|0)==(c[t+16>>2]|0)){mc[c[(c[t>>2]|0)+40>>2]&63](t)|0;H=r;w=B;x=C;y=s;v=H;continue}else{c[F>>2]=G+1;H=r;w=B;x=C;y=s;v=H;continue}}if((m|0)==40){do{if((D|0)==0){I=0}else{if((c[D+12>>2]|0)!=(c[D+16>>2]|0)){I=D;break}if((mc[c[(c[D>>2]|0)+36>>2]&63](D)|0)==-1){c[k>>2]=0;I=0;break}else{I=c[k>>2]|0;break}}}while(0);q=(I|0)==0;b:do{if((B|0)==0){m=50}else{do{if((c[B+12>>2]|0)==(c[B+16>>2]|0)){if(!((mc[c[(c[B>>2]|0)+36>>2]&63](B)|0)==-1)){break}c[l>>2]=0;m=50;break b}}while(0);if(q){o=z}else{break}i=j;return o|0}}while(0);do{if((m|0)==50){if(q){break}else{o=z}i=j;return o|0}}while(0);c[f>>2]=c[f>>2]|2;o=z;i=j;return o|0}else if((m|0)==52){i=j;return o|0}}}while(0);c[f>>2]=c[f>>2]|4;o=0;i=j;return o|0}function Mh(a,b,d,e,f,g,h,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0;l=i;i=i+64|0;m=l;n=l+8|0;o=l+16|0;p=l+32|0;q=l+40|0;r=l+48|0;s=l+56|0;Ge(p,f);t=p;p=c[t>>2]|0;if(!((c[57586]|0)==-1)){c[o>>2]=230344;c[o+4>>2]=112;c[o+8>>2]=0;he(230344,o,113)}o=(c[230348>>2]|0)+ -1|0;u=c[p+8>>2]|0;if(!((c[p+12>>2]|0)-u>>2>>>0>o>>>0)){v=Va(4)|0;w=v;gm(w);xb(v|0,238312,101)}p=c[u+(o<<2)>>2]|0;if((p|0)==0){v=Va(4)|0;w=v;gm(w);xb(v|0,238312,101)}v=p;Pd(c[t>>2]|0)|0;c[g>>2]=0;t=d;a:do{if((j|0)==(k|0)){x=69}else{w=e;o=p;u=p;y=p;z=b;A=r;B=s;C=q;D=j;E=0;b:while(1){F=E;while(1){if((F|0)!=0){x=69;break a}G=c[t>>2]|0;do{if((G|0)==0){H=0;I=1}else{J=c[G+12>>2]|0;if((J|0)==(c[G+16>>2]|0)){K=mc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{K=c[J>>2]|0}if(!((K|0)==-1)){H=G;I=0;break}c[t>>2]=0;H=0;I=1}}while(0);G=c[w>>2]|0;do{if((G|0)==0){x=22}else{J=c[G+12>>2]|0;if((J|0)==(c[G+16>>2]|0)){L=mc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{L=c[J>>2]|0}if((L|0)==-1){c[w>>2]=0;x=22;break}else{if(I){M=G;break}else{x=24;break b}}}}while(0);if((x|0)==22){x=0;if(I){x=24;break b}else{M=0}}if((gc[c[(c[o>>2]|0)+52>>2]&31](v,c[D>>2]|0,0)|0)<<24>>24==37){x=26;break}if(gc[c[(c[u>>2]|0)+12>>2]&31](v,8192,c[D>>2]|0)|0){N=D;x=36;break}O=H+12|0;G=c[O>>2]|0;P=H+16|0;if((G|0)==(c[P>>2]|0)){Q=mc[c[(c[H>>2]|0)+36>>2]&63](H)|0}else{Q=c[G>>2]|0}G=vc[c[(c[y>>2]|0)+28>>2]&15](v,Q)|0;if((G|0)==(vc[c[(c[y>>2]|0)+28>>2]&15](v,c[D>>2]|0)|0)){x=64;break}c[g>>2]=4;F=4}c:do{if((x|0)==26){x=0;F=D+4|0;if((F|0)==(k|0)){x=27;break b}G=gc[c[(c[o>>2]|0)+52>>2]&31](v,c[F>>2]|0,0)|0;if(G<<24>>24==48|G<<24>>24==69){J=D+8|0;if((J|0)==(k|0)){x=30;break b}R=J;S=gc[c[(c[o>>2]|0)+52>>2]&31](v,c[J>>2]|0,0)|0;T=G}else{R=F;S=G;T=0}G=c[(c[z>>2]|0)+36>>2]|0;c[A>>2]=H;c[B>>2]=M;F=n;J=r;c[F+0>>2]=c[J+0>>2];J=m;F=s;c[J+0>>2]=c[F+0>>2];lc[G&3](q,b,n,m,f,g,h,S,T);c[t>>2]=c[C>>2];U=R+4|0}else if((x|0)==36){while(1){x=0;G=N+4|0;if((G|0)==(k|0)){V=k;break}if(gc[c[(c[u>>2]|0)+12>>2]&31](v,8192,c[G>>2]|0)|0){N=G;x=36}else{V=G;break}}G=H;F=M;J=M;while(1){do{if((G|0)==0){W=0;X=1}else{Y=c[G+12>>2]|0;if((Y|0)==(c[G+16>>2]|0)){Z=mc[c[(c[G>>2]|0)+36>>2]&63](G)|0}else{Z=c[Y>>2]|0}if(!((Z|0)==-1)){W=G;X=0;break}c[t>>2]=0;W=0;X=1}}while(0);do{if((J|0)==0){_=F;x=51}else{Y=c[J+12>>2]|0;if((Y|0)==(c[J+16>>2]|0)){$=mc[c[(c[J>>2]|0)+36>>2]&63](J)|0}else{$=c[Y>>2]|0}if(($|0)==-1){c[w>>2]=0;_=0;x=51;break}else{if(X^(F|0)==0){aa=F;ba=F;break}else{U=V;break c}}}}while(0);if((x|0)==51){x=0;if(X){U=V;break c}else{aa=_;ba=0}}Y=W+12|0;ca=c[Y>>2]|0;da=W+16|0;if((ca|0)==(c[da>>2]|0)){ea=mc[c[(c[W>>2]|0)+36>>2]&63](W)|0}else{ea=c[ca>>2]|0}if(!(gc[c[(c[u>>2]|0)+12>>2]&31](v,8192,ea)|0)){U=V;break c}ca=c[Y>>2]|0;if((ca|0)==(c[da>>2]|0)){mc[c[(c[W>>2]|0)+40>>2]&63](W)|0;G=W;F=aa;J=ba;continue}else{c[Y>>2]=ca+4;G=W;F=aa;J=ba;continue}}}else if((x|0)==64){x=0;J=c[O>>2]|0;if((J|0)==(c[P>>2]|0)){mc[c[(c[H>>2]|0)+40>>2]&63](H)|0}else{c[O>>2]=J+4}U=D+4|0}}while(0);if((U|0)==(k|0)){x=69;break a}D=U;E=c[g>>2]|0}if((x|0)==24){c[g>>2]=4;fa=H;break}else if((x|0)==27){c[g>>2]=4;fa=H;break}else if((x|0)==30){c[g>>2]=4;fa=H;break}}}while(0);if((x|0)==69){fa=c[t>>2]|0}t=d;do{if((fa|0)==0){ga=0;ha=1}else{d=c[fa+12>>2]|0;if((d|0)==(c[fa+16>>2]|0)){ia=mc[c[(c[fa>>2]|0)+36>>2]&63](fa)|0}else{ia=c[d>>2]|0}if(!((ia|0)==-1)){ga=fa;ha=0;break}c[t>>2]=0;ga=0;ha=1}}while(0);t=e;e=c[t>>2]|0;do{if((e|0)==0){x=82}else{fa=c[e+12>>2]|0;if((fa|0)==(c[e+16>>2]|0)){ja=mc[c[(c[e>>2]|0)+36>>2]&63](e)|0}else{ja=c[fa>>2]|0}if((ja|0)==-1){c[t>>2]=0;x=82;break}if(!ha){break}ka=a;c[ka>>2]=ga;i=l;return}}while(0);do{if((x|0)==82){if(ha){break}ka=a;c[ka>>2]=ga;i=l;return}}while(0);c[g>>2]=c[g>>2]|2;ka=a;c[ka>>2]=ga;i=l;return}function Nh(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Oh(a){a=a|0;i=i;return}function Ph(a){a=a|0;i=i;return 2}function Qh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;k=j;l=j+8|0;m=j+16|0;n=j+24|0;c[m>>2]=c[d>>2];c[n>>2]=c[e>>2];e=l;d=m;c[e+0>>2]=c[d+0>>2];d=k;e=n;c[d+0>>2]=c[e+0>>2];Mh(a,b,l,k,f,g,h,229408,229440|0);i=j;return}function Rh(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;l=k;m=k+8|0;n=k+16|0;o=k+24|0;p=d+8|0;q=mc[c[(c[p>>2]|0)+20>>2]&63](p)|0;c[n>>2]=c[e>>2];c[o>>2]=c[f>>2];f=a[q]|0;if((f&1)==0){r=q+4|0;s=q+4|0;t=(f&255)>>>1}else{f=c[q+8>>2]|0;r=f;s=f;t=c[q+4>>2]|0}q=r+(t<<2)|0;t=m;r=n;c[t+0>>2]=c[r+0>>2];r=l;t=o;c[r+0>>2]=c[t+0>>2];Mh(b,d,m,l,g,h,j,s,q);i=k;return}function Sh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Ge(n,f);f=n;n=c[f>>2]|0;if(!((c[57586]|0)==-1)){c[m>>2]=230344;c[m+4>>2]=112;c[m+8>>2]=0;he(230344,m,113)}m=(c[230348>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}p=n;Pd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=mc[c[c[e>>2]>>2]&63](e)|0;c[l>>2]=f;f=b+168|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=zg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=168){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+24>>2]=((g|0)/12|0|0)%7|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Th(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+40|0;k=j;l=j+8|0;m=j+16|0;n=j+32|0;Ge(n,f);f=n;n=c[f>>2]|0;if(!((c[57586]|0)==-1)){c[m>>2]=230344;c[m+4>>2]=112;c[m+8>>2]=0;he(230344,m,113)}m=(c[230348>>2]|0)+ -1|0;o=c[n+8>>2]|0;if(!((c[n+12>>2]|0)-o>>2>>>0>m>>>0)){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}n=c[o+(m<<2)>>2]|0;if((n|0)==0){p=Va(4)|0;q=p;gm(q);xb(p|0,238312,101)}p=n;Pd(c[f>>2]|0)|0;f=c[e>>2]|0;e=b+8|0;b=mc[c[(c[e>>2]|0)+4>>2]&63](e)|0;c[l>>2]=f;f=b+288|0;e=k;n=l;c[e+0>>2]=c[n+0>>2];n=zg(d,k,b,f,p,g,0)|0;g=n-b|0;if((g|0)>=288){r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}c[h+16>>2]=((g|0)/12|0|0)%12|0;r=d;s=c[r>>2]|0;t=a;c[t>>2]=s;i=j;return}function Uh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;b=i;i=i+40|0;j=b;k=b+8|0;l=b+16|0;m=b+32|0;Ge(m,f);f=m;m=c[f>>2]|0;if(!((c[57586]|0)==-1)){c[l>>2]=230344;c[l+4>>2]=112;c[l+8>>2]=0;he(230344,l,113)}l=(c[230348>>2]|0)+ -1|0;n=c[m+8>>2]|0;if(!((c[m+12>>2]|0)-n>>2>>>0>l>>>0)){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}m=c[n+(l<<2)>>2]|0;if((m|0)==0){o=Va(4)|0;p=o;gm(p);xb(o|0,238312,101)}o=m;Pd(c[f>>2]|0)|0;f=h+20|0;c[k>>2]=c[e>>2];e=j;h=k;c[e+0>>2]=c[h+0>>2];h=Yh(d,j,g,o,4)|0;if((c[g>>2]&4|0)!=0){q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}if((h|0)<69){t=h+2e3|0}else{t=(h+ -69|0)>>>0<31?h+1900|0:h}c[f>>2]=t+ -1900;q=d;r=c[q>>2]|0;s=a;c[s>>2]=r;i=b;return}function Vh(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;l=i;i=i+576|0;m=l;n=l+8|0;o=l+16|0;p=l+24|0;q=l+32|0;r=l+40|0;s=l+48|0;t=l+56|0;u=l+64|0;v=l+72|0;w=l+80|0;x=l+88|0;y=l+96|0;z=l+104|0;A=l+112|0;B=l+120|0;C=l+128|0;D=l+136|0;E=l+144|0;F=l+152|0;G=l+160|0;H=l+168|0;I=l+176|0;J=l+184|0;K=l+192|0;L=l+200|0;M=l+208|0;N=l+216|0;O=l+224|0;P=l+232|0;Q=l+240|0;R=l+248|0;S=l+256|0;T=l+264|0;U=l+272|0;V=l+280|0;W=l+288|0;X=l+296|0;Y=l+304|0;Z=l+312|0;_=l+320|0;$=l+328|0;aa=l+336|0;ba=l+344|0;ca=l+352|0;da=l+368|0;ea=l+376|0;fa=l+384|0;ga=l+392|0;ha=l+400|0;ia=l+408|0;ja=l+416|0;ka=l+424|0;la=l+432|0;ma=l+440|0;na=l+448|0;oa=l+456|0;pa=l+464|0;qa=l+472|0;ra=l+480|0;sa=l+488|0;ta=l+496|0;ua=l+504|0;va=l+512|0;wa=l+520|0;xa=l+528|0;ya=l+536|0;za=l+544|0;Aa=l+552|0;Ba=l+560|0;Ca=l+568|0;c[h>>2]=0;Ge(da,g);Da=da;da=c[Da>>2]|0;if(!((c[57586]|0)==-1)){c[ca>>2]=230344;c[ca+4>>2]=112;c[ca+8>>2]=0;he(230344,ca,113)}ca=(c[230348>>2]|0)+ -1|0;Ea=c[da+8>>2]|0;if(!((c[da+12>>2]|0)-Ea>>2>>>0>ca>>>0)){Fa=Va(4)|0;Ga=Fa;gm(Ga);xb(Fa|0,238312,101)}da=c[Ea+(ca<<2)>>2]|0;if((da|0)==0){Fa=Va(4)|0;Ga=Fa;gm(Ga);xb(Fa|0,238312,101)}Fa=da;Pd(c[Da>>2]|0)|0;a:do{switch(k<<24>>24|0){case 104:case 66:case 98:{Da=c[f>>2]|0;da=d+8|0;Ga=mc[c[(c[da>>2]|0)+4>>2]&63](da)|0;c[aa>>2]=Da;c[P+0>>2]=c[aa+0>>2];Da=(zg(e,P,Ga,Ga+288|0,Fa,h,0)|0)-Ga|0;if((Da|0)>=288){break a}c[j+16>>2]=((Da|0)/12|0|0)%12|0;break};case 99:{Da=d+8|0;Ga=mc[c[(c[Da>>2]|0)+12>>2]&63](Da)|0;Da=e;c[fa>>2]=c[Da>>2];c[ga>>2]=c[f>>2];da=a[Ga]|0;if((da&1)==0){Ha=Ga+4|0;Ia=Ga+4|0;Ja=(da&255)>>>1}else{da=c[Ga+8>>2]|0;Ha=da;Ia=da;Ja=c[Ga+4>>2]|0}c[O+0>>2]=c[fa+0>>2];c[N+0>>2]=c[ga+0>>2];Mh(ea,d,O,N,g,h,j,Ia,Ha+(Ja<<2)|0);c[Da>>2]=c[ea>>2];break};case 77:{c[W>>2]=c[f>>2];c[D+0>>2]=c[W+0>>2];Da=Yh(e,D,h,Fa,2)|0;Ga=c[h>>2]|0;if((Ga&4|0)==0&(Da|0)<60){c[j+4>>2]=Da;break a}else{c[h>>2]=Ga|4;break a}break};case 121:{c[S>>2]=c[f>>2];c[o+0>>2]=c[S+0>>2];Ga=Yh(e,o,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}if((Ga|0)<69){Ka=Ga+2e3|0}else{Ka=(Ga+ -69|0)>>>0<31?Ga+1900|0:Ga}c[j+20>>2]=Ka+ -1900;break};case 89:{c[R>>2]=c[f>>2];c[n+0>>2]=c[R+0>>2];Ga=Yh(e,n,h,Fa,4)|0;if((c[h>>2]&4|0)!=0){break a}c[j+20>>2]=Ga+ -1900;break};case 109:{c[X>>2]=c[f>>2];c[E+0>>2]=c[X+0>>2];Ga=Yh(e,E,h,Fa,2)|0;Da=c[h>>2]|0;if((Da&4|0)==0&(Ga|0)<13){c[j+16>>2]=Ga+ -1;break a}else{c[h>>2]=Da|4;break a}break};case 116:case 110:{c[na>>2]=c[f>>2];c[C+0>>2]=c[na+0>>2];Wh(0,e,C,h,Fa);break};case 112:{Da=j+8|0;Ga=c[f>>2]|0;da=d+8|0;ca=mc[c[(c[da>>2]|0)+8>>2]&63](da)|0;da=a[ca]|0;if((da&1)==0){La=(da&255)>>>1}else{La=c[ca+4>>2]|0}da=a[ca+12|0]|0;if((da&1)==0){Ma=(da&255)>>>1}else{Ma=c[ca+16>>2]|0}if((La|0)==(0-Ma|0)){c[h>>2]=c[h>>2]|4;break a}c[V>>2]=Ga;c[B+0>>2]=c[V+0>>2];Ga=zg(e,B,ca,ca+24|0,Fa,h,0)|0;da=Ga-ca|0;do{if((Ga|0)==(ca|0)){if((c[Da>>2]|0)!=12){break}c[Da>>2]=0;break a}}while(0);if((da|0)!=12){break a}ca=c[Da>>2]|0;if((ca|0)>=12){break a}c[Da>>2]=ca+12;break};case 84:{ca=e;c[va>>2]=c[ca>>2];c[wa>>2]=c[f>>2];c[v+0>>2]=c[va+0>>2];c[u+0>>2]=c[wa+0>>2];Mh(ua,d,v,u,g,h,j,229576,229608|0);c[ca>>2]=c[ua>>2];break};case 120:{ca=c[(c[d>>2]|0)+20>>2]|0;c[xa>>2]=c[e>>2];c[ya>>2]=c[f>>2];c[s+0>>2]=c[xa+0>>2];c[r+0>>2]=c[ya+0>>2];hc[ca&63](b,d,s,r,g,h,j);i=l;return};case 88:{ca=d+8|0;Ga=mc[c[(c[ca>>2]|0)+24>>2]&63](ca)|0;ca=e;c[Aa>>2]=c[ca>>2];c[Ba>>2]=c[f>>2];Ea=a[Ga]|0;if((Ea&1)==0){Na=Ga+4|0;Oa=Ga+4|0;Pa=(Ea&255)>>>1}else{Ea=c[Ga+8>>2]|0;Na=Ea;Oa=Ea;Pa=c[Ga+4>>2]|0}c[q+0>>2]=c[Aa+0>>2];c[p+0>>2]=c[Ba+0>>2];Mh(za,d,q,p,g,h,j,Oa,Na+(Pa<<2)|0);c[ca>>2]=c[za>>2];break};case 101:case 100:{ca=j+12|0;c[$>>2]=c[f>>2];c[M+0>>2]=c[$+0>>2];Ga=Yh(e,M,h,Fa,2)|0;Ea=c[h>>2]|0;do{if((Ea&4|0)==0){if(!((Ga+ -1|0)>>>0<31)){break}c[ca>>2]=Ga;break a}}while(0);c[h>>2]=Ea|4;break};case 68:{Ga=e;c[ia>>2]=c[Ga>>2];c[ja>>2]=c[f>>2];c[L+0>>2]=c[ia+0>>2];c[K+0>>2]=c[ja+0>>2];Mh(ha,d,L,K,g,h,j,229440,229472|0);c[Ga>>2]=c[ha>>2];break};case 70:{Ga=e;c[la>>2]=c[Ga>>2];c[ma>>2]=c[f>>2];c[J+0>>2]=c[la+0>>2];c[I+0>>2]=c[ma+0>>2];Mh(ka,d,J,I,g,h,j,229472,229504|0);c[Ga>>2]=c[ka>>2];break};case 72:{c[_>>2]=c[f>>2];c[H+0>>2]=c[_+0>>2];Ga=Yh(e,H,h,Fa,2)|0;ca=c[h>>2]|0;if((ca&4|0)==0&(Ga|0)<24){c[j+8>>2]=Ga;break a}else{c[h>>2]=ca|4;break a}break};case 73:{ca=j+8|0;c[Z>>2]=c[f>>2];c[G+0>>2]=c[Z+0>>2];Ga=Yh(e,G,h,Fa,2)|0;Da=c[h>>2]|0;do{if((Da&4|0)==0){if(!((Ga+ -1|0)>>>0<12)){break}c[ca>>2]=Ga;break a}}while(0);c[h>>2]=Da|4;break};case 106:{c[Y>>2]=c[f>>2];c[F+0>>2]=c[Y+0>>2];Ga=Yh(e,F,h,Fa,3)|0;ca=c[h>>2]|0;if((ca&4|0)==0&(Ga|0)<366){c[j+28>>2]=Ga;break a}else{c[h>>2]=ca|4;break a}break};case 65:case 97:{ca=c[f>>2]|0;Ga=d+8|0;Ea=mc[c[c[Ga>>2]>>2]&63](Ga)|0;c[ba>>2]=ca;c[Q+0>>2]=c[ba+0>>2];ca=(zg(e,Q,Ea,Ea+168|0,Fa,h,0)|0)-Ea|0;if((ca|0)>=168){break a}c[j+24>>2]=((ca|0)/12|0|0)%7|0;break};case 114:{ca=e;c[pa>>2]=c[ca>>2];c[qa>>2]=c[f>>2];c[A+0>>2]=c[pa+0>>2];c[z+0>>2]=c[qa+0>>2];Mh(oa,d,A,z,g,h,j,229504,229548|0);c[ca>>2]=c[oa>>2];break};case 82:{ca=e;c[sa>>2]=c[ca>>2];c[ta>>2]=c[f>>2];c[y+0>>2]=c[sa+0>>2];c[x+0>>2]=c[ta+0>>2];Mh(ra,d,y,x,g,h,j,229552,229572|0);c[ca>>2]=c[ra>>2];break};case 83:{c[U>>2]=c[f>>2];c[w+0>>2]=c[U+0>>2];ca=Yh(e,w,h,Fa,2)|0;Ea=c[h>>2]|0;if((Ea&4|0)==0&(ca|0)<61){c[j>>2]=ca;break a}else{c[h>>2]=Ea|4;break a}break};case 119:{c[T>>2]=c[f>>2];c[t+0>>2]=c[T+0>>2];Ea=Yh(e,t,h,Fa,1)|0;ca=c[h>>2]|0;if((ca&4|0)==0&(Ea|0)<7){c[j+24>>2]=Ea;break a}else{c[h>>2]=ca|4;break a}break};case 37:{c[Ca>>2]=c[f>>2];c[m+0>>2]=c[Ca+0>>2];Xh(0,e,m,h,Fa);break};default:{c[h>>2]=c[h>>2]|4}}}while(0);c[b>>2]=c[e>>2];i=l;return}function Wh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;a=i;g=b;b=d;d=f;a:while(1){h=c[g>>2]|0;do{if((h|0)==0){j=1}else{k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){l=mc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{l=c[k>>2]|0}if((l|0)==-1){c[g>>2]=0;j=1;break}else{j=(c[g>>2]|0)==0;break}}}while(0);h=c[b>>2]|0;do{if((h|0)==0){m=15}else{k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){n=mc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{n=c[k>>2]|0}if((n|0)==-1){c[b>>2]=0;m=15;break}else{if(j){o=h;break}else{p=h;break a}}}}while(0);if((m|0)==15){m=0;if(j){p=0;break}else{o=0}}h=c[g>>2]|0;k=c[h+12>>2]|0;if((k|0)==(c[h+16>>2]|0)){q=mc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{q=c[k>>2]|0}if(!(gc[c[(c[d>>2]|0)+12>>2]&31](f,8192,q)|0)){p=o;break}k=c[g>>2]|0;h=k+12|0;r=c[h>>2]|0;if((r|0)==(c[k+16>>2]|0)){mc[c[(c[k>>2]|0)+40>>2]&63](k)|0;continue}else{c[h>>2]=r+4;continue}}o=c[g>>2]|0;do{if((o|0)==0){s=1}else{q=c[o+12>>2]|0;if((q|0)==(c[o+16>>2]|0)){t=mc[c[(c[o>>2]|0)+36>>2]&63](o)|0}else{t=c[q>>2]|0}if((t|0)==-1){c[g>>2]=0;s=1;break}else{s=(c[g>>2]|0)==0;break}}}while(0);do{if((p|0)==0){m=37}else{g=c[p+12>>2]|0;if((g|0)==(c[p+16>>2]|0)){u=mc[c[(c[p>>2]|0)+36>>2]&63](p)|0}else{u=c[g>>2]|0}if((u|0)==-1){c[b>>2]=0;m=37;break}if(!s){break}i=a;return}}while(0);do{if((m|0)==37){if(s){break}i=a;return}}while(0);c[e>>2]=c[e>>2]|2;i=a;return}function Xh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=i;g=b;b=c[g>>2]|0;do{if((b|0)==0){h=1}else{j=c[b+12>>2]|0;if((j|0)==(c[b+16>>2]|0)){k=mc[c[(c[b>>2]|0)+36>>2]&63](b)|0}else{k=c[j>>2]|0}if((k|0)==-1){c[g>>2]=0;h=1;break}else{h=(c[g>>2]|0)==0;break}}}while(0);k=d;d=c[k>>2]|0;do{if((d|0)==0){l=14}else{b=c[d+12>>2]|0;if((b|0)==(c[d+16>>2]|0)){m=mc[c[(c[d>>2]|0)+36>>2]&63](d)|0}else{m=c[b>>2]|0}if((m|0)==-1){c[k>>2]=0;l=14;break}else{if(h){n=d;break}else{l=16;break}}}}while(0);if((l|0)==14){if(h){l=16}else{n=0}}if((l|0)==16){c[e>>2]=c[e>>2]|6;i=a;return}h=c[g>>2]|0;d=c[h+12>>2]|0;if((d|0)==(c[h+16>>2]|0)){o=mc[c[(c[h>>2]|0)+36>>2]&63](h)|0}else{o=c[d>>2]|0}if(!((gc[c[(c[f>>2]|0)+52>>2]&31](f,o,0)|0)<<24>>24==37)){c[e>>2]=c[e>>2]|4;i=a;return}o=c[g>>2]|0;f=o+12|0;d=c[f>>2]|0;if((d|0)==(c[o+16>>2]|0)){mc[c[(c[o>>2]|0)+40>>2]&63](o)|0}else{c[f>>2]=d+4}d=c[g>>2]|0;do{if((d|0)==0){p=1}else{f=c[d+12>>2]|0;if((f|0)==(c[d+16>>2]|0)){q=mc[c[(c[d>>2]|0)+36>>2]&63](d)|0}else{q=c[f>>2]|0}if((q|0)==-1){c[g>>2]=0;p=1;break}else{p=(c[g>>2]|0)==0;break}}}while(0);do{if((n|0)==0){l=38}else{g=c[n+12>>2]|0;if((g|0)==(c[n+16>>2]|0)){r=mc[c[(c[n>>2]|0)+36>>2]&63](n)|0}else{r=c[g>>2]|0}if((r|0)==-1){c[k>>2]=0;l=38;break}if(!p){break}i=a;return}}while(0);do{if((l|0)==38){if(p){break}i=a;return}}while(0);c[e>>2]=c[e>>2]|2;i=a;return}function Yh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;g=i;h=a;a=c[h>>2]|0;do{if((a|0)==0){j=1}else{k=c[a+12>>2]|0;if((k|0)==(c[a+16>>2]|0)){l=mc[c[(c[a>>2]|0)+36>>2]&63](a)|0}else{l=c[k>>2]|0}if((l|0)==-1){c[h>>2]=0;j=1;break}else{j=(c[h>>2]|0)==0;break}}}while(0);l=b;b=c[l>>2]|0;do{if((b|0)==0){m=14}else{a=c[b+12>>2]|0;if((a|0)==(c[b+16>>2]|0)){n=mc[c[(c[b>>2]|0)+36>>2]&63](b)|0}else{n=c[a>>2]|0}if((n|0)==-1){c[l>>2]=0;m=14;break}else{if(j){o=b;break}else{m=16;break}}}}while(0);if((m|0)==14){if(j){m=16}else{o=0}}if((m|0)==16){c[d>>2]=c[d>>2]|6;p=0;i=g;return p|0}j=c[h>>2]|0;b=c[j+12>>2]|0;if((b|0)==(c[j+16>>2]|0)){q=mc[c[(c[j>>2]|0)+36>>2]&63](j)|0}else{q=c[b>>2]|0}b=e;if(!(gc[c[(c[b>>2]|0)+12>>2]&31](e,2048,q)|0)){c[d>>2]=c[d>>2]|4;p=0;i=g;return p|0}j=e;n=(gc[c[(c[j>>2]|0)+52>>2]&31](e,q,0)|0)<<24>>24;q=c[h>>2]|0;a=q+12|0;k=c[a>>2]|0;if((k|0)==(c[q+16>>2]|0)){mc[c[(c[q>>2]|0)+40>>2]&63](q)|0;r=f;s=o;t=o;u=n}else{c[a>>2]=k+4;r=f;s=o;t=o;u=n}while(1){v=u+ -48|0;n=r+ -1|0;o=c[h>>2]|0;do{if((o|0)==0){w=1}else{f=c[o+12>>2]|0;if((f|0)==(c[o+16>>2]|0)){x=mc[c[(c[o>>2]|0)+36>>2]&63](o)|0}else{x=c[f>>2]|0}if((x|0)==-1){c[h>>2]=0;w=1;break}else{w=(c[h>>2]|0)==0;break}}}while(0);do{if((t|0)==0){y=s;z=0;A=1}else{o=c[t+12>>2]|0;if((o|0)==(c[t+16>>2]|0)){B=mc[c[(c[t>>2]|0)+36>>2]&63](t)|0}else{B=c[o>>2]|0}if((B|0)==-1){c[l>>2]=0;y=0;z=0;A=1;break}else{y=s;z=s;A=(s|0)==0;break}}}while(0);C=c[h>>2]|0;if(!((w^A)&(n|0)>0)){break}o=c[C+12>>2]|0;if((o|0)==(c[C+16>>2]|0)){D=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{D=c[o>>2]|0}if(!(gc[c[(c[b>>2]|0)+12>>2]&31](e,2048,D)|0)){p=v;m=63;break}o=((gc[c[(c[j>>2]|0)+52>>2]&31](e,D,0)|0)<<24>>24)+(v*10|0)|0;f=c[h>>2]|0;k=f+12|0;a=c[k>>2]|0;if((a|0)==(c[f+16>>2]|0)){mc[c[(c[f>>2]|0)+40>>2]&63](f)|0;E=n;s=y;t=z;u=o;r=E;continue}else{c[k>>2]=a+4;E=n;s=y;t=z;u=o;r=E;continue}}if((m|0)==63){i=g;return p|0}do{if((C|0)==0){F=1}else{E=c[C+12>>2]|0;if((E|0)==(c[C+16>>2]|0)){G=mc[c[(c[C>>2]|0)+36>>2]&63](C)|0}else{G=c[E>>2]|0}if((G|0)==-1){c[h>>2]=0;F=1;break}else{F=(c[h>>2]|0)==0;break}}}while(0);do{if((y|0)==0){m=60}else{h=c[y+12>>2]|0;if((h|0)==(c[y+16>>2]|0)){H=mc[c[(c[y>>2]|0)+36>>2]&63](y)|0}else{H=c[h>>2]|0}if((H|0)==-1){c[l>>2]=0;m=60;break}if(F){p=v}else{break}i=g;return p|0}}while(0);do{if((m|0)==60){if(F){break}else{p=v}i=g;return p|0}}while(0);c[d>>2]=c[d>>2]|2;p=v;i=g;return p|0}function Zh(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b+8|0;f=c[e>>2]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);if((f|0)==(c[57560]|0)){g=b;Im(g);i=d;return}Ea(c[e>>2]|0);g=b;Im(g);i=d;return}function _h(b){b=b|0;var d=0,e=0;d=i;e=b+8|0;b=c[e>>2]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);if((b|0)==(c[57560]|0)){i=d;return}Ea(c[e>>2]|0);i=d;return}function $h(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;g=i;i=i+112|0;f=g;l=g+8|0;m=l;n=f;a[n]=37;o=f+1|0;a[o]=j;p=f+2|0;a[p]=k;a[f+3|0]=0;if(!(k<<24>>24==0)){a[o]=k;a[p]=j}j=db(m|0,100,n|0,h|0,c[d+8>>2]|0)|0;d=l+j|0;l=c[e>>2]|0;if((j|0)==0){q=l;r=b;c[r>>2]=q;i=g;return}else{s=m;t=l;u=l}while(1){l=a[s]|0;do{if((u|0)==0){v=t;w=0}else{m=u+24|0;j=c[m>>2]|0;if((j|0)==(c[u+28>>2]|0)){e=(vc[c[(c[u>>2]|0)+52>>2]&15](u,l&255)|0)==-1;v=e?0:t;w=e?0:u;break}else{c[m>>2]=j+1;a[j]=l;v=t;w=u;break}}}while(0);l=s+1|0;if((l|0)==(d|0)){q=v;break}else{s=l;t=v;u=w}}r=b;c[r>>2]=q;i=g;return}function ai(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;e=b+8|0;f=c[e>>2]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);if((f|0)==(c[57560]|0)){g=b;Im(g);i=d;return}Ea(c[e>>2]|0);g=b;Im(g);i=d;return}function bi(b){b=b|0;var d=0,e=0;d=i;e=b+8|0;b=c[e>>2]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);if((b|0)==(c[57560]|0)){i=d;return}Ea(c[e>>2]|0);i=d;return}function ci(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=i;i=i+408|0;e=f;k=f+400|0;l=e;c[k>>2]=e+400;di(b+8|0,l,k,g,h,j);j=c[k>>2]|0;k=c[d>>2]|0;if((l|0)==(j|0)){m=k;n=a;c[n>>2]=m;i=f;return}else{o=l;p=k;q=k}while(1){k=c[o>>2]|0;if((p|0)==0){r=q;s=0}else{l=p+24|0;d=c[l>>2]|0;if((d|0)==(c[p+28>>2]|0)){t=vc[c[(c[p>>2]|0)+52>>2]&15](p,k)|0}else{c[l>>2]=d+4;c[d>>2]=k;t=k}k=(t|0)==-1;r=k?0:q;s=k?0:p}k=o+4|0;if((k|0)==(j|0)){m=r;break}else{o=k;p=s;q=r}}n=a;c[n>>2]=m;i=f;return}function di(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+120|0;k=j;l=j+112|0;m=i;i=i+8|0;n=j+8|0;o=k;a[o]=37;p=k+1|0;a[p]=g;q=k+2|0;a[q]=h;a[k+3|0]=0;if(!(h<<24>>24==0)){a[p]=h;a[q]=g}g=b;db(n|0,100,o|0,f|0,c[g>>2]|0)|0;f=l;c[f>>2]=0;c[f+4>>2]=0;c[m>>2]=n;n=(c[e>>2]|0)-d>>2;f=ib(c[g>>2]|0)|0;g=Yl(d,m,n,l)|0;if((f|0)!=0){ib(f|0)|0}if((g|0)==-1){$i(231232)}else{c[e>>2]=d+(g<<2);i=j;return}}function ei(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function fi(a){a=a|0;i=i;return}function gi(a){a=a|0;i=i;return 127}function hi(a){a=a|0;i=i;return 127}function ii(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function ji(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function ki(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function li(a,b){a=a|0;b=b|0;b=i;le(a,1,45);i=b;return}function mi(a){a=a|0;i=i;return 0}function ni(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function oi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function pi(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function qi(a){a=a|0;i=i;return}function ri(a){a=a|0;i=i;return 127}function si(a){a=a|0;i=i;return 127}function ti(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function ui(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function vi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function wi(a,b){a=a|0;b=b|0;b=i;le(a,1,45);i=b;return}function xi(a){a=a|0;i=i;return 0}function yi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function zi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ai(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Bi(a){a=a|0;i=i;return}function Ci(a){a=a|0;i=i;return 2147483647}function Di(a){a=a|0;i=i;return 2147483647}function Ei(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Fi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Gi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Hi(a,b){a=a|0;b=b|0;b=i;we(a,1,45);i=b;return}function Ii(a){a=a|0;i=i;return 0}function Ji(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Ki(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Li(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Mi(a){a=a|0;i=i;return}function Ni(a){a=a|0;i=i;return 2147483647}function Oi(a){a=a|0;i=i;return 2147483647}function Pi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Qi(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Ri(a,b){a=a|0;b=b|0;var d=0;b=i;d=a;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;i=b;return}function Si(a,b){a=a|0;b=b|0;b=i;we(a,1,45);i=b;return}function Ti(a){a=a|0;i=i;return 0}function Ui(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Vi(b,c){b=b|0;c=c|0;c=b;a[c]=67109634;a[c+1|0]=262147;a[c+2|0]=1024;a[c+3|0]=4;i=i;return}function Wi(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Xi(a){a=a|0;i=i;return}function Yi(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+104|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=i;i=i+8|0;u=i;i=i+16|0;v=i;i=i+104|0;w=p;c[w>>2]=o;x=p+4|0;c[x>>2]=114;y=o+100|0;Ge(r,h);o=r;z=c[o>>2]|0;if(!((c[57588]|0)==-1)){c[n>>2]=230352;c[n+4>>2]=112;c[n+8>>2]=0;he(230352,n,113)}n=(c[230356>>2]|0)+ -1|0;A=c[z+8>>2]|0;if(!((c[z+12>>2]|0)-A>>2>>>0>n>>>0)){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}z=c[A+(n<<2)>>2]|0;if((z|0)==0){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}B=z;a[s]=0;C=f;c[t>>2]=c[C>>2];f=c[h+4>>2]|0;h=l;n=t;c[h+0>>2]=c[n+0>>2];n=_i(e,l,g,r,f,j,s,B,p,q,y)|0;do{if(n){y=u;sc[c[(c[z>>2]|0)+32>>2]&7](B,229968,229978|0,y)|0;p=v;f=c[q>>2]|0;r=c[w>>2]|0;g=f-r|0;do{if((g|0)>98){l=Bm(g+2|0)|0;if((l|0)!=0){D=l;E=l;break}Nm()}else{D=0;E=p}}while(0);if((a[s]|0)==0){F=E}else{a[E]=45;F=E+1|0}if(r>>>0<f>>>0){g=u+10|0;l=u;h=F;t=r;while(1){A=a[t]|0;G=y;while(1){H=G+1|0;if((a[G]|0)==A<<24>>24){I=G;break}if((H|0)==(g|0)){I=g;break}else{G=H}}a[h]=a[229968+(I-l)|0]|0;G=t+1|0;A=h+1|0;if(G>>>0<(c[q>>2]|0)>>>0){h=A;t=G}else{J=A;break}}}else{J=F}a[J]=0;c[m>>2]=k;if((gb(p|0,229984,m|0)|0)!=1){t=Va(8)|0;Vd(t,229992);xb(t|0,227360,11)}if((D|0)==0){break}Cm(D)}}while(0);D=e;e=c[D>>2]|0;do{if((e|0)==0){K=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){K=e;break}if(!((mc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){K=e;break}c[D>>2]=0;K=0}}while(0);D=(K|0)==0;e=c[C>>2]|0;do{if((e|0)==0){L=31}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){if(D){break}else{L=33;break}}if((mc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1){c[C>>2]=0;L=31;break}else{if(D){break}else{L=33;break}}}}while(0);if((L|0)==31){if(D){L=33}}if((L|0)==33){c[j>>2]=c[j>>2]|2}c[b>>2]=K;Pd(c[o>>2]|0)|0;o=c[w>>2]|0;c[w>>2]=0;if((o|0)==0){i=d;return}jc[c[x>>2]&127](o);i=d;return}function Zi(a){a=a|0;i=i;return}function _i(e,f,g,h,j,k,l,m,n,o,p){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;var q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,kc=0,lc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0;q=i;i=i+408|0;r=q;s=q+400|0;t=s;u=i;i=i+8|0;v=i;i=i+8|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+8|0;D=r;c[s>>2]=0;E=w;c[E+0>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;F=x;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;G=y;c[G+0>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;H=z;c[H+0>>2]=0;c[H+4>>2]=0;c[H+8>>2]=0;I=A;c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;cj(g,h,t,u,v,w,x,y,z,B);t=n;c[o>>2]=c[t>>2];h=e;e=f;f=s;s=m+8|0;m=z+1|0;g=z+4|0;J=z+8|0;K=y+1|0;L=y+4|0;M=y+8|0;N=(j&512|0)!=0;j=x+1|0;O=x+8|0;P=x+4|0;Q=A;R=Q+1|0;S=A+8|0;T=A+4|0;U=f+3|0;V=n+4|0;n=w+4|0;W=r+400|0;r=D;X=D;D=p;p=0;Y=0;Z=114;a:while(1){_=c[h>>2]|0;do{if((_|0)==0){$=0}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){$=_;break}if((mc[c[(c[_>>2]|0)+36>>2]&63](_)|0)==-1){c[h>>2]=0;$=0;break}else{$=c[h>>2]|0;break}}}while(0);_=($|0)==0;aa=c[e>>2]|0;do{if((aa|0)==0){ba=12}else{if((c[aa+12>>2]|0)!=(c[aa+16>>2]|0)){if(_){ca=aa;break}else{da=X;ea=r;fa=Y;ga=Z;ba=269;break a}}if((mc[c[(c[aa>>2]|0)+36>>2]&63](aa)|0)==-1){c[e>>2]=0;ba=12;break}else{if(_){ca=aa;break}else{da=X;ea=r;fa=Y;ga=Z;ba=269;break a}}}}while(0);if((ba|0)==12){ba=0;if(_){da=X;ea=r;fa=Y;ga=Z;ba=269;break}else{ca=0}}b:do{switch(a[f+p|0]|0){case 4:{aa=D;ha=X;ia=r;ja=W;ka=0;la=Z;c:while(1){ma=c[h>>2]|0;do{if((ma|0)==0){na=0}else{if((c[ma+12>>2]|0)!=(c[ma+16>>2]|0)){na=ma;break}if((mc[c[(c[ma>>2]|0)+36>>2]&63](ma)|0)==-1){c[h>>2]=0;na=0;break}else{na=c[h>>2]|0;break}}}while(0);ma=(na|0)==0;oa=c[e>>2]|0;do{if((oa|0)==0){ba=173}else{if((c[oa+12>>2]|0)!=(c[oa+16>>2]|0)){if(ma){break}else{break c}}if((mc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0)==-1){c[e>>2]=0;ba=173;break}else{if(ma){break}else{break c}}}}while(0);if((ba|0)==173){ba=0;if(ma){break}}oa=c[h>>2]|0;pa=c[oa+12>>2]|0;if((pa|0)==(c[oa+16>>2]|0)){qa=mc[c[(c[oa>>2]|0)+36>>2]&63](oa)|0}else{qa=d[pa]|0}pa=qa&255;do{if(pa<<24>>24>-1){if((b[(c[s>>2]|0)+(qa<<24>>24<<1)>>1]&2048)==0){ba=189;break}oa=c[o>>2]|0;if((oa|0)==(aa|0)){ra=(c[V>>2]|0)!=114;sa=c[t>>2]|0;ta=aa-sa|0;ua=ta>>>0<2147483647?ta<<1:-1;va=Dm(ra?sa:0,ua)|0;if((va|0)==0){ba=182;break a}do{if(ra){c[t>>2]=va;wa=va}else{sa=c[t>>2]|0;c[t>>2]=va;if((sa|0)==0){wa=va;break}jc[c[V>>2]&127](sa);wa=c[t>>2]|0}}while(0);c[V>>2]=115;va=wa+ta|0;c[o>>2]=va;xa=va;ya=(c[t>>2]|0)+ua|0}else{xa=oa;ya=aa}c[o>>2]=xa+1;a[xa]=pa;za=ya;Aa=ha;Ba=ia;Ca=ja;Da=ka+1|0;Ea=la}else{ba=189}}while(0);if((ba|0)==189){ba=0;ma=a[E]|0;if((ma&1)==0){Fa=(ma&255)>>>1}else{Fa=c[n>>2]|0}if((Fa|0)==0|(ka|0)==0){break}if(!(pa<<24>>24==(a[v]|0))){break}if((ia|0)==(ja|0)){ma=ia-ha|0;va=ma>>>0<2147483647?ma<<1:-1;if((la|0)==114){Ga=0}else{Ga=ha}ra=Dm(Ga,va)|0;sa=ra;if((ra|0)==0){ba=198;break a}Ha=sa;Ia=sa+(ma>>2<<2)|0;Ja=sa+(va>>>2<<2)|0;Ka=115}else{Ha=ha;Ia=ia;Ja=ja;Ka=la}c[Ia>>2]=ka;za=aa;Aa=Ha;Ba=Ia+4|0;Ca=Ja;Da=0;Ea=Ka}va=c[h>>2]|0;sa=va+12|0;ma=c[sa>>2]|0;if((ma|0)==(c[va+16>>2]|0)){mc[c[(c[va>>2]|0)+40>>2]&63](va)|0;aa=za;ha=Aa;ia=Ba;ja=Ca;ka=Da;la=Ea;continue}else{c[sa>>2]=ma+1;aa=za;ha=Aa;ia=Ba;ja=Ca;ka=Da;la=Ea;continue}}if((ha|0)==(ia|0)|(ka|0)==0){La=ha;Ma=ia;Na=ja;Oa=la}else{if((ia|0)==(ja|0)){ma=ia-ha|0;sa=ma>>>0<2147483647?ma<<1:-1;if((la|0)==114){Pa=0}else{Pa=ha}va=Dm(Pa,sa)|0;ra=va;if((va|0)==0){ba=209;break a}Qa=ra;Ra=ra+(ma>>2<<2)|0;Sa=ra+(sa>>>2<<2)|0;Ta=115}else{Qa=ha;Ra=ia;Sa=ja;Ta=la}c[Ra>>2]=ka;La=Qa;Ma=Ra+4|0;Na=Sa;Oa=Ta}sa=c[B>>2]|0;if((sa|0)>0){ra=c[h>>2]|0;do{if((ra|0)==0){Ua=0}else{if((c[ra+12>>2]|0)!=(c[ra+16>>2]|0)){Ua=ra;break}if((mc[c[(c[ra>>2]|0)+36>>2]&63](ra)|0)==-1){c[h>>2]=0;Ua=0;break}else{Ua=c[h>>2]|0;break}}}while(0);ra=(Ua|0)==0;ka=c[e>>2]|0;do{if((ka|0)==0){ba=223}else{if((c[ka+12>>2]|0)!=(c[ka+16>>2]|0)){if(ra){Va=ka;break}else{ba=229;break a}}if((mc[c[(c[ka>>2]|0)+36>>2]&63](ka)|0)==-1){c[e>>2]=0;ba=223;break}else{if(ra){Va=ka;break}else{ba=229;break a}}}}while(0);if((ba|0)==223){ba=0;if(ra){ba=229;break a}else{Va=0}}ka=c[h>>2]|0;la=c[ka+12>>2]|0;if((la|0)==(c[ka+16>>2]|0)){Wa=mc[c[(c[ka>>2]|0)+36>>2]&63](ka)|0}else{Wa=d[la]|0}if(!((Wa&255)<<24>>24==(a[u]|0))){ba=229;break a}la=c[h>>2]|0;ka=la+12|0;ja=c[ka>>2]|0;if((ja|0)==(c[la+16>>2]|0)){mc[c[(c[la>>2]|0)+40>>2]&63](la)|0;Xa=Va;Ya=sa;Za=Va;_a=aa}else{c[ka>>2]=ja+1;Xa=Va;Ya=sa;Za=Va;_a=aa}while(1){ja=c[h>>2]|0;do{if((ja|0)==0){$a=0}else{if((c[ja+12>>2]|0)!=(c[ja+16>>2]|0)){$a=ja;break}if((mc[c[(c[ja>>2]|0)+36>>2]&63](ja)|0)==-1){c[h>>2]=0;$a=0;break}else{$a=c[h>>2]|0;break}}}while(0);ja=($a|0)==0;do{if((Za|0)==0){ab=Xa;ba=243}else{if((c[Za+12>>2]|0)!=(c[Za+16>>2]|0)){if(ja){bb=Xa;cb=Za;break}else{ba=250;break a}}if((mc[c[(c[Za>>2]|0)+36>>2]&63](Za)|0)==-1){c[e>>2]=0;ab=0;ba=243;break}else{if(ja^(Xa|0)==0){bb=Xa;cb=Xa;break}else{ba=250;break a}}}}while(0);if((ba|0)==243){ba=0;if(ja){ba=250;break a}else{bb=ab;cb=0}}pa=c[h>>2]|0;ka=c[pa+12>>2]|0;if((ka|0)==(c[pa+16>>2]|0)){db=mc[c[(c[pa>>2]|0)+36>>2]&63](pa)|0}else{db=d[ka]|0}if(!((db&255)<<24>>24>-1)){ba=250;break a}if((b[(c[s>>2]|0)+(db<<24>>24<<1)>>1]&2048)==0){ba=250;break a}ka=c[o>>2]|0;if((ka|0)==(_a|0)){pa=(c[V>>2]|0)!=114;la=c[t>>2]|0;ia=_a-la|0;ha=ia>>>0<2147483647?ia<<1:-1;ma=Dm(pa?la:0,ha)|0;if((ma|0)==0){ba=253;break a}do{if(pa){c[t>>2]=ma;eb=ma}else{la=c[t>>2]|0;c[t>>2]=ma;if((la|0)==0){eb=ma;break}jc[c[V>>2]&127](la);eb=c[t>>2]|0}}while(0);c[V>>2]=115;ma=eb+ia|0;c[o>>2]=ma;fb=ma;gb=(c[t>>2]|0)+ha|0}else{fb=ka;gb=_a}ma=c[h>>2]|0;pa=c[ma+12>>2]|0;if((pa|0)==(c[ma+16>>2]|0)){ja=mc[c[(c[ma>>2]|0)+36>>2]&63](ma)|0;hb=ja;ib=c[o>>2]|0}else{hb=d[pa]|0;ib=fb}c[o>>2]=ib+1;a[ib]=hb;pa=Ya+ -1|0;c[B>>2]=pa;ja=c[h>>2]|0;ma=ja+12|0;la=c[ma>>2]|0;if((la|0)==(c[ja+16>>2]|0)){mc[c[(c[ja>>2]|0)+40>>2]&63](ja)|0}else{c[ma>>2]=la+1}if((pa|0)>0){Xa=bb;Ya=pa;Za=cb;_a=gb}else{jb=gb;break}}}else{jb=aa}if((c[o>>2]|0)==(c[t>>2]|0)){ba=267;break a}else{kb=jb;lb=La;mb=Ma;nb=Na;ob=Y;pb=Oa}break};case 0:{ba=26;break};case 1:{if((p|0)==3){da=X;ea=r;fa=Y;ga=Z;ba=269;break a}sa=c[h>>2]|0;ra=c[sa+12>>2]|0;if((ra|0)==(c[sa+16>>2]|0)){qb=mc[c[(c[sa>>2]|0)+36>>2]&63](sa)|0}else{qb=d[ra]|0}if(!((qb&255)<<24>>24>-1)){ba=25;break a}if((b[(c[s>>2]|0)+(qb<<24>>24<<1)>>1]&8192)==0){ba=25;break a}ra=c[h>>2]|0;sa=ra+12|0;pa=c[sa>>2]|0;if((pa|0)==(c[ra+16>>2]|0)){rb=mc[c[(c[ra>>2]|0)+40>>2]&63](ra)|0}else{c[sa>>2]=pa+1;rb=d[pa]|0}re(A,rb&255);ba=26;break};case 3:{pa=a[G]|0;sa=(pa&1)==0;if(sa){sb=(pa&255)>>>1}else{sb=c[L>>2]|0}ra=a[H]|0;la=(ra&1)==0;if(la){tb=(ra&255)>>>1}else{tb=c[g>>2]|0}if((sb|0)==(0-tb|0)){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}if(sa){ub=(pa&255)>>>1}else{ub=c[L>>2]|0}do{if((ub|0)!=0){if(la){vb=(ra&255)>>>1}else{vb=c[g>>2]|0}if((vb|0)==0){break}ma=c[h>>2]|0;ja=c[ma+12>>2]|0;va=c[ma+16>>2]|0;if((ja|0)==(va|0)){wb=mc[c[(c[ma>>2]|0)+36>>2]&63](ma)|0;xb=c[h>>2]|0;yb=wb;zb=c[xb+16>>2]|0;Ab=c[xb+12>>2]|0;Bb=xb;Cb=a[G]|0}else{yb=d[ja]|0;zb=va;Ab=ja;Bb=ma;Cb=pa}ma=Bb+12|0;ja=(Ab|0)==(zb|0);if((yb&255)<<24>>24==(a[(Cb&1)==0?K:c[M>>2]|0]|0)){if(ja){mc[c[(c[Bb>>2]|0)+40>>2]&63](Bb)|0}else{c[ma>>2]=Ab+1}ma=a[G]|0;if((ma&1)==0){Db=(ma&255)>>>1}else{Db=c[L>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Db>>>0>1?y:Y;pb=Z;break b}if(ja){Eb=mc[c[(c[Bb>>2]|0)+36>>2]&63](Bb)|0}else{Eb=d[Ab]|0}if(!((Eb&255)<<24>>24==(a[(a[H]&1)==0?m:c[J>>2]|0]|0))){ba=112;break a}ja=c[h>>2]|0;ma=ja+12|0;va=c[ma>>2]|0;if((va|0)==(c[ja+16>>2]|0)){mc[c[(c[ja>>2]|0)+40>>2]&63](ja)|0}else{c[ma>>2]=va+1}a[l]=1;va=a[H]|0;if((va&1)==0){Fb=(va&255)>>>1}else{Fb=c[g>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Fb>>>0>1?z:Y;pb=Z;break b}}while(0);if(sa){Gb=(pa&255)>>>1}else{Gb=c[L>>2]|0}la=c[h>>2]|0;aa=c[la+12>>2]|0;va=(aa|0)==(c[la+16>>2]|0);if((Gb|0)==0){if(va){ma=mc[c[(c[la>>2]|0)+36>>2]&63](la)|0;Hb=ma;Ib=a[H]|0}else{Hb=d[aa]|0;Ib=ra}if(!((Hb&255)<<24>>24==(a[(Ib&1)==0?m:c[J>>2]|0]|0))){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}ma=c[h>>2]|0;ja=ma+12|0;xb=c[ja>>2]|0;if((xb|0)==(c[ma+16>>2]|0)){mc[c[(c[ma>>2]|0)+40>>2]&63](ma)|0}else{c[ja>>2]=xb+1}a[l]=1;xb=a[H]|0;if((xb&1)==0){Jb=(xb&255)>>>1}else{Jb=c[g>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Jb>>>0>1?z:Y;pb=Z;break b}if(va){va=mc[c[(c[la>>2]|0)+36>>2]&63](la)|0;Kb=va;Lb=a[G]|0}else{Kb=d[aa]|0;Lb=pa}if(!((Kb&255)<<24>>24==(a[(Lb&1)==0?K:c[M>>2]|0]|0))){a[l]=1;kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}aa=c[h>>2]|0;va=aa+12|0;la=c[va>>2]|0;if((la|0)==(c[aa+16>>2]|0)){mc[c[(c[aa>>2]|0)+40>>2]&63](aa)|0}else{c[va>>2]=la+1}la=a[G]|0;if((la&1)==0){Mb=(la&255)>>>1}else{Mb=c[L>>2]|0}kb=D;lb=X;mb=r;nb=W;ob=Mb>>>0>1?y:Y;pb=Z;break};case 2:{if(!((Y|0)!=0|p>>>0<2)){if((p|0)==2){Nb=(a[U]|0)!=0}else{Nb=0}if(!(N|Nb)){kb=D;lb=X;mb=r;nb=W;ob=0;pb=Z;break b}}la=a[F]|0;va=(la&1)==0;aa=va?j:c[O>>2]|0;d:do{if((p|0)==0){Ob=ca;Pb=ca;Qb=la;Rb=aa}else{if((d[f+(p+ -1)|0]|0)>=2){Ob=ca;Pb=ca;Qb=la;Rb=aa;break}xb=aa+(va?(la&255)>>>1:c[P>>2]|0)|0;ja=aa;while(1){if((ja|0)==(xb|0)){Sb=xb;break}ma=a[ja]|0;if(!(ma<<24>>24>-1)){Sb=ja;break}if((b[(c[s>>2]|0)+(ma<<24>>24<<1)>>1]&8192)==0){Sb=ja;break}else{ja=ja+1|0}}ja=Sb-aa|0;xb=a[I]|0;ka=(xb&1)==0;if(ka){Tb=(xb&255)>>>1}else{Tb=c[T>>2]|0}if(ja>>>0>Tb>>>0){Ob=ca;Pb=ca;Qb=la;Rb=aa;break}if(ka){ka=(xb&255)>>>1;Ub=Q+(ka-ja)+1|0;Vb=R;Wb=ka}else{ka=c[S>>2]|0;xb=c[T>>2]|0;Ub=ka+(xb-ja)|0;Vb=ka;Wb=xb}xb=Vb+Wb|0;if((Ub|0)==(xb|0)){Ob=ca;Pb=ca;Qb=la;Rb=Sb;break}else{Xb=aa;Yb=Ub}while(1){if((a[Yb]|0)!=(a[Xb]|0)){Ob=ca;Pb=ca;Qb=la;Rb=aa;break d}ka=Yb+1|0;if((ka|0)==(xb|0)){Ob=ca;Pb=ca;Qb=la;Rb=Sb;break}else{Xb=Xb+1|0;Yb=ka}}}}while(0);e:while(1){if((Qb&1)==0){Zb=j;_b=(Qb&255)>>>1}else{Zb=c[O>>2]|0;_b=c[P>>2]|0}if((Rb|0)==(Zb+_b|0)){break}la=c[h>>2]|0;do{if((la|0)==0){$b=0}else{if((c[la+12>>2]|0)!=(c[la+16>>2]|0)){$b=la;break}if((mc[c[(c[la>>2]|0)+36>>2]&63](la)|0)==-1){c[h>>2]=0;$b=0;break}else{$b=c[h>>2]|0;break}}}while(0);la=($b|0)==0;do{if((Pb|0)==0){ac=Ob;ba=147}else{if((c[Pb+12>>2]|0)!=(c[Pb+16>>2]|0)){if(la){bc=Ob;cc=Pb;break}else{break e}}if((mc[c[(c[Pb>>2]|0)+36>>2]&63](Pb)|0)==-1){c[e>>2]=0;ac=0;ba=147;break}else{if(la^(Ob|0)==0){bc=Ob;cc=Ob;break}else{break e}}}}while(0);if((ba|0)==147){ba=0;if(la){break}else{bc=ac;cc=0}}aa=c[h>>2]|0;va=c[aa+12>>2]|0;if((va|0)==(c[aa+16>>2]|0)){dc=mc[c[(c[aa>>2]|0)+36>>2]&63](aa)|0}else{dc=d[va]|0}if(!((dc&255)<<24>>24==(a[Rb]|0))){break}va=c[h>>2]|0;aa=va+12|0;pa=c[aa>>2]|0;if((pa|0)==(c[va+16>>2]|0)){mc[c[(c[va>>2]|0)+40>>2]&63](va)|0}else{c[aa>>2]=pa+1}Ob=bc;Pb=cc;Qb=a[F]|0;Rb=Rb+1|0}if(!N){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break b}pa=a[F]|0;if((pa&1)==0){ec=j;fc=(pa&255)>>>1}else{ec=c[O>>2]|0;fc=c[P>>2]|0}if((Rb|0)==(ec+fc|0)){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z}else{ba=162;break a}break};default:{kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z}}}while(0);f:do{if((ba|0)==26){ba=0;if((p|0)==3){da=X;ea=r;fa=Y;ga=Z;ba=269;break a}else{gc=ca;hc=ca}while(1){_=c[h>>2]|0;do{if((_|0)==0){ic=0}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){ic=_;break}if((mc[c[(c[_>>2]|0)+36>>2]&63](_)|0)==-1){c[h>>2]=0;ic=0;break}else{ic=c[h>>2]|0;break}}}while(0);_=(ic|0)==0;do{if((hc|0)==0){kc=gc;ba=37}else{if((c[hc+12>>2]|0)!=(c[hc+16>>2]|0)){if(_){lc=gc;nc=hc;break}else{kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}}if((mc[c[(c[hc>>2]|0)+36>>2]&63](hc)|0)==-1){c[e>>2]=0;kc=0;ba=37;break}else{if(_^(gc|0)==0){lc=gc;nc=gc;break}else{kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}}}}while(0);if((ba|0)==37){ba=0;if(_){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}else{lc=kc;nc=0}}la=c[h>>2]|0;pa=c[la+12>>2]|0;if((pa|0)==(c[la+16>>2]|0)){oc=mc[c[(c[la>>2]|0)+36>>2]&63](la)|0}else{oc=d[pa]|0}if(!((oc&255)<<24>>24>-1)){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}if((b[(c[s>>2]|0)+(oc<<24>>24<<1)>>1]&8192)==0){kb=D;lb=X;mb=r;nb=W;ob=Y;pb=Z;break f}pa=c[h>>2]|0;la=pa+12|0;aa=c[la>>2]|0;if((aa|0)==(c[pa+16>>2]|0)){pc=mc[c[(c[pa>>2]|0)+40>>2]&63](pa)|0}else{c[la>>2]=aa+1;pc=d[aa]|0}re(A,pc&255);gc=lc;hc=nc}}}while(0);aa=p+1|0;if(aa>>>0<4){W=nb;r=mb;X=lb;D=kb;p=aa;Y=ob;Z=pb}else{da=lb;ea=mb;fa=ob;ga=pb;ba=269;break}}g:do{if((ba|0)==25){c[k>>2]=c[k>>2]|4;qc=0;rc=X;sc=Z}else if((ba|0)==112){c[k>>2]=c[k>>2]|4;qc=0;rc=X;sc=Z}else if((ba|0)==162){c[k>>2]=c[k>>2]|4;qc=0;rc=X;sc=Z}else if((ba|0)==182){Nm()}else if((ba|0)==198){Nm()}else if((ba|0)==209){Nm()}else if((ba|0)==229){c[k>>2]=c[k>>2]|4;qc=0;rc=La;sc=Oa}else if((ba|0)==250){c[k>>2]=c[k>>2]|4;qc=0;rc=La;sc=Oa}else if((ba|0)==253){Nm()}else if((ba|0)==267){c[k>>2]=c[k>>2]|4;qc=0;rc=La;sc=Oa}else if((ba|0)==269){h:do{if((fa|0)!=0){pb=fa;ob=fa+1|0;mb=fa+8|0;lb=fa+4|0;Y=1;i:while(1){p=a[pb]|0;if((p&1)==0){tc=(p&255)>>>1}else{tc=c[lb>>2]|0}if(!(Y>>>0<tc>>>0)){break h}p=c[h>>2]|0;do{if((p|0)==0){uc=0}else{if((c[p+12>>2]|0)!=(c[p+16>>2]|0)){uc=p;break}if((mc[c[(c[p>>2]|0)+36>>2]&63](p)|0)==-1){c[h>>2]=0;uc=0;break}else{uc=c[h>>2]|0;break}}}while(0);p=(uc|0)==0;_=c[e>>2]|0;do{if((_|0)==0){ba=285}else{if((c[_+12>>2]|0)!=(c[_+16>>2]|0)){if(p){break}else{break i}}if((mc[c[(c[_>>2]|0)+36>>2]&63](_)|0)==-1){c[e>>2]=0;ba=285;break}else{if(p){break}else{break i}}}}while(0);if((ba|0)==285){ba=0;if(p){break}}_=c[h>>2]|0;kb=c[_+12>>2]|0;if((kb|0)==(c[_+16>>2]|0)){vc=mc[c[(c[_>>2]|0)+36>>2]&63](_)|0}else{vc=d[kb]|0}if((a[pb]&1)==0){wc=ob}else{wc=c[mb>>2]|0}if(!((vc&255)<<24>>24==(a[wc+Y|0]|0))){break}kb=Y+1|0;_=c[h>>2]|0;D=_+12|0;r=c[D>>2]|0;if((r|0)==(c[_+16>>2]|0)){mc[c[(c[_>>2]|0)+40>>2]&63](_)|0;Y=kb;continue}else{c[D>>2]=r+1;Y=kb;continue}}c[k>>2]=c[k>>2]|4;qc=0;rc=da;sc=ga;break g}}while(0);if((da|0)==(ea|0)){qc=1;rc=ea;sc=ga;break}c[C>>2]=0;dj(w,da,ea,C);if((c[C>>2]|0)==0){qc=1;rc=da;sc=ga;break}c[k>>2]=c[k>>2]|4;qc=0;rc=da;sc=ga}}while(0);me(A);me(z);me(y);me(x);me(w);if((rc|0)==0){i=q;return qc|0}jc[sc&127](rc);i=q;return qc|0}function $i(a){a=a|0;var b=0;b=Va(8)|0;Vd(b,a);xb(b|0,227360,11)}function aj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;d=i;i=i+168|0;l=d;m=d+8|0;n=d+24|0;o=d+128|0;p=d+136|0;q=d+144|0;r=d+152|0;s=d+160|0;t=o;c[t>>2]=n;u=o+4|0;c[u>>2]=114;v=n+100|0;Ge(q,h);n=q;w=c[n>>2]|0;if(!((c[57588]|0)==-1)){c[m>>2]=230352;c[m+4>>2]=112;c[m+8>>2]=0;he(230352,m,113)}m=(c[230356>>2]|0)+ -1|0;x=c[w+8>>2]|0;if(!((c[w+12>>2]|0)-x>>2>>>0>m>>>0)){y=Va(4)|0;z=y;gm(z);xb(y|0,238312,101)}w=c[x+(m<<2)>>2]|0;if((w|0)==0){y=Va(4)|0;z=y;gm(z);xb(y|0,238312,101)}y=w;a[r]=0;z=f;f=c[z>>2]|0;c[s>>2]=f;m=c[h+4>>2]|0;h=l;x=s;c[h+0>>2]=c[x+0>>2];x=_i(e,l,g,q,m,j,r,y,o,p,v)|0;if(x){x=k;if((a[x]&1)==0){a[k+1|0]=0;a[x]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}x=w;if((a[r]|0)!=0){re(k,vc[c[(c[x>>2]|0)+28>>2]&15](y,45)|0)}r=vc[c[(c[x>>2]|0)+28>>2]&15](y,48)|0;y=c[t>>2]|0;x=c[p>>2]|0;p=x+ -1|0;a:do{if(y>>>0<p>>>0){w=y;while(1){v=w+1|0;if(!((a[w]|0)==r<<24>>24)){A=w;break a}if(v>>>0<p>>>0){w=v}else{A=v;break}}}else{A=y}}while(0);bj(k,A,x)|0}x=e;e=c[x>>2]|0;do{if((e|0)==0){B=0}else{if((c[e+12>>2]|0)!=(c[e+16>>2]|0)){B=e;break}if(!((mc[c[(c[e>>2]|0)+36>>2]&63](e)|0)==-1)){B=e;break}c[x>>2]=0;B=0}}while(0);x=(B|0)==0;do{if((f|0)==0){C=25}else{if((c[f+12>>2]|0)!=(c[f+16>>2]|0)){if(x){break}else{C=27;break}}if((mc[c[(c[f>>2]|0)+36>>2]&63](f)|0)==-1){c[z>>2]=0;C=25;break}else{if(x^(f|0)==0){break}else{C=27;break}}}}while(0);if((C|0)==25){if(x){C=27}}if((C|0)==27){c[j>>2]=c[j>>2]|2}c[b>>2]=B;Pd(c[n>>2]|0)|0;n=c[t>>2]|0;c[t>>2]=0;if((n|0)==0){i=d;return}jc[c[u>>2]&127](n);i=d;return}function bj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;g=b;h=d;j=a[g]|0;if((j&1)==0){k=(j&255)>>>1;l=j;m=10}else{j=c[b>>2]|0;k=c[b+4>>2]|0;l=j&255;m=(j&-2)+ -1|0}j=e-h|0;if((e|0)==(d|0)){i=f;return b|0}if((m-k|0)>>>0<j>>>0){ue(b,m,k+j-m|0,k,k,0,0);n=a[g]|0}else{n=l}if((n&1)==0){o=b+1|0}else{o=c[b+8>>2]|0}n=e+(k-h)|0;h=d;d=o+k|0;while(1){a[d]=a[h]|0;l=h+1|0;if((l|0)==(e|0)){break}else{d=d+1|0;h=l}}a[o+n|0]=0;n=k+j|0;if((a[g]&1)==0){a[g]=n<<1;i=f;return b|0}else{c[b+4>>2]=n;i=f;return b|0}return 0}function cj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;n=i;i=i+176|0;o=n;p=n+16|0;q=n+32|0;r=n+40|0;s=n+56|0;t=n+72|0;u=n+88|0;v=n+104|0;w=n+112|0;x=n+128|0;y=n+144|0;z=n+160|0;if(b){b=c[d>>2]|0;if(!((c[57448]|0)==-1)){c[p>>2]=229792;c[p+4>>2]=112;c[p+8>>2]=0;he(229792,p,113)}p=(c[229796>>2]|0)+ -1|0;A=c[b+8>>2]|0;if(!((c[b+12>>2]|0)-A>>2>>>0>p>>>0)){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}b=c[A+(p<<2)>>2]|0;if((b|0)==0){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}B=b;kc[c[(c[b>>2]|0)+44>>2]&63](q,B);C=e;p=c[q>>2]|0;a[C]=p;a[C+1|0]=p>>8;a[C+2|0]=p>>16;a[C+3|0]=p>>24;p=b;kc[c[(c[p>>2]|0)+32>>2]&63](r,B);C=l;if((a[C]&1)==0){a[l+1|0]=0;a[C]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}qe(l,0);q=r;c[C+0>>2]=c[q+0>>2];c[C+4>>2]=c[q+4>>2];c[C+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;me(r);kc[c[(c[p>>2]|0)+28>>2]&63](s,B);r=k;if((a[r]&1)==0){a[k+1|0]=0;a[r]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}qe(k,0);q=s;c[r+0>>2]=c[q+0>>2];c[r+4>>2]=c[q+4>>2];c[r+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;me(s);s=b;a[f]=mc[c[(c[s>>2]|0)+12>>2]&63](B)|0;a[g]=mc[c[(c[s>>2]|0)+16>>2]&63](B)|0;kc[c[(c[p>>2]|0)+20>>2]&63](t,B);s=h;if((a[s]&1)==0){a[h+1|0]=0;a[s]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}qe(h,0);q=t;c[s+0>>2]=c[q+0>>2];c[s+4>>2]=c[q+4>>2];c[s+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;me(t);kc[c[(c[p>>2]|0)+24>>2]&63](u,B);p=j;if((a[p]&1)==0){a[j+1|0]=0;a[p]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}qe(j,0);t=u;c[p+0>>2]=c[t+0>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;me(u);D=mc[c[(c[b>>2]|0)+36>>2]&63](B)|0;c[m>>2]=D;i=n;return}else{B=c[d>>2]|0;if(!((c[57432]|0)==-1)){c[o>>2]=229728;c[o+4>>2]=112;c[o+8>>2]=0;he(229728,o,113)}o=(c[229732>>2]|0)+ -1|0;d=c[B+8>>2]|0;if(!((c[B+12>>2]|0)-d>>2>>>0>o>>>0)){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}B=c[d+(o<<2)>>2]|0;if((B|0)==0){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}E=B;kc[c[(c[B>>2]|0)+44>>2]&63](v,E);F=e;e=c[v>>2]|0;a[F]=e;a[F+1|0]=e>>8;a[F+2|0]=e>>16;a[F+3|0]=e>>24;e=B;kc[c[(c[e>>2]|0)+32>>2]&63](w,E);F=l;if((a[F]&1)==0){a[l+1|0]=0;a[F]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}qe(l,0);l=w;c[F+0>>2]=c[l+0>>2];c[F+4>>2]=c[l+4>>2];c[F+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;me(w);kc[c[(c[e>>2]|0)+28>>2]&63](x,E);w=k;if((a[w]&1)==0){a[k+1|0]=0;a[w]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}qe(k,0);k=x;c[w+0>>2]=c[k+0>>2];c[w+4>>2]=c[k+4>>2];c[w+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;me(x);x=B;a[f]=mc[c[(c[x>>2]|0)+12>>2]&63](E)|0;a[g]=mc[c[(c[x>>2]|0)+16>>2]&63](E)|0;kc[c[(c[e>>2]|0)+20>>2]&63](y,E);x=h;if((a[x]&1)==0){a[h+1|0]=0;a[x]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}qe(h,0);h=y;c[x+0>>2]=c[h+0>>2];c[x+4>>2]=c[h+4>>2];c[x+8>>2]=c[h+8>>2];c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;me(y);kc[c[(c[e>>2]|0)+24>>2]&63](z,E);e=j;if((a[e]&1)==0){a[j+1|0]=0;a[e]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}qe(j,0);j=z;c[e+0>>2]=c[j+0>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;me(z);D=mc[c[(c[B>>2]|0)+36>>2]&63](E)|0;c[m>>2]=D;i=n;return}}function dj(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;h=b;j=a[h]|0;if((j&1)==0){k=(j&255)>>>1}else{k=c[b+4>>2]|0}if((k|0)==0){i=g;return}do{if((d|0)==(e|0)){l=j}else{k=e+ -4|0;if(k>>>0>d>>>0){m=d;n=k}else{l=j;break}do{k=c[m>>2]|0;c[m>>2]=c[n>>2];c[n>>2]=k;m=m+4|0;n=n+ -4|0;}while(m>>>0<n>>>0);l=a[h]|0}}while(0);if((l&1)==0){o=b+1|0;p=(l&255)>>>1}else{o=c[b+8>>2]|0;p=c[b+4>>2]|0}b=e+ -4|0;e=a[o]|0;l=e<<24>>24<1|e<<24>>24==127;a:do{if(b>>>0>d>>>0){h=o+p|0;n=e;m=o;j=d;k=l;while(1){if(!k){if((n<<24>>24|0)!=(c[j>>2]|0)){break}}q=(h-m|0)>1?m+1|0:m;r=j+4|0;s=a[q]|0;t=s<<24>>24<1|s<<24>>24==127;if(r>>>0<b>>>0){n=s;m=q;j=r;k=t}else{u=s;v=t;break a}}c[f>>2]=4;i=g;return}else{u=e;v=l}}while(0);if(v){i=g;return}v=c[b>>2]|0;if(!(u<<24>>24>>>0<v>>>0|(v|0)==0)){i=g;return}c[f>>2]=4;i=g;return}function ej(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function fj(a){a=a|0;i=i;return}function gj(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;d=i;i=i+16|0;l=d;m=d+8|0;n=i;i=i+16|0;o=i;i=i+400|0;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+8|0;s=i;i=i+8|0;t=i;i=i+8|0;u=i;i=i+40|0;v=i;i=i+104|0;w=p;c[w>>2]=o;x=p+4|0;c[x>>2]=114;y=o+400|0;Ge(r,h);o=r;z=c[o>>2]|0;if(!((c[57586]|0)==-1)){c[n>>2]=230344;c[n+4>>2]=112;c[n+8>>2]=0;he(230344,n,113)}n=(c[230348>>2]|0)+ -1|0;A=c[z+8>>2]|0;if(!((c[z+12>>2]|0)-A>>2>>>0>n>>>0)){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}z=c[A+(n<<2)>>2]|0;if((z|0)==0){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}B=z;a[s]=0;C=f;c[t>>2]=c[C>>2];f=c[h+4>>2]|0;h=l;n=t;c[h+0>>2]=c[n+0>>2];n=hj(e,l,g,r,f,j,s,B,p,q,y)|0;do{if(n){y=u;sc[c[(c[z>>2]|0)+48>>2]&7](B,230048,230058|0,y)|0;p=v;f=c[q>>2]|0;r=c[w>>2]|0;g=f-r|0;do{if((g|0)>392){l=Bm((g>>2)+2|0)|0;if((l|0)!=0){D=l;E=l;break}Nm()}else{D=0;E=p}}while(0);if((a[s]|0)==0){F=E}else{a[E]=45;F=E+1|0}if(r>>>0<f>>>0){g=u+40|0;l=u;h=F;t=r;while(1){A=c[t>>2]|0;G=y;while(1){H=G+4|0;if((c[G>>2]|0)==(A|0)){I=G;break}if((H|0)==(g|0)){I=g;break}else{G=H}}a[h]=a[230048+(I-l>>2)|0]|0;G=t+4|0;A=h+1|0;if(G>>>0<(c[q>>2]|0)>>>0){h=A;t=G}else{J=A;break}}}else{J=F}a[J]=0;c[m>>2]=k;if((gb(p|0,229984,m|0)|0)!=1){t=Va(8)|0;Vd(t,229992);xb(t|0,227360,11)}if((D|0)==0){break}Cm(D)}}while(0);D=e;e=c[D>>2]|0;do{if((e|0)==0){K=1}else{m=c[e+12>>2]|0;if((m|0)==(c[e+16>>2]|0)){L=mc[c[(c[e>>2]|0)+36>>2]&63](e)|0}else{L=c[m>>2]|0}if((L|0)==-1){c[D>>2]=0;K=1;break}else{K=(c[D>>2]|0)==0;break}}}while(0);L=c[C>>2]|0;do{if((L|0)==0){M=35}else{e=c[L+12>>2]|0;if((e|0)==(c[L+16>>2]|0)){N=mc[c[(c[L>>2]|0)+36>>2]&63](L)|0}else{N=c[e>>2]|0}if((N|0)==-1){c[C>>2]=0;M=35;break}else{if(K){break}else{M=37;break}}}}while(0);if((M|0)==35){if(K){M=37}}if((M|0)==37){c[j>>2]=c[j>>2]|2}c[b>>2]=c[D>>2];Pd(c[o>>2]|0)|0;o=c[w>>2]|0;c[w>>2]=0;if((o|0)==0){i=d;return}jc[c[x>>2]&127](o);i=d;return}\n\n\n\nfunction hj(b,e,f,g,h,j,k,l,m,n,o){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,hc=0,ic=0,kc=0,lc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec=0,Fc=0;p=i;i=i+408|0;q=p;r=p+400|0;s=r;t=i;i=i+8|0;u=i;i=i+8|0;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+8|0;B=i;i=i+8|0;C=q;c[r>>2]=0;D=v;c[D+0>>2]=0;c[D+4>>2]=0;c[D+8>>2]=0;E=w;c[E+0>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;F=x;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;G=y;c[G+0>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;H=z;c[H+0>>2]=0;c[H+4>>2]=0;c[H+8>>2]=0;kj(f,g,s,t,u,v,w,x,y,A);s=m;c[n>>2]=c[s>>2];g=b;b=e;e=r;r=l;f=y+4|0;I=y+8|0;J=x+4|0;K=x+8|0;L=(h&512|0)!=0;h=w+4|0;M=w+8|0;N=z+4|0;O=z+8|0;P=e+3|0;Q=m+4|0;m=v+4|0;R=q+400|0;q=C;S=C;C=o;o=0;T=0;U=114;a:while(1){V=c[g>>2]|0;do{if((V|0)==0){W=1}else{X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){Y=mc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{Y=c[X>>2]|0}if((Y|0)==-1){c[g>>2]=0;W=1;break}else{W=(c[g>>2]|0)==0;break}}}while(0);V=c[b>>2]|0;do{if((V|0)==0){Z=15}else{X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){_=mc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{_=c[X>>2]|0}if((_|0)==-1){c[b>>2]=0;Z=15;break}else{if(W){$=V;break}else{aa=S;ba=q;ca=T;da=U;Z=292;break a}}}}while(0);if((Z|0)==15){Z=0;if(W){aa=S;ba=q;ca=T;da=U;Z=292;break}else{$=0}}b:do{switch(a[e+o|0]|0){case 1:{if((o|0)==3){aa=S;ba=q;ca=T;da=U;Z=292;break a}V=c[g>>2]|0;X=c[V+12>>2]|0;if((X|0)==(c[V+16>>2]|0)){ea=mc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{ea=c[X>>2]|0}if(!(gc[c[(c[r>>2]|0)+12>>2]&31](l,8192,ea)|0)){Z=27;break a}X=c[g>>2]|0;V=X+12|0;fa=c[V>>2]|0;if((fa|0)==(c[X+16>>2]|0)){ga=mc[c[(c[X>>2]|0)+40>>2]&63](X)|0}else{c[V>>2]=fa+4;ga=c[fa>>2]|0}Be(z,ga);Z=28;break};case 0:{Z=28;break};case 3:{fa=a[F]|0;V=(fa&1)==0;if(V){ha=(fa&255)>>>1}else{ha=c[J>>2]|0}X=a[G]|0;ia=(X&1)==0;if(ia){ja=(X&255)>>>1}else{ja=c[f>>2]|0}if((ha|0)==(0-ja|0)){ka=C;la=S;ma=q;na=R;oa=T;pa=U;break b}if(V){qa=(fa&255)>>>1}else{qa=c[J>>2]|0}do{if((qa|0)!=0){if(ia){ra=(X&255)>>>1}else{ra=c[f>>2]|0}if((ra|0)==0){break}sa=c[g>>2]|0;ta=c[sa+12>>2]|0;if((ta|0)==(c[sa+16>>2]|0)){ua=mc[c[(c[sa>>2]|0)+36>>2]&63](sa)|0;va=ua;wa=a[F]|0}else{va=c[ta>>2]|0;wa=fa}ta=c[g>>2]|0;ua=ta+12|0;sa=c[ua>>2]|0;xa=(sa|0)==(c[ta+16>>2]|0);if((va|0)==(c[((wa&1)==0?J:c[K>>2]|0)>>2]|0)){if(xa){mc[c[(c[ta>>2]|0)+40>>2]&63](ta)|0}else{c[ua>>2]=sa+4}ua=a[F]|0;if((ua&1)==0){ya=(ua&255)>>>1}else{ya=c[J>>2]|0}ka=C;la=S;ma=q;na=R;oa=ya>>>0>1?x:T;pa=U;break b}if(xa){za=mc[c[(c[ta>>2]|0)+36>>2]&63](ta)|0}else{za=c[sa>>2]|0}if((za|0)!=(c[((a[G]&1)==0?f:c[I>>2]|0)>>2]|0)){Z=116;break a}sa=c[g>>2]|0;ta=sa+12|0;xa=c[ta>>2]|0;if((xa|0)==(c[sa+16>>2]|0)){mc[c[(c[sa>>2]|0)+40>>2]&63](sa)|0}else{c[ta>>2]=xa+4}a[k]=1;xa=a[G]|0;if((xa&1)==0){Aa=(xa&255)>>>1}else{Aa=c[f>>2]|0}ka=C;la=S;ma=q;na=R;oa=Aa>>>0>1?y:T;pa=U;break b}}while(0);if(V){Ba=(fa&255)>>>1}else{Ba=c[J>>2]|0}ia=c[g>>2]|0;xa=c[ia+12>>2]|0;ta=(xa|0)==(c[ia+16>>2]|0);if((Ba|0)==0){if(ta){sa=mc[c[(c[ia>>2]|0)+36>>2]&63](ia)|0;Ca=sa;Da=a[G]|0}else{Ca=c[xa>>2]|0;Da=X}if((Ca|0)!=(c[((Da&1)==0?f:c[I>>2]|0)>>2]|0)){ka=C;la=S;ma=q;na=R;oa=T;pa=U;break b}sa=c[g>>2]|0;ua=sa+12|0;Ea=c[ua>>2]|0;if((Ea|0)==(c[sa+16>>2]|0)){mc[c[(c[sa>>2]|0)+40>>2]&63](sa)|0}else{c[ua>>2]=Ea+4}a[k]=1;Ea=a[G]|0;if((Ea&1)==0){Fa=(Ea&255)>>>1}else{Fa=c[f>>2]|0}ka=C;la=S;ma=q;na=R;oa=Fa>>>0>1?y:T;pa=U;break b}if(ta){ta=mc[c[(c[ia>>2]|0)+36>>2]&63](ia)|0;Ga=ta;Ha=a[F]|0}else{Ga=c[xa>>2]|0;Ha=fa}if((Ga|0)!=(c[((Ha&1)==0?J:c[K>>2]|0)>>2]|0)){a[k]=1;ka=C;la=S;ma=q;na=R;oa=T;pa=U;break b}xa=c[g>>2]|0;ta=xa+12|0;ia=c[ta>>2]|0;if((ia|0)==(c[xa+16>>2]|0)){mc[c[(c[xa>>2]|0)+40>>2]&63](xa)|0}else{c[ta>>2]=ia+4}ia=a[F]|0;if((ia&1)==0){Ia=(ia&255)>>>1}else{Ia=c[J>>2]|0}ka=C;la=S;ma=q;na=R;oa=Ia>>>0>1?x:T;pa=U;break};case 2:{if(!((T|0)!=0|o>>>0<2)){if((o|0)==2){Ja=(a[P]|0)!=0}else{Ja=0}if(!(L|Ja)){ka=C;la=S;ma=q;na=R;oa=0;pa=U;break b}}ia=a[E]|0;ta=(ia&1)==0?h:c[M>>2]|0;c:do{if((o|0)==0){Ka=$;La=$;Ma=ia;Na=ta}else{if((d[e+(o+ -1)|0]|0)<2){Oa=ia;Pa=ta}else{Ka=$;La=$;Ma=ia;Na=ta;break}while(1){if((Oa&1)==0){Qa=h;Ra=(Oa&255)>>>1}else{Qa=c[M>>2]|0;Ra=c[h>>2]|0}if((Pa|0)==(Qa+(Ra<<2)|0)){Sa=Oa;break}if(!(gc[c[(c[r>>2]|0)+12>>2]&31](l,8192,c[Pa>>2]|0)|0)){Z=129;break}Oa=a[E]|0;Pa=Pa+4|0}if((Z|0)==129){Z=0;Sa=a[E]|0}xa=(Sa&1)==0;Ea=Pa-(xa?h:c[M>>2]|0)>>2;ua=a[H]|0;sa=(ua&1)==0;if(sa){Ta=(ua&255)>>>1}else{Ta=c[N>>2]|0}d:do{if(!(Ea>>>0>Ta>>>0)){if(sa){Ua=N+(((ua&255)>>>1)-Ea<<2)|0;Va=N;Wa=(ua&255)>>>1}else{Xa=c[O>>2]|0;Ya=c[N>>2]|0;Ua=Xa+(Ya-Ea<<2)|0;Va=Xa;Wa=Ya}Ya=Va+(Wa<<2)|0;if((Ua|0)==(Ya|0)){Ka=$;La=$;Ma=Sa;Na=Pa;break c}else{Za=xa?h:c[M>>2]|0;_a=Ua}while(1){if((c[_a>>2]|0)!=(c[Za>>2]|0)){break d}Xa=_a+4|0;if((Xa|0)==(Ya|0)){Ka=$;La=$;Ma=Sa;Na=Pa;break c}Za=Za+4|0;_a=Xa}}}while(0);Ka=$;La=$;Ma=Sa;Na=xa?h:c[M>>2]|0}}while(0);e:while(1){if((Ma&1)==0){$a=h;ab=(Ma&255)>>>1}else{$a=c[M>>2]|0;ab=c[h>>2]|0}if((Na|0)==($a+(ab<<2)|0)){break}ta=c[g>>2]|0;do{if((ta|0)==0){bb=1}else{ia=c[ta+12>>2]|0;if((ia|0)==(c[ta+16>>2]|0)){cb=mc[c[(c[ta>>2]|0)+36>>2]&63](ta)|0}else{cb=c[ia>>2]|0}if((cb|0)==-1){c[g>>2]=0;bb=1;break}else{bb=(c[g>>2]|0)==0;break}}}while(0);do{if((La|0)==0){db=Ka;Z=159}else{ta=c[La+12>>2]|0;if((ta|0)==(c[La+16>>2]|0)){eb=mc[c[(c[La>>2]|0)+36>>2]&63](La)|0}else{eb=c[ta>>2]|0}if((eb|0)==-1){c[b>>2]=0;db=0;Z=159;break}else{if(bb^(Ka|0)==0){fb=Ka;gb=Ka;break}else{break e}}}}while(0);if((Z|0)==159){Z=0;if(bb){break}else{fb=db;gb=0}}ta=c[g>>2]|0;xa=c[ta+12>>2]|0;if((xa|0)==(c[ta+16>>2]|0)){hb=mc[c[(c[ta>>2]|0)+36>>2]&63](ta)|0}else{hb=c[xa>>2]|0}if((hb|0)!=(c[Na>>2]|0)){break}xa=c[g>>2]|0;ta=xa+12|0;ia=c[ta>>2]|0;if((ia|0)==(c[xa+16>>2]|0)){mc[c[(c[xa>>2]|0)+40>>2]&63](xa)|0}else{c[ta>>2]=ia+4}Ka=fb;La=gb;Ma=a[E]|0;Na=Na+4|0}if(!L){ka=C;la=S;ma=q;na=R;oa=T;pa=U;break b}ia=a[E]|0;if((ia&1)==0){ib=h;jb=(ia&255)>>>1}else{ib=c[M>>2]|0;jb=c[h>>2]|0}if((Na|0)==(ib+(jb<<2)|0)){ka=C;la=S;ma=q;na=R;oa=T;pa=U}else{Z=174;break a}break};case 4:{ia=C;ta=S;xa=q;fa=R;X=0;V=U;f:while(1){Ea=c[g>>2]|0;do{if((Ea|0)==0){kb=1}else{ua=c[Ea+12>>2]|0;if((ua|0)==(c[Ea+16>>2]|0)){lb=mc[c[(c[Ea>>2]|0)+36>>2]&63](Ea)|0}else{lb=c[ua>>2]|0}if((lb|0)==-1){c[g>>2]=0;kb=1;break}else{kb=(c[g>>2]|0)==0;break}}}while(0);Ea=c[b>>2]|0;do{if((Ea|0)==0){Z=188}else{ua=c[Ea+12>>2]|0;if((ua|0)==(c[Ea+16>>2]|0)){mb=mc[c[(c[Ea>>2]|0)+36>>2]&63](Ea)|0}else{mb=c[ua>>2]|0}if((mb|0)==-1){c[b>>2]=0;Z=188;break}else{if(kb){break}else{break f}}}}while(0);if((Z|0)==188){Z=0;if(kb){break}}Ea=c[g>>2]|0;ua=c[Ea+12>>2]|0;if((ua|0)==(c[Ea+16>>2]|0)){nb=mc[c[(c[Ea>>2]|0)+36>>2]&63](Ea)|0}else{nb=c[ua>>2]|0}if(gc[c[(c[r>>2]|0)+12>>2]&31](l,2048,nb)|0){ua=c[n>>2]|0;if((ua|0)==(ia|0)){Ea=(c[Q>>2]|0)!=114;sa=c[s>>2]|0;Ya=ia-sa|0;Xa=Ya>>>0<2147483647?Ya<<1:-1;ob=Ya>>2;if(Ea){pb=sa}else{pb=0}sa=Dm(pb,Xa)|0;Ya=sa;if((sa|0)==0){Z=198;break a}do{if(Ea){c[s>>2]=Ya;qb=Ya}else{sa=c[s>>2]|0;c[s>>2]=Ya;if((sa|0)==0){qb=Ya;break}jc[c[Q>>2]&127](sa);qb=c[s>>2]|0}}while(0);c[Q>>2]=115;Ya=qb+(ob<<2)|0;c[n>>2]=Ya;rb=Ya;sb=(c[s>>2]|0)+(Xa>>>2<<2)|0}else{rb=ua;sb=ia}c[n>>2]=rb+4;c[rb>>2]=nb;tb=sb;ub=ta;vb=xa;wb=fa;xb=X+1|0;yb=V}else{Ya=a[D]|0;if((Ya&1)==0){zb=(Ya&255)>>>1}else{zb=c[m>>2]|0}if((zb|0)==0|(X|0)==0){break}if((nb|0)!=(c[u>>2]|0)){break}if((xa|0)==(fa|0)){Ya=xa-ta|0;Ea=Ya>>>0<2147483647?Ya<<1:-1;if((V|0)!=114){Ab=ta}else{Ab=0}sa=Dm(Ab,Ea)|0;Bb=sa;if((sa|0)==0){Z=214;break a}Cb=Bb;Db=Bb+(Ya>>2<<2)|0;Eb=Bb+(Ea>>>2<<2)|0;Fb=115}else{Cb=ta;Db=xa;Eb=fa;Fb=V}c[Db>>2]=X;tb=ia;ub=Cb;vb=Db+4|0;wb=Eb;xb=0;yb=Fb}Ea=c[g>>2]|0;Bb=Ea+12|0;Ya=c[Bb>>2]|0;if((Ya|0)==(c[Ea+16>>2]|0)){mc[c[(c[Ea>>2]|0)+40>>2]&63](Ea)|0;ia=tb;ta=ub;xa=vb;fa=wb;X=xb;V=yb;continue}else{c[Bb>>2]=Ya+4;ia=tb;ta=ub;xa=vb;fa=wb;X=xb;V=yb;continue}}if((ta|0)==(xa|0)|(X|0)==0){Gb=ta;Hb=xa;Ib=fa;Jb=V}else{if((xa|0)==(fa|0)){Ya=xa-ta|0;Bb=Ya>>>0<2147483647?Ya<<1:-1;if((V|0)!=114){Kb=ta}else{Kb=0}Ea=Dm(Kb,Bb)|0;sa=Ea;if((Ea|0)==0){Z=225;break a}Lb=sa;Mb=sa+(Ya>>2<<2)|0;Nb=sa+(Bb>>>2<<2)|0;Ob=115}else{Lb=ta;Mb=xa;Nb=fa;Ob=V}c[Mb>>2]=X;Gb=Lb;Hb=Mb+4|0;Ib=Nb;Jb=Ob}Bb=c[A>>2]|0;if((Bb|0)>0){sa=c[g>>2]|0;do{if((sa|0)==0){Pb=1}else{Ya=c[sa+12>>2]|0;if((Ya|0)==(c[sa+16>>2]|0)){Qb=mc[c[(c[sa>>2]|0)+36>>2]&63](sa)|0}else{Qb=c[Ya>>2]|0}if((Qb|0)==-1){c[g>>2]=0;Pb=1;break}else{Pb=(c[g>>2]|0)==0;break}}}while(0);sa=c[b>>2]|0;do{if((sa|0)==0){Z=242}else{X=c[sa+12>>2]|0;if((X|0)==(c[sa+16>>2]|0)){Rb=mc[c[(c[sa>>2]|0)+36>>2]&63](sa)|0}else{Rb=c[X>>2]|0}if((Rb|0)==-1){c[b>>2]=0;Z=242;break}else{if(Pb){Sb=sa;break}else{Z=248;break a}}}}while(0);if((Z|0)==242){Z=0;if(Pb){Z=248;break a}else{Sb=0}}sa=c[g>>2]|0;X=c[sa+12>>2]|0;if((X|0)==(c[sa+16>>2]|0)){Tb=mc[c[(c[sa>>2]|0)+36>>2]&63](sa)|0}else{Tb=c[X>>2]|0}if((Tb|0)!=(c[t>>2]|0)){Z=248;break a}X=c[g>>2]|0;sa=X+12|0;V=c[sa>>2]|0;if((V|0)==(c[X+16>>2]|0)){mc[c[(c[X>>2]|0)+40>>2]&63](X)|0;Ub=Sb;Vb=Bb;Wb=Sb;Xb=ia}else{c[sa>>2]=V+4;Ub=Sb;Vb=Bb;Wb=Sb;Xb=ia}while(1){V=c[g>>2]|0;do{if((V|0)==0){Yb=1}else{sa=c[V+12>>2]|0;if((sa|0)==(c[V+16>>2]|0)){Zb=mc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{Zb=c[sa>>2]|0}if((Zb|0)==-1){c[g>>2]=0;Yb=1;break}else{Yb=(c[g>>2]|0)==0;break}}}while(0);do{if((Wb|0)==0){_b=Ub;Z=265}else{V=c[Wb+12>>2]|0;if((V|0)==(c[Wb+16>>2]|0)){$b=mc[c[(c[Wb>>2]|0)+36>>2]&63](Wb)|0}else{$b=c[V>>2]|0}if(($b|0)==-1){c[b>>2]=0;_b=0;Z=265;break}else{if(Yb^(Ub|0)==0){ac=Ub;bc=Ub;break}else{Z=271;break a}}}}while(0);if((Z|0)==265){Z=0;if(Yb){Z=271;break a}else{ac=_b;bc=0}}V=c[g>>2]|0;ua=c[V+12>>2]|0;if((ua|0)==(c[V+16>>2]|0)){cc=mc[c[(c[V>>2]|0)+36>>2]&63](V)|0}else{cc=c[ua>>2]|0}if(!(gc[c[(c[r>>2]|0)+12>>2]&31](l,2048,cc)|0)){Z=271;break a}ua=c[n>>2]|0;if((ua|0)==(Xb|0)){V=(c[Q>>2]|0)!=114;Xa=c[s>>2]|0;ob=Xb-Xa|0;sa=ob>>>0<2147483647?ob<<1:-1;X=ob>>2;if(V){dc=Xa}else{dc=0}Xa=Dm(dc,sa)|0;ob=Xa;if((Xa|0)==0){Z=276;break a}do{if(V){c[s>>2]=ob;ec=ob}else{Xa=c[s>>2]|0;c[s>>2]=ob;if((Xa|0)==0){ec=ob;break}jc[c[Q>>2]&127](Xa);ec=c[s>>2]|0}}while(0);c[Q>>2]=115;ob=ec+(X<<2)|0;c[n>>2]=ob;fc=ob;hc=(c[s>>2]|0)+(sa>>>2<<2)|0}else{fc=ua;hc=Xb}ob=c[g>>2]|0;V=c[ob+12>>2]|0;if((V|0)==(c[ob+16>>2]|0)){Xa=mc[c[(c[ob>>2]|0)+36>>2]&63](ob)|0;ic=Xa;kc=c[n>>2]|0}else{ic=c[V>>2]|0;kc=fc}c[n>>2]=kc+4;c[kc>>2]=ic;V=Vb+ -1|0;c[A>>2]=V;Xa=c[g>>2]|0;ob=Xa+12|0;fa=c[ob>>2]|0;if((fa|0)==(c[Xa+16>>2]|0)){mc[c[(c[Xa>>2]|0)+40>>2]&63](Xa)|0}else{c[ob>>2]=fa+4}if((V|0)>0){Ub=ac;Vb=V;Wb=bc;Xb=hc}else{lc=hc;break}}}else{lc=ia}if((c[n>>2]|0)==(c[s>>2]|0)){Z=290;break a}else{ka=lc;la=Gb;ma=Hb;na=Ib;oa=T;pa=Jb}break};default:{ka=C;la=S;ma=q;na=R;oa=T;pa=U}}}while(0);g:do{if((Z|0)==28){Z=0;if((o|0)==3){aa=S;ba=q;ca=T;da=U;Z=292;break a}else{nc=$;oc=$}while(1){Bb=c[g>>2]|0;do{if((Bb|0)==0){pc=1}else{V=c[Bb+12>>2]|0;if((V|0)==(c[Bb+16>>2]|0)){qc=mc[c[(c[Bb>>2]|0)+36>>2]&63](Bb)|0}else{qc=c[V>>2]|0}if((qc|0)==-1){c[g>>2]=0;pc=1;break}else{pc=(c[g>>2]|0)==0;break}}}while(0);do{if((oc|0)==0){rc=nc;Z=42}else{Bb=c[oc+12>>2]|0;if((Bb|0)==(c[oc+16>>2]|0)){sc=mc[c[(c[oc>>2]|0)+36>>2]&63](oc)|0}else{sc=c[Bb>>2]|0}if((sc|0)==-1){c[b>>2]=0;rc=0;Z=42;break}else{if(pc^(nc|0)==0){tc=nc;uc=nc;break}else{ka=C;la=S;ma=q;na=R;oa=T;pa=U;break g}}}}while(0);if((Z|0)==42){Z=0;if(pc){ka=C;la=S;ma=q;na=R;oa=T;pa=U;break g}else{tc=rc;uc=0}}Bb=c[g>>2]|0;ua=c[Bb+12>>2]|0;if((ua|0)==(c[Bb+16>>2]|0)){vc=mc[c[(c[Bb>>2]|0)+36>>2]&63](Bb)|0}else{vc=c[ua>>2]|0}if(!(gc[c[(c[r>>2]|0)+12>>2]&31](l,8192,vc)|0)){ka=C;la=S;ma=q;na=R;oa=T;pa=U;break g}ua=c[g>>2]|0;Bb=ua+12|0;sa=c[Bb>>2]|0;if((sa|0)==(c[ua+16>>2]|0)){wc=mc[c[(c[ua>>2]|0)+40>>2]&63](ua)|0}else{c[Bb>>2]=sa+4;wc=c[sa>>2]|0}Be(z,wc);nc=tc;oc=uc}}}while(0);ia=o+1|0;if(ia>>>0<4){R=na;q=ma;S=la;C=ka;o=ia;T=oa;U=pa}else{aa=la;ba=ma;ca=oa;da=pa;Z=292;break}}h:do{if((Z|0)==27){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==116){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==174){c[j>>2]=c[j>>2]|4;xc=0;yc=S;zc=U}else if((Z|0)==198){Nm()}else if((Z|0)==214){Nm()}else if((Z|0)==225){Nm()}else if((Z|0)==248){c[j>>2]=c[j>>2]|4;xc=0;yc=Gb;zc=Jb}else if((Z|0)==271){c[j>>2]=c[j>>2]|4;xc=0;yc=Gb;zc=Jb}else if((Z|0)==276){Nm()}else if((Z|0)==290){c[j>>2]=c[j>>2]|4;xc=0;yc=Gb;zc=Jb}else if((Z|0)==292){i:do{if((ca|0)!=0){pa=ca;oa=ca+4|0;ma=ca+8|0;la=1;j:while(1){T=a[pa]|0;if((T&1)==0){Ac=(T&255)>>>1}else{Ac=c[oa>>2]|0}if(!(la>>>0<Ac>>>0)){break i}T=c[g>>2]|0;do{if((T|0)==0){Bc=1}else{o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Cc=mc[c[(c[T>>2]|0)+36>>2]&63](T)|0}else{Cc=c[o>>2]|0}if((Cc|0)==-1){c[g>>2]=0;Bc=1;break}else{Bc=(c[g>>2]|0)==0;break}}}while(0);T=c[b>>2]|0;do{if((T|0)==0){Z=311}else{o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Dc=mc[c[(c[T>>2]|0)+36>>2]&63](T)|0}else{Dc=c[o>>2]|0}if((Dc|0)==-1){c[b>>2]=0;Z=311;break}else{if(Bc){break}else{break j}}}}while(0);if((Z|0)==311){Z=0;if(Bc){break}}T=c[g>>2]|0;o=c[T+12>>2]|0;if((o|0)==(c[T+16>>2]|0)){Ec=mc[c[(c[T>>2]|0)+36>>2]&63](T)|0}else{Ec=c[o>>2]|0}if((a[pa]&1)==0){Fc=oa}else{Fc=c[ma>>2]|0}if((Ec|0)!=(c[Fc+(la<<2)>>2]|0)){break}o=la+1|0;T=c[g>>2]|0;ka=T+12|0;C=c[ka>>2]|0;if((C|0)==(c[T+16>>2]|0)){mc[c[(c[T>>2]|0)+40>>2]&63](T)|0;la=o;continue}else{c[ka>>2]=C+4;la=o;continue}}c[j>>2]=c[j>>2]|4;xc=0;yc=aa;zc=da;break h}}while(0);if((aa|0)==(ba|0)){xc=1;yc=ba;zc=da;break}c[B>>2]=0;dj(v,aa,ba,B);if((c[B>>2]|0)==0){xc=1;yc=aa;zc=da;break}c[j>>2]=c[j>>2]|4;xc=0;yc=aa;zc=da}}while(0);xe(z);xe(y);xe(x);xe(w);me(v);if((yc|0)==0){i=p;return xc|0}jc[zc&127](yc);i=p;return xc|0}function ij(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=i;i=i+464|0;l=d;m=d+8|0;n=d+24|0;o=d+424|0;p=d+432|0;q=d+440|0;r=d+448|0;s=d+456|0;t=o;c[t>>2]=n;u=o+4|0;c[u>>2]=114;v=n+400|0;Ge(q,h);n=q;w=c[n>>2]|0;if(!((c[57586]|0)==-1)){c[m>>2]=230344;c[m+4>>2]=112;c[m+8>>2]=0;he(230344,m,113)}m=(c[230348>>2]|0)+ -1|0;x=c[w+8>>2]|0;if(!((c[w+12>>2]|0)-x>>2>>>0>m>>>0)){y=Va(4)|0;z=y;gm(z);xb(y|0,238312,101)}w=c[x+(m<<2)>>2]|0;if((w|0)==0){y=Va(4)|0;z=y;gm(z);xb(y|0,238312,101)}y=w;a[r]=0;z=f;f=c[z>>2]|0;c[s>>2]=f;m=c[h+4>>2]|0;h=l;x=s;c[h+0>>2]=c[x+0>>2];x=hj(e,l,g,q,m,j,r,y,o,p,v)|0;if(x){x=k;if((a[x]&1)==0){c[k+4>>2]=0;a[x]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}x=w;if((a[r]|0)!=0){Be(k,vc[c[(c[x>>2]|0)+44>>2]&15](y,45)|0)}r=vc[c[(c[x>>2]|0)+44>>2]&15](y,48)|0;y=c[t>>2]|0;x=c[p>>2]|0;p=x+ -4|0;a:do{if(y>>>0<p>>>0){w=y;while(1){v=w+4|0;if((c[w>>2]|0)!=(r|0)){A=w;break a}if(v>>>0<p>>>0){w=v}else{A=v;break}}}else{A=y}}while(0);jj(k,A,x)|0}x=e;e=c[x>>2]|0;do{if((e|0)==0){B=1}else{A=c[e+12>>2]|0;if((A|0)==(c[e+16>>2]|0)){C=mc[c[(c[e>>2]|0)+36>>2]&63](e)|0}else{C=c[A>>2]|0}if((C|0)==-1){c[x>>2]=0;B=1;break}else{B=(c[x>>2]|0)==0;break}}}while(0);do{if((f|0)==0){D=29}else{C=c[f+12>>2]|0;if((C|0)==(c[f+16>>2]|0)){E=mc[c[(c[f>>2]|0)+36>>2]&63](f)|0}else{E=c[C>>2]|0}if((E|0)==-1){c[z>>2]=0;D=29;break}else{if(B){break}else{D=31;break}}}}while(0);if((D|0)==29){if(B){D=31}}if((D|0)==31){c[j>>2]=c[j>>2]|2}c[b>>2]=c[x>>2];Pd(c[n>>2]|0)|0;n=c[t>>2]|0;c[t>>2]=0;if((n|0)==0){i=d;return}jc[c[u>>2]&127](n);i=d;return}function jj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;g=b;h=d;j=a[g]|0;if((j&1)==0){k=(j&255)>>>1;l=j;m=1}else{j=c[b>>2]|0;k=c[b+4>>2]|0;l=j&255;m=(j&-2)+ -1|0}j=e-h>>2;if((j|0)==0){i=f;return b|0}if((m-k|0)>>>0<j>>>0){De(b,m,k+j-m|0,k,k,0,0);n=a[g]|0}else{n=l}if((n&1)==0){o=b+4|0}else{o=c[b+8>>2]|0}n=o+(k<<2)|0;if((d|0)==(e|0)){p=n}else{l=k+((e+ -4+(0-h)|0)>>>2)+1|0;h=d;d=n;while(1){c[d>>2]=c[h>>2];n=h+4|0;if((n|0)==(e|0)){break}else{d=d+4|0;h=n}}p=o+(l<<2)|0}c[p>>2]=0;p=k+j|0;if((a[g]&1)==0){a[g]=p<<1;i=f;return b|0}else{c[b+4>>2]=p;i=f;return b|0}return 0}function kj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;n=i;i=i+176|0;o=n;p=n+16|0;q=n+32|0;r=n+40|0;s=n+56|0;t=n+72|0;u=n+88|0;v=n+104|0;w=n+112|0;x=n+128|0;y=n+144|0;z=n+160|0;if(b){b=c[d>>2]|0;if(!((c[57480]|0)==-1)){c[p>>2]=229920;c[p+4>>2]=112;c[p+8>>2]=0;he(229920,p,113)}p=(c[229924>>2]|0)+ -1|0;A=c[b+8>>2]|0;if(!((c[b+12>>2]|0)-A>>2>>>0>p>>>0)){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}b=c[A+(p<<2)>>2]|0;if((b|0)==0){B=Va(4)|0;C=B;gm(C);xb(B|0,238312,101)}B=b;kc[c[(c[b>>2]|0)+44>>2]&63](q,B);C=e;p=c[q>>2]|0;a[C]=p;a[C+1|0]=p>>8;a[C+2|0]=p>>16;a[C+3|0]=p>>24;p=b;kc[c[(c[p>>2]|0)+32>>2]&63](r,B);C=l;if((a[C]&1)==0){c[l+4>>2]=0;a[C]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ae(l,0);q=r;c[C+0>>2]=c[q+0>>2];c[C+4>>2]=c[q+4>>2];c[C+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;xe(r);kc[c[(c[p>>2]|0)+28>>2]&63](s,B);r=k;if((a[r]&1)==0){c[k+4>>2]=0;a[r]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ae(k,0);q=s;c[r+0>>2]=c[q+0>>2];c[r+4>>2]=c[q+4>>2];c[r+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;xe(s);s=b;c[f>>2]=mc[c[(c[s>>2]|0)+12>>2]&63](B)|0;c[g>>2]=mc[c[(c[s>>2]|0)+16>>2]&63](B)|0;kc[c[(c[b>>2]|0)+20>>2]&63](t,B);b=h;if((a[b]&1)==0){a[h+1|0]=0;a[b]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}qe(h,0);q=t;c[b+0>>2]=c[q+0>>2];c[b+4>>2]=c[q+4>>2];c[b+8>>2]=c[q+8>>2];c[q+0>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;me(t);kc[c[(c[p>>2]|0)+24>>2]&63](u,B);p=j;if((a[p]&1)==0){c[j+4>>2]=0;a[p]=0}else{c[c[j+8>>2]>>2]=0;c[j+4>>2]=0}Ae(j,0);t=u;c[p+0>>2]=c[t+0>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;xe(u);D=mc[c[(c[s>>2]|0)+36>>2]&63](B)|0;c[m>>2]=D;i=n;return}else{B=c[d>>2]|0;if(!((c[57464]|0)==-1)){c[o>>2]=229856;c[o+4>>2]=112;c[o+8>>2]=0;he(229856,o,113)}o=(c[229860>>2]|0)+ -1|0;d=c[B+8>>2]|0;if(!((c[B+12>>2]|0)-d>>2>>>0>o>>>0)){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}B=c[d+(o<<2)>>2]|0;if((B|0)==0){E=Va(4)|0;F=E;gm(F);xb(E|0,238312,101)}E=B;kc[c[(c[B>>2]|0)+44>>2]&63](v,E);F=e;e=c[v>>2]|0;a[F]=e;a[F+1|0]=e>>8;a[F+2|0]=e>>16;a[F+3|0]=e>>24;e=B;kc[c[(c[e>>2]|0)+32>>2]&63](w,E);F=l;if((a[F]&1)==0){c[l+4>>2]=0;a[F]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ae(l,0);l=w;c[F+0>>2]=c[l+0>>2];c[F+4>>2]=c[l+4>>2];c[F+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;xe(w);kc[c[(c[e>>2]|0)+28>>2]&63](x,E);w=k;if((a[w]&1)==0){c[k+4>>2]=0;a[w]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ae(k,0);k=x;c[w+0>>2]=c[k+0>>2];c[w+4>>2]=c[k+4>>2];c[w+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;xe(x);x=B;c[f>>2]=mc[c[(c[x>>2]|0)+12>>2]&63](E)|0;c[g>>2]=mc[c[(c[x>>2]|0)+16>>2]&63](E)|0;kc[c[(c[B>>2]|0)+20>>2]&63](y,E);B=h;if((a[B]&1)==0){a[h+1|0]=0;a[B]=0}else{a[c[h+8>>2]|0]=0;c[h+4>>2]=0}qe(h,0);h=y;c[B+0>>2]=c[h+0>>2];c[B+4>>2]=c[h+4>>2];c[B+8>>2]=c[h+8>>2];c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;me(y);kc[c[(c[e>>2]|0)+24>>2]&63](z,E);e=j;if((a[e]&1)==0){c[j+4>>2]=0;a[e]=0}else{c[c[j+8>>2]>>2]=0;c[j+4>>2]=0}Ae(j,0);j=z;c[e+0>>2]=c[j+0>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;xe(z);D=mc[c[(c[x>>2]|0)+36>>2]&63](E)|0;c[m>>2]=D;i=n;return}}function lj(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function mj(a){a=a|0;i=i;return}function nj(b,d,e,f,g,j,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;l=+l;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0;d=i;i=i+16|0;m=d;n=d+8|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+104|0;r=i;i=i+8|0;s=i;i=i+104|0;t=i;i=i+8|0;u=i;i=i+8|0;v=u;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+104|0;D=i;i=i+8|0;E=i;i=i+8|0;F=i;i=i+8|0;G=q;c[r>>2]=G;q=s;s=o;h[k>>3]=l;c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];s=lb(G|0,100,230104,o|0)|0;do{if(s>>>0>99){do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);o=c[57560]|0;G=n;h[k>>3]=l;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];G=ih(r,o,230104,n)|0;o=c[r>>2]|0;if((o|0)==0){Nm()}H=Bm(G)|0;if((H|0)!=0){I=o;J=H;K=H;L=G;break}Nm()}else{I=0;J=0;K=q;L=s}}while(0);Ge(t,g);s=t;q=c[s>>2]|0;if(!((c[57588]|0)==-1)){c[p>>2]=230352;c[p+4>>2]=112;c[p+8>>2]=0;he(230352,p,113)}p=(c[230356>>2]|0)+ -1|0;n=c[q+8>>2]|0;if(!((c[q+12>>2]|0)-n>>2>>>0>p>>>0)){M=Va(4)|0;N=M;gm(N);xb(M|0,238312,101)}q=c[n+(p<<2)>>2]|0;if((q|0)==0){M=Va(4)|0;N=M;gm(N);xb(M|0,238312,101)}M=q;N=c[r>>2]|0;sc[c[(c[q>>2]|0)+32>>2]&7](M,N,N+L|0,K)|0;if((L|0)==0){O=0}else{O=(a[c[r>>2]|0]|0)==45}c[u>>2]=0;u=y;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;u=z;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;r=A;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;oj(f,O,t,v,w,x,y,z,A,B);t=C;C=c[B>>2]|0;if((L|0)>(C|0)){B=a[r]|0;if((B&1)==0){P=(B&255)>>>1}else{P=c[A+4>>2]|0}B=a[u]|0;if((B&1)==0){Q=(B&255)>>>1}else{Q=c[z+4>>2]|0}R=P+(L-C<<1|1)+Q|0}else{Q=a[r]|0;if((Q&1)==0){S=(Q&255)>>>1}else{S=c[A+4>>2]|0}Q=a[u]|0;if((Q&1)==0){T=(Q&255)>>>1}else{T=c[z+4>>2]|0}R=S+2+T|0}T=R+C|0;do{if(T>>>0>100){R=Bm(T)|0;if((R|0)!=0){U=R;V=R;break}Nm()}else{U=0;V=t}}while(0);pj(V,D,E,c[g+4>>2]|0,K,K+L|0,M,O,v,a[w]|0,a[x]|0,y,z,A,C);c[F>>2]=c[e>>2];e=c[D>>2]|0;D=c[E>>2]|0;E=m;C=F;c[E+0>>2]=c[C+0>>2];gd(b,m,V,e,D,g,j);if((U|0)!=0){Cm(U)}me(A);me(z);me(y);Pd(c[s>>2]|0)|0;if((J|0)!=0){Cm(J)}if((I|0)==0){i=d;return}Cm(I);i=d;return}function oj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=i;i=i+40|0;o=n;p=n+16|0;q=n+32|0;r=q;s=i;i=i+16|0;t=i;i=i+8|0;u=t;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+8|0;z=y;A=i;i=i+16|0;B=i;i=i+8|0;C=B;D=i;i=i+16|0;E=i;i=i+16|0;F=i;i=i+16|0;G=c[e>>2]|0;if(b){if(!((c[57448]|0)==-1)){c[p>>2]=229792;c[p+4>>2]=112;c[p+8>>2]=0;he(229792,p,113)}p=(c[229796>>2]|0)+ -1|0;b=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-b>>2>>>0>p>>>0)){H=Va(4)|0;I=H;gm(I);xb(H|0,238312,101)}e=c[b+(p<<2)>>2]|0;if((e|0)==0){H=Va(4)|0;I=H;gm(I);xb(H|0,238312,101)}H=e;I=c[e>>2]|0;if(d){kc[c[I+44>>2]&63](r,H);r=f;p=c[q>>2]|0;a[r]=p;a[r+1|0]=p>>8;a[r+2|0]=p>>16;a[r+3|0]=p>>24;kc[c[(c[e>>2]|0)+32>>2]&63](s,H);p=l;if((a[p]&1)==0){a[l+1|0]=0;a[p]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}qe(l,0);r=s;c[p+0>>2]=c[r+0>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;me(s)}else{kc[c[I+40>>2]&63](u,H);u=f;I=c[t>>2]|0;a[u]=I;a[u+1|0]=I>>8;a[u+2|0]=I>>16;a[u+3|0]=I>>24;kc[c[(c[e>>2]|0)+28>>2]&63](v,H);I=l;if((a[I]&1)==0){a[l+1|0]=0;a[I]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}qe(l,0);u=v;c[I+0>>2]=c[u+0>>2];c[I+4>>2]=c[u+4>>2];c[I+8>>2]=c[u+8>>2];c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;me(v)}v=e;a[g]=mc[c[(c[v>>2]|0)+12>>2]&63](H)|0;a[h]=mc[c[(c[v>>2]|0)+16>>2]&63](H)|0;v=e;kc[c[(c[v>>2]|0)+20>>2]&63](w,H);u=j;if((a[u]&1)==0){a[j+1|0]=0;a[u]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}qe(j,0);I=w;c[u+0>>2]=c[I+0>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;me(w);kc[c[(c[v>>2]|0)+24>>2]&63](x,H);v=k;if((a[v]&1)==0){a[k+1|0]=0;a[v]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}qe(k,0);w=x;c[v+0>>2]=c[w+0>>2];c[v+4>>2]=c[w+4>>2];c[v+8>>2]=c[w+8>>2];c[w+0>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;me(x);J=mc[c[(c[e>>2]|0)+36>>2]&63](H)|0;c[m>>2]=J;i=n;return}else{if(!((c[57432]|0)==-1)){c[o>>2]=229728;c[o+4>>2]=112;c[o+8>>2]=0;he(229728,o,113)}o=(c[229732>>2]|0)+ -1|0;H=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-H>>2>>>0>o>>>0)){K=Va(4)|0;L=K;gm(L);xb(K|0,238312,101)}G=c[H+(o<<2)>>2]|0;if((G|0)==0){K=Va(4)|0;L=K;gm(L);xb(K|0,238312,101)}K=G;L=c[G>>2]|0;if(d){kc[c[L+44>>2]&63](z,K);z=f;d=c[y>>2]|0;a[z]=d;a[z+1|0]=d>>8;a[z+2|0]=d>>16;a[z+3|0]=d>>24;kc[c[(c[G>>2]|0)+32>>2]&63](A,K);d=l;if((a[d]&1)==0){a[l+1|0]=0;a[d]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}qe(l,0);z=A;c[d+0>>2]=c[z+0>>2];c[d+4>>2]=c[z+4>>2];c[d+8>>2]=c[z+8>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;me(A)}else{kc[c[L+40>>2]&63](C,K);C=f;f=c[B>>2]|0;a[C]=f;a[C+1|0]=f>>8;a[C+2|0]=f>>16;a[C+3|0]=f>>24;kc[c[(c[G>>2]|0)+28>>2]&63](D,K);f=l;if((a[f]&1)==0){a[l+1|0]=0;a[f]=0}else{a[c[l+8>>2]|0]=0;c[l+4>>2]=0}qe(l,0);l=D;c[f+0>>2]=c[l+0>>2];c[f+4>>2]=c[l+4>>2];c[f+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;me(D)}D=G;a[g]=mc[c[(c[D>>2]|0)+12>>2]&63](K)|0;a[h]=mc[c[(c[D>>2]|0)+16>>2]&63](K)|0;D=G;kc[c[(c[D>>2]|0)+20>>2]&63](E,K);h=j;if((a[h]&1)==0){a[j+1|0]=0;a[h]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}qe(j,0);j=E;c[h+0>>2]=c[j+0>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;me(E);kc[c[(c[D>>2]|0)+24>>2]&63](F,K);D=k;if((a[D]&1)==0){a[k+1|0]=0;a[D]=0}else{a[c[k+8>>2]|0]=0;c[k+4>>2]=0}qe(k,0);k=F;c[D+0>>2]=c[k+0>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;me(F);J=mc[c[(c[G>>2]|0)+36>>2]&63](K)|0;c[m>>2]=J;i=n;return}}function pj(d,e,f,g,h,j,k,l,m,n,o,p,q,r,s){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;s=s|0;var t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0;t=i;c[f>>2]=d;u=k;v=r;w=r+1|0;x=r+8|0;y=r+4|0;r=q;z=(g&512|0)==0;A=q+1|0;B=q+8|0;C=q+4|0;q=(s|0)>0;D=p;E=p+1|0;F=p+8|0;G=p+4|0;p=k+8|0;H=0-s|0;I=h;h=0;while(1){a:do{switch(a[m+h|0]|0){case 1:{c[e>>2]=c[f>>2];J=vc[c[(c[u>>2]|0)+28>>2]&15](k,32)|0;K=c[f>>2]|0;c[f>>2]=K+1;a[K]=J;L=I;break};case 4:{J=c[f>>2]|0;K=l?I+1|0:I;b:do{if(K>>>0<j>>>0){M=K;while(1){N=a[M]|0;if(!(N<<24>>24>-1)){O=M;break b}P=M+1|0;if((b[(c[p>>2]|0)+(N<<24>>24<<1)>>1]&2048)==0){O=M;break b}if(P>>>0<j>>>0){M=P}else{O=P;break}}}else{O=K}}while(0);M=O;if(q){if(O>>>0>K>>>0){P=K+(0-M)|0;M=P>>>0<H>>>0?H:P;P=M+s|0;N=J;Q=O;R=s;while(1){S=Q+ -1|0;T=a[S]|0;c[f>>2]=N+1;a[N]=T;T=R+ -1|0;U=(T|0)>0;if(!(S>>>0>K>>>0&U)){break}N=c[f>>2]|0;R=T;Q=S}Q=O+M|0;if(U){V=Q;W=P;X=32}else{Y=0;Z=Q;_=P}}else{V=O;W=s;X=32}if((X|0)==32){X=0;Y=vc[c[(c[u>>2]|0)+28>>2]&15](k,48)|0;Z=V;_=W}Q=c[f>>2]|0;c[f>>2]=Q+1;if((_|0)>0){R=Q;N=_;while(1){a[R]=Y;S=N+ -1|0;T=c[f>>2]|0;c[f>>2]=T+1;if((S|0)>0){N=S;R=T}else{$=T;break}}}else{$=Q}a[$]=n;aa=Z}else{aa=O}if((aa|0)==(K|0)){R=vc[c[(c[u>>2]|0)+28>>2]&15](k,48)|0;N=c[f>>2]|0;c[f>>2]=N+1;a[N]=R}else{R=a[D]|0;N=(R&1)==0;if(N){ba=(R&255)>>>1}else{ba=c[G>>2]|0}if((ba|0)==0){ca=aa;da=-1;ea=0;fa=0}else{if(N){ga=E}else{ga=c[F>>2]|0}ca=aa;da=a[ga]|0;ea=0;fa=0}while(1){do{if((fa|0)==(da|0)){N=c[f>>2]|0;c[f>>2]=N+1;a[N]=o;N=ea+1|0;R=a[D]|0;P=(R&1)==0;if(P){ha=(R&255)>>>1}else{ha=c[G>>2]|0}if(!(N>>>0<ha>>>0)){ia=da;ja=N;ka=0;break}if(P){la=E}else{la=c[F>>2]|0}if((a[la+N|0]|0)==127){ia=-1;ja=N;ka=0;break}if(P){ma=E}else{ma=c[F>>2]|0}ia=a[ma+N|0]|0;ja=N;ka=0}else{ia=da;ja=ea;ka=fa}}while(0);N=ca+ -1|0;P=a[N]|0;R=c[f>>2]|0;c[f>>2]=R+1;a[R]=P;if((N|0)==(K|0)){break}else{ca=N;da=ia;ea=ja;fa=ka+1|0}}}Q=c[f>>2]|0;if((J|0)==(Q|0)){L=K;break a}N=Q+ -1|0;if(N>>>0>J>>>0){na=J;oa=N}else{L=K;break a}while(1){N=a[na]|0;a[na]=a[oa]|0;a[oa]=N;N=na+1|0;Q=oa+ -1|0;if(N>>>0<Q>>>0){oa=Q;na=N}else{L=K;break}}break};case 3:{K=a[v]|0;J=(K&1)==0;if(J){pa=(K&255)>>>1}else{pa=c[y>>2]|0}if((pa|0)==0){L=I;break a}if(J){qa=w}else{qa=c[x>>2]|0}J=a[qa]|0;K=c[f>>2]|0;c[f>>2]=K+1;a[K]=J;L=I;break};case 0:{c[e>>2]=c[f>>2];L=I;break};case 2:{J=a[r]|0;K=(J&1)==0;if(K){ra=(J&255)>>>1}else{ra=c[C>>2]|0}if((ra|0)==0|z){L=I;break a}if(K){sa=A;ta=(J&255)>>>1}else{sa=c[B>>2]|0;ta=c[C>>2]|0}J=sa+ta|0;K=c[f>>2]|0;if((sa|0)==(J|0)){ua=K}else{N=K;K=sa;while(1){a[N]=a[K]|0;Q=K+1|0;P=N+1|0;if((Q|0)==(J|0)){ua=P;break}else{K=Q;N=P}}}c[f>>2]=ua;L=I;break};default:{L=I}}}while(0);N=h+1|0;if((N|0)==4){break}else{I=L;h=N}}h=a[v]|0;v=(h&1)==0;if(v){va=(h&255)>>>1}else{va=c[y>>2]|0}if(va>>>0>1){if(v){wa=w;xa=(h&255)>>>1}else{wa=c[x>>2]|0;xa=c[y>>2]|0}y=wa+1|0;x=wa+xa|0;xa=c[f>>2]|0;if((y|0)==(x|0)){ya=xa}else{wa=xa;xa=y;while(1){a[wa]=a[xa]|0;y=xa+1|0;h=wa+1|0;if((y|0)==(x|0)){ya=h;break}else{xa=y;wa=h}}}c[f>>2]=ya}ya=g&176;if((ya|0)==32){c[e>>2]=c[f>>2];i=t;return}else if((ya|0)==16){i=t;return}else{c[e>>2]=d;i=t;return}}function qj(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;d=i;i=i+40|0;k=d;l=d+8|0;m=d+24|0;n=d+32|0;o=n;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+16|0;s=i;i=i+16|0;t=i;i=i+16|0;u=i;i=i+8|0;v=i;i=i+104|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;Ge(m,g);z=m;A=c[z>>2]|0;if(!((c[57588]|0)==-1)){c[l>>2]=230352;c[l+4>>2]=112;c[l+8>>2]=0;he(230352,l,113)}l=(c[230356>>2]|0)+ -1|0;B=c[A+8>>2]|0;if(!((c[A+12>>2]|0)-B>>2>>>0>l>>>0)){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}A=c[B+(l<<2)>>2]|0;if((A|0)==0){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}C=A;D=j;l=a[D]|0;B=(l&1)==0;if(B){E=(l&255)>>>1}else{E=c[j+4>>2]|0}if((E|0)==0){F=0}else{if(B){G=j+1|0}else{G=c[j+8>>2]|0}B=a[G]|0;F=B<<24>>24==(vc[c[(c[A>>2]|0)+28>>2]&15](C,45)|0)<<24>>24}c[n>>2]=0;n=r;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;n=s;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;A=t;c[A+0>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;oj(f,F,m,o,p,q,r,s,t,u);m=v;v=a[D]|0;D=(v&1)==0;if(D){H=(v&255)>>>1}else{H=c[j+4>>2]|0}f=c[u>>2]|0;if((H|0)>(f|0)){if(D){I=(v&255)>>>1}else{I=c[j+4>>2]|0}D=a[A]|0;if((D&1)==0){J=(D&255)>>>1}else{J=c[t+4>>2]|0}D=a[n]|0;if((D&1)==0){K=(D&255)>>>1}else{K=c[s+4>>2]|0}L=J+(I-f<<1|1)+K|0}else{K=a[A]|0;if((K&1)==0){M=(K&255)>>>1}else{M=c[t+4>>2]|0}K=a[n]|0;if((K&1)==0){N=(K&255)>>>1}else{N=c[s+4>>2]|0}L=M+2+N|0}N=L+f|0;do{if(N>>>0>100){L=Bm(N)|0;if((L|0)!=0){O=L;P=L;break}Nm()}else{O=0;P=m}}while(0);if((v&1)==0){Q=j+1|0;R=(v&255)>>>1}else{Q=c[j+8>>2]|0;R=c[j+4>>2]|0}pj(P,w,x,c[g+4>>2]|0,Q,Q+R|0,C,F,o,a[p]|0,a[q]|0,r,s,t,f);c[y>>2]=c[e>>2];e=c[w>>2]|0;w=c[x>>2]|0;x=k;f=y;c[x+0>>2]=c[f+0>>2];gd(b,k,P,e,w,g,h);if((O|0)==0){me(t);me(s);me(r);S=c[z>>2]|0;T=S;Pd(T)|0;i=d;return}Cm(O);me(t);me(s);me(r);S=c[z>>2]|0;T=S;Pd(T)|0;i=d;return}function rj(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function sj(a){a=a|0;i=i;return}function tj(b,d,e,f,g,j,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;j=j|0;l=+l;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;d=i;i=i+16|0;m=d;n=d+8|0;o=i;i=i+8|0;p=i;i=i+16|0;q=i;i=i+104|0;r=i;i=i+8|0;s=i;i=i+400|0;t=i;i=i+8|0;u=i;i=i+8|0;v=u;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+16|0;z=i;i=i+16|0;A=i;i=i+16|0;B=i;i=i+8|0;C=i;i=i+400|0;D=i;i=i+8|0;E=i;i=i+8|0;F=i;i=i+8|0;G=q;c[r>>2]=G;q=s;s=o;h[k>>3]=l;c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];s=lb(G|0,100,230104,o|0)|0;do{if(s>>>0>99){do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);o=c[57560]|0;G=n;h[k>>3]=l;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];G=ih(r,o,230104,n)|0;o=c[r>>2]|0;if((o|0)==0){Nm()}H=Bm(G<<2)|0;I=H;if((H|0)!=0){J=o;K=I;L=I;M=G;break}Nm()}else{J=0;K=0;L=q;M=s}}while(0);Ge(t,g);s=t;q=c[s>>2]|0;if(!((c[57586]|0)==-1)){c[p>>2]=230344;c[p+4>>2]=112;c[p+8>>2]=0;he(230344,p,113)}p=(c[230348>>2]|0)+ -1|0;n=c[q+8>>2]|0;if(!((c[q+12>>2]|0)-n>>2>>>0>p>>>0)){N=Va(4)|0;O=N;gm(O);xb(N|0,238312,101)}q=c[n+(p<<2)>>2]|0;if((q|0)==0){N=Va(4)|0;O=N;gm(O);xb(N|0,238312,101)}N=q;O=c[r>>2]|0;sc[c[(c[q>>2]|0)+48>>2]&7](N,O,O+M|0,L)|0;if((M|0)==0){P=0}else{P=(a[c[r>>2]|0]|0)==45}c[u>>2]=0;u=y;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;u=z;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;r=A;c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;uj(f,P,t,v,w,x,y,z,A,B);t=C;C=c[B>>2]|0;if((M|0)>(C|0)){B=a[r]|0;if((B&1)==0){Q=(B&255)>>>1}else{Q=c[A+4>>2]|0}B=a[u]|0;if((B&1)==0){R=(B&255)>>>1}else{R=c[z+4>>2]|0}S=Q+(M-C<<1|1)+R|0}else{R=a[r]|0;if((R&1)==0){T=(R&255)>>>1}else{T=c[A+4>>2]|0}R=a[u]|0;if((R&1)==0){U=(R&255)>>>1}else{U=c[z+4>>2]|0}S=T+2+U|0}U=S+C|0;do{if(U>>>0>100){S=Bm(U<<2)|0;T=S;if((S|0)!=0){V=T;W=T;break}Nm()}else{V=0;W=t}}while(0);vj(W,D,E,c[g+4>>2]|0,L,L+(M<<2)|0,N,P,v,c[w>>2]|0,c[x>>2]|0,y,z,A,C);c[F>>2]=c[e>>2];e=c[D>>2]|0;D=c[E>>2]|0;E=m;C=F;c[E+0>>2]=c[C+0>>2];rh(b,m,W,e,D,g,j);if((V|0)!=0){Cm(V)}xe(A);xe(z);me(y);Pd(c[s>>2]|0)|0;if((K|0)!=0){Cm(K)}if((J|0)==0){i=d;return}Cm(J);i=d;return}function uj(b,d,e,f,g,h,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=i;i=i+40|0;o=n;p=n+16|0;q=n+32|0;r=q;s=i;i=i+16|0;t=i;i=i+8|0;u=t;v=i;i=i+16|0;w=i;i=i+16|0;x=i;i=i+16|0;y=i;i=i+8|0;z=y;A=i;i=i+16|0;B=i;i=i+8|0;C=B;D=i;i=i+16|0;E=i;i=i+16|0;F=i;i=i+16|0;G=c[e>>2]|0;if(b){if(!((c[57480]|0)==-1)){c[p>>2]=229920;c[p+4>>2]=112;c[p+8>>2]=0;he(229920,p,113)}p=(c[229924>>2]|0)+ -1|0;b=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-b>>2>>>0>p>>>0)){H=Va(4)|0;I=H;gm(I);xb(H|0,238312,101)}e=c[b+(p<<2)>>2]|0;if((e|0)==0){H=Va(4)|0;I=H;gm(I);xb(H|0,238312,101)}H=e;I=c[e>>2]|0;if(d){kc[c[I+44>>2]&63](r,H);r=f;p=c[q>>2]|0;a[r]=p;a[r+1|0]=p>>8;a[r+2|0]=p>>16;a[r+3|0]=p>>24;kc[c[(c[e>>2]|0)+32>>2]&63](s,H);p=l;if((a[p]&1)==0){c[l+4>>2]=0;a[p]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ae(l,0);r=s;c[p+0>>2]=c[r+0>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[r+0>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;xe(s)}else{kc[c[I+40>>2]&63](u,H);u=f;I=c[t>>2]|0;a[u]=I;a[u+1|0]=I>>8;a[u+2|0]=I>>16;a[u+3|0]=I>>24;kc[c[(c[e>>2]|0)+28>>2]&63](v,H);I=l;if((a[I]&1)==0){c[l+4>>2]=0;a[I]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ae(l,0);u=v;c[I+0>>2]=c[u+0>>2];c[I+4>>2]=c[u+4>>2];c[I+8>>2]=c[u+8>>2];c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;xe(v)}v=e;c[g>>2]=mc[c[(c[v>>2]|0)+12>>2]&63](H)|0;c[h>>2]=mc[c[(c[v>>2]|0)+16>>2]&63](H)|0;kc[c[(c[e>>2]|0)+20>>2]&63](w,H);u=j;if((a[u]&1)==0){a[j+1|0]=0;a[u]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}qe(j,0);I=w;c[u+0>>2]=c[I+0>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[I+0>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;me(w);kc[c[(c[e>>2]|0)+24>>2]&63](x,H);e=k;if((a[e]&1)==0){c[k+4>>2]=0;a[e]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ae(k,0);w=x;c[e+0>>2]=c[w+0>>2];c[e+4>>2]=c[w+4>>2];c[e+8>>2]=c[w+8>>2];c[w+0>>2]=0;c[w+4>>2]=0;c[w+8>>2]=0;xe(x);J=mc[c[(c[v>>2]|0)+36>>2]&63](H)|0;c[m>>2]=J;i=n;return}else{if(!((c[57464]|0)==-1)){c[o>>2]=229856;c[o+4>>2]=112;c[o+8>>2]=0;he(229856,o,113)}o=(c[229860>>2]|0)+ -1|0;H=c[G+8>>2]|0;if(!((c[G+12>>2]|0)-H>>2>>>0>o>>>0)){K=Va(4)|0;L=K;gm(L);xb(K|0,238312,101)}G=c[H+(o<<2)>>2]|0;if((G|0)==0){K=Va(4)|0;L=K;gm(L);xb(K|0,238312,101)}K=G;L=c[G>>2]|0;if(d){kc[c[L+44>>2]&63](z,K);z=f;d=c[y>>2]|0;a[z]=d;a[z+1|0]=d>>8;a[z+2|0]=d>>16;a[z+3|0]=d>>24;kc[c[(c[G>>2]|0)+32>>2]&63](A,K);d=l;if((a[d]&1)==0){c[l+4>>2]=0;a[d]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ae(l,0);z=A;c[d+0>>2]=c[z+0>>2];c[d+4>>2]=c[z+4>>2];c[d+8>>2]=c[z+8>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;xe(A)}else{kc[c[L+40>>2]&63](C,K);C=f;f=c[B>>2]|0;a[C]=f;a[C+1|0]=f>>8;a[C+2|0]=f>>16;a[C+3|0]=f>>24;kc[c[(c[G>>2]|0)+28>>2]&63](D,K);f=l;if((a[f]&1)==0){c[l+4>>2]=0;a[f]=0}else{c[c[l+8>>2]>>2]=0;c[l+4>>2]=0}Ae(l,0);l=D;c[f+0>>2]=c[l+0>>2];c[f+4>>2]=c[l+4>>2];c[f+8>>2]=c[l+8>>2];c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;xe(D)}D=G;c[g>>2]=mc[c[(c[D>>2]|0)+12>>2]&63](K)|0;c[h>>2]=mc[c[(c[D>>2]|0)+16>>2]&63](K)|0;kc[c[(c[G>>2]|0)+20>>2]&63](E,K);h=j;if((a[h]&1)==0){a[j+1|0]=0;a[h]=0}else{a[c[j+8>>2]|0]=0;c[j+4>>2]=0}qe(j,0);j=E;c[h+0>>2]=c[j+0>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;me(E);kc[c[(c[G>>2]|0)+24>>2]&63](F,K);G=k;if((a[G]&1)==0){c[k+4>>2]=0;a[G]=0}else{c[c[k+8>>2]>>2]=0;c[k+4>>2]=0}Ae(k,0);k=F;c[G+0>>2]=c[k+0>>2];c[G+4>>2]=c[k+4>>2];c[G+8>>2]=c[k+8>>2];c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;xe(F);J=mc[c[(c[D>>2]|0)+36>>2]&63](K)|0;c[m>>2]=J;i=n;return}}function vj(b,d,e,f,g,h,j,k,l,m,n,o,p,q,r){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0;s=i;c[e>>2]=b;t=j;u=q;v=q+4|0;w=q+8|0;q=p;x=(f&512|0)==0;y=p+4|0;z=p+8|0;p=(r|0)>0;A=o;B=o+1|0;C=o+8|0;D=o+4|0;o=j;E=g;g=0;while(1){a:do{switch(a[l+g|0]|0){case 1:{c[d>>2]=c[e>>2];F=vc[c[(c[t>>2]|0)+44>>2]&15](j,32)|0;G=c[e>>2]|0;c[e>>2]=G+4;c[G>>2]=F;H=E;break};case 3:{F=a[u]|0;G=(F&1)==0;if(G){I=(F&255)>>>1}else{I=c[v>>2]|0}if((I|0)==0){H=E;break a}if(G){J=v}else{J=c[w>>2]|0}G=c[J>>2]|0;F=c[e>>2]|0;c[e>>2]=F+4;c[F>>2]=G;H=E;break};case 0:{c[d>>2]=c[e>>2];H=E;break};case 4:{G=c[e>>2]|0;F=k?E+4|0:E;b:do{if(F>>>0<h>>>0){K=F;while(1){L=K+4|0;if(!(gc[c[(c[o>>2]|0)+12>>2]&31](j,2048,c[K>>2]|0)|0)){M=K;break b}if(L>>>0<h>>>0){K=L}else{M=L;break}}}else{M=F}}while(0);if(p){do{if(M>>>0>F>>>0){K=c[e>>2]|0;L=M;N=r;while(1){O=L+ -4|0;P=K+4|0;c[K>>2]=c[O>>2];Q=N+ -1|0;R=(Q|0)>0;if(O>>>0>F>>>0&R){N=Q;L=O;K=P}else{break}}c[e>>2]=P;if(R){S=O;T=Q;U=34;break}K=c[e>>2]|0;c[e>>2]=K+4;V=K;W=O}else{S=M;T=r;U=34}}while(0);do{if((U|0)==34){U=0;K=vc[c[(c[t>>2]|0)+44>>2]&15](j,48)|0;L=c[e>>2]|0;N=L+4|0;c[e>>2]=N;if((T|0)>0){X=N;Y=L;Z=T}else{V=L;W=S;break}while(1){c[Y>>2]=K;N=Z+ -1|0;if((N|0)>0){Z=N;Y=X;X=X+4|0}else{break}}c[e>>2]=L+(T+1<<2);V=L+(T<<2)|0;W=S}}while(0);c[V>>2]=m;_=W}else{_=M}if((_|0)==(F|0)){K=vc[c[(c[t>>2]|0)+44>>2]&15](j,48)|0;N=c[e>>2]|0;$=N+4|0;c[e>>2]=$;c[N>>2]=K;aa=$}else{$=a[A]|0;K=($&1)==0;if(K){ba=($&255)>>>1}else{ba=c[D>>2]|0}if((ba|0)==0){ca=_;da=-1;ea=0;fa=0}else{if(K){ga=B}else{ga=c[C>>2]|0}ca=_;da=a[ga]|0;ea=0;fa=0}while(1){K=c[e>>2]|0;do{if((fa|0)==(da|0)){$=K+4|0;c[e>>2]=$;c[K>>2]=n;N=ea+1|0;ha=a[A]|0;ia=(ha&1)==0;if(ia){ja=(ha&255)>>>1}else{ja=c[D>>2]|0}if(!(N>>>0<ja>>>0)){ka=$;la=da;ma=N;na=0;break}if(ia){oa=B}else{oa=c[C>>2]|0}if((a[oa+N|0]|0)==127){ka=$;la=-1;ma=N;na=0;break}if(ia){pa=B}else{pa=c[C>>2]|0}ka=$;la=a[pa+N|0]|0;ma=N;na=0}else{ka=K;la=da;ma=ea;na=fa}}while(0);K=ca+ -4|0;L=c[K>>2]|0;N=ka+4|0;c[e>>2]=N;c[ka>>2]=L;if((K|0)==(F|0)){aa=N;break}else{ca=K;da=la;ea=ma;fa=na+1|0}}}if((G|0)==(aa|0)){H=F;break a}K=aa+ -4|0;if(K>>>0>G>>>0){qa=G;ra=K}else{H=F;break a}while(1){K=c[qa>>2]|0;c[qa>>2]=c[ra>>2];c[ra>>2]=K;K=qa+4|0;N=ra+ -4|0;if(K>>>0<N>>>0){ra=N;qa=K}else{H=F;break}}break};case 2:{F=a[q]|0;G=(F&1)==0;if(G){sa=(F&255)>>>1}else{sa=c[y>>2]|0}if((sa|0)==0|x){H=E;break a}if(G){ta=y;ua=(F&255)>>>1}else{ta=c[z>>2]|0;ua=c[y>>2]|0}F=ta+(ua<<2)|0;G=c[e>>2]|0;if((ta|0)==(F|0)){va=G}else{K=(ta+(ua+ -1<<2)+(0-ta)|0)>>>2;N=G;L=ta;while(1){c[N>>2]=c[L>>2];$=L+4|0;if(($|0)==(F|0)){break}N=N+4|0;L=$}va=G+(K+1<<2)|0}c[e>>2]=va;H=E;break};default:{H=E}}}while(0);L=g+1|0;if((L|0)==4){break}else{E=H;g=L}}g=a[u]|0;u=(g&1)==0;if(u){wa=(g&255)>>>1}else{wa=c[v>>2]|0}if(wa>>>0>1){if(u){xa=v;ya=(g&255)>>>1}else{xa=c[w>>2]|0;ya=c[v>>2]|0}v=xa+4|0;w=xa+(ya<<2)|0;g=c[e>>2]|0;if((v|0)==(w|0)){za=g}else{u=(xa+(ya+ -1<<2)+(0-v)|0)>>>2;ya=g;xa=v;while(1){c[ya>>2]=c[xa>>2];v=xa+4|0;if((v|0)==(w|0)){break}else{xa=v;ya=ya+4|0}}za=g+(u+1<<2)|0}c[e>>2]=za}za=f&176;if((za|0)==32){c[d>>2]=c[e>>2];i=s;return}else if((za|0)==16){i=s;return}else{c[d>>2]=b;i=s;return}}function wj(b,d,e,f,g,h,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;d=i;i=i+40|0;k=d;l=d+8|0;m=d+24|0;n=d+32|0;o=n;p=i;i=i+8|0;q=i;i=i+8|0;r=i;i=i+16|0;s=i;i=i+16|0;t=i;i=i+16|0;u=i;i=i+8|0;v=i;i=i+400|0;w=i;i=i+8|0;x=i;i=i+8|0;y=i;i=i+8|0;Ge(m,g);z=m;A=c[z>>2]|0;if(!((c[57586]|0)==-1)){c[l>>2]=230344;c[l+4>>2]=112;c[l+8>>2]=0;he(230344,l,113)}l=(c[230348>>2]|0)+ -1|0;B=c[A+8>>2]|0;if(!((c[A+12>>2]|0)-B>>2>>>0>l>>>0)){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}A=c[B+(l<<2)>>2]|0;if((A|0)==0){C=Va(4)|0;D=C;gm(D);xb(C|0,238312,101)}C=A;D=j;l=a[D]|0;B=(l&1)==0;if(B){E=(l&255)>>>1}else{E=c[j+4>>2]|0}if((E|0)==0){F=0}else{if(B){G=j+4|0}else{G=c[j+8>>2]|0}B=c[G>>2]|0;F=(B|0)==(vc[c[(c[A>>2]|0)+44>>2]&15](C,45)|0)}c[n>>2]=0;n=r;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;n=s;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;A=t;c[A+0>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;uj(f,F,m,o,p,q,r,s,t,u);m=v;v=a[D]|0;D=(v&1)==0;if(D){H=(v&255)>>>1}else{H=c[j+4>>2]|0}f=c[u>>2]|0;if((H|0)>(f|0)){if(D){I=(v&255)>>>1}else{I=c[j+4>>2]|0}D=a[A]|0;if((D&1)==0){J=(D&255)>>>1}else{J=c[t+4>>2]|0}D=a[n]|0;if((D&1)==0){K=(D&255)>>>1}else{K=c[s+4>>2]|0}L=J+(I-f<<1|1)+K|0}else{K=a[A]|0;if((K&1)==0){M=(K&255)>>>1}else{M=c[t+4>>2]|0}K=a[n]|0;if((K&1)==0){N=(K&255)>>>1}else{N=c[s+4>>2]|0}L=M+2+N|0}N=L+f|0;do{if(N>>>0>100){L=Bm(N<<2)|0;M=L;if((L|0)!=0){O=M;P=M;break}Nm()}else{O=0;P=m}}while(0);if((v&1)==0){Q=j+4|0;R=(v&255)>>>1}else{Q=c[j+8>>2]|0;R=c[j+4>>2]|0}vj(P,w,x,c[g+4>>2]|0,Q,Q+(R<<2)|0,C,F,o,c[p>>2]|0,c[q>>2]|0,r,s,t,f);c[y>>2]=c[e>>2];e=c[w>>2]|0;w=c[x>>2]|0;x=k;f=y;c[x+0>>2]=c[f+0>>2];rh(b,k,P,e,w,g,h);if((O|0)==0){xe(t);xe(s);me(r);S=c[z>>2]|0;T=S;Pd(T)|0;i=d;return}Cm(O);xe(t);xe(s);me(r);S=c[z>>2]|0;T=S;Pd(T)|0;i=d;return}function xj(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function yj(a){a=a|0;i=i;return}function zj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=cc(f|0,1)|0;i=e;return d>>>((d|0)!=(-1|0)|0)|0}function Aj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;i=i+16|0;j=d;k=j;c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;l=a[h]|0;if((l&1)==0){m=h+1|0;n=h+1|0;o=(l&255)>>>1}else{l=c[h+8>>2]|0;m=l;n=l;o=c[h+4>>2]|0}h=m+o|0;do{if(n>>>0<h>>>0){o=n;do{re(j,a[o]|0);o=o+1|0;}while((o|0)!=(h|0));o=(e|0)==-1?-1:e<<1;if((a[k]&1)==0){p=o;q=9;break}r=o;s=c[j+8>>2]|0}else{p=(e|0)==-1?-1:e<<1;q=9}}while(0);if((q|0)==9){r=p;s=j+1|0}p=jb(r|0,f|0,g|0,s|0)|0;s=b;c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;s=bn(p|0)|0;g=p+s|0;if((s|0)>0){t=p}else{me(j);i=d;return}do{re(b,a[t]|0);t=t+1|0;}while((t|0)!=(g|0));me(j);i=d;return}function Bj(a,b){a=a|0;b=b|0;a=i;Wb(((b|0)==-1?-1:b<<1)|0)|0;i=a;return}function Cj(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Dj(a){a=a|0;i=i;return}function Ej(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((a[d]&1)==0){f=d+1|0}else{f=c[d+8>>2]|0}d=cc(f|0,1)|0;i=e;return d>>>((d|0)!=(-1|0)|0)|0}function Fj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;d=i;i=i+240|0;j=d;k=d+8|0;l=d+40|0;m=d+48|0;n=d+56|0;o=d+64|0;p=d+192|0;q=d+200|0;r=d+208|0;s=d+224|0;t=d+232|0;u=r;c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[s+4>>2]=0;c[s>>2]=232008;v=a[h]|0;if((v&1)==0){w=h+4|0;x=h+4|0;y=(v&255)>>>1}else{v=c[h+8>>2]|0;w=v;x=v;y=c[h+4>>2]|0}h=w+(y<<2)|0;y=k;w=j;v=j;c[v>>2]=0;c[v+4>>2]=0;a:do{if(x>>>0<h>>>0){v=s;j=s;z=k+32|0;A=x;B=232008|0;while(1){c[m>>2]=A;C=(rc[c[B+12>>2]&15](v,w,A,h,m,y,z,l)|0)==2;D=c[m>>2]|0;if(C|(D|0)==(A|0)){break}if(y>>>0<(c[l>>2]|0)>>>0){C=y;do{re(r,a[C]|0);C=C+1|0;}while(C>>>0<(c[l>>2]|0)>>>0);E=c[m>>2]|0}else{E=D}if(!(E>>>0<h>>>0)){break a}A=E;B=c[j>>2]|0}$i(231232)}}while(0);if((a[u]&1)==0){F=r+1|0}else{F=c[r+8>>2]|0}u=jb(((e|0)==-1?-1:e<<1)|0,f|0,g|0,F|0)|0;F=b;c[F+0>>2]=0;c[F+4>>2]=0;c[F+8>>2]=0;c[t+4>>2]=0;c[t>>2]=232112;F=bn(u|0)|0;g=u+F|0;f=n;e=n;c[e>>2]=0;c[e+4>>2]=0;if((F|0)<=0){me(r);i=d;return}F=t;e=t;t=g;n=o;E=o+128|0;o=u;u=232112|0;while(1){c[q>>2]=o;h=(rc[c[u+16>>2]&15](F,f,o,(t-o|0)>32?o+32|0:g,q,n,E,p)|0)==2;m=c[q>>2]|0;if(h|(m|0)==(o|0)){G=20;break}if(n>>>0<(c[p>>2]|0)>>>0){h=n;do{Be(b,c[h>>2]|0);h=h+4|0;}while(h>>>0<(c[p>>2]|0)>>>0);H=c[q>>2]|0}else{H=m}if(!(H>>>0<g>>>0)){G=25;break}o=H;u=c[e>>2]|0}if((G|0)==20){$i(231232)}else if((G|0)==25){me(r);i=d;return}}function Gj(a,b){a=a|0;b=b|0;a=i;Wb(((b|0)==-1?-1:b<<1)|0)|0;i=a;return}function Hj(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=230440;e=b+8|0;b=c[e>>2]|0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);if((b|0)==(c[57560]|0)){i=d;return}Ea(c[e>>2]|0);i=d;return}function Ij(a){a=a|0;a=Va(8)|0;Qd(a,230232);c[a>>2]=227280;xb(a|0,227320,9)}function Jj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;e=i;i=i+448|0;f=e;g=e+16|0;h=e+32|0;j=e+48|0;k=e+64|0;l=e+80|0;m=e+96|0;n=e+112|0;o=e+128|0;p=e+144|0;q=e+160|0;r=e+176|0;s=e+192|0;t=e+208|0;u=e+224|0;v=e+240|0;w=e+256|0;x=e+272|0;y=e+288|0;z=e+304|0;A=e+320|0;B=e+336|0;C=e+352|0;D=e+368|0;E=e+384|0;F=e+400|0;G=e+416|0;H=e+432|0;c[b+4>>2]=d+ -1;c[b>>2]=230272;d=b+8|0;I=b+12|0;J=b+136|0;a[J]=1;K=b+24|0;c[I>>2]=K;c[d>>2]=K;c[b+16>>2]=J;J=28;L=K;do{if((L|0)==0){M=0}else{c[L>>2]=0;M=c[I>>2]|0}L=M+4|0;c[I>>2]=L;J=J+ -1|0;}while((J|0)!=0);ke(b+144|0,230256,1);J=c[d>>2]|0;d=c[I>>2]|0;if((d|0)!=(J|0)){c[I>>2]=d+(~((d+ -4+(0-J)|0)>>>2)<<2)}c[235164>>2]=0;c[58790]=228752;if(!((c[57194]|0)==-1)){c[G>>2]=228776;c[G+4>>2]=112;c[G+8>>2]=0;he(228776,G,113)}Kj(b,235160,(c[228780>>2]|0)+ -1|0);c[235156>>2]=0;c[58788]=228792;if(!((c[57204]|0)==-1)){c[F>>2]=228816;c[F+4>>2]=112;c[F+8>>2]=0;he(228816,F,113)}Kj(b,235152,(c[228820>>2]|0)+ -1|0);c[235140>>2]=0;c[58784]=230368;c[235144>>2]=0;a[235148|0]=0;c[235144>>2]=c[(Ka()|0)>>2];if(!((c[57588]|0)==-1)){c[E>>2]=230352;c[E+4>>2]=112;c[E+8>>2]=0;he(230352,E,113)}Kj(b,235136,(c[230356>>2]|0)+ -1|0);c[235132>>2]=0;c[58782]=231328;if(!((c[57586]|0)==-1)){c[D>>2]=230344;c[D+4>>2]=112;c[D+8>>2]=0;he(230344,D,113)}Kj(b,235128,(c[230348>>2]|0)+ -1|0);c[235124>>2]=0;c[58780]=231544;if(!((c[57604]|0)==-1)){c[C>>2]=230416;c[C+4>>2]=112;c[C+8>>2]=0;he(230416,C,113)}Kj(b,235120,(c[230420>>2]|0)+ -1|0);c[235108>>2]=0;c[58776]=230440;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);c[235112>>2]=c[57560];if(!((c[57606]|0)==-1)){c[B>>2]=230424;c[B+4>>2]=112;c[B+8>>2]=0;he(230424,B,113)}Kj(b,235104,(c[230428>>2]|0)+ -1|0);c[235100>>2]=0;c[58774]=231768;if(!((c[57620]|0)==-1)){c[A>>2]=230480;c[A+4>>2]=112;c[A+8>>2]=0;he(230480,A,113)}Kj(b,235096,(c[230484>>2]|0)+ -1|0);c[235092>>2]=0;c[58772]=231888;if(!((c[57622]|0)==-1)){c[z>>2]=230488;c[z+4>>2]=112;c[z+8>>2]=0;he(230488,z,113)}Kj(b,235088,(c[230492>>2]|0)+ -1|0);c[235068>>2]=0;c[58766]=230520;a[235072|0]=46;a[235073|0]=44;c[235076>>2]=0;c[235080>>2]=0;c[235084>>2]=0;if(!((c[57624]|0)==-1)){c[y>>2]=230496;c[y+4>>2]=112;c[y+8>>2]=0;he(230496,y,113)}Kj(b,235064,(c[230500>>2]|0)+ -1|0);c[235036>>2]=0;c[58758]=230560;c[235040>>2]=46;c[235044>>2]=44;c[235048>>2]=0;c[235052>>2]=0;c[235056>>2]=0;if(!((c[57626]|0)==-1)){c[x>>2]=230504;c[x+4>>2]=112;c[x+8>>2]=0;he(230504,x,113)}Kj(b,235032,(c[230508>>2]|0)+ -1|0);c[235028>>2]=0;c[58756]=228832;if(!((c[57222]|0)==-1)){c[w>>2]=228888;c[w+4>>2]=112;c[w+8>>2]=0;he(228888,w,113)}Kj(b,235024,(c[228892>>2]|0)+ -1|0);c[235020>>2]=0;c[58754]=228952;if(!((c[57252]|0)==-1)){c[v>>2]=229008;c[v+4>>2]=112;c[v+8>>2]=0;he(229008,v,113)}Kj(b,235016,(c[229012>>2]|0)+ -1|0);c[235012>>2]=0;c[58752]=229024;if(!((c[57268]|0)==-1)){c[u>>2]=229072;c[u+4>>2]=112;c[u+8>>2]=0;he(229072,u,113)}Kj(b,235008,(c[229076>>2]|0)+ -1|0);c[235004>>2]=0;c[58750]=229088;if(!((c[57284]|0)==-1)){c[t>>2]=229136;c[t+4>>2]=112;c[t+8>>2]=0;he(229136,t,113)}Kj(b,235e3,(c[229140>>2]|0)+ -1|0);c[234996>>2]=0;c[58748]=229680;if(!((c[57432]|0)==-1)){c[s>>2]=229728;c[s+4>>2]=112;c[s+8>>2]=0;he(229728,s,113)}Kj(b,234992,(c[229732>>2]|0)+ -1|0);c[234988>>2]=0;c[58746]=229744;if(!((c[57448]|0)==-1)){c[r>>2]=229792;c[r+4>>2]=112;c[r+8>>2]=0;he(229792,r,113)}Kj(b,234984,(c[229796>>2]|0)+ -1|0);c[234980>>2]=0;c[58744]=229808;if(!((c[57464]|0)==-1)){c[q>>2]=229856;c[q+4>>2]=112;c[q+8>>2]=0;he(229856,q,113)}Kj(b,234976,(c[229860>>2]|0)+ -1|0);c[234972>>2]=0;c[58742]=229872;if(!((c[57480]|0)==-1)){c[p>>2]=229920;c[p+4>>2]=112;c[p+8>>2]=0;he(229920,p,113)}Kj(b,234968,(c[229924>>2]|0)+ -1|0);c[234964>>2]=0;c[58740]=229936;if(!((c[57490]|0)==-1)){c[o>>2]=229960;c[o+4>>2]=112;c[o+8>>2]=0;he(229960,o,113)}Kj(b,234960,(c[229964>>2]|0)+ -1|0);c[234956>>2]=0;c[58738]=230016;if(!((c[57510]|0)==-1)){c[n>>2]=230040;c[n+4>>2]=112;c[n+8>>2]=0;he(230040,n,113)}Kj(b,234952,(c[230044>>2]|0)+ -1|0);c[234948>>2]=0;c[58736]=230072;if(!((c[57524]|0)==-1)){c[m>>2]=230096;c[m+4>>2]=112;c[m+8>>2]=0;he(230096,m,113)}Kj(b,234944,(c[230100>>2]|0)+ -1|0);c[234940>>2]=0;c[58734]=230120;if(!((c[57536]|0)==-1)){c[l>>2]=230144;c[l+4>>2]=112;c[l+8>>2]=0;he(230144,l,113)}Kj(b,234936,(c[230148>>2]|0)+ -1|0);c[234924>>2]=0;c[58730]=229168;c[234928>>2]=229216;if(!((c[57312]|0)==-1)){c[k>>2]=229248;c[k+4>>2]=112;c[k+8>>2]=0;he(229248,k,113)}Kj(b,234920,(c[229252>>2]|0)+ -1|0);c[234908>>2]=0;c[58726]=229320;c[234912>>2]=229368;if(!((c[57350]|0)==-1)){c[j>>2]=229400;c[j+4>>2]=112;c[j+8>>2]=0;he(229400,j,113)}Kj(b,234904,(c[229404>>2]|0)+ -1|0);c[234892>>2]=0;c[58722]=231264;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);c[234896>>2]=c[57560];c[58722]=229616;if(!((c[57408]|0)==-1)){c[h>>2]=229632;c[h+4>>2]=112;c[h+8>>2]=0;he(229632,h,113)}Kj(b,234888,(c[229636>>2]|0)+ -1|0);c[234876>>2]=0;c[58718]=231264;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);c[234880>>2]=c[57560];c[58718]=229648;if(!((c[57416]|0)==-1)){c[g>>2]=229664;c[g+4>>2]=112;c[g+8>>2]=0;he(229664,g,113)}Kj(b,234872,(c[229668>>2]|0)+ -1|0);c[234868>>2]=0;c[58716]=230160;if(!((c[57546]|0)==-1)){c[f>>2]=230184;c[f+4>>2]=112;c[f+8>>2]=0;he(230184,f,113)}Kj(b,234864,(c[230188>>2]|0)+ -1|0);c[234860>>2]=0;c[58714]=230200;if((c[57556]|0)==-1){N=c[230228>>2]|0;O=N+ -1|0;Kj(b,234856,O);i=e;return}c[H>>2]=230224;c[H+4>>2]=112;c[H+8>>2]=0;he(230224,H,113);N=c[230228>>2]|0;O=N+ -1|0;Kj(b,234856,O);i=e;return}function Kj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;Od(b);f=a+8|0;g=a+12|0;a=c[g>>2]|0;h=f;j=c[h>>2]|0;k=a-j>>2;do{if(k>>>0>d>>>0){l=j}else{m=d+1|0;if(k>>>0<m>>>0){Ol(f,m-k|0);l=c[h>>2]|0;break}if(!(k>>>0>m>>>0)){l=j;break}n=j+(m<<2)|0;if((a|0)==(n|0)){l=j;break}c[g>>2]=a+(~((a+ -4+(0-n)|0)>>>2)<<2);l=j}}while(0);j=c[l+(d<<2)>>2]|0;if((j|0)==0){o=l;p=o+(d<<2)|0;c[p>>2]=b;i=e;return}Pd(j)|0;o=c[h>>2]|0;p=o+(d<<2)|0;c[p>>2]=b;i=e;return}function Lj(a){a=a|0;var b=0;b=i;Mj(a);Im(a);i=b;return}function Mj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;d=i;c[b>>2]=230272;e=b+12|0;f=c[e>>2]|0;g=b+8|0;h=c[g>>2]|0;if((f|0)!=(h|0)){j=f;f=h;h=0;while(1){k=c[f+(h<<2)>>2]|0;if((k|0)==0){l=f;m=j}else{Pd(k)|0;l=c[g>>2]|0;m=c[e>>2]|0}k=h+1|0;if(k>>>0<m-l>>2>>>0){j=m;f=l;h=k}else{break}}}me(b+144|0);h=c[g>>2]|0;if((h|0)==0){i=d;return}g=c[e>>2]|0;if((g|0)!=(h|0)){c[e>>2]=g+(~((g+ -4+(0-h)|0)>>>2)<<2)}if((b+24|0)==(h|0)){a[b+136|0]=0;i=d;return}else{Im(h);i=d;return}}function Nj(){var b=0,d=0,e=0;b=i;if((a[230328]|0)!=0){d=c[57580]|0;i=b;return d|0}if((Na(230328)|0)==0){d=c[57580]|0;i=b;return d|0}do{if((a[230304]|0)==0){if((Na(230304)|0)==0){break}Jj(234696,1);c[57572]=234696;c[57574]=230288;_a(230304)}}while(0);e=c[c[57574]>>2]|0;c[57578]=e;Od(e);c[57580]=230312;_a(230328);d=c[57580]|0;i=b;return d|0}function Oj(a){a=a|0;var b=0,d=0;b=i;d=c[(Nj()|0)>>2]|0;c[a>>2]=d;Od(d);i=b;return}function Pj(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;e=c[b>>2]|0;c[a>>2]=e;Od(e);i=d;return}function Qj(a){a=a|0;var b=0;b=i;Pd(c[a>>2]|0)|0;i=b;return}function Rj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d;f=c[a>>2]|0;a=b;if(!((c[a>>2]|0)==-1)){c[e>>2]=b;c[e+4>>2]=112;c[e+8>>2]=0;he(a,e,113)}e=(c[b+4>>2]|0)+ -1|0;b=c[f+8>>2]|0;if(!((c[f+12>>2]|0)-b>>2>>>0>e>>>0)){g=Va(4)|0;h=g;gm(h);xb(g|0,238312,101)}f=c[b+(e<<2)>>2]|0;if((f|0)==0){g=Va(4)|0;h=g;gm(h);xb(g|0,238312,101)}else{i=d;return f|0}return 0}function Sj(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Tj(a){a=a|0;var b=0;b=i;if((a|0)==0){i=b;return}jc[c[(c[a>>2]|0)+4>>2]&127](a);i=b;return}function Uj(a){a=a|0;var b=0;b=c[57584]|0;c[57584]=b+1;c[a+4>>2]=b+1;i=i;return}function Vj(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Wj(a,d,e){a=a|0;d=d|0;e=e|0;var f=0;a=i;if(!(e>>>0<128)){f=0;i=a;return f|0}f=(b[(c[(Ka()|0)>>2]|0)+(e<<1)>>1]&d)<<16>>16!=0;i=a;return f|0}function Xj(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;a=i;if((d|0)==(e|0)){g=d;i=a;return g|0}else{h=d;j=f}while(1){f=c[h>>2]|0;if(f>>>0<128){k=b[(c[(Ka()|0)>>2]|0)+(f<<1)>>1]|0}else{k=0}b[j>>1]=k;f=h+4|0;if((f|0)==(e|0)){g=e;break}else{h=f;j=j+2|0}}i=a;return g|0}function Yj(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;a=i;a:do{if((e|0)==(f|0)){g=e}else{h=e;while(1){j=c[h>>2]|0;if(j>>>0<128){if(!((b[(c[(Ka()|0)>>2]|0)+(j<<1)>>1]&d)<<16>>16==0)){g=h;break a}}j=h+4|0;if((j|0)==(f|0)){g=f;break}else{h=j}}}}while(0);i=a;return g|0}function Zj(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;a=i;a:do{if((e|0)==(f|0)){g=e}else{h=e;while(1){j=c[h>>2]|0;if(!(j>>>0<128)){g=h;break a}k=h+4|0;if((b[(c[(Ka()|0)>>2]|0)+(j<<1)>>1]&d)<<16>>16==0){g=h;break a}if((k|0)==(f|0)){g=f;break}else{h=k}}}}while(0);i=a;return g|0}function _j(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b>>>0<128)){d=b;i=a;return d|0}d=c[(c[(Ya()|0)>>2]|0)+(b<<2)>>2]|0;i=a;return d|0}function $j(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;a=i;if((b|0)==(d|0)){e=b;i=a;return e|0}else{f=b}while(1){b=c[f>>2]|0;if(b>>>0<128){g=c[(c[(Ya()|0)>>2]|0)+(b<<2)>>2]|0}else{g=b}c[f>>2]=g;b=f+4|0;if((b|0)==(d|0)){e=d;break}else{f=b}}i=a;return e|0}function ak(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b>>>0<128)){d=b;i=a;return d|0}d=c[(c[(yb()|0)>>2]|0)+(b<<2)>>2]|0;i=a;return d|0}function bk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;a=i;if((b|0)==(d|0)){e=b;i=a;return e|0}else{f=b}while(1){b=c[f>>2]|0;if(b>>>0<128){g=c[(c[(yb()|0)>>2]|0)+(b<<2)>>2]|0}else{g=b}c[f>>2]=g;b=f+4|0;if((b|0)==(d|0)){e=d;break}else{f=b}}i=a;return e|0}function ck(a,b){a=a|0;b=b|0;i=i;return b<<24>>24|0}function dk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;b=i;if((d|0)==(e|0)){g=d;i=b;return g|0}else{h=d;j=f}while(1){c[j>>2]=a[h]|0;f=h+1|0;if((f|0)==(e|0)){g=e;break}else{j=j+4|0;h=f}}i=b;return g|0}function ek(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return(b>>>0<128?b&255:c)|0}function fk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0;b=i;if((d|0)==(e|0)){h=d;i=b;return h|0}j=((e+ -4+(0-d)|0)>>>2)+1|0;k=d;l=g;while(1){g=c[k>>2]|0;a[l]=g>>>0<128?g&255:f;g=k+4|0;if((g|0)==(e|0)){break}else{l=l+1|0;k=g}}h=d+(j<<2)|0;i=b;return h|0}function gk(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=230368;e=c[b+8>>2]|0;do{if((e|0)!=0){if((a[b+12|0]|0)==0){break}Jm(e)}}while(0);Im(b);i=d;return}function hk(b){b=b|0;var d=0,e=0;d=i;c[b>>2]=230368;e=c[b+8>>2]|0;if((e|0)==0){i=d;return}if((a[b+12|0]|0)==0){i=d;return}Jm(e);i=d;return}function ik(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b<<24>>24>-1)){d=b;i=a;return d|0}d=c[(c[(Ya()|0)>>2]|0)+((b&255)<<2)>>2]&255;i=a;return d|0}function jk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;b=i;if((d|0)==(e|0)){f=d;i=b;return f|0}else{g=d}while(1){d=a[g]|0;if(d<<24>>24>-1){h=c[(c[(Ya()|0)>>2]|0)+(d<<24>>24<<2)>>2]&255}else{h=d}a[g]=h;d=g+1|0;if((d|0)==(e|0)){f=e;break}else{g=d}}i=b;return f|0}function kk(a,b){a=a|0;b=b|0;var d=0;a=i;if(!(b<<24>>24>-1)){d=b;i=a;return d|0}d=c[(c[(yb()|0)>>2]|0)+(b<<24>>24<<2)>>2]&255;i=a;return d|0}function lk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;b=i;if((d|0)==(e|0)){f=d;i=b;return f|0}else{g=d}while(1){d=a[g]|0;if(d<<24>>24>-1){h=c[(c[(yb()|0)>>2]|0)+(d<<24>>24<<2)>>2]&255}else{h=d}a[g]=h;d=g+1|0;if((d|0)==(e|0)){f=e;break}else{g=d}}i=b;return f|0}function mk(a,b){a=a|0;b=b|0;i=i;return b|0}function nk(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;b=i;if((c|0)==(d|0)){f=c}else{g=c;c=e;while(1){a[c]=a[g]|0;e=g+1|0;if((e|0)==(d|0)){f=d;break}else{c=c+1|0;g=e}}}i=b;return f|0}function ok(a,b,c){a=a|0;b=b|0;c=c|0;i=i;return(b<<24>>24>-1?b:c)|0}function pk(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;b=i;if((c|0)==(d|0)){g=c;i=b;return g|0}else{h=c;j=f}while(1){f=a[h]|0;a[j]=f<<24>>24>-1?f:e;f=h+1|0;if((f|0)==(d|0)){g=d;break}else{j=j+1|0;h=f}}i=b;return g|0}function qk(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function rk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;c[f>>2]=d;c[j>>2]=g;i=i;return 3}function sk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;c[f>>2]=d;c[j>>2]=g;i=i;return 3}function tk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function uk(a){a=a|0;i=i;return 1}function vk(a){a=a|0;i=i;return 1}function wk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=d-c|0;i=i;return(b>>>0<e>>>0?b:e)|0}function xk(a){a=a|0;i=i;return 1}function yk(a){a=a|0;var b=0;b=i;Hj(a);Im(a);i=b;return}function zk(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;l=i;i=i+8|0;m=l;n=m;o=i;i=i+8|0;p=(e|0)==(f|0);a:do{if(p){c[k>>2]=h;c[g>>2]=e;q=e}else{r=e;while(1){s=r+4|0;if((c[r>>2]|0)==0){t=r;break}if((s|0)==(f|0)){t=f;break}else{r=s}}c[k>>2]=h;c[g>>2]=e;if(p|(h|0)==(j|0)){q=e;break}r=d;s=j;u=b+8|0;v=o;w=e;x=h;y=t;while(1){z=r;A=c[z+4>>2]|0;B=m;c[B>>2]=c[z>>2];c[B+4>>2]=A;A=ib(c[u>>2]|0)|0;B=$l(x,g,y-w>>2,s-x|0,d)|0;if((A|0)!=0){ib(A|0)|0}if((B|0)==0){C=1;D=33;break}else if((B|0)==-1){D=10;break}A=(c[k>>2]|0)+B|0;c[k>>2]=A;if((A|0)==(j|0)){D=31;break}if((y|0)==(f|0)){E=c[g>>2]|0;F=A;G=f}else{A=ib(c[u>>2]|0)|0;B=_l(v,0,d)|0;if((A|0)!=0){ib(A|0)|0}if((B|0)==-1){C=2;D=33;break}A=c[k>>2]|0;if(B>>>0>(s-A|0)>>>0){C=1;D=33;break}b:do{if((B|0)!=0){z=A;H=B;I=v;while(1){J=a[I]|0;c[k>>2]=z+1;a[z]=J;J=H+ -1|0;if((J|0)==0){break b}z=c[k>>2]|0;I=I+1|0;H=J}}}while(0);B=(c[g>>2]|0)+4|0;c[g>>2]=B;c:do{if((B|0)==(f|0)){K=f}else{A=B;while(1){H=A+4|0;if((c[A>>2]|0)==0){K=A;break c}if((H|0)==(f|0)){K=f;break}else{A=H}}}}while(0);E=B;F=c[k>>2]|0;G=K}if((E|0)==(f|0)|(F|0)==(j|0)){q=E;break a}else{w=E;x=F;y=G}}if((D|0)==10){c[k>>2]=x;d:do{if((w|0)==(c[g>>2]|0)){L=w}else{y=w;v=x;while(1){s=c[y>>2]|0;r=ib(c[u>>2]|0)|0;A=_l(v,s,n)|0;if((r|0)!=0){ib(r|0)|0}if((A|0)==-1){L=y;break d}r=(c[k>>2]|0)+A|0;c[k>>2]=r;A=y+4|0;if((A|0)==(c[g>>2]|0)){L=A;break}else{y=A;v=r}}}}while(0);c[g>>2]=L;C=2;i=l;return C|0}else if((D|0)==31){q=c[g>>2]|0;break}else if((D|0)==33){i=l;return C|0}}}while(0);C=(q|0)!=(f|0)|0;i=l;return C|0}function Ak(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;l=i;i=i+8|0;m=l;n=m;o=(e|0)==(f|0);a:do{if(o){c[k>>2]=h;c[g>>2]=e;p=e}else{q=e;while(1){r=q+1|0;if((a[q]|0)==0){s=q;break}if((r|0)==(f|0)){s=f;break}else{q=r}}c[k>>2]=h;c[g>>2]=e;if(o|(h|0)==(j|0)){p=e;break}q=d;r=j;t=b+8|0;u=e;v=h;w=s;while(1){x=q;y=c[x+4>>2]|0;z=m;c[z>>2]=c[x>>2];c[z+4>>2]=y;A=w;y=ib(c[t>>2]|0)|0;z=Xl(v,g,A-u|0,r-v>>2,d)|0;if((y|0)!=0){ib(y|0)|0}if((z|0)==-1){B=10;break}else if((z|0)==0){C=2;B=32;break}y=(c[k>>2]|0)+(z<<2)|0;c[k>>2]=y;if((y|0)==(j|0)){B=30;break}z=c[g>>2]|0;if((w|0)==(f|0)){D=z;E=y;F=f}else{x=ib(c[t>>2]|0)|0;G=Wl(y,z,1,d)|0;if((x|0)!=0){ib(x|0)|0}if((G|0)!=0){C=2;B=32;break}c[k>>2]=(c[k>>2]|0)+4;G=(c[g>>2]|0)+1|0;c[g>>2]=G;b:do{if((G|0)==(f|0)){H=f}else{x=G;while(1){z=x+1|0;if((a[x]|0)==0){H=x;break b}if((z|0)==(f|0)){H=f;break}else{x=z}}}}while(0);D=G;E=c[k>>2]|0;F=H}if((D|0)==(f|0)|(E|0)==(j|0)){p=D;break a}else{u=D;v=E;w=F}}if((B|0)==10){c[k>>2]=v;c:do{if((u|0)==(c[g>>2]|0)){I=u}else{w=u;r=v;while(1){q=ib(c[t>>2]|0)|0;x=Wl(r,w,A-w|0,n)|0;if((q|0)!=0){ib(q|0)|0}if((x|0)==-2){B=16;break}else if((x|0)==-1){B=15;break}else if((x|0)==0){J=w+1|0}else{J=w+x|0}x=(c[k>>2]|0)+4|0;c[k>>2]=x;if((J|0)==(c[g>>2]|0)){I=J;break c}else{w=J;r=x}}if((B|0)==15){c[g>>2]=w;C=2;i=l;return C|0}else if((B|0)==16){c[g>>2]=w;C=1;i=l;return C|0}}}while(0);c[g>>2]=I;C=(I|0)!=(f|0)|0;i=l;return C|0}else if((B|0)==30){p=c[g>>2]|0;break}else if((B|0)==32){i=l;return C|0}}}while(0);C=(p|0)!=(f|0)|0;i=l;return C|0}function Bk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+8|0;c[g>>2]=e;e=h;j=ib(c[b+8>>2]|0)|0;b=_l(e,0,d)|0;if((j|0)!=0){ib(j|0)|0}if((b|0)==0|(b|0)==-1){k=2;i=h;return k|0}j=b+ -1|0;b=c[g>>2]|0;if(j>>>0>(f-b|0)>>>0){k=1;i=h;return k|0}if((j|0)==0){k=0;i=h;return k|0}else{l=b;m=j;n=e}while(1){e=a[n]|0;c[g>>2]=l+1;a[l]=e;e=m+ -1|0;if((e|0)==0){k=0;break}l=c[g>>2]|0;n=n+1|0;m=e}i=h;return k|0}function Ck(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;d=a+8|0;a=ib(c[d>>2]|0)|0;e=Zl(0,0,4)|0;if((a|0)!=0){ib(a|0)|0}do{if((e|0)==0){a=c[d>>2]|0;if((a|0)==0){f=1;break}g=ib(a|0)|0;if((g|0)==0){f=0;break}ib(g|0)|0;f=0}else{f=-1}}while(0);i=b;return f|0}function Dk(a){a=a|0;i=i;return 0}function Ek(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;if((f|0)==0|(d|0)==(e|0)){h=0;i=g;return h|0}j=e;k=a+8|0;a=d;d=0;l=0;while(1){m=ib(c[k>>2]|0)|0;n=Vl(a,j-a|0,b)|0;if((m|0)!=0){ib(m|0)|0}if((n|0)==0){o=a+1|0;p=1}else if((n|0)==-2|(n|0)==-1){h=d;q=9;break}else{o=a+n|0;p=n}n=p+d|0;m=l+1|0;if(m>>>0>=f>>>0|(o|0)==(e|0)){h=n;q=9;break}else{a=o;d=n;l=m}}if((q|0)==9){i=g;return h|0}return 0}function Fk(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a+8>>2]|0;do{if((d|0)==0){e=1}else{a=ib(d|0)|0;if((a|0)==0){e=4;break}ib(a|0)|0;e=4}}while(0);i=b;return e|0}function Gk(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Hk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Ik(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d>>1<<1);c[j>>2]=g+((c[k>>2]|0)-g);i=b;return l|0}function Ik(d,f,g,h,j,k,l,m){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;c[g>>2]=d;c[k>>2]=h;do{if((m&2|0)!=0){if((j-h|0)<3){o=1;i=n;return o|0}else{c[k>>2]=h+1;a[h]=-17;d=c[k>>2]|0;c[k>>2]=d+1;a[d]=-69;d=c[k>>2]|0;c[k>>2]=d+1;a[d]=-65;break}}}while(0);h=f;m=c[g>>2]|0;if(!(m>>>0<f>>>0)){o=0;i=n;return o|0}d=j;j=m;a:while(1){m=b[j>>1]|0;p=m&65535;if(p>>>0>l>>>0){o=2;q=26;break}do{if((m&65535)<128){r=c[k>>2]|0;if((d-r|0)<1){o=1;q=26;break a}c[k>>2]=r+1;a[r]=m}else{if((m&65535)<2048){r=c[k>>2]|0;if((d-r|0)<2){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>6|192;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if((m&65535)<55296){r=c[k>>2]|0;if((d-r|0)<3){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>12|224;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p>>>6&63|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if(!((m&65535)<56320)){if((m&65535)<57344){o=2;q=26;break a}r=c[k>>2]|0;if((d-r|0)<3){o=1;q=26;break a}c[k>>2]=r+1;a[r]=p>>>12|224;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p>>>6&63|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p&63|128;break}if((h-j|0)<4){o=1;q=26;break a}r=j+2|0;s=e[r>>1]|0;if((s&64512|0)!=56320){o=2;q=26;break a}if((d-(c[k>>2]|0)|0)<4){o=1;q=26;break a}t=p&960;if(((t<<10)+65536|p<<10&64512|s&1023)>>>0>l>>>0){o=2;q=26;break a}c[g>>2]=r;r=(t>>>6)+1|0;t=c[k>>2]|0;c[k>>2]=t+1;a[t]=r>>>2|240;t=c[k>>2]|0;c[k>>2]=t+1;a[t]=p>>>2&15|r<<4&48|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=p<<4&48|s>>>6&15|128;r=c[k>>2]|0;c[k>>2]=r+1;a[r]=s&63|128}}while(0);p=(c[g>>2]|0)+2|0;c[g>>2]=p;if(p>>>0<f>>>0){j=p}else{o=0;q=26;break}}if((q|0)==26){i=n;return o|0}return 0}function Jk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Kk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d);c[j>>2]=g+((c[k>>2]|0)-g>>1<<1);i=b;return l|0}function Kk(e,f,g,h,j,k,l,m){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;n=i;c[g>>2]=e;c[k>>2]=h;h=c[g>>2]|0;do{if((m&4|0)==0){o=h}else{if((f-h|0)<=2){o=h;break}if(!((a[h]|0)==-17)){o=h;break}if(!((a[h+1|0]|0)==-69)){o=h;break}if(!((a[h+2|0]|0)==-65)){o=h;break}e=h+3|0;c[g>>2]=e;o=e}}while(0);a:do{if(o>>>0<f>>>0){h=f;m=j;e=o;p=c[k>>2]|0;b:while(1){if(!(p>>>0<j>>>0)){q=e;break a}r=a[e]|0;s=r&255;if(s>>>0>l>>>0){t=2;u=41;break}do{if(r<<24>>24>-1){b[p>>1]=r&255;c[g>>2]=e+1}else{if((r&255)<194){t=2;u=41;break b}if((r&255)<224){if((h-e|0)<2){t=1;u=41;break b}v=d[e+1|0]|0;if((v&192|0)!=128){t=2;u=41;break b}w=v&63|s<<6&1984;if(w>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=w;c[g>>2]=e+2;break}if((r&255)<240){if((h-e|0)<3){t=1;u=41;break b}w=a[e+1|0]|0;v=a[e+2|0]|0;if((s|0)==224){if(!((w&-32)<<24>>24==-96)){t=2;u=41;break b}}else if((s|0)==237){if(!((w&-32)<<24>>24==-128)){t=2;u=41;break b}}else{if(!((w&-64)<<24>>24==-128)){t=2;u=41;break b}}x=v&255;if((x&192|0)!=128){t=2;u=41;break b}v=(w&255)<<6&4032|s<<12|x&63;if((v&65535)>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=v;c[g>>2]=e+3;break}if(!((r&255)<245)){t=2;u=41;break b}if((h-e|0)<4){t=1;u=41;break b}v=a[e+1|0]|0;x=a[e+2|0]|0;w=a[e+3|0]|0;if((s|0)==240){if(!((v+112<<24>>24&255)<48)){t=2;u=41;break b}}else if((s|0)==244){if(!((v&-16)<<24>>24==-128)){t=2;u=41;break b}}else{if(!((v&-64)<<24>>24==-128)){t=2;u=41;break b}}y=x&255;if((y&192|0)!=128){t=2;u=41;break b}x=w&255;if((x&192|0)!=128){t=2;u=41;break b}if((m-p|0)<4){t=1;u=41;break b}w=s&7;z=v&255;v=y<<6;A=x&63;if((z<<12&258048|w<<18|v&4032|A)>>>0>l>>>0){t=2;u=41;break b}b[p>>1]=z<<2&60|y>>>4&3|((z>>>4&3|w<<2)<<6)+16320|55296;w=p+2|0;c[k>>2]=w;b[w>>1]=A|v&960|56320;c[g>>2]=(c[g>>2]|0)+4}}while(0);s=(c[k>>2]|0)+2|0;c[k>>2]=s;r=c[g>>2]|0;if(r>>>0<f>>>0){e=r;p=s}else{q=r;break a}}if((u|0)==41){i=n;return t|0}}else{q=o}}while(0);t=q>>>0<f>>>0|0;i=n;return t|0}function Lk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function Mk(a){a=a|0;i=i;return 0}function Nk(a){a=a|0;i=i;return 0}function Ok(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=i;a=Pk(c,d,e,1114111,0)|0;i=b;return a|0}function Pk(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;h=i;do{if((g&4|0)==0){j=b}else{if((c-b|0)<=2){j=b;break}if(!((a[b]|0)==-17)){j=b;break}if(!((a[b+1|0]|0)==-69)){j=b;break}j=(a[b+2|0]|0)==-65?b+3|0:b}}while(0);a:do{if(j>>>0<c>>>0&(e|0)!=0){g=c;k=j;l=0;b:while(1){m=a[k]|0;n=m&255;if(n>>>0>f>>>0){o=k;break a}do{if(m<<24>>24>-1){p=k+1|0;q=l}else{if((m&255)<194){o=k;break a}if((m&255)<224){if((g-k|0)<2){o=k;break a}r=d[k+1|0]|0;if((r&192|0)!=128){o=k;break a}if((r&63|n<<6&1984)>>>0>f>>>0){o=k;break a}p=k+2|0;q=l;break}if((m&255)<240){s=k;if((g-s|0)<3){o=k;break a}r=a[k+1|0]|0;t=a[k+2|0]|0;if((n|0)==237){if(!((r&-32)<<24>>24==-128)){u=23;break b}}else if((n|0)==224){if(!((r&-32)<<24>>24==-96)){u=21;break b}}else{if(!((r&-64)<<24>>24==-128)){u=25;break b}}v=t&255;if((v&192|0)!=128){o=k;break a}if(((r&255)<<6&4032|n<<12&61440|v&63)>>>0>f>>>0){o=k;break a}p=k+3|0;q=l;break}if(!((m&255)<245)){o=k;break a}w=k;if((g-w|0)<4){o=k;break a}if((e-l|0)>>>0<2){o=k;break a}v=a[k+1|0]|0;r=a[k+2|0]|0;t=a[k+3|0]|0;if((n|0)==244){if(!((v&-16)<<24>>24==-128)){u=36;break b}}else if((n|0)==240){if(!((v+112<<24>>24&255)<48)){u=34;break b}}else{if(!((v&-64)<<24>>24==-128)){u=38;break b}}x=r&255;if((x&192|0)!=128){o=k;break a}r=t&255;if((r&192|0)!=128){o=k;break a}if(((v&255)<<12&258048|n<<18&1835008|x<<6&4032|r&63)>>>0>f>>>0){o=k;break a}p=k+4|0;q=l+1|0}}while(0);n=q+1|0;if(p>>>0<c>>>0&n>>>0<e>>>0){k=p;l=n}else{o=p;break a}}if((u|0)==21){y=s-b|0;i=h;return y|0}else if((u|0)==23){y=s-b|0;i=h;return y|0}else if((u|0)==25){y=s-b|0;i=h;return y|0}else if((u|0)==34){y=w-b|0;i=h;return y|0}else if((u|0)==36){y=w-b|0;i=h;return y|0}else if((u|0)==38){y=w-b|0;i=h;return y|0}}else{o=j}}while(0);y=o-b|0;i=h;return y|0}function Qk(a){a=a|0;i=i;return 4}function Rk(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Sk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Tk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d>>2<<2);c[j>>2]=g+((c[k>>2]|0)-g);i=b;return l|0}function Tk(b,d,e,f,g,h,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0;l=i;c[e>>2]=b;c[h>>2]=f;do{if((k&2|0)!=0){if((g-f|0)<3){m=1;i=l;return m|0}else{c[h>>2]=f+1;a[f]=-17;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=-69;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=-65;break}}}while(0);f=c[e>>2]|0;if(!(f>>>0<d>>>0)){m=0;i=l;return m|0}k=g;g=f;a:while(1){f=c[g>>2]|0;if((f&-2048|0)==55296|f>>>0>j>>>0){m=2;n=19;break}do{if(f>>>0<128){b=c[h>>2]|0;if((k-b|0)<1){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f}else{if(f>>>0<2048){b=c[h>>2]|0;if((k-b|0)<2){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>6|192;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f&63|128;break}b=c[h>>2]|0;o=k-b|0;if(f>>>0<65536){if((o|0)<3){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>12|224;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=f>>>6&63|128;p=c[h>>2]|0;c[h>>2]=p+1;a[p]=f&63|128;break}else{if((o|0)<4){m=1;n=19;break a}c[h>>2]=b+1;a[b]=f>>>18|240;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f>>>12&63|128;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f>>>6&63|128;b=c[h>>2]|0;c[h>>2]=b+1;a[b]=f&63|128;break}}}while(0);f=(c[e>>2]|0)+4|0;c[e>>2]=f;if(f>>>0<d>>>0){g=f}else{m=0;n=19;break}}if((n|0)==19){i=l;return m|0}return 0}function Uk(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0;b=i;i=i+16|0;a=b;k=b+8|0;c[a>>2]=d;c[k>>2]=g;l=Vk(d,e,a,g,h,k,1114111,0)|0;c[f>>2]=d+((c[a>>2]|0)-d);c[j>>2]=g+((c[k>>2]|0)-g>>2<<2);i=b;return l|0}function Vk(b,e,f,g,h,j,k,l){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;m=i;c[f>>2]=b;c[j>>2]=g;g=c[f>>2]|0;do{if((l&4|0)==0){n=g}else{if((e-g|0)<=2){n=g;break}if(!((a[g]|0)==-17)){n=g;break}if(!((a[g+1|0]|0)==-69)){n=g;break}if(!((a[g+2|0]|0)==-65)){n=g;break}b=g+3|0;c[f>>2]=b;n=b}}while(0);a:do{if(n>>>0<e>>>0){g=e;l=n;b=c[j>>2]|0;while(1){if(!(b>>>0<h>>>0)){o=l;p=39;break a}q=a[l]|0;r=q&255;do{if(q<<24>>24>-1){if(r>>>0>k>>>0){s=2;break a}c[b>>2]=r;c[f>>2]=l+1}else{if((q&255)<194){s=2;break a}if((q&255)<224){if((g-l|0)<2){s=1;break a}t=d[l+1|0]|0;if((t&192|0)!=128){s=2;break a}u=t&63|r<<6&1984;if(u>>>0>k>>>0){s=2;break a}c[b>>2]=u;c[f>>2]=l+2;break}if((q&255)<240){if((g-l|0)<3){s=1;break a}u=a[l+1|0]|0;t=a[l+2|0]|0;if((r|0)==237){if(!((u&-32)<<24>>24==-128)){s=2;break a}}else if((r|0)==224){if(!((u&-32)<<24>>24==-96)){s=2;break a}}else{if(!((u&-64)<<24>>24==-128)){s=2;break a}}v=t&255;if((v&192|0)!=128){s=2;break a}t=(u&255)<<6&4032|r<<12&61440|v&63;if(t>>>0>k>>>0){s=2;break a}c[b>>2]=t;c[f>>2]=l+3;break}if(!((q&255)<245)){s=2;break a}if((g-l|0)<4){s=1;break a}t=a[l+1|0]|0;v=a[l+2|0]|0;u=a[l+3|0]|0;if((r|0)==244){if(!((t&-16)<<24>>24==-128)){s=2;break a}}else if((r|0)==240){if(!((t+112<<24>>24&255)<48)){s=2;break a}}else{if(!((t&-64)<<24>>24==-128)){s=2;break a}}w=v&255;if((w&192|0)!=128){s=2;break a}v=u&255;if((v&192|0)!=128){s=2;break a}u=(t&255)<<12&258048|r<<18&1835008|w<<6&4032|v&63;if(u>>>0>k>>>0){s=2;break a}c[b>>2]=u;c[f>>2]=l+4}}while(0);r=(c[j>>2]|0)+4|0;c[j>>2]=r;q=c[f>>2]|0;if(q>>>0<e>>>0){l=q;b=r}else{o=q;p=39;break}}}else{o=n;p=39}}while(0);if((p|0)==39){s=o>>>0<e>>>0|0}i=m;return s|0}function Wk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[f>>2]=d;i=i;return 3}function Xk(a){a=a|0;i=i;return 0}function Yk(a){a=a|0;i=i;return 0}function Zk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;b=i;a=_k(c,d,e,1114111,0)|0;i=b;return a|0}function _k(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=i;do{if((g&4|0)==0){j=b}else{if((c-b|0)<=2){j=b;break}if(!((a[b]|0)==-17)){j=b;break}if(!((a[b+1|0]|0)==-69)){j=b;break}j=(a[b+2|0]|0)==-65?b+3|0:b}}while(0);a:do{if(j>>>0<c>>>0&(e|0)!=0){g=c;k=j;l=1;b:while(1){m=a[k]|0;n=m&255;do{if(m<<24>>24>-1){if(n>>>0>f>>>0){o=k;break a}p=k+1|0}else{if((m&255)<194){o=k;break a}if((m&255)<224){if((g-k|0)<2){o=k;break a}q=d[k+1|0]|0;if((q&192|0)!=128){o=k;break a}if((q&63|n<<6&1984)>>>0>f>>>0){o=k;break a}p=k+2|0;break}if((m&255)<240){r=k;if((g-r|0)<3){o=k;break a}q=a[k+1|0]|0;s=a[k+2|0]|0;if((n|0)==224){if(!((q&-32)<<24>>24==-96)){t=21;break b}}else if((n|0)==237){if(!((q&-32)<<24>>24==-128)){t=23;break b}}else{if(!((q&-64)<<24>>24==-128)){t=25;break b}}u=s&255;if((u&192|0)!=128){o=k;break a}if(((q&255)<<6&4032|n<<12&61440|u&63)>>>0>f>>>0){o=k;break a}p=k+3|0;break}if(!((m&255)<245)){o=k;break a}v=k;if((g-v|0)<4){o=k;break a}u=a[k+1|0]|0;q=a[k+2|0]|0;s=a[k+3|0]|0;if((n|0)==240){if(!((u+112<<24>>24&255)<48)){t=33;break b}}else if((n|0)==244){if(!((u&-16)<<24>>24==-128)){t=35;break b}}else{if(!((u&-64)<<24>>24==-128)){t=37;break b}}w=q&255;if((w&192|0)!=128){o=k;break a}q=s&255;if((q&192|0)!=128){o=k;break a}if(((u&255)<<12&258048|n<<18&1835008|w<<6&4032|q&63)>>>0>f>>>0){o=k;break a}p=k+4|0}}while(0);if(!(p>>>0<c>>>0&l>>>0<e>>>0)){o=p;break a}k=p;l=l+1|0}if((t|0)==21){x=r-b|0;i=h;return x|0}else if((t|0)==23){x=r-b|0;i=h;return x|0}else if((t|0)==25){x=r-b|0;i=h;return x|0}else if((t|0)==33){x=v-b|0;i=h;return x|0}else if((t|0)==35){x=v-b|0;i=h;return x|0}else if((t|0)==37){x=v-b|0;i=h;return x|0}}else{o=j}}while(0);x=o-b|0;i=h;return x|0}function $k(a){a=a|0;i=i;return 4}function al(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function bl(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function cl(a){a=a|0;var b=0;b=i;c[a>>2]=230520;me(a+12|0);Im(a);i=b;return}function dl(a){a=a|0;var b=0;b=i;c[a>>2]=230520;me(a+12|0);i=b;return}function el(a){a=a|0;var b=0;b=i;c[a>>2]=230560;me(a+16|0);Im(a);i=b;return}function fl(a){a=a|0;var b=0;b=i;c[a>>2]=230560;me(a+16|0);i=b;return}function gl(b){b=b|0;i=i;return a[b+8|0]|0}function hl(a){a=a|0;i=i;return c[a+8>>2]|0}function il(b){b=b|0;i=i;return a[b+9|0]|0}function jl(a){a=a|0;i=i;return c[a+12>>2]|0}function kl(a,b){a=a|0;b=b|0;var c=0;c=i;je(a,b+12|0);i=c;return}function ll(a,b){a=a|0;b=b|0;var c=0;c=i;je(a,b+16|0);i=c;return}function ml(a,b){a=a|0;b=b|0;b=i;ke(a,230592,4);i=b;return}function nl(a,b){a=a|0;b=b|0;b=i;ve(a,230600,bm(230600)|0);i=b;return}function ol(a,b){a=a|0;b=b|0;b=i;ke(a,230624,5);i=b;return}function pl(a,b){a=a|0;b=b|0;b=i;ve(a,230632,bm(230632)|0);i=b;return}function ql(b){b=b|0;var d=0;b=i;if((a[230664]|0)!=0){d=c[57664]|0;i=b;return d|0}if((Na(230664)|0)==0){d=c[57664]|0;i=b;return d|0}do{if((a[237864]|0)==0){if((Na(237864)|0)==0){break}Ym(237696,0,168)|0;Ra(116,0,p|0)|0;_a(237864)}}while(0);ne(237696,237872)|0;ne(237708|0,237880)|0;ne(237720|0,237888)|0;ne(237732|0,237896)|0;ne(237744|0,237912)|0;ne(237756|0,237928)|0;ne(237768|0,237936)|0;ne(237780|0,237952)|0;ne(237792|0,237960)|0;ne(237804|0,237968)|0;ne(237816|0,237976)|0;ne(237828|0,237984)|0;ne(237840|0,237992)|0;ne(237852|0,238e3)|0;c[57664]=237696;_a(230664);d=c[57664]|0;i=b;return d|0}function rl(b){b=b|0;var d=0;b=i;if((a[230680]|0)!=0){d=c[57668]|0;i=b;return d|0}if((Na(230680)|0)==0){d=c[57668]|0;i=b;return d|0}do{if((a[237328]|0)==0){if((Na(237328)|0)==0){break}Ym(237160,0,168)|0;Ra(117,0,p|0)|0;_a(237328)}}while(0);ye(237160,237336)|0;ye(237172|0,237368)|0;ye(237184|0,237400)|0;ye(237196|0,237432)|0;ye(237208|0,237472)|0;ye(237220|0,237512)|0;ye(237232|0,237544)|0;ye(237244|0,237584)|0;ye(237256|0,237600)|0;ye(237268|0,237616)|0;ye(237280|0,237632)|0;ye(237292|0,237648)|0;ye(237304|0,237664)|0;ye(237316|0,237680)|0;c[57668]=237160;_a(230680);d=c[57668]|0;i=b;return d|0}function sl(b){b=b|0;var d=0;b=i;if((a[230696]|0)!=0){d=c[57672]|0;i=b;return d|0}if((Na(230696)|0)==0){d=c[57672]|0;i=b;return d|0}do{if((a[236936]|0)==0){if((Na(236936)|0)==0){break}Ym(236648,0,288)|0;Ra(118,0,p|0)|0;_a(236936)}}while(0);ne(236648,236944)|0;ne(236660|0,236952)|0;ne(236672|0,236968)|0;ne(236684|0,236976)|0;ne(236696|0,236984)|0;ne(236708|0,236992)|0;ne(236720|0,237e3)|0;ne(236732|0,237008)|0;ne(236744|0,237016)|0;ne(236756|0,237032)|0;ne(236768|0,237040)|0;ne(236780|0,237056)|0;ne(236792|0,237072)|0;ne(236804|0,237080)|0;ne(236816|0,237088)|0;ne(236828|0,237096)|0;ne(236840|0,236984)|0;ne(236852|0,237104)|0;ne(236864|0,237112)|0;ne(236876|0,237120)|0;ne(236888|0,237128)|0;ne(236900|0,237136)|0;ne(236912|0,237144)|0;ne(236924|0,237152)|0;c[57672]=236648;_a(230696);d=c[57672]|0;i=b;return d|0}function tl(b){b=b|0;var d=0;b=i;if((a[230712]|0)!=0){d=c[57676]|0;i=b;return d|0}if((Na(230712)|0)==0){d=c[57676]|0;i=b;return d|0}do{if((a[236096]|0)==0){if((Na(236096)|0)==0){break}Ym(235808,0,288)|0;Ra(119,0,p|0)|0;_a(236096)}}while(0);ye(235808,236104)|0;ye(235820|0,236136)|0;ye(235832|0,236176)|0;ye(235844|0,236200)|0;ye(235856|0,236520)|0;ye(235868|0,236224)|0;ye(235880|0,236248)|0;ye(235892|0,236272)|0;ye(235904|0,236304)|0;ye(235916|0,236344)|0;ye(235928|0,236376)|0;ye(235940|0,236416)|0;ye(235952|0,236456)|0;ye(235964|0,236472)|0;ye(235976|0,236488)|0;ye(235988|0,236504)|0;ye(236e3|0,236520)|0;ye(236012|0,236536)|0;ye(236024|0,236552)|0;ye(236036|0,236568)|0;ye(236048|0,236584)|0;ye(236060|0,236600)|0;ye(236072|0,236616)|0;ye(236084|0,236632)|0;c[57676]=235808;_a(230712);d=c[57676]|0;i=b;return d|0}function ul(b){b=b|0;var d=0;b=i;if((a[230728]|0)!=0){d=c[57680]|0;i=b;return d|0}if((Na(230728)|0)==0){d=c[57680]|0;i=b;return d|0}do{if((a[235784]|0)==0){if((Na(235784)|0)==0){break}Ym(235496,0,288)|0;Ra(120,0,p|0)|0;_a(235784)}}while(0);ne(235496,235792)|0;ne(235508|0,235800)|0;c[57680]=235496;_a(230728);d=c[57680]|0;i=b;return d|0}function vl(b){b=b|0;var d=0;b=i;if((a[230744]|0)!=0){d=c[57684]|0;i=b;return d|0}if((Na(230744)|0)==0){d=c[57684]|0;i=b;return d|0}do{if((a[235456]|0)==0){if((Na(235456)|0)==0){break}Ym(235168,0,288)|0;Ra(121,0,p|0)|0;_a(235456)}}while(0);ye(235168,235464)|0;ye(235180|0,235480)|0;c[57684]=235168;_a(230744);d=c[57684]|0;i=b;return d|0}function wl(b){b=b|0;b=i;do{if((a[230768]|0)==0){if((Na(230768)|0)==0){break}ke(230752,230776,8);Ra(122,230752,p|0)|0;_a(230768)}}while(0);i=b;return 230752}function xl(b){b=b|0;b=i;if((a[230808]|0)!=0){i=b;return 230792}if((Na(230808)|0)==0){i=b;return 230792}ve(230792,230816,bm(230816)|0);Ra(123,230792,p|0)|0;_a(230808);i=b;return 230792}function yl(b){b=b|0;b=i;do{if((a[230872]|0)==0){if((Na(230872)|0)==0){break}ke(230856,230880,8);Ra(122,230856,p|0)|0;_a(230872)}}while(0);i=b;return 230856}function zl(b){b=b|0;b=i;if((a[230912]|0)!=0){i=b;return 230896}if((Na(230912)|0)==0){i=b;return 230896}ve(230896,230920,bm(230920)|0);Ra(123,230896,p|0)|0;_a(230912);i=b;return 230896}function Al(b){b=b|0;b=i;do{if((a[230976]|0)==0){if((Na(230976)|0)==0){break}ke(230960,230984,20);Ra(122,230960,p|0)|0;_a(230976)}}while(0);i=b;return 230960}function Bl(b){b=b|0;b=i;if((a[231024]|0)!=0){i=b;return 231008}if((Na(231024)|0)==0){i=b;return 231008}ve(231008,231032,bm(231032)|0);Ra(123,231008,p|0)|0;_a(231024);i=b;return 231008}function Cl(b){b=b|0;b=i;do{if((a[231136]|0)==0){if((Na(231136)|0)==0){break}ke(231120,231144,11);Ra(122,231120,p|0)|0;_a(231136)}}while(0);i=b;return 231120}function Dl(b){b=b|0;b=i;if((a[231176]|0)!=0){i=b;return 231160}if((Na(231176)|0)==0){i=b;return 231160}ve(231160,231184,bm(231184)|0);Ra(123,231160,p|0)|0;_a(231176);i=b;return 231160}function El(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=ab()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);l=+Wm(b,g,c[57560]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)!=34){h=l;i=f;return+h}c[e>>2]=4;h=l;i=f;return+h}function Fl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=ab()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);l=+Wm(b,g,c[57560]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)!=34){h=l;i=f;return+h}c[e>>2]=4;h=l;i=f;return+h}function Gl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0.0,j=0,k=0,l=0.0;f=i;i=i+8|0;g=f;if((b|0)==(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}j=ab()|0;k=c[j>>2]|0;c[j>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);l=+Wm(b,g,c[57560]|0);b=c[j>>2]|0;if((b|0)==0){c[j>>2]=k}if((c[g>>2]|0)!=(d|0)){c[e>>2]=4;h=0.0;i=f;return+h}if((b|0)==34){c[e>>2]=4}h=l;i=f;return+h}function Hl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+8|0;h=g;do{if((b|0)==(d|0)){c[e>>2]=4;j=0;k=0}else{if((a[b]|0)==45){c[e>>2]=4;j=0;k=0;break}l=ab()|0;m=c[l>>2]|0;c[l>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);n=Ob(b|0,h|0,f|0,c[57560]|0)|0;o=c[l>>2]|0;if((o|0)==0){c[l>>2]=m}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;k=0;break}if((o|0)!=34){j=n;k=I;break}c[e>>2]=4;j=-1;k=-1}}while(0);I=k;i=g;return j|0}function Il(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=ab()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);m=Ob(b|0,h|0,f|0,c[57560]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>4294967295)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m;i=g;return j|0}return 0}function Jl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=ab()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);m=Ob(b|0,h|0,f|0,c[57560]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>4294967295)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m;i=g;return j|0}return 0}function Kl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((a[b]|0)==45){c[e>>2]=4;j=0;i=g;return j|0}k=ab()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);m=Ob(b|0,h|0,f|0,c[57560]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}if((b|0)==34|(f>>>0>0|(f|0)==0&m>>>0>65535)){c[e>>2]=4;j=-1;i=g;return j|0}else{j=m&65535;i=g;return j|0}return 0}function Ll(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;k=0;I=k;i=g;return j|0}l=ab()|0;m=c[l>>2]|0;c[l>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);n=Ia(b|0,h|0,f|0,c[57560]|0)|0;f=I;b=c[l>>2]|0;if((b|0)==0){c[l>>2]=m}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;k=0;I=k;i=g;return j|0}if((b|0)==34){c[e>>2]=4;e=(f|0)>0|(f|0)==0&n>>>0>0;I=e?2147483647:-2147483648;i=g;return(e?-1:0)|0}else{j=n;k=f;I=k;i=g;return j|0}return 0}function Ml(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+8|0;h=g;if((b|0)==(d|0)){c[e>>2]=4;j=0;i=g;return j|0}k=ab()|0;l=c[k>>2]|0;c[k>>2]=0;do{if((a[230248]|0)==0){if((Na(230248)|0)==0){break}c[57560]=kb(2147483647,230256,0)|0;_a(230248)}}while(0);m=Ia(b|0,h|0,f|0,c[57560]|0)|0;f=I;b=c[k>>2]|0;if((b|0)==0){c[k>>2]=l}if((c[h>>2]|0)!=(d|0)){c[e>>2]=4;j=0;i=g;return j|0}do{if((b|0)==34){c[e>>2]=4;if((f|0)>0|(f|0)==0&m>>>0>0){j=2147483647}else{break}i=g;return j|0}else{if((f|0)<-1|(f|0)==-1&m>>>0<2147483648){c[e>>2]=4;break}if((f|0)>0|(f|0)==0&m>>>0>2147483647){c[e>>2]=4;j=2147483647;i=g;return j|0}else{j=m;i=g;return j|0}}}while(0);j=-2147483648;i=g;return j|0}function Nl(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;b=i;e=a+4|0;f=e;g=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;f=e+4|0;e=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;f=(c[a>>2]|0)+(e>>1)|0;a=f;if((e&1|0)==0){h=g;jc[h&127](a);i=b;return}else{h=c[(c[f>>2]|0)+g>>2]|0;jc[h&127](a);i=b;return}}function Ol(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;f=b+8|0;g=b+4|0;h=c[g>>2]|0;j=c[f>>2]|0;k=h;if(!(j-k>>2>>>0<d>>>0)){l=d;m=h;do{if((m|0)==0){n=0}else{c[m>>2]=0;n=c[g>>2]|0}m=n+4|0;c[g>>2]=m;l=l+ -1|0;}while((l|0)!=0);i=e;return}l=b+16|0;m=b;n=c[m>>2]|0;h=k-n>>2;k=h+d|0;if(k>>>0>1073741823){Ij(0)}o=j-n|0;do{if(o>>2>>>0<536870911){n=o>>1;j=n>>>0<k>>>0?k:n;if((j|0)==0){p=0;q=0;break}n=b+128|0;if(!((a[n]|0)==0&j>>>0<29)){r=j;s=11;break}a[n]=1;p=j;q=l}else{r=1073741823;s=11}}while(0);if((s|0)==11){p=r;q=Gm(r<<2)|0}r=d;d=q+(h<<2)|0;do{if((d|0)==0){t=0}else{c[d>>2]=0;t=d}d=t+4|0;r=r+ -1|0;}while((r|0)!=0);r=c[m>>2]|0;t=(c[g>>2]|0)-r|0;s=q+(h-(t>>2)<<2)|0;h=r;$m(s|0,h|0,t|0)|0;c[m>>2]=s;c[g>>2]=d;c[f>>2]=q+(p<<2);if((r|0)==0){i=e;return}if((l|0)==(r|0)){a[b+128|0]=0;i=e;return}else{Im(h);i=e;return}}function Pl(a){a=a|0;a=i;xe(235444|0);xe(235432|0);xe(235420|0);xe(235408|0);xe(235396|0);xe(235384|0);xe(235372|0);xe(235360|0);xe(235348|0);xe(235336|0);xe(235324|0);xe(235312|0);xe(235300|0);xe(235288|0);xe(235276|0);xe(235264|0);xe(235252|0);xe(235240|0);xe(235228|0);xe(235216|0);xe(235204|0);xe(235192|0);xe(235180|0);xe(235168);i=a;return}function Ql(a){a=a|0;a=i;me(235772|0);me(235760|0);me(235748|0);me(235736|0);me(235724|0);me(235712|0);me(235700|0);me(235688|0);me(235676|0);me(235664|0);me(235652|0);me(235640|0);me(235628|0);me(235616|0);me(235604|0);me(235592|0);me(235580|0);me(235568|0);me(235556|0);me(235544|0);me(235532|0);me(235520|0);me(235508|0);me(235496);i=a;return}function Rl(a){a=a|0;a=i;xe(236084|0);xe(236072|0);xe(236060|0);xe(236048|0);xe(236036|0);xe(236024|0);xe(236012|0);xe(236e3|0);xe(235988|0);xe(235976|0);xe(235964|0);xe(235952|0);xe(235940|0);xe(235928|0);xe(235916|0);xe(235904|0);xe(235892|0);xe(235880|0);xe(235868|0);xe(235856|0);xe(235844|0);xe(235832|0);xe(235820|0);xe(235808);i=a;return}function Sl(a){a=a|0;a=i;me(236924|0);me(236912|0);me(236900|0);me(236888|0);me(236876|0);me(236864|0);me(236852|0);me(236840|0);me(236828|0);me(236816|0);me(236804|0);me(236792|0);me(236780|0);me(236768|0);me(236756|0);me(236744|0);me(236732|0);me(236720|0);me(236708|0);me(236696|0);me(236684|0);me(236672|0);me(236660|0);me(236648);i=a;return}function Tl(a){a=a|0;a=i;xe(237316|0);xe(237304|0);xe(237292|0);xe(237280|0);xe(237268|0);xe(237256|0);xe(237244|0);xe(237232|0);xe(237220|0);xe(237208|0);xe(237196|0);xe(237184|0);xe(237172|0);xe(237160);i=a;return}function Ul(a){a=a|0;a=i;me(237852|0);me(237840|0);me(237828|0);me(237816|0);me(237804|0);me(237792|0);me(237780|0);me(237768|0);me(237756|0);me(237744|0);me(237732|0);me(237720|0);me(237708|0);me(237696);i=a;return}function Vl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=i;e=Wl(0,a,b,(c|0)!=0?c:238216)|0;i=d;return e|0}function Wl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;i=i+8|0;h=g;c[h>>2]=b;j=(f|0)==0?238224:f;f=c[j>>2]|0;a:do{if((d|0)==0){if((f|0)==0){k=0}else{break}i=g;return k|0}else{if((b|0)==0){l=h;c[h>>2]=l;m=l}else{m=b}if((e|0)==0){k=-2;i=g;return k|0}do{if((f|0)==0){l=a[d]|0;n=l&255;if(l<<24>>24>-1){c[m>>2]=n;k=l<<24>>24!=0|0;i=g;return k|0}else{l=n+ -194|0;if(l>>>0>50){break a}o=e+ -1|0;p=c[238008+(l<<2)>>2]|0;q=d+1|0;break}}else{o=e;p=f;q=d}}while(0);b:do{if((o|0)==0){r=p}else{l=a[q]|0;n=(l&255)>>>3;if((n+ -16|n+(p>>26))>>>0>7){break a}else{s=o;t=l;u=p;v=q}while(1){v=v+1|0;u=(t&255)+ -128|u<<6;s=s+ -1|0;if((u|0)>=0){break}if((s|0)==0){r=u;break b}t=a[v]|0;if(((t&255)+ -128|0)>>>0>63){break a}}c[j>>2]=0;c[m>>2]=u;k=e-s|0;i=g;return k|0}}while(0);c[j>>2]=r;k=-2;i=g;return k|0}}while(0);c[j>>2]=0;c[(ab()|0)>>2]=84;k=-1;i=g;return k|0}function Xl(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;g=i;i=i+1032|0;h=g+1024|0;j=c[b>>2]|0;c[h>>2]=j;k=(a|0)!=0;l=g;m=k?e:256;e=k?a:l;a:do{if((j|0)==0|(m|0)==0){n=d;o=m;p=j;q=0;r=e}else{a=d;s=m;t=j;u=0;v=e;while(1){w=a>>>2;x=w>>>0>=s>>>0;if(!(x|a>>>0>131)){n=a;o=s;p=t;q=u;r=v;break a}y=x?s:w;z=a-y|0;w=Yl(v,h,y,f)|0;if((w|0)==-1){break}if((v|0)==(l|0)){A=s;B=l}else{A=s-w|0;B=v+(w<<2)|0}y=w+u|0;w=c[h>>2]|0;if((w|0)==0|(A|0)==0){n=z;o=A;p=w;q=y;r=B;break a}else{a=z;s=A;t=w;u=y;v=B}}n=z;o=0;p=c[h>>2]|0;q=-1;r=v}}while(0);b:do{if((p|0)==0){C=q}else{if((o|0)==0|(n|0)==0){C=q;break}else{D=n;E=o;F=p;G=q;H=r}while(1){I=Wl(H,F,D,f)|0;if((I+2|0)>>>0<3){break}z=(c[h>>2]|0)+I|0;c[h>>2]=z;B=E+ -1|0;A=G+1|0;if((B|0)==0|(D|0)==(I|0)){C=A;break b}else{D=D-I|0;E=B;F=z;G=A;H=H+4|0}}if((I|0)==0){c[h>>2]=0;C=G;break}else if((I|0)==-1){C=-1;break}else{c[f>>2]=0;C=G;break}}}while(0);if(!k){i=g;return C|0}c[b>>2]=c[h>>2];i=g;return C|0}function Yl(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0;h=i;j=c[e>>2]|0;do{if((g|0)==0){k=5}else{l=g;m=c[l>>2]|0;if((m|0)==0){k=5;break}if((b|0)==0){n=f;o=m;p=j;k=16;break}c[l>>2]=0;q=b;r=f;s=m;t=j;k=36}}while(0);if((k|0)==5){if((b|0)==0){u=f;v=j;k=7}else{w=b;x=f;y=j;k=6}}a:while(1){if((k|0)==6){k=0;if((x|0)==0){z=f;k=53;break}else{A=w;B=x;C=y}while(1){j=a[C]|0;do{if(((j&255)+ -1|0)>>>0<127){if((C&3|0)==0&B>>>0>3){D=A;E=B;F=C}else{G=A;H=B;I=j;J=C;break}while(1){K=c[F>>2]|0;if(((K+ -16843009|K)&-2139062144|0)!=0){k=30;break}c[D>>2]=K&255;c[D+4>>2]=d[F+1|0]|0;c[D+8>>2]=d[F+2|0]|0;L=F+4|0;M=D+16|0;c[D+12>>2]=d[F+3|0]|0;N=E+ -4|0;if(N>>>0>3){D=M;E=N;F=L}else{k=31;break}}if((k|0)==30){k=0;G=D;H=E;I=K&255;J=F;break}else if((k|0)==31){k=0;G=M;H=N;I=a[L]|0;J=L;break}}else{G=A;H=B;I=j;J=C}}while(0);O=I&255;if(!((O+ -1|0)>>>0<127)){break}c[G>>2]=O;j=H+ -1|0;if((j|0)==0){z=f;k=53;break a}else{A=G+4|0;B=j;C=J+1|0}}j=O+ -194|0;if(j>>>0>50){P=G;Q=H;R=J;k=47;break}q=G;r=H;s=c[238008+(j<<2)>>2]|0;t=J+1|0;k=36;continue}else if((k|0)==7){k=0;j=a[v]|0;do{if(((j&255)+ -1|0)>>>0<127){if((v&3|0)!=0){S=u;T=j;U=v;break}g=c[v>>2]|0;if(((g+ -16843009|g)&-2139062144|0)==0){m=u;l=v;while(1){V=l+4|0;W=m+ -4|0;X=c[V>>2]|0;if(((X+ -16843009|X)&-2139062144|0)==0){l=V;m=W}else{Y=W;Z=X;_=V;break}}}else{Y=u;Z=g;_=v}S=Y;T=Z&255;U=_}else{S=u;T=j;U=v}}while(0);j=T&255;if((j+ -1|0)>>>0<127){u=S+ -1|0;v=U+1|0;k=7;continue}m=j+ -194|0;if(m>>>0>50){P=b;Q=S;R=U;k=47;break}n=S;o=c[238008+(m<<2)>>2]|0;p=U+1|0;k=16;continue}else if((k|0)==16){k=0;m=(d[p]|0)>>>3;if((m+ -16|m+(o>>26))>>>0>7){k=17;break}m=p+1|0;do{if((o&33554432|0)==0){$=m}else{if(((d[m]|0)+ -128|0)>>>0>63){k=20;break a}j=p+2|0;if((o&524288|0)==0){$=j;break}if(((d[j]|0)+ -128|0)>>>0>63){k=23;break a}$=p+3|0}}while(0);u=n+ -1|0;v=$;k=7;continue}else if((k|0)==36){k=0;m=d[t]|0;j=m>>>3;if((j+ -16|j+(s>>26))>>>0>7){k=37;break}j=t+1|0;aa=m+ -128|s<<6;do{if((aa|0)<0){m=(d[j]|0)+ -128|0;if(m>>>0>63){k=40;break a}l=t+2|0;ba=m|aa<<6;if((ba|0)>=0){ca=ba;da=l;break}m=(d[l]|0)+ -128|0;if(m>>>0>63){k=43;break a}ca=m|ba<<6;da=t+3|0}else{ca=aa;da=j}}while(0);c[q>>2]=ca;w=q+4|0;x=r+ -1|0;y=da;k=6;continue}}if((k|0)==17){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==20){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==23){ea=b;fa=n;ga=o;ha=p+ -1|0;k=46}else if((k|0)==37){ea=q;fa=r;ga=s;ha=t+ -1|0;k=46}else if((k|0)==40){ea=q;fa=r;ga=aa;ha=t+ -1|0;k=46}else if((k|0)==43){ea=q;fa=r;ga=ba;ha=t+ -1|0;k=46}else if((k|0)==53){i=h;return z|0}if((k|0)==46){if((ga|0)==0){P=ea;Q=fa;R=ha;k=47}else{ia=ea;ja=ha}}do{if((k|0)==47){if((a[R]|0)!=0){ia=P;ja=R;break}if((P|0)!=0){c[P>>2]=0;c[e>>2]=0}z=f-Q|0;i=h;return z|0}}while(0);c[(ab()|0)>>2]=84;if((ia|0)==0){z=-1;i=h;return z|0}c[e>>2]=ja;z=-1;i=h;return z|0}function Zl(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+8|0;h=g;c[h>>2]=b;if((e|0)==0){j=0;i=g;return j|0}do{if((f|0)!=0){if((b|0)==0){k=h;c[h>>2]=k;l=k}else{l=b}k=a[e]|0;m=k&255;if(k<<24>>24>-1){c[l>>2]=m;j=k<<24>>24!=0|0;i=g;return j|0}k=m+ -194|0;if(k>>>0>50){break}m=e+1|0;n=c[238008+(k<<2)>>2]|0;if(f>>>0<4){if((n&-2147483648>>>((f*6|0)+ -6|0)|0)!=0){break}}k=d[m]|0;m=k>>>3;if((m+ -16|m+(n>>26))>>>0>7){break}m=k+ -128|n<<6;if((m|0)>=0){c[l>>2]=m;j=2;i=g;return j|0}n=(d[e+2|0]|0)+ -128|0;if(n>>>0>63){break}k=n|m<<6;if((k|0)>=0){c[l>>2]=k;j=3;i=g;return j|0}m=(d[e+3|0]|0)+ -128|0;if(m>>>0>63){break}c[l>>2]=m|k<<6;j=4;i=g;return j|0}}while(0);c[(ab()|0)>>2]=84;j=-1;i=g;return j|0}function _l(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;e=i;if((b|0)==0){f=1;i=e;return f|0}if(d>>>0<128){a[b]=d;f=1;i=e;return f|0}if(d>>>0<2048){a[b]=d>>>6|192;a[b+1|0]=d&63|128;f=2;i=e;return f|0}if(d>>>0<55296|(d+ -57344|0)>>>0<8192){a[b]=d>>>12|224;a[b+1|0]=d>>>6&63|128;a[b+2|0]=d&63|128;f=3;i=e;return f|0}if((d+ -65536|0)>>>0<1048576){a[b]=d>>>18|240;a[b+1|0]=d>>>12&63|128;a[b+2|0]=d>>>6&63|128;a[b+3|0]=d&63|128;f=4;i=e;return f|0}else{c[(ab()|0)>>2]=84;f=-1;i=e;return f|0}return 0}function $l(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;f=i;i=i+264|0;g=f+256|0;h=f;j=c[b>>2]|0;c[g>>2]=j;k=(a|0)!=0;l=k?e:256;e=k?a:h;a:do{if((j|0)==0|(l|0)==0){m=d;n=l;o=j;p=0;q=e}else{a=d;r=l;s=j;t=0;u=e;while(1){v=a>>>0>=r>>>0;if(!(v|a>>>0>32)){m=a;n=r;o=s;p=t;q=u;break a}w=v?r:a;x=a-w|0;v=am(u,g,w,0)|0;if((v|0)==-1){break}if((u|0)==(h|0)){y=r;z=h}else{y=r-v|0;z=u+v|0}w=v+t|0;v=c[g>>2]|0;if((v|0)==0|(y|0)==0){m=x;n=y;o=v;p=w;q=z;break a}else{a=x;r=y;s=v;t=w;u=z}}m=x;n=0;o=c[g>>2]|0;p=-1;q=u}}while(0);b:do{if((o|0)==0){A=p}else{if((n|0)==0|(m|0)==0){A=p;break}else{B=m;C=n;D=o;E=p;F=q}while(1){G=_l(F,c[D>>2]|0,0)|0;if((G+1|0)>>>0<2){break}x=(c[g>>2]|0)+4|0;c[g>>2]=x;z=B+ -1|0;y=E+1|0;if((C|0)==(G|0)|(z|0)==0){A=y;break b}else{B=z;C=C-G|0;D=x;E=y;F=F+G|0}}if((G|0)!=0){A=-1;break}c[g>>2]=0;A=E}}while(0);if(!k){i=f;return A|0}c[b>>2]=c[g>>2];i=f;return A|0}function am(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=i;i=i+8|0;g=f;if((b|0)==0){h=c[d>>2]|0;j=g;k=c[h>>2]|0;if((k|0)==0){l=0;i=f;return l|0}else{m=0;n=k;o=h}while(1){if(n>>>0>127){h=_l(j,n,0)|0;if((h|0)==-1){l=-1;p=26;break}else{q=h}}else{q=1}h=q+m|0;k=o+4|0;r=c[k>>2]|0;if((r|0)==0){l=h;p=26;break}else{m=h;n=r;o=k}}if((p|0)==26){i=f;return l|0}}a:do{if(e>>>0>3){o=b;n=e;m=c[d>>2]|0;while(1){q=c[m>>2]|0;if((q|0)==0){s=o;t=n;break a}if(q>>>0>127){j=_l(o,q,0)|0;if((j|0)==-1){l=-1;break}u=o+j|0;v=n-j|0;w=m}else{a[o]=q;u=o+1|0;v=n+ -1|0;w=c[d>>2]|0}q=w+4|0;c[d>>2]=q;if(v>>>0>3){o=u;n=v;m=q}else{s=u;t=v;break a}}i=f;return l|0}else{s=b;t=e}}while(0);b:do{if((t|0)==0){x=0}else{b=g;v=s;u=t;w=c[d>>2]|0;while(1){m=c[w>>2]|0;if((m|0)==0){p=24;break}if(m>>>0>127){n=_l(b,m,0)|0;if((n|0)==-1){l=-1;p=26;break}if(n>>>0>u>>>0){p=20;break}_l(v,c[w>>2]|0,0)|0;y=v+n|0;z=u-n|0;A=w}else{a[v]=m;y=v+1|0;z=u+ -1|0;A=c[d>>2]|0}m=A+4|0;c[d>>2]=m;if((z|0)==0){x=0;break b}else{v=y;u=z;w=m}}if((p|0)==20){l=e-u|0;i=f;return l|0}else if((p|0)==24){a[v]=0;x=u;break}else if((p|0)==26){i=f;return l|0}}}while(0);c[d>>2]=0;l=e-x|0;i=f;return l|0}function bm(a){a=a|0;var b=0,d=0;b=i;d=a;while(1){if((c[d>>2]|0)==0){break}else{d=d+4|0}}i=b;return d-a>>2|0}function cm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;if((d|0)==0){i=e;return a|0}else{f=d;g=b;h=a}while(1){b=f+ -1|0;c[h>>2]=c[g>>2];if((b|0)==0){break}else{h=h+4|0;g=g+4|0;f=b}}i=e;return a|0}function dm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;f=(d|0)==0;do{if(a-b>>2>>>0<d>>>0){if(f){break}else{g=d}do{g=g+ -1|0;c[a+(g<<2)>>2]=c[b+(g<<2)>>2];}while((g|0)!=0)}else{if(f){break}else{h=b;j=a;k=d}while(1){l=k+ -1|0;c[j>>2]=c[h>>2];if((l|0)==0){break}else{k=l;j=j+4|0;h=h+4|0}}}}while(0);i=e;return a|0}function em(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;if((d|0)!=0){f=d;d=a;while(1){g=f+ -1|0;c[d>>2]=b;if((g|0)==0){break}else{d=d+4|0;f=g}}}i=e;return a|0}function fm(a){a=a|0;i=i;return}function gm(a){a=a|0;c[a>>2]=238240;i=i;return}function hm(a){a=a|0;var b=0;b=i;Mb(a|0);Im(a);i=b;return}function im(a){a=a|0;var b=0;b=i;Mb(a|0);i=b;return}function jm(a){a=a|0;i=i;return 238256}function km(a){a=a|0;i=i;return}function lm(a){a=a|0;i=i;return}function mm(a){a=a|0;i=i;return}function nm(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function om(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function pm(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function qm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+56|0;f=e;if((a|0)==(b|0)){g=1;i=e;return g|0}if((b|0)==0){g=0;i=e;return g|0}h=um(b,238368,238424,0)|0;b=h;if((h|0)==0){g=0;i=e;return g|0}j=f+0|0;k=j+56|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));c[f>>2]=b;c[f+8>>2]=a;c[f+12>>2]=-1;c[f+48>>2]=1;xc[c[(c[h>>2]|0)+28>>2]&7](b,f,c[d>>2]|0,1);if((c[f+24>>2]|0)!=1){g=0;i=e;return g|0}c[d>>2]=c[f+16>>2];g=1;i=e;return g|0}function rm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;if((c[d+8>>2]|0)!=(b|0)){i=g;return}b=d+16|0;h=c[b>>2]|0;if((h|0)==0){c[b>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((h|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}e=d+24|0;if((c[e>>2]|0)!=2){i=g;return}c[e>>2]=f;i=g;return}function sm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;if((b|0)!=(c[d+8>>2]|0)){h=c[b+8>>2]|0;xc[c[(c[h>>2]|0)+28>>2]&7](h,d,e,f);i=g;return}h=d+16|0;b=c[h>>2]|0;if((b|0)==0){c[h>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((b|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}e=d+24|0;if((c[e>>2]|0)!=2){i=g;return}c[e>>2]=f;i=g;return}function tm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;if((b|0)==(c[d+8>>2]|0)){h=d+16|0;j=c[h>>2]|0;if((j|0)==0){c[h>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1;i=g;return}if((j|0)!=(e|0)){j=d+36|0;c[j>>2]=(c[j>>2]|0)+1;c[d+24>>2]=2;a[d+54|0]=1;i=g;return}j=d+24|0;if((c[j>>2]|0)!=2){i=g;return}c[j>>2]=f;i=g;return}j=c[b+12>>2]|0;h=b+(j<<3)+16|0;k=c[b+20>>2]|0;l=k>>8;if((k&1|0)==0){m=l}else{m=c[(c[e>>2]|0)+l>>2]|0}l=c[b+16>>2]|0;xc[c[(c[l>>2]|0)+28>>2]&7](l,d,e+m|0,(k&2|0)!=0?f:2);if((j|0)<=1){i=g;return}j=d+54|0;k=e;m=b+24|0;while(1){b=c[m+4>>2]|0;l=b>>8;if((b&1|0)==0){n=l}else{n=c[(c[k>>2]|0)+l>>2]|0}l=c[m>>2]|0;xc[c[(c[l>>2]|0)+28>>2]&7](l,d,e+n|0,(b&2|0)!=0?f:2);if((a[j]|0)!=0){o=16;break}b=m+8|0;if(b>>>0<h>>>0){m=b}else{o=16;break}}if((o|0)==16){i=g;return}}function um(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+56|0;j=h;k=c[d>>2]|0;l=d+(c[k+ -8>>2]|0)|0;m=c[k+ -4>>2]|0;k=m;c[j>>2]=f;c[j+4>>2]=d;c[j+8>>2]=e;c[j+12>>2]=g;g=j+16|0;e=j+20|0;d=j+24|0;n=j+28|0;o=j+32|0;p=j+40|0;q=(m|0)==(f|0);f=g;r=f+0|0;s=r+36|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(s|0));b[f+36>>1]=0;a[f+38|0]=0;if(q){c[j+48>>2]=1;uc[c[(c[m>>2]|0)+20>>2]&15](k,j,l,l,1,0);t=(c[d>>2]|0)==1?l:0;i=h;return t|0}ic[c[(c[m>>2]|0)+24>>2]&3](k,j,l,1,0);l=c[j+36>>2]|0;if((l|0)==1){do{if((c[d>>2]|0)!=1){if((c[p>>2]|0)!=0){t=0;i=h;return t|0}if((c[n>>2]|0)!=1){t=0;i=h;return t|0}if((c[o>>2]|0)==1){break}else{t=0}i=h;return t|0}}while(0);t=c[g>>2]|0;i=h;return t|0}else if((l|0)==0){if((c[p>>2]|0)!=1){t=0;i=h;return t|0}if((c[n>>2]|0)!=1){t=0;i=h;return t|0}t=(c[o>>2]|0)==1?c[e>>2]|0:0;i=h;return t|0}else{t=0;i=h;return t|0}return 0}function vm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;h=i;j=b;if((j|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)!=(e|0)){i=h;return}k=d+28|0;if((c[k>>2]|0)==1){i=h;return}c[k>>2]=f;i=h;return}if((j|0)==(c[d>>2]|0)){do{if((c[d+16>>2]|0)!=(e|0)){j=d+20|0;if((c[j>>2]|0)==(e|0)){break}c[d+32>>2]=f;k=d+44|0;if((c[k>>2]|0)==4){i=h;return}l=c[b+12>>2]|0;m=b+(l<<3)+16|0;a:do{if((l|0)>0){n=d+52|0;o=d+53|0;p=d+54|0;q=b+8|0;r=d+24|0;s=e;t=0;u=0;v=b+16|0;b:while(1){a[n]=0;a[o]=0;w=c[v+4>>2]|0;x=w>>8;if((w&1|0)==0){y=x}else{y=c[(c[s>>2]|0)+x>>2]|0}x=c[v>>2]|0;uc[c[(c[x>>2]|0)+20>>2]&15](x,d,e,e+y|0,2-(w>>>1&1)|0,g);if((a[p]|0)!=0){z=t;A=u;break}do{if((a[o]|0)==0){B=t;C=u}else{if((a[n]|0)==0){if((c[q>>2]&1|0)==0){z=t;A=1;break b}else{B=t;C=1;break}}if((c[r>>2]|0)==1){D=27;break a}if((c[q>>2]&2|0)==0){D=27;break a}else{B=1;C=1}}}while(0);w=v+8|0;if(w>>>0<m>>>0){t=B;u=C;v=w}else{z=B;A=C;break}}if(z){E=A;D=26}else{F=A;D=23}}else{F=0;D=23}}while(0);do{if((D|0)==23){c[j>>2]=e;m=d+40|0;c[m>>2]=(c[m>>2]|0)+1;if((c[d+36>>2]|0)!=1){E=F;D=26;break}if((c[d+24>>2]|0)!=2){E=F;D=26;break}a[d+54|0]=1;if(F){D=27}else{D=28}}}while(0);if((D|0)==26){if(E){D=27}else{D=28}}if((D|0)==27){c[k>>2]=3;i=h;return}else if((D|0)==28){c[k>>2]=4;i=h;return}}}while(0);if((f|0)!=1){i=h;return}c[d+32>>2]=1;i=h;return}E=c[b+12>>2]|0;F=b+(E<<3)+16|0;A=c[b+20>>2]|0;z=A>>8;if((A&1|0)==0){G=z}else{G=c[(c[e>>2]|0)+z>>2]|0}z=c[b+16>>2]|0;ic[c[(c[z>>2]|0)+24>>2]&3](z,d,e+G|0,(A&2|0)!=0?f:2,g);A=b+24|0;if((E|0)<=1){i=h;return}E=c[b+8>>2]|0;do{if((E&2|0)==0){b=d+36|0;if((c[b>>2]|0)==1){break}if((E&1|0)==0){G=d+54|0;z=e;C=A;while(1){if((a[G]|0)!=0){D=53;break}if((c[b>>2]|0)==1){D=53;break}B=c[C+4>>2]|0;y=B>>8;if((B&1|0)==0){H=y}else{H=c[(c[z>>2]|0)+y>>2]|0}y=c[C>>2]|0;ic[c[(c[y>>2]|0)+24>>2]&3](y,d,e+H|0,(B&2|0)!=0?f:2,g);B=C+8|0;if(B>>>0<F>>>0){C=B}else{D=53;break}}if((D|0)==53){i=h;return}}C=d+24|0;z=d+54|0;G=e;k=A;while(1){if((a[z]|0)!=0){D=53;break}if((c[b>>2]|0)==1){if((c[C>>2]|0)==1){D=53;break}}B=c[k+4>>2]|0;y=B>>8;if((B&1|0)==0){I=y}else{I=c[(c[G>>2]|0)+y>>2]|0}y=c[k>>2]|0;ic[c[(c[y>>2]|0)+24>>2]&3](y,d,e+I|0,(B&2|0)!=0?f:2,g);B=k+8|0;if(B>>>0<F>>>0){k=B}else{D=53;break}}if((D|0)==53){i=h;return}}}while(0);I=d+54|0;H=e;E=A;while(1){if((a[I]|0)!=0){D=53;break}A=c[E+4>>2]|0;k=A>>8;if((A&1|0)==0){J=k}else{J=c[(c[H>>2]|0)+k>>2]|0}k=c[E>>2]|0;ic[c[(c[k>>2]|0)+24>>2]&3](k,d,e+J|0,(A&2|0)!=0?f:2,g);A=E+8|0;if(A>>>0<F>>>0){E=A}else{D=53;break}}if((D|0)==53){i=h;return}}function wm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=i;j=b;if((j|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)!=(e|0)){i=h;return}k=d+28|0;if((c[k>>2]|0)==1){i=h;return}c[k>>2]=f;i=h;return}if((j|0)!=(c[d>>2]|0)){j=c[b+8>>2]|0;ic[c[(c[j>>2]|0)+24>>2]&3](j,d,e,f,g);i=h;return}do{if((c[d+16>>2]|0)!=(e|0)){j=d+20|0;if((c[j>>2]|0)==(e|0)){break}c[d+32>>2]=f;k=d+44|0;if((c[k>>2]|0)==4){i=h;return}l=d+52|0;a[l]=0;m=d+53|0;a[m]=0;n=c[b+8>>2]|0;uc[c[(c[n>>2]|0)+20>>2]&15](n,d,e,e,1,g);if((a[m]|0)==0){o=0;p=13}else{if((a[l]|0)==0){o=1;p=13}}a:do{if((p|0)==13){c[j>>2]=e;l=d+40|0;c[l>>2]=(c[l>>2]|0)+1;do{if((c[d+36>>2]|0)==1){if((c[d+24>>2]|0)!=2){p=16;break}a[d+54|0]=1;if(o){break a}}else{p=16}}while(0);if((p|0)==16){if(o){break}}c[k>>2]=4;i=h;return}}while(0);c[k>>2]=3;i=h;return}}while(0);if((f|0)!=1){i=h;return}c[d+32>>2]=1;i=h;return}function xm(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;g=i;if((c[d+8>>2]|0)==(b|0)){if((c[d+4>>2]|0)!=(e|0)){i=g;return}h=d+28|0;if((c[h>>2]|0)==1){i=g;return}c[h>>2]=f;i=g;return}if((c[d>>2]|0)!=(b|0)){i=g;return}do{if((c[d+16>>2]|0)!=(e|0)){b=d+20|0;if((c[b>>2]|0)==(e|0)){break}c[d+32>>2]=f;c[b>>2]=e;b=d+40|0;c[b>>2]=(c[b>>2]|0)+1;do{if((c[d+36>>2]|0)==1){if((c[d+24>>2]|0)!=2){break}a[d+54|0]=1}}while(0);c[d+44>>2]=4;i=g;return}}while(0);if((f|0)!=1){i=g;return}c[d+32>>2]=1;i=g;return}function ym(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;j=i;if((b|0)!=(c[d+8>>2]|0)){k=d+52|0;l=a[k]|0;m=d+53|0;n=a[m]|0;o=c[b+12>>2]|0;p=b+(o<<3)+16|0;a[k]=0;a[m]=0;q=c[b+20>>2]|0;r=q>>8;if((q&1|0)==0){s=r}else{s=c[(c[f>>2]|0)+r>>2]|0}r=c[b+16>>2]|0;uc[c[(c[r>>2]|0)+20>>2]&15](r,d,e,f+s|0,(q&2|0)!=0?g:2,h);a:do{if((o|0)>1){q=d+24|0;s=b+8|0;r=d+54|0;t=f;u=b+24|0;do{if((a[r]|0)!=0){break a}do{if((a[k]|0)==0){if((a[m]|0)==0){break}if((c[s>>2]&1|0)==0){break a}}else{if((c[q>>2]|0)==1){break a}if((c[s>>2]&2|0)==0){break a}}}while(0);a[k]=0;a[m]=0;v=c[u+4>>2]|0;w=v>>8;if((v&1|0)==0){x=w}else{x=c[(c[t>>2]|0)+w>>2]|0}w=c[u>>2]|0;uc[c[(c[w>>2]|0)+20>>2]&15](w,d,e,f+x|0,(v&2|0)!=0?g:2,h);u=u+8|0;}while(u>>>0<p>>>0)}}while(0);a[k]=l;a[m]=n;i=j;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=j;return}a[d+52|0]=1;f=d+16|0;n=c[f>>2]|0;if((n|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}if((n|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=j;return}e=d+24|0;n=c[e>>2]|0;if((n|0)==2){c[e>>2]=g;y=g}else{y=n}if(!((c[d+48>>2]|0)==1&(y|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}function zm(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0;j=i;if((b|0)!=(c[d+8>>2]|0)){k=c[b+8>>2]|0;uc[c[(c[k>>2]|0)+20>>2]&15](k,d,e,f,g,h);i=j;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=j;return}a[d+52|0]=1;f=d+16|0;h=c[f>>2]|0;if((h|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}if((h|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=j;return}e=d+24|0;h=c[e>>2]|0;if((h|0)==2){c[e>>2]=g;l=g}else{l=h}if(!((c[d+48>>2]|0)==1&(l|0)==1)){i=j;return}a[d+54|0]=1;i=j;return}function Am(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0;h=i;if((c[d+8>>2]|0)!=(b|0)){i=h;return}a[d+53|0]=1;if((c[d+4>>2]|0)!=(f|0)){i=h;return}a[d+52|0]=1;f=d+16|0;b=c[f>>2]|0;if((b|0)==0){c[f>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((c[d+48>>2]|0)==1&(g|0)==1)){i=h;return}a[d+54|0]=1;i=h;return}if((b|0)!=(e|0)){e=d+36|0;c[e>>2]=(c[e>>2]|0)+1;a[d+54|0]=1;i=h;return}e=d+24|0;b=c[e>>2]|0;if((b|0)==2){c[e>>2]=g;j=g}else{j=b}if(!((c[d+48>>2]|0)==1&(j|0)==1)){i=h;return}a[d+54|0]=1;i=h;return}\n\n\n\nfunction Bm(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0;b=i;do{if(a>>>0<245){if(a>>>0<11){d=16}else{d=a+11&-8}e=d>>>3;f=c[59668]|0;g=f>>>e;if((g&3|0)!=0){h=(g&1^1)+e|0;j=h<<1;k=238712+(j<<2)|0;l=238712+(j+2<<2)|0;j=c[l>>2]|0;m=j+8|0;n=c[m>>2]|0;do{if((k|0)==(n|0)){c[59668]=f&~(1<<h)}else{if(n>>>0<(c[238688>>2]|0)>>>0){Vb()}o=n+12|0;if((c[o>>2]|0)==(j|0)){c[o>>2]=k;c[l>>2]=n;break}else{Vb()}}}while(0);n=h<<3;c[j+4>>2]=n|3;l=j+(n|4)|0;c[l>>2]=c[l>>2]|1;p=m;i=b;return p|0}if(!(d>>>0>(c[238680>>2]|0)>>>0)){q=d;break}if((g|0)!=0){l=2<<e;n=g<<e&(l|0-l);l=(n&0-n)+ -1|0;n=l>>>12&16;k=l>>>n;l=k>>>5&8;o=k>>>l;k=o>>>2&4;r=o>>>k;o=r>>>1&2;s=r>>>o;r=s>>>1&1;t=(l|n|k|o|r)+(s>>>r)|0;r=t<<1;s=238712+(r<<2)|0;o=238712+(r+2<<2)|0;r=c[o>>2]|0;k=r+8|0;n=c[k>>2]|0;do{if((s|0)==(n|0)){c[59668]=f&~(1<<t)}else{if(n>>>0<(c[238688>>2]|0)>>>0){Vb()}l=n+12|0;if((c[l>>2]|0)==(r|0)){c[l>>2]=s;c[o>>2]=n;break}else{Vb()}}}while(0);n=t<<3;o=n-d|0;c[r+4>>2]=d|3;s=r;f=s+d|0;c[s+(d|4)>>2]=o|1;c[s+n>>2]=o;n=c[238680>>2]|0;if((n|0)!=0){s=c[238692>>2]|0;e=n>>>3;n=e<<1;g=238712+(n<<2)|0;m=c[59668]|0;j=1<<e;do{if((m&j|0)==0){c[59668]=m|j;u=238712+(n+2<<2)|0;v=g}else{e=238712+(n+2<<2)|0;h=c[e>>2]|0;if(!(h>>>0<(c[238688>>2]|0)>>>0)){u=e;v=h;break}Vb()}}while(0);c[u>>2]=s;c[v+12>>2]=s;c[s+8>>2]=v;c[s+12>>2]=g}c[238680>>2]=o;c[238692>>2]=f;p=k;i=b;return p|0}n=c[238676>>2]|0;if((n|0)==0){q=d;break}j=(n&0-n)+ -1|0;n=j>>>12&16;m=j>>>n;j=m>>>5&8;r=m>>>j;m=r>>>2&4;t=r>>>m;r=t>>>1&2;h=t>>>r;t=h>>>1&1;e=c[238976+((j|n|m|r|t)+(h>>>t)<<2)>>2]|0;t=(c[e+4>>2]&-8)-d|0;h=e;r=e;while(1){e=c[h+16>>2]|0;if((e|0)==0){m=c[h+20>>2]|0;if((m|0)==0){break}else{w=m}}else{w=e}e=(c[w+4>>2]&-8)-d|0;m=e>>>0<t>>>0;t=m?e:t;h=w;r=m?w:r}h=r;k=c[238688>>2]|0;if(h>>>0<k>>>0){Vb()}f=h+d|0;o=f;if(!(h>>>0<f>>>0)){Vb()}f=c[r+24>>2]|0;g=c[r+12>>2]|0;do{if((g|0)==(r|0)){s=r+20|0;m=c[s>>2]|0;if((m|0)==0){e=r+16|0;n=c[e>>2]|0;if((n|0)==0){x=0;break}else{y=n;z=e}}else{y=m;z=s}while(1){s=y+20|0;m=c[s>>2]|0;if((m|0)!=0){z=s;y=m;continue}m=y+16|0;s=c[m>>2]|0;if((s|0)==0){break}else{y=s;z=m}}if(z>>>0<k>>>0){Vb()}else{c[z>>2]=0;x=y;break}}else{m=c[r+8>>2]|0;if(m>>>0<k>>>0){Vb()}s=m+12|0;if((c[s>>2]|0)!=(r|0)){Vb()}e=g+8|0;if((c[e>>2]|0)==(r|0)){c[s>>2]=g;c[e>>2]=m;x=g;break}else{Vb()}}}while(0);a:do{if((f|0)!=0){g=c[r+28>>2]|0;k=238976+(g<<2)|0;do{if((r|0)==(c[k>>2]|0)){c[k>>2]=x;if((x|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<g);break a}else{if(f>>>0<(c[238688>>2]|0)>>>0){Vb()}m=f+16|0;if((c[m>>2]|0)==(r|0)){c[m>>2]=x}else{c[f+20>>2]=x}if((x|0)==0){break a}}}while(0);if(x>>>0<(c[238688>>2]|0)>>>0){Vb()}c[x+24>>2]=f;g=c[r+16>>2]|0;do{if((g|0)!=0){if(g>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[x+16>>2]=g;c[g+24>>2]=x;break}}}while(0);g=c[r+20>>2]|0;if((g|0)==0){break}if(g>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[x+20>>2]=g;c[g+24>>2]=x;break}}}while(0);if(t>>>0<16){f=t+d|0;c[r+4>>2]=f|3;g=h+(f+4)|0;c[g>>2]=c[g>>2]|1}else{c[r+4>>2]=d|3;c[h+(d|4)>>2]=t|1;c[h+(t+d)>>2]=t;g=c[238680>>2]|0;if((g|0)!=0){f=c[238692>>2]|0;k=g>>>3;g=k<<1;m=238712+(g<<2)|0;e=c[59668]|0;s=1<<k;do{if((e&s|0)==0){c[59668]=e|s;A=238712+(g+2<<2)|0;B=m}else{k=238712+(g+2<<2)|0;n=c[k>>2]|0;if(!(n>>>0<(c[238688>>2]|0)>>>0)){A=k;B=n;break}Vb()}}while(0);c[A>>2]=f;c[B+12>>2]=f;c[f+8>>2]=B;c[f+12>>2]=m}c[238680>>2]=t;c[238692>>2]=o}p=r+8|0;i=b;return p|0}else{if(a>>>0>4294967231){q=-1;break}g=a+11|0;s=g&-8;e=c[238676>>2]|0;if((e|0)==0){q=s;break}h=0-s|0;n=g>>>8;do{if((n|0)==0){C=0}else{if(s>>>0>16777215){C=31;break}g=(n+1048320|0)>>>16&8;k=n<<g;j=(k+520192|0)>>>16&4;l=k<<j;k=(l+245760|0)>>>16&2;D=14-(j|g|k)+(l<<k>>>15)|0;C=s>>>(D+7|0)&1|D<<1}}while(0);n=c[238976+(C<<2)>>2]|0;b:do{if((n|0)==0){E=h;F=0;G=0}else{if((C|0)==31){H=0}else{H=25-(C>>>1)|0}r=h;o=0;t=s<<H;m=n;f=0;while(1){D=c[m+4>>2]&-8;k=D-s|0;if(k>>>0<r>>>0){if((D|0)==(s|0)){E=k;F=m;G=m;break b}else{I=k;J=m}}else{I=r;J=f}k=c[m+20>>2]|0;D=c[m+(t>>>31<<2)+16>>2]|0;l=(k|0)==0|(k|0)==(D|0)?o:k;if((D|0)==0){E=I;F=l;G=J;break}else{r=I;o=l;t=t<<1;m=D;f=J}}}}while(0);if((F|0)==0&(G|0)==0){n=2<<C;h=e&(n|0-n);if((h|0)==0){q=s;break}n=(h&0-h)+ -1|0;h=n>>>12&16;f=n>>>h;n=f>>>5&8;m=f>>>n;f=m>>>2&4;t=m>>>f;m=t>>>1&2;o=t>>>m;t=o>>>1&1;K=c[238976+((n|h|f|m|t)+(o>>>t)<<2)>>2]|0}else{K=F}if((K|0)==0){L=E;M=G}else{t=E;o=K;m=G;while(1){f=(c[o+4>>2]&-8)-s|0;h=f>>>0<t>>>0;n=h?f:t;f=h?o:m;h=c[o+16>>2]|0;if((h|0)!=0){N=f;O=n;m=N;o=h;t=O;continue}h=c[o+20>>2]|0;if((h|0)==0){L=n;M=f;break}else{N=f;O=n;o=h;m=N;t=O}}}if((M|0)==0){q=s;break}if(!(L>>>0<((c[238680>>2]|0)-s|0)>>>0)){q=s;break}t=M;m=c[238688>>2]|0;if(t>>>0<m>>>0){Vb()}o=t+s|0;e=o;if(!(t>>>0<o>>>0)){Vb()}h=c[M+24>>2]|0;n=c[M+12>>2]|0;do{if((n|0)==(M|0)){f=M+20|0;r=c[f>>2]|0;if((r|0)==0){D=M+16|0;l=c[D>>2]|0;if((l|0)==0){P=0;break}else{Q=l;R=D}}else{Q=r;R=f}while(1){f=Q+20|0;r=c[f>>2]|0;if((r|0)!=0){R=f;Q=r;continue}r=Q+16|0;f=c[r>>2]|0;if((f|0)==0){break}else{Q=f;R=r}}if(R>>>0<m>>>0){Vb()}else{c[R>>2]=0;P=Q;break}}else{r=c[M+8>>2]|0;if(r>>>0<m>>>0){Vb()}f=r+12|0;if((c[f>>2]|0)!=(M|0)){Vb()}D=n+8|0;if((c[D>>2]|0)==(M|0)){c[f>>2]=n;c[D>>2]=r;P=n;break}else{Vb()}}}while(0);c:do{if((h|0)!=0){n=c[M+28>>2]|0;m=238976+(n<<2)|0;do{if((M|0)==(c[m>>2]|0)){c[m>>2]=P;if((P|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<n);break c}else{if(h>>>0<(c[238688>>2]|0)>>>0){Vb()}r=h+16|0;if((c[r>>2]|0)==(M|0)){c[r>>2]=P}else{c[h+20>>2]=P}if((P|0)==0){break c}}}while(0);if(P>>>0<(c[238688>>2]|0)>>>0){Vb()}c[P+24>>2]=h;n=c[M+16>>2]|0;do{if((n|0)!=0){if(n>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[P+16>>2]=n;c[n+24>>2]=P;break}}}while(0);n=c[M+20>>2]|0;if((n|0)==0){break}if(n>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[P+20>>2]=n;c[n+24>>2]=P;break}}}while(0);d:do{if(L>>>0<16){h=L+s|0;c[M+4>>2]=h|3;n=t+(h+4)|0;c[n>>2]=c[n>>2]|1}else{c[M+4>>2]=s|3;c[t+(s|4)>>2]=L|1;c[t+(L+s)>>2]=L;n=L>>>3;if(L>>>0<256){h=n<<1;m=238712+(h<<2)|0;r=c[59668]|0;D=1<<n;do{if((r&D|0)==0){c[59668]=r|D;S=238712+(h+2<<2)|0;T=m}else{n=238712+(h+2<<2)|0;f=c[n>>2]|0;if(!(f>>>0<(c[238688>>2]|0)>>>0)){S=n;T=f;break}Vb()}}while(0);c[S>>2]=e;c[T+12>>2]=e;c[t+(s+8)>>2]=T;c[t+(s+12)>>2]=m;break}h=o;D=L>>>8;do{if((D|0)==0){U=0}else{if(L>>>0>16777215){U=31;break}r=(D+1048320|0)>>>16&8;f=D<<r;n=(f+520192|0)>>>16&4;l=f<<n;f=(l+245760|0)>>>16&2;k=14-(n|r|f)+(l<<f>>>15)|0;U=L>>>(k+7|0)&1|k<<1}}while(0);D=238976+(U<<2)|0;c[t+(s+28)>>2]=U;c[t+(s+20)>>2]=0;c[t+(s+16)>>2]=0;m=c[238676>>2]|0;k=1<<U;if((m&k|0)==0){c[238676>>2]=m|k;c[D>>2]=h;c[t+(s+24)>>2]=D;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break}k=c[D>>2]|0;if((U|0)==31){V=0}else{V=25-(U>>>1)|0}e:do{if((c[k+4>>2]&-8|0)==(L|0)){W=k}else{D=L<<V;m=k;while(1){X=m+(D>>>31<<2)+16|0;f=c[X>>2]|0;if((f|0)==0){break}if((c[f+4>>2]&-8|0)==(L|0)){W=f;break e}else{D=D<<1;m=f}}if(X>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[X>>2]=h;c[t+(s+24)>>2]=m;c[t+(s+12)>>2]=h;c[t+(s+8)>>2]=h;break d}}}while(0);k=W+8|0;D=c[k>>2]|0;f=c[238688>>2]|0;if(W>>>0<f>>>0){Vb()}if(D>>>0<f>>>0){Vb()}else{c[D+12>>2]=h;c[k>>2]=h;c[t+(s+8)>>2]=D;c[t+(s+12)>>2]=W;c[t+(s+24)>>2]=0;break}}}while(0);p=M+8|0;i=b;return p|0}}while(0);M=c[238680>>2]|0;if(!(q>>>0>M>>>0)){W=M-q|0;X=c[238692>>2]|0;if(W>>>0>15){L=X;c[238692>>2]=L+q;c[238680>>2]=W;c[L+(q+4)>>2]=W|1;c[L+M>>2]=W;c[X+4>>2]=q|3}else{c[238680>>2]=0;c[238692>>2]=0;c[X+4>>2]=M|3;W=X+(M+4)|0;c[W>>2]=c[W>>2]|1}p=X+8|0;i=b;return p|0}X=c[238684>>2]|0;if(q>>>0<X>>>0){W=X-q|0;c[238684>>2]=W;X=c[238696>>2]|0;M=X;c[238696>>2]=M+q;c[M+(q+4)>>2]=W|1;c[X+4>>2]=q|3;p=X+8|0;i=b;return p|0}do{if((c[59786]|0)==0){X=Rb(30)|0;if((X+ -1&X|0)==0){c[239152>>2]=X;c[239148>>2]=X;c[239156>>2]=-1;c[239160>>2]=-1;c[239164>>2]=0;c[239116>>2]=0;c[59786]=(Yb(0)|0)&-16^1431655768;break}else{Vb()}}}while(0);X=q+48|0;W=c[239152>>2]|0;M=q+47|0;L=W+M|0;V=0-W|0;W=L&V;if(!(W>>>0>q>>>0)){p=0;i=b;return p|0}U=c[239112>>2]|0;do{if((U|0)!=0){T=c[239104>>2]|0;S=T+W|0;if(S>>>0<=T>>>0|S>>>0>U>>>0){p=0}else{break}i=b;return p|0}}while(0);f:do{if((c[239116>>2]&4|0)==0){U=c[238696>>2]|0;g:do{if((U|0)==0){Y=182}else{S=U;T=239120|0;while(1){Z=T;P=c[Z>>2]|0;if(!(P>>>0>S>>>0)){_=T+4|0;if((P+(c[_>>2]|0)|0)>>>0>S>>>0){break}}P=c[T+8>>2]|0;if((P|0)==0){Y=182;break g}else{T=P}}if((T|0)==0){Y=182;break}S=L-(c[238684>>2]|0)&V;if(!(S>>>0<2147483647)){$=0;break}h=hb(S|0)|0;P=(h|0)==((c[Z>>2]|0)+(c[_>>2]|0)|0);aa=h;ba=S;ca=P?h:-1;da=P?S:0;Y=191}}while(0);do{if((Y|0)==182){U=hb(0)|0;if((U|0)==(-1|0)){$=0;break}S=U;P=c[239148>>2]|0;h=P+ -1|0;if((h&S|0)==0){ea=W}else{ea=W-S+(h+S&0-P)|0}P=c[239104>>2]|0;S=P+ea|0;if(!(ea>>>0>q>>>0&ea>>>0<2147483647)){$=0;break}h=c[239112>>2]|0;if((h|0)!=0){if(S>>>0<=P>>>0|S>>>0>h>>>0){$=0;break}}h=hb(ea|0)|0;S=(h|0)==(U|0);aa=h;ba=ea;ca=S?U:-1;da=S?ea:0;Y=191}}while(0);h:do{if((Y|0)==191){S=0-ba|0;if((ca|0)!=(-1|0)){fa=ca;ga=da;Y=202;break f}do{if((aa|0)!=(-1|0)&ba>>>0<2147483647&ba>>>0<X>>>0){U=c[239152>>2]|0;h=M-ba+U&0-U;if(!(h>>>0<2147483647)){ha=ba;break}if((hb(h|0)|0)==(-1|0)){hb(S|0)|0;$=da;break h}else{ha=h+ba|0;break}}else{ha=ba}}while(0);if((aa|0)==(-1|0)){$=da}else{fa=aa;ga=ha;Y=202;break f}}}while(0);c[239116>>2]=c[239116>>2]|4;ia=$;Y=199}else{ia=0;Y=199}}while(0);do{if((Y|0)==199){if(!(W>>>0<2147483647)){break}$=hb(W|0)|0;ha=hb(0)|0;if(!((ha|0)!=(-1|0)&($|0)!=(-1|0)&$>>>0<ha>>>0)){break}aa=ha-$|0;ha=aa>>>0>(q+40|0)>>>0;if(ha){fa=$;ga=ha?aa:ia;Y=202}}}while(0);do{if((Y|0)==202){ia=(c[239104>>2]|0)+ga|0;c[239104>>2]=ia;if(ia>>>0>(c[239108>>2]|0)>>>0){c[239108>>2]=ia}ia=c[238696>>2]|0;i:do{if((ia|0)==0){W=c[238688>>2]|0;if((W|0)==0|fa>>>0<W>>>0){c[238688>>2]=fa}c[239120>>2]=fa;c[239124>>2]=ga;c[239132>>2]=0;c[238708>>2]=c[59786];c[238704>>2]=-1;W=0;do{aa=W<<1;ha=238712+(aa<<2)|0;c[238712+(aa+3<<2)>>2]=ha;c[238712+(aa+2<<2)>>2]=ha;W=W+1|0;}while((W|0)!=32);W=fa+8|0;if((W&7|0)==0){ja=0}else{ja=0-W&7}W=ga+ -40-ja|0;c[238696>>2]=fa+ja;c[238684>>2]=W;c[fa+(ja+4)>>2]=W|1;c[fa+(ga+ -36)>>2]=40;c[238700>>2]=c[239160>>2]}else{W=239120|0;while(1){ka=c[W>>2]|0;la=W+4|0;ma=c[la>>2]|0;if((fa|0)==(ka+ma|0)){Y=214;break}ha=c[W+8>>2]|0;if((ha|0)==0){break}else{W=ha}}do{if((Y|0)==214){if((c[W+12>>2]&8|0)!=0){break}ha=ia;if(!(ha>>>0>=ka>>>0&ha>>>0<fa>>>0)){break}c[la>>2]=ma+ga;aa=(c[238684>>2]|0)+ga|0;$=ia+8|0;if(($&7|0)==0){na=0}else{na=0-$&7}$=aa-na|0;c[238696>>2]=ha+na;c[238684>>2]=$;c[ha+(na+4)>>2]=$|1;c[ha+(aa+4)>>2]=40;c[238700>>2]=c[239160>>2];break i}}while(0);if(fa>>>0<(c[238688>>2]|0)>>>0){c[238688>>2]=fa}W=fa+ga|0;aa=239120|0;while(1){oa=aa;if((c[oa>>2]|0)==(W|0)){Y=224;break}ha=c[aa+8>>2]|0;if((ha|0)==0){break}else{aa=ha}}do{if((Y|0)==224){if((c[aa+12>>2]&8|0)!=0){break}c[oa>>2]=fa;W=aa+4|0;c[W>>2]=(c[W>>2]|0)+ga;W=fa+8|0;if((W&7|0)==0){pa=0}else{pa=0-W&7}W=fa+(ga+8)|0;if((W&7|0)==0){qa=0}else{qa=0-W&7}W=fa+(qa+ga)|0;ha=W;$=pa+q|0;da=fa+$|0;ba=da;M=W-(fa+pa)-q|0;c[fa+(pa+4)>>2]=q|3;j:do{if((ha|0)==(c[238696>>2]|0)){X=(c[238684>>2]|0)+M|0;c[238684>>2]=X;c[238696>>2]=ba;c[fa+($+4)>>2]=X|1}else{if((ha|0)==(c[238692>>2]|0)){X=(c[238680>>2]|0)+M|0;c[238680>>2]=X;c[238692>>2]=ba;c[fa+($+4)>>2]=X|1;c[fa+(X+$)>>2]=X;break}X=ga+4|0;ca=c[fa+(X+qa)>>2]|0;if((ca&3|0)==1){ea=ca&-8;_=ca>>>3;k:do{if(ca>>>0<256){Z=c[fa+((qa|8)+ga)>>2]|0;V=c[fa+(ga+12+qa)>>2]|0;L=238712+(_<<1<<2)|0;do{if((Z|0)!=(L|0)){if(Z>>>0<(c[238688>>2]|0)>>>0){Vb()}if((c[Z+12>>2]|0)==(ha|0)){break}Vb()}}while(0);if((V|0)==(Z|0)){c[59668]=c[59668]&~(1<<_);break}do{if((V|0)==(L|0)){ra=V+8|0}else{if(V>>>0<(c[238688>>2]|0)>>>0){Vb()}S=V+8|0;if((c[S>>2]|0)==(ha|0)){ra=S;break}Vb()}}while(0);c[Z+12>>2]=V;c[ra>>2]=Z}else{L=W;S=c[fa+((qa|24)+ga)>>2]|0;T=c[fa+(ga+12+qa)>>2]|0;do{if((T|0)==(L|0)){h=qa|16;U=fa+(X+h)|0;P=c[U>>2]|0;if((P|0)==0){Q=fa+(h+ga)|0;h=c[Q>>2]|0;if((h|0)==0){sa=0;break}else{ta=h;ua=Q}}else{ta=P;ua=U}while(1){U=ta+20|0;P=c[U>>2]|0;if((P|0)!=0){ua=U;ta=P;continue}P=ta+16|0;U=c[P>>2]|0;if((U|0)==0){break}else{ta=U;ua=P}}if(ua>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[ua>>2]=0;sa=ta;break}}else{P=c[fa+((qa|8)+ga)>>2]|0;if(P>>>0<(c[238688>>2]|0)>>>0){Vb()}U=P+12|0;if((c[U>>2]|0)!=(L|0)){Vb()}Q=T+8|0;if((c[Q>>2]|0)==(L|0)){c[U>>2]=T;c[Q>>2]=P;sa=T;break}else{Vb()}}}while(0);if((S|0)==0){break}T=c[fa+(ga+28+qa)>>2]|0;Z=238976+(T<<2)|0;do{if((L|0)==(c[Z>>2]|0)){c[Z>>2]=sa;if((sa|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<T);break k}else{if(S>>>0<(c[238688>>2]|0)>>>0){Vb()}V=S+16|0;if((c[V>>2]|0)==(L|0)){c[V>>2]=sa}else{c[S+20>>2]=sa}if((sa|0)==0){break k}}}while(0);if(sa>>>0<(c[238688>>2]|0)>>>0){Vb()}c[sa+24>>2]=S;L=qa|16;T=c[fa+(L+ga)>>2]|0;do{if((T|0)!=0){if(T>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[sa+16>>2]=T;c[T+24>>2]=sa;break}}}while(0);T=c[fa+(X+L)>>2]|0;if((T|0)==0){break}if(T>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[sa+20>>2]=T;c[T+24>>2]=sa;break}}}while(0);va=fa+((ea|qa)+ga)|0;wa=ea+M|0}else{va=ha;wa=M}X=va+4|0;c[X>>2]=c[X>>2]&-2;c[fa+($+4)>>2]=wa|1;c[fa+(wa+$)>>2]=wa;X=wa>>>3;if(wa>>>0<256){_=X<<1;ca=238712+(_<<2)|0;T=c[59668]|0;S=1<<X;do{if((T&S|0)==0){c[59668]=T|S;xa=238712+(_+2<<2)|0;ya=ca}else{X=238712+(_+2<<2)|0;Z=c[X>>2]|0;if(!(Z>>>0<(c[238688>>2]|0)>>>0)){xa=X;ya=Z;break}Vb()}}while(0);c[xa>>2]=ba;c[ya+12>>2]=ba;c[fa+($+8)>>2]=ya;c[fa+($+12)>>2]=ca;break}_=da;S=wa>>>8;do{if((S|0)==0){za=0}else{if(wa>>>0>16777215){za=31;break}T=(S+1048320|0)>>>16&8;ea=S<<T;Z=(ea+520192|0)>>>16&4;X=ea<<Z;ea=(X+245760|0)>>>16&2;V=14-(Z|T|ea)+(X<<ea>>>15)|0;za=wa>>>(V+7|0)&1|V<<1}}while(0);S=238976+(za<<2)|0;c[fa+($+28)>>2]=za;c[fa+($+20)>>2]=0;c[fa+($+16)>>2]=0;ca=c[238676>>2]|0;V=1<<za;if((ca&V|0)==0){c[238676>>2]=ca|V;c[S>>2]=_;c[fa+($+24)>>2]=S;c[fa+($+12)>>2]=_;c[fa+($+8)>>2]=_;break}V=c[S>>2]|0;if((za|0)==31){Aa=0}else{Aa=25-(za>>>1)|0}l:do{if((c[V+4>>2]&-8|0)==(wa|0)){Ba=V}else{S=wa<<Aa;ca=V;while(1){Ca=ca+(S>>>31<<2)+16|0;ea=c[Ca>>2]|0;if((ea|0)==0){break}if((c[ea+4>>2]&-8|0)==(wa|0)){Ba=ea;break l}else{S=S<<1;ca=ea}}if(Ca>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[Ca>>2]=_;c[fa+($+24)>>2]=ca;c[fa+($+12)>>2]=_;c[fa+($+8)>>2]=_;break j}}}while(0);V=Ba+8|0;S=c[V>>2]|0;L=c[238688>>2]|0;if(Ba>>>0<L>>>0){Vb()}if(S>>>0<L>>>0){Vb()}else{c[S+12>>2]=_;c[V>>2]=_;c[fa+($+8)>>2]=S;c[fa+($+12)>>2]=Ba;c[fa+($+24)>>2]=0;break}}}while(0);p=fa+(pa|8)|0;i=b;return p|0}}while(0);aa=ia;$=239120|0;while(1){Da=c[$>>2]|0;if(!(Da>>>0>aa>>>0)){Ea=c[$+4>>2]|0;Fa=Da+Ea|0;if(Fa>>>0>aa>>>0){break}}$=c[$+8>>2]|0}$=Da+(Ea+ -39)|0;if(($&7|0)==0){Ga=0}else{Ga=0-$&7}$=Da+(Ea+ -47+Ga)|0;da=$>>>0<(ia+16|0)>>>0?aa:$;$=da+8|0;ba=$;M=fa+8|0;if((M&7|0)==0){Ha=0}else{Ha=0-M&7}M=ga+ -40-Ha|0;c[238696>>2]=fa+Ha;c[238684>>2]=M;c[fa+(Ha+4)>>2]=M|1;c[fa+(ga+ -36)>>2]=40;c[238700>>2]=c[239160>>2];c[da+4>>2]=27;c[$+0>>2]=c[239120>>2];c[$+4>>2]=c[239124>>2];c[$+8>>2]=c[239128>>2];c[$+12>>2]=c[239132>>2];c[239120>>2]=fa;c[239124>>2]=ga;c[239132>>2]=0;c[239128>>2]=ba;ba=da+28|0;c[ba>>2]=7;if((da+32|0)>>>0<Fa>>>0){$=ba;while(1){ba=$+4|0;c[ba>>2]=7;if(($+8|0)>>>0<Fa>>>0){$=ba}else{break}}}if((da|0)==(aa|0)){break}$=da-ia|0;ba=aa+($+4)|0;c[ba>>2]=c[ba>>2]&-2;c[ia+4>>2]=$|1;c[aa+$>>2]=$;ba=$>>>3;if($>>>0<256){M=ba<<1;ha=238712+(M<<2)|0;W=c[59668]|0;m=1<<ba;do{if((W&m|0)==0){c[59668]=W|m;Ia=238712+(M+2<<2)|0;Ja=ha}else{ba=238712+(M+2<<2)|0;S=c[ba>>2]|0;if(!(S>>>0<(c[238688>>2]|0)>>>0)){Ia=ba;Ja=S;break}Vb()}}while(0);c[Ia>>2]=ia;c[Ja+12>>2]=ia;c[ia+8>>2]=Ja;c[ia+12>>2]=ha;break}M=ia;m=$>>>8;do{if((m|0)==0){Ka=0}else{if($>>>0>16777215){Ka=31;break}W=(m+1048320|0)>>>16&8;aa=m<<W;da=(aa+520192|0)>>>16&4;S=aa<<da;aa=(S+245760|0)>>>16&2;ba=14-(da|W|aa)+(S<<aa>>>15)|0;Ka=$>>>(ba+7|0)&1|ba<<1}}while(0);m=238976+(Ka<<2)|0;c[ia+28>>2]=Ka;c[ia+20>>2]=0;c[ia+16>>2]=0;ha=c[238676>>2]|0;ba=1<<Ka;if((ha&ba|0)==0){c[238676>>2]=ha|ba;c[m>>2]=M;c[ia+24>>2]=m;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break}ba=c[m>>2]|0;if((Ka|0)==31){La=0}else{La=25-(Ka>>>1)|0}m:do{if((c[ba+4>>2]&-8|0)==($|0)){Ma=ba}else{m=$<<La;ha=ba;while(1){Na=ha+(m>>>31<<2)+16|0;aa=c[Na>>2]|0;if((aa|0)==0){break}if((c[aa+4>>2]&-8|0)==($|0)){Ma=aa;break m}else{m=m<<1;ha=aa}}if(Na>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[Na>>2]=M;c[ia+24>>2]=ha;c[ia+12>>2]=ia;c[ia+8>>2]=ia;break i}}}while(0);$=Ma+8|0;ba=c[$>>2]|0;m=c[238688>>2]|0;if(Ma>>>0<m>>>0){Vb()}if(ba>>>0<m>>>0){Vb()}else{c[ba+12>>2]=M;c[$>>2]=M;c[ia+8>>2]=ba;c[ia+12>>2]=Ma;c[ia+24>>2]=0;break}}}while(0);ia=c[238684>>2]|0;if(!(ia>>>0>q>>>0)){break}ba=ia-q|0;c[238684>>2]=ba;ia=c[238696>>2]|0;$=ia;c[238696>>2]=$+q;c[$+(q+4)>>2]=ba|1;c[ia+4>>2]=q|3;p=ia+8|0;i=b;return p|0}}while(0);c[(ab()|0)>>2]=12;p=0;i=b;return p|0}function Cm(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;b=i;if((a|0)==0){i=b;return}d=a+ -8|0;e=d;f=c[238688>>2]|0;if(d>>>0<f>>>0){Vb()}g=c[a+ -4>>2]|0;h=g&3;if((h|0)==1){Vb()}j=g&-8;k=a+(j+ -8)|0;l=k;a:do{if((g&1|0)==0){m=c[d>>2]|0;if((h|0)==0){i=b;return}n=-8-m|0;o=a+n|0;p=o;q=m+j|0;if(o>>>0<f>>>0){Vb()}if((p|0)==(c[238692>>2]|0)){r=a+(j+ -4)|0;if((c[r>>2]&3|0)!=3){s=p;t=q;break}c[238680>>2]=q;c[r>>2]=c[r>>2]&-2;c[a+(n+4)>>2]=q|1;c[k>>2]=q;i=b;return}r=m>>>3;if(m>>>0<256){m=c[a+(n+8)>>2]|0;u=c[a+(n+12)>>2]|0;v=238712+(r<<1<<2)|0;do{if((m|0)!=(v|0)){if(m>>>0<f>>>0){Vb()}if((c[m+12>>2]|0)==(p|0)){break}Vb()}}while(0);if((u|0)==(m|0)){c[59668]=c[59668]&~(1<<r);s=p;t=q;break}do{if((u|0)==(v|0)){w=u+8|0}else{if(u>>>0<f>>>0){Vb()}x=u+8|0;if((c[x>>2]|0)==(p|0)){w=x;break}Vb()}}while(0);c[m+12>>2]=u;c[w>>2]=m;s=p;t=q;break}v=o;r=c[a+(n+24)>>2]|0;x=c[a+(n+12)>>2]|0;do{if((x|0)==(v|0)){y=a+(n+20)|0;z=c[y>>2]|0;if((z|0)==0){A=a+(n+16)|0;B=c[A>>2]|0;if((B|0)==0){C=0;break}else{D=B;E=A}}else{D=z;E=y}while(1){y=D+20|0;z=c[y>>2]|0;if((z|0)!=0){E=y;D=z;continue}z=D+16|0;y=c[z>>2]|0;if((y|0)==0){break}else{D=y;E=z}}if(E>>>0<f>>>0){Vb()}else{c[E>>2]=0;C=D;break}}else{z=c[a+(n+8)>>2]|0;if(z>>>0<f>>>0){Vb()}y=z+12|0;if((c[y>>2]|0)!=(v|0)){Vb()}A=x+8|0;if((c[A>>2]|0)==(v|0)){c[y>>2]=x;c[A>>2]=z;C=x;break}else{Vb()}}}while(0);if((r|0)==0){s=p;t=q;break}x=c[a+(n+28)>>2]|0;o=238976+(x<<2)|0;do{if((v|0)==(c[o>>2]|0)){c[o>>2]=C;if((C|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<x);s=p;t=q;break a}else{if(r>>>0<(c[238688>>2]|0)>>>0){Vb()}m=r+16|0;if((c[m>>2]|0)==(v|0)){c[m>>2]=C}else{c[r+20>>2]=C}if((C|0)==0){s=p;t=q;break a}}}while(0);if(C>>>0<(c[238688>>2]|0)>>>0){Vb()}c[C+24>>2]=r;v=c[a+(n+16)>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[C+16>>2]=v;c[v+24>>2]=C;break}}}while(0);v=c[a+(n+20)>>2]|0;if((v|0)==0){s=p;t=q;break}if(v>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[C+20>>2]=v;c[v+24>>2]=C;s=p;t=q;break}}else{s=e;t=j}}while(0);e=s;if(!(e>>>0<k>>>0)){Vb()}C=a+(j+ -4)|0;f=c[C>>2]|0;if((f&1|0)==0){Vb()}do{if((f&2|0)==0){if((l|0)==(c[238696>>2]|0)){D=(c[238684>>2]|0)+t|0;c[238684>>2]=D;c[238696>>2]=s;c[s+4>>2]=D|1;if((s|0)!=(c[238692>>2]|0)){i=b;return}c[238692>>2]=0;c[238680>>2]=0;i=b;return}if((l|0)==(c[238692>>2]|0)){D=(c[238680>>2]|0)+t|0;c[238680>>2]=D;c[238692>>2]=s;c[s+4>>2]=D|1;c[e+D>>2]=D;i=b;return}D=(f&-8)+t|0;E=f>>>3;b:do{if(f>>>0<256){w=c[a+j>>2]|0;h=c[a+(j|4)>>2]|0;d=238712+(E<<1<<2)|0;do{if((w|0)!=(d|0)){if(w>>>0<(c[238688>>2]|0)>>>0){Vb()}if((c[w+12>>2]|0)==(l|0)){break}Vb()}}while(0);if((h|0)==(w|0)){c[59668]=c[59668]&~(1<<E);break}do{if((h|0)==(d|0)){F=h+8|0}else{if(h>>>0<(c[238688>>2]|0)>>>0){Vb()}g=h+8|0;if((c[g>>2]|0)==(l|0)){F=g;break}Vb()}}while(0);c[w+12>>2]=h;c[F>>2]=w}else{d=k;g=c[a+(j+16)>>2]|0;v=c[a+(j|4)>>2]|0;do{if((v|0)==(d|0)){r=a+(j+12)|0;x=c[r>>2]|0;if((x|0)==0){o=a+(j+8)|0;m=c[o>>2]|0;if((m|0)==0){G=0;break}else{H=m;I=o}}else{H=x;I=r}while(1){r=H+20|0;x=c[r>>2]|0;if((x|0)!=0){I=r;H=x;continue}x=H+16|0;r=c[x>>2]|0;if((r|0)==0){break}else{H=r;I=x}}if(I>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[I>>2]=0;G=H;break}}else{x=c[a+j>>2]|0;if(x>>>0<(c[238688>>2]|0)>>>0){Vb()}r=x+12|0;if((c[r>>2]|0)!=(d|0)){Vb()}o=v+8|0;if((c[o>>2]|0)==(d|0)){c[r>>2]=v;c[o>>2]=x;G=v;break}else{Vb()}}}while(0);if((g|0)==0){break}v=c[a+(j+20)>>2]|0;w=238976+(v<<2)|0;do{if((d|0)==(c[w>>2]|0)){c[w>>2]=G;if((G|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<v);break b}else{if(g>>>0<(c[238688>>2]|0)>>>0){Vb()}h=g+16|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=G}else{c[g+20>>2]=G}if((G|0)==0){break b}}}while(0);if(G>>>0<(c[238688>>2]|0)>>>0){Vb()}c[G+24>>2]=g;d=c[a+(j+8)>>2]|0;do{if((d|0)!=0){if(d>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[G+16>>2]=d;c[d+24>>2]=G;break}}}while(0);d=c[a+(j+12)>>2]|0;if((d|0)==0){break}if(d>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[G+20>>2]=d;c[d+24>>2]=G;break}}}while(0);c[s+4>>2]=D|1;c[e+D>>2]=D;if((s|0)!=(c[238692>>2]|0)){J=D;break}c[238680>>2]=D;i=b;return}else{c[C>>2]=f&-2;c[s+4>>2]=t|1;c[e+t>>2]=t;J=t}}while(0);t=J>>>3;if(J>>>0<256){e=t<<1;f=238712+(e<<2)|0;C=c[59668]|0;G=1<<t;do{if((C&G|0)==0){c[59668]=C|G;K=238712+(e+2<<2)|0;L=f}else{t=238712+(e+2<<2)|0;j=c[t>>2]|0;if(!(j>>>0<(c[238688>>2]|0)>>>0)){K=t;L=j;break}Vb()}}while(0);c[K>>2]=s;c[L+12>>2]=s;c[s+8>>2]=L;c[s+12>>2]=f;i=b;return}f=s;L=J>>>8;do{if((L|0)==0){M=0}else{if(J>>>0>16777215){M=31;break}K=(L+1048320|0)>>>16&8;e=L<<K;G=(e+520192|0)>>>16&4;C=e<<G;e=(C+245760|0)>>>16&2;j=14-(G|K|e)+(C<<e>>>15)|0;M=J>>>(j+7|0)&1|j<<1}}while(0);L=238976+(M<<2)|0;c[s+28>>2]=M;c[s+20>>2]=0;c[s+16>>2]=0;j=c[238676>>2]|0;e=1<<M;c:do{if((j&e|0)==0){c[238676>>2]=j|e;c[L>>2]=f;c[s+24>>2]=L;c[s+12>>2]=s;c[s+8>>2]=s}else{C=c[L>>2]|0;if((M|0)==31){N=0}else{N=25-(M>>>1)|0}d:do{if((c[C+4>>2]&-8|0)==(J|0)){O=C}else{K=J<<N;G=C;while(1){P=G+(K>>>31<<2)+16|0;t=c[P>>2]|0;if((t|0)==0){break}if((c[t+4>>2]&-8|0)==(J|0)){O=t;break d}else{K=K<<1;G=t}}if(P>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[P>>2]=f;c[s+24>>2]=G;c[s+12>>2]=s;c[s+8>>2]=s;break c}}}while(0);C=O+8|0;D=c[C>>2]|0;K=c[238688>>2]|0;if(O>>>0<K>>>0){Vb()}if(D>>>0<K>>>0){Vb()}else{c[D+12>>2]=f;c[C>>2]=f;c[s+8>>2]=D;c[s+12>>2]=O;c[s+24>>2]=0;break}}}while(0);s=(c[238704>>2]|0)+ -1|0;c[238704>>2]=s;if((s|0)==0){Q=239128|0}else{i=b;return}while(1){s=c[Q>>2]|0;if((s|0)==0){break}else{Q=s+8|0}}c[238704>>2]=-1;i=b;return}function Dm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;if((a|0)==0){e=Bm(b)|0;i=d;return e|0}if(b>>>0>4294967231){c[(ab()|0)>>2]=12;e=0;i=d;return e|0}if(b>>>0<11){f=16}else{f=b+11&-8}g=Em(a+ -8|0,f)|0;if((g|0)!=0){e=g+8|0;i=d;return e|0}g=Bm(b)|0;if((g|0)==0){e=0;i=d;return e|0}f=c[a+ -4>>2]|0;h=(f&-8)-((f&3|0)==0?8:4)|0;$m(g|0,a|0,(h>>>0<b>>>0?h:b)|0)|0;Cm(a);e=g;i=d;return e|0}function Em(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;d=i;e=a+4|0;f=c[e>>2]|0;g=f&-8;h=a;j=h+g|0;k=j;l=c[238688>>2]|0;if(h>>>0<l>>>0){Vb()}m=f&3;if(!((m|0)!=1&h>>>0<j>>>0)){Vb()}n=h+(g|4)|0;o=c[n>>2]|0;if((o&1|0)==0){Vb()}if((m|0)==0){if(b>>>0<256){p=0;i=d;return p|0}do{if(!(g>>>0<(b+4|0)>>>0)){if((g-b|0)>>>0>c[239152>>2]<<1>>>0){break}else{p=a}i=d;return p|0}}while(0);p=0;i=d;return p|0}if(!(g>>>0<b>>>0)){m=g-b|0;if(!(m>>>0>15)){p=a;i=d;return p|0}c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=m|3;c[n>>2]=c[n>>2]|1;Fm(h+b|0,m);p=a;i=d;return p|0}if((k|0)==(c[238696>>2]|0)){m=(c[238684>>2]|0)+g|0;if(!(m>>>0>b>>>0)){p=0;i=d;return p|0}n=m-b|0;c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=n|1;c[238696>>2]=h+b;c[238684>>2]=n;p=a;i=d;return p|0}if((k|0)==(c[238692>>2]|0)){n=(c[238680>>2]|0)+g|0;if(n>>>0<b>>>0){p=0;i=d;return p|0}m=n-b|0;if(m>>>0>15){c[e>>2]=f&1|b|2;c[h+(b+4)>>2]=m|1;c[h+n>>2]=m;q=h+(n+4)|0;c[q>>2]=c[q>>2]&-2;r=h+b|0;s=m}else{c[e>>2]=f&1|n|2;f=h+(n+4)|0;c[f>>2]=c[f>>2]|1;r=0;s=0}c[238680>>2]=s;c[238692>>2]=r;p=a;i=d;return p|0}if((o&2|0)!=0){p=0;i=d;return p|0}r=(o&-8)+g|0;if(r>>>0<b>>>0){p=0;i=d;return p|0}s=r-b|0;f=o>>>3;a:do{if(o>>>0<256){n=c[h+(g+8)>>2]|0;m=c[h+(g+12)>>2]|0;q=238712+(f<<1<<2)|0;do{if((n|0)!=(q|0)){if(n>>>0<l>>>0){Vb()}if((c[n+12>>2]|0)==(k|0)){break}Vb()}}while(0);if((m|0)==(n|0)){c[59668]=c[59668]&~(1<<f);break}do{if((m|0)==(q|0)){t=m+8|0}else{if(m>>>0<l>>>0){Vb()}u=m+8|0;if((c[u>>2]|0)==(k|0)){t=u;break}Vb()}}while(0);c[n+12>>2]=m;c[t>>2]=n}else{q=j;u=c[h+(g+24)>>2]|0;v=c[h+(g+12)>>2]|0;do{if((v|0)==(q|0)){w=h+(g+20)|0;x=c[w>>2]|0;if((x|0)==0){y=h+(g+16)|0;z=c[y>>2]|0;if((z|0)==0){A=0;break}else{B=z;C=y}}else{B=x;C=w}while(1){w=B+20|0;x=c[w>>2]|0;if((x|0)!=0){C=w;B=x;continue}x=B+16|0;w=c[x>>2]|0;if((w|0)==0){break}else{B=w;C=x}}if(C>>>0<l>>>0){Vb()}else{c[C>>2]=0;A=B;break}}else{x=c[h+(g+8)>>2]|0;if(x>>>0<l>>>0){Vb()}w=x+12|0;if((c[w>>2]|0)!=(q|0)){Vb()}y=v+8|0;if((c[y>>2]|0)==(q|0)){c[w>>2]=v;c[y>>2]=x;A=v;break}else{Vb()}}}while(0);if((u|0)==0){break}v=c[h+(g+28)>>2]|0;n=238976+(v<<2)|0;do{if((q|0)==(c[n>>2]|0)){c[n>>2]=A;if((A|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<v);break a}else{if(u>>>0<(c[238688>>2]|0)>>>0){Vb()}m=u+16|0;if((c[m>>2]|0)==(q|0)){c[m>>2]=A}else{c[u+20>>2]=A}if((A|0)==0){break a}}}while(0);if(A>>>0<(c[238688>>2]|0)>>>0){Vb()}c[A+24>>2]=u;q=c[h+(g+16)>>2]|0;do{if((q|0)!=0){if(q>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[A+16>>2]=q;c[q+24>>2]=A;break}}}while(0);q=c[h+(g+20)>>2]|0;if((q|0)==0){break}if(q>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[A+20>>2]=q;c[q+24>>2]=A;break}}}while(0);if(s>>>0<16){c[e>>2]=r|c[e>>2]&1|2;A=h+(r|4)|0;c[A>>2]=c[A>>2]|1;p=a;i=d;return p|0}else{c[e>>2]=c[e>>2]&1|b|2;c[h+(b+4)>>2]=s|3;e=h+(r|4)|0;c[e>>2]=c[e>>2]|1;Fm(h+b|0,s);p=a;i=d;return p|0}return 0}function Fm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;d=i;e=a;f=e+b|0;g=f;h=c[a+4>>2]|0;a:do{if((h&1|0)==0){j=c[a>>2]|0;if((h&3|0)==0){i=d;return}k=e+(0-j)|0;l=k;m=j+b|0;n=c[238688>>2]|0;if(k>>>0<n>>>0){Vb()}if((l|0)==(c[238692>>2]|0)){o=e+(b+4)|0;if((c[o>>2]&3|0)!=3){p=l;q=m;break}c[238680>>2]=m;c[o>>2]=c[o>>2]&-2;c[e+(4-j)>>2]=m|1;c[f>>2]=m;i=d;return}o=j>>>3;if(j>>>0<256){r=c[e+(8-j)>>2]|0;s=c[e+(12-j)>>2]|0;t=238712+(o<<1<<2)|0;do{if((r|0)!=(t|0)){if(r>>>0<n>>>0){Vb()}if((c[r+12>>2]|0)==(l|0)){break}Vb()}}while(0);if((s|0)==(r|0)){c[59668]=c[59668]&~(1<<o);p=l;q=m;break}do{if((s|0)==(t|0)){u=s+8|0}else{if(s>>>0<n>>>0){Vb()}v=s+8|0;if((c[v>>2]|0)==(l|0)){u=v;break}Vb()}}while(0);c[r+12>>2]=s;c[u>>2]=r;p=l;q=m;break}t=k;o=c[e+(24-j)>>2]|0;v=c[e+(12-j)>>2]|0;do{if((v|0)==(t|0)){w=16-j|0;x=e+(w+4)|0;y=c[x>>2]|0;if((y|0)==0){z=e+w|0;w=c[z>>2]|0;if((w|0)==0){A=0;break}else{B=w;C=z}}else{B=y;C=x}while(1){x=B+20|0;y=c[x>>2]|0;if((y|0)!=0){C=x;B=y;continue}y=B+16|0;x=c[y>>2]|0;if((x|0)==0){break}else{B=x;C=y}}if(C>>>0<n>>>0){Vb()}else{c[C>>2]=0;A=B;break}}else{y=c[e+(8-j)>>2]|0;if(y>>>0<n>>>0){Vb()}x=y+12|0;if((c[x>>2]|0)!=(t|0)){Vb()}z=v+8|0;if((c[z>>2]|0)==(t|0)){c[x>>2]=v;c[z>>2]=y;A=v;break}else{Vb()}}}while(0);if((o|0)==0){p=l;q=m;break}v=c[e+(28-j)>>2]|0;n=238976+(v<<2)|0;do{if((t|0)==(c[n>>2]|0)){c[n>>2]=A;if((A|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<v);p=l;q=m;break a}else{if(o>>>0<(c[238688>>2]|0)>>>0){Vb()}k=o+16|0;if((c[k>>2]|0)==(t|0)){c[k>>2]=A}else{c[o+20>>2]=A}if((A|0)==0){p=l;q=m;break a}}}while(0);if(A>>>0<(c[238688>>2]|0)>>>0){Vb()}c[A+24>>2]=o;t=16-j|0;v=c[e+t>>2]|0;do{if((v|0)!=0){if(v>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[A+16>>2]=v;c[v+24>>2]=A;break}}}while(0);v=c[e+(t+4)>>2]|0;if((v|0)==0){p=l;q=m;break}if(v>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[A+20>>2]=v;c[v+24>>2]=A;p=l;q=m;break}}else{p=a;q=b}}while(0);a=c[238688>>2]|0;if(f>>>0<a>>>0){Vb()}A=e+(b+4)|0;B=c[A>>2]|0;do{if((B&2|0)==0){if((g|0)==(c[238696>>2]|0)){C=(c[238684>>2]|0)+q|0;c[238684>>2]=C;c[238696>>2]=p;c[p+4>>2]=C|1;if((p|0)!=(c[238692>>2]|0)){i=d;return}c[238692>>2]=0;c[238680>>2]=0;i=d;return}if((g|0)==(c[238692>>2]|0)){C=(c[238680>>2]|0)+q|0;c[238680>>2]=C;c[238692>>2]=p;c[p+4>>2]=C|1;c[p+C>>2]=C;i=d;return}C=(B&-8)+q|0;u=B>>>3;b:do{if(B>>>0<256){h=c[e+(b+8)>>2]|0;v=c[e+(b+12)>>2]|0;j=238712+(u<<1<<2)|0;do{if((h|0)!=(j|0)){if(h>>>0<a>>>0){Vb()}if((c[h+12>>2]|0)==(g|0)){break}Vb()}}while(0);if((v|0)==(h|0)){c[59668]=c[59668]&~(1<<u);break}do{if((v|0)==(j|0)){D=v+8|0}else{if(v>>>0<a>>>0){Vb()}o=v+8|0;if((c[o>>2]|0)==(g|0)){D=o;break}Vb()}}while(0);c[h+12>>2]=v;c[D>>2]=h}else{j=f;o=c[e+(b+24)>>2]|0;n=c[e+(b+12)>>2]|0;do{if((n|0)==(j|0)){k=e+(b+20)|0;r=c[k>>2]|0;if((r|0)==0){s=e+(b+16)|0;y=c[s>>2]|0;if((y|0)==0){E=0;break}else{F=y;G=s}}else{F=r;G=k}while(1){k=F+20|0;r=c[k>>2]|0;if((r|0)!=0){G=k;F=r;continue}r=F+16|0;k=c[r>>2]|0;if((k|0)==0){break}else{F=k;G=r}}if(G>>>0<a>>>0){Vb()}else{c[G>>2]=0;E=F;break}}else{r=c[e+(b+8)>>2]|0;if(r>>>0<a>>>0){Vb()}k=r+12|0;if((c[k>>2]|0)!=(j|0)){Vb()}s=n+8|0;if((c[s>>2]|0)==(j|0)){c[k>>2]=n;c[s>>2]=r;E=n;break}else{Vb()}}}while(0);if((o|0)==0){break}n=c[e+(b+28)>>2]|0;h=238976+(n<<2)|0;do{if((j|0)==(c[h>>2]|0)){c[h>>2]=E;if((E|0)!=0){break}c[238676>>2]=c[238676>>2]&~(1<<n);break b}else{if(o>>>0<(c[238688>>2]|0)>>>0){Vb()}v=o+16|0;if((c[v>>2]|0)==(j|0)){c[v>>2]=E}else{c[o+20>>2]=E}if((E|0)==0){break b}}}while(0);if(E>>>0<(c[238688>>2]|0)>>>0){Vb()}c[E+24>>2]=o;j=c[e+(b+16)>>2]|0;do{if((j|0)!=0){if(j>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[E+16>>2]=j;c[j+24>>2]=E;break}}}while(0);j=c[e+(b+20)>>2]|0;if((j|0)==0){break}if(j>>>0<(c[238688>>2]|0)>>>0){Vb()}else{c[E+20>>2]=j;c[j+24>>2]=E;break}}}while(0);c[p+4>>2]=C|1;c[p+C>>2]=C;if((p|0)!=(c[238692>>2]|0)){H=C;break}c[238680>>2]=C;i=d;return}else{c[A>>2]=B&-2;c[p+4>>2]=q|1;c[p+q>>2]=q;H=q}}while(0);q=H>>>3;if(H>>>0<256){B=q<<1;A=238712+(B<<2)|0;E=c[59668]|0;b=1<<q;do{if((E&b|0)==0){c[59668]=E|b;I=238712+(B+2<<2)|0;J=A}else{q=238712+(B+2<<2)|0;e=c[q>>2]|0;if(!(e>>>0<(c[238688>>2]|0)>>>0)){I=q;J=e;break}Vb()}}while(0);c[I>>2]=p;c[J+12>>2]=p;c[p+8>>2]=J;c[p+12>>2]=A;i=d;return}A=p;J=H>>>8;do{if((J|0)==0){K=0}else{if(H>>>0>16777215){K=31;break}I=(J+1048320|0)>>>16&8;B=J<<I;b=(B+520192|0)>>>16&4;E=B<<b;B=(E+245760|0)>>>16&2;e=14-(b|I|B)+(E<<B>>>15)|0;K=H>>>(e+7|0)&1|e<<1}}while(0);J=238976+(K<<2)|0;c[p+28>>2]=K;c[p+20>>2]=0;c[p+16>>2]=0;e=c[238676>>2]|0;B=1<<K;if((e&B|0)==0){c[238676>>2]=e|B;c[J>>2]=A;c[p+24>>2]=J;c[p+12>>2]=p;c[p+8>>2]=p;i=d;return}B=c[J>>2]|0;if((K|0)==31){L=0}else{L=25-(K>>>1)|0}c:do{if((c[B+4>>2]&-8|0)==(H|0)){M=B}else{K=H<<L;J=B;while(1){N=J+(K>>>31<<2)+16|0;e=c[N>>2]|0;if((e|0)==0){break}if((c[e+4>>2]&-8|0)==(H|0)){M=e;break c}else{K=K<<1;J=e}}if(N>>>0<(c[238688>>2]|0)>>>0){Vb()}c[N>>2]=A;c[p+24>>2]=J;c[p+12>>2]=p;c[p+8>>2]=p;i=d;return}}while(0);N=M+8|0;H=c[N>>2]|0;B=c[238688>>2]|0;if(M>>>0<B>>>0){Vb()}if(H>>>0<B>>>0){Vb()}c[H+12>>2]=A;c[N>>2]=A;c[p+8>>2]=H;c[p+12>>2]=M;c[p+24>>2]=0;i=d;return}function Gm(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=(a|0)==0?1:a;while(1){e=Bm(d)|0;if((e|0)!=0){f=6;break}a=c[59792]|0;c[59792]=a+0;if((a|0)==0){f=5;break}qc[a&0]()}if((f|0)==5){d=Va(4)|0;c[d>>2]=239184;xb(d|0,239232,109)}else if((f|0)==6){i=b;return e|0}return 0}function Hm(a){a=a|0;var b=0,c=0;b=i;c=Gm(a)|0;i=b;return c|0}function Im(a){a=a|0;var b=0;b=i;if((a|0)!=0){Cm(a)}i=b;return}function Jm(a){a=a|0;var b=0;b=i;Im(a);i=b;return}function Km(a){a=a|0;var b=0;b=i;Mb(a|0);Im(a);i=b;return}function Lm(a){a=a|0;var b=0;b=i;Mb(a|0);i=b;return}function Mm(a){a=a|0;i=i;return 239200}function Nm(){var a=0;a=Va(4)|0;c[a>>2]=239184;xb(a|0,239232,109)}function Om(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0.0,U=0,V=0.0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,fa=0,ga=0,ha=0,ia=0.0,ja=0,ka=0.0,la=0,ma=0.0,na=0,oa=0.0,pa=0.0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0.0,ya=0,za=0.0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0.0,Fa=0,Ga=0.0,Ha=0.0,Ia=0,Ja=0.0,Ka=0,La=0,Na=0,Pa=0,Qa=0,Ra=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0.0,Bc=0,Cc=0,Dc=0.0,Ec=0.0,Fc=0.0,Gc=0.0,Hc=0.0,Ic=0.0,Jc=0,Kc=0,Lc=0.0,Mc=0,Nc=0.0,Oc=0;g=i;i=i+512|0;h=g;if((e|0)==2){j=53;k=-1074}else if((e|0)==1){j=53;k=-1074}else if((e|0)==0){j=24;k=-149}else{l=0.0;i=g;return+l}e=b+4|0;m=b+100|0;do{n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;o=d[n]|0}else{o=Rm(b)|0}}while((Oa(o|0)|0)!=0);do{if((o|0)==43|(o|0)==45){n=1-(((o|0)==45)<<1)|0;p=c[e>>2]|0;if(p>>>0<(c[m>>2]|0)>>>0){c[e>>2]=p+1;q=d[p]|0;r=n;break}else{q=Rm(b)|0;r=n;break}}else{q=o;r=1}}while(0);o=q;q=0;while(1){if((o|32|0)!=(a[239248+q|0]|0)){s=o;t=q;break}do{if(q>>>0<7){n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;u=d[n]|0;break}else{u=Rm(b)|0;break}}else{u=o}}while(0);n=q+1|0;if(n>>>0<8){o=u;q=n}else{s=u;t=n;break}}do{if((t|0)==3){v=23}else if((t|0)!=8){u=(f|0)==0;if(!(t>>>0<4|u)){if((t|0)==8){break}else{v=23;break}}a:do{if((t|0)==0){q=s;o=0;while(1){if((q|32|0)!=(a[239264+o|0]|0)){w=q;z=o;break a}do{if(o>>>0<2){n=c[e>>2]|0;if(n>>>0<(c[m>>2]|0)>>>0){c[e>>2]=n+1;A=d[n]|0;break}else{A=Rm(b)|0;break}}else{A=q}}while(0);n=o+1|0;if(n>>>0<3){q=A;o=n}else{w=A;z=n;break}}}else{w=s;z=t}}while(0);if((z|0)==3){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;B=d[o]|0}else{B=Rm(b)|0}if((B|0)==40){C=1}else{if((c[m>>2]|0)==0){l=x;i=g;return+l}c[e>>2]=(c[e>>2]|0)+ -1;l=x;i=g;return+l}while(1){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;D=d[o]|0}else{D=Rm(b)|0}if(!((D+ -48|0)>>>0<10|(D+ -65|0)>>>0<26)){if(!((D+ -97|0)>>>0<26|(D|0)==95)){break}}C=C+1|0}if((D|0)==41){l=x;i=g;return+l}o=(c[m>>2]|0)==0;if(!o){c[e>>2]=(c[e>>2]|0)+ -1}if(u){c[(ab()|0)>>2]=22;Qm(b,0);l=0.0;i=g;return+l}if((C|0)==0|o){l=x;i=g;return+l}else{E=C}while(1){o=E+ -1|0;c[e>>2]=(c[e>>2]|0)+ -1;if((o|0)==0){l=x;break}else{E=o}}i=g;return+l}else if((z|0)==0){do{if((w|0)==48){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;F=d[o]|0}else{F=Rm(b)|0}if((F|32|0)!=120){if((c[m>>2]|0)==0){G=48;break}c[e>>2]=(c[e>>2]|0)+ -1;G=48;break}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;H=d[o]|0;J=0}else{H=Rm(b)|0;J=0}while(1){if((H|0)==46){v=70;break}else if((H|0)!=48){K=0;L=0;M=0;N=0;O=H;P=J;Q=0;R=0;S=1.0;U=0;V=0.0;break}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;H=d[o]|0;J=1;continue}else{H=Rm(b)|0;J=1;continue}}b:do{if((v|0)==70){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;W=d[o]|0}else{W=Rm(b)|0}if((W|0)==48){X=-1;Y=-1}else{K=0;L=0;M=0;N=0;O=W;P=J;Q=1;R=0;S=1.0;U=0;V=0.0;break}while(1){o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;Z=d[o]|0}else{Z=Rm(b)|0}if((Z|0)!=48){K=X;L=Y;M=0;N=0;O=Z;P=1;Q=1;R=0;S=1.0;U=0;V=0.0;break b}o=_m(X|0,Y|0,-1,-1)|0;X=o;Y=I}}}while(0);c:while(1){o=O+ -48|0;do{if(o>>>0<10){_=o;v=84}else{q=O|32;n=(O|0)==46;if(!((q+ -97|0)>>>0<6|n)){$=O;break c}if(n){if((Q|0)==0){aa=M;ba=N;ca=M;da=N;fa=P;ga=1;ha=R;ia=S;ja=U;ka=V;break}else{$=46;break c}}else{_=(O|0)>57?q+ -87|0:o;v=84;break}}}while(0);if((v|0)==84){v=0;do{if((N|0)<0|(N|0)==0&M>>>0<8){la=R;ma=S;na=_+(U<<4)|0;oa=V}else{if((N|0)<0|(N|0)==0&M>>>0<14){pa=S*.0625;la=R;ma=pa;na=U;oa=V+pa*+(_|0);break}if(!((_|0)!=0&(R|0)==0)){la=R;ma=S;na=U;oa=V;break}la=1;ma=S;na=U;oa=V+S*.5}}while(0);o=_m(M|0,N|0,1,0)|0;aa=K;ba=L;ca=o;da=I;fa=1;ga=Q;ha=la;ia=ma;ja=na;ka=oa}o=c[e>>2]|0;if(o>>>0<(c[m>>2]|0)>>>0){c[e>>2]=o+1;K=aa;L=ba;M=ca;N=da;O=d[o]|0;P=fa;Q=ga;R=ha;S=ia;U=ja;V=ka;continue}else{K=aa;L=ba;M=ca;N=da;O=Rm(b)|0;P=fa;Q=ga;R=ha;S=ia;U=ja;V=ka;continue}}if((P|0)==0){o=(c[m>>2]|0)==0;if(!o){c[e>>2]=(c[e>>2]|0)+ -1}do{if(u){Qm(b,0)}else{if(o){break}q=c[e>>2]|0;c[e>>2]=q+ -1;if((Q|0)==0){break}c[e>>2]=q+ -2}}while(0);l=+(r|0)*0.0;i=g;return+l}o=(Q|0)==0;q=o?M:K;n=o?N:L;if((N|0)<0|(N|0)==0&M>>>0<8){o=M;p=N;qa=U;while(1){ra=qa<<4;sa=_m(o|0,p|0,1,0)|0;ta=I;if((ta|0)<0|(ta|0)==0&sa>>>0<8){qa=ra;p=ta;o=sa}else{ua=ra;break}}}else{ua=U}do{if(($|32|0)==112){o=Pm(b,f)|0;p=I;if(!((o|0)==0&(p|0)==-2147483648)){va=o;wa=p;break}if(u){Qm(b,0);l=0.0;i=g;return+l}else{if((c[m>>2]|0)==0){va=0;wa=0;break}c[e>>2]=(c[e>>2]|0)+ -1;va=0;wa=0;break}}else{if((c[m>>2]|0)==0){va=0;wa=0;break}c[e>>2]=(c[e>>2]|0)+ -1;va=0;wa=0}}while(0);p=cn(q|0,n|0,2)|0;o=_m(p|0,I|0,-32,-1)|0;p=_m(o|0,I|0,va|0,wa|0)|0;o=I;if((ua|0)==0){l=+(r|0)*0.0;i=g;return+l}if((o|0)>0|(o|0)==0&p>>>0>(0-k|0)>>>0){c[(ab()|0)>>2]=34;l=+(r|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+l}qa=k+ -106|0;ra=((qa|0)<0)<<31>>31;if((o|0)<(ra|0)|(o|0)==(ra|0)&p>>>0<qa>>>0){c[(ab()|0)>>2]=34;l=+(r|0)*2.2250738585072014e-308*2.2250738585072014e-308;i=g;return+l}if((ua|0)>-1){qa=p;ra=o;sa=ua;pa=V;while(1){ta=sa<<1;if(!(pa>=.5)){xa=pa;ya=ta}else{xa=pa+-1.0;ya=ta|1}za=pa+xa;ta=_m(qa|0,ra|0,-1,-1)|0;Aa=I;if((ya|0)>-1){qa=ta;ra=Aa;sa=ya;pa=za}else{Ba=ta;Ca=Aa;Da=ya;Ea=za;break}}}else{Ba=p;Ca=o;Da=ua;Ea=V}sa=Zm(32,0,k|0,((k|0)<0)<<31>>31|0)|0;ra=_m(Ba|0,Ca|0,sa|0,I|0)|0;sa=I;if(0>(sa|0)|0==(sa|0)&j>>>0>ra>>>0){Fa=(ra|0)<0?0:ra}else{Fa=j}do{if((Fa|0)<53){pa=+(r|0);za=+Sa(+(+Sm(1.0,84-Fa|0)),+pa);if(!((Fa|0)<32&Ea!=0.0)){Ga=pa;Ha=za;Ia=Da;Ja=Ea;break}ra=Da&1;Ga=pa;Ha=za;Ia=(ra^1)+Da|0;Ja=(ra|0)==0?0.0:Ea}else{Ga=+(r|0);Ha=0.0;Ia=Da;Ja=Ea}}while(0);za=Ga*Ja+(Ha+Ga*+(Ia>>>0))-Ha;if(!(za!=0.0)){c[(ab()|0)>>2]=34}l=+Tm(za,Ba);i=g;return+l}else{G=w}}while(0);o=k+j|0;p=0-o|0;ra=G;sa=0;while(1){if((ra|0)==46){v=139;break}else if((ra|0)!=48){Ka=ra;La=0;Na=0;Pa=sa;Qa=0;break}qa=c[e>>2]|0;if(qa>>>0<(c[m>>2]|0)>>>0){c[e>>2]=qa+1;ra=d[qa]|0;sa=1;continue}else{ra=Rm(b)|0;sa=1;continue}}d:do{if((v|0)==139){ra=c[e>>2]|0;if(ra>>>0<(c[m>>2]|0)>>>0){c[e>>2]=ra+1;Ra=d[ra]|0}else{Ra=Rm(b)|0}if((Ra|0)==48){Ta=-1;Ua=-1}else{Ka=Ra;La=0;Na=0;Pa=sa;Qa=1;break}while(1){ra=c[e>>2]|0;if(ra>>>0<(c[m>>2]|0)>>>0){c[e>>2]=ra+1;Va=d[ra]|0}else{Va=Rm(b)|0}if((Va|0)!=48){Ka=Va;La=Ta;Na=Ua;Pa=1;Qa=1;break d}ra=_m(Ta|0,Ua|0,-1,-1)|0;Ta=ra;Ua=I}}}while(0);sa=h;c[sa>>2]=0;ra=Ka+ -48|0;qa=(Ka|0)==46;e:do{if(ra>>>0<10|qa){n=h+496|0;q=Ka;Aa=qa;ta=ra;Wa=0;Xa=0;Ya=La;Za=Na;_a=Pa;$a=Qa;bb=0;cb=0;db=0;while(1){do{if(Aa){if(($a|0)==0){eb=Wa;fb=Xa;gb=Wa;hb=Xa;ib=_a;jb=1;kb=bb;lb=cb;mb=db}else{nb=q;ob=Wa;pb=Xa;qb=Ya;rb=Za;sb=_a;tb=bb;ub=cb;vb=db;break e}}else{wb=_m(Wa|0,Xa|0,1,0)|0;xb=I;yb=(q|0)!=48;if((cb|0)>=125){if(!yb){eb=Ya;fb=Za;gb=wb;hb=xb;ib=_a;jb=$a;kb=bb;lb=cb;mb=db;break}c[n>>2]=c[n>>2]|1;eb=Ya;fb=Za;gb=wb;hb=xb;ib=_a;jb=$a;kb=bb;lb=cb;mb=db;break}zb=h+(cb<<2)|0;if((bb|0)==0){Ab=ta}else{Ab=q+ -48+((c[zb>>2]|0)*10|0)|0}c[zb>>2]=Ab;zb=bb+1|0;Bb=(zb|0)==9;eb=Ya;fb=Za;gb=wb;hb=xb;ib=1;jb=$a;kb=Bb?0:zb;lb=(Bb&1)+cb|0;mb=yb?wb:db}}while(0);wb=c[e>>2]|0;if(wb>>>0<(c[m>>2]|0)>>>0){c[e>>2]=wb+1;Cb=d[wb]|0}else{Cb=Rm(b)|0}wb=Cb+ -48|0;yb=(Cb|0)==46;if(wb>>>0<10|yb){q=Cb;Aa=yb;ta=wb;Wa=gb;Xa=hb;Ya=eb;Za=fb;_a=ib;$a=jb;bb=kb;cb=lb;db=mb}else{Db=Cb;Eb=gb;Fb=hb;Gb=eb;Hb=fb;Ib=ib;Jb=jb;Kb=kb;Lb=lb;Mb=mb;v=162;break}}}else{Db=Ka;Eb=0;Fb=0;Gb=La;Hb=Na;Ib=Pa;Jb=Qa;Kb=0;Lb=0;Mb=0;v=162}}while(0);if((v|0)==162){ra=(Jb|0)==0;nb=Db;ob=Eb;pb=Fb;qb=ra?Eb:Gb;rb=ra?Fb:Hb;sb=Ib;tb=Kb;ub=Lb;vb=Mb}ra=(sb|0)!=0;do{if(ra){if((nb|32|0)!=101){v=171;break}qa=Pm(b,f)|0;db=I;do{if((qa|0)==0&(db|0)==-2147483648){if(u){Qm(b,0);l=0.0;i=g;return+l}else{if((c[m>>2]|0)==0){Nb=0;Ob=0;break}c[e>>2]=(c[e>>2]|0)+ -1;Nb=0;Ob=0;break}}else{Nb=qa;Ob=db}}while(0);db=_m(Nb|0,Ob|0,qb|0,rb|0)|0;Pb=db;Qb=I}else{v=171}}while(0);do{if((v|0)==171){if(!((nb|0)>-1)){Pb=qb;Qb=rb;break}if((c[m>>2]|0)==0){Pb=qb;Qb=rb;break}c[e>>2]=(c[e>>2]|0)+ -1;Pb=qb;Qb=rb}}while(0);if(!ra){c[(ab()|0)>>2]=22;Qm(b,0);l=0.0;i=g;return+l}u=c[sa>>2]|0;if((u|0)==0){l=+(r|0)*0.0;i=g;return+l}do{if((Pb|0)==(ob|0)&(Qb|0)==(pb|0)&((pb|0)<0|(pb|0)==0&ob>>>0<10)){if(!(j>>>0>30)){if((u>>>j|0)!=0){break}}l=+(r|0)*+(u>>>0);i=g;return+l}}while(0);u=(k|0)/-2|0;ra=((u|0)<0)<<31>>31;if((Qb|0)>(ra|0)|(Qb|0)==(ra|0)&Pb>>>0>u>>>0){c[(ab()|0)>>2]=34;l=+(r|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+l}u=k+ -106|0;ra=((u|0)<0)<<31>>31;if((Qb|0)<(ra|0)|(Qb|0)==(ra|0)&Pb>>>0<u>>>0){c[(ab()|0)>>2]=34;l=+(r|0)*2.2250738585072014e-308*2.2250738585072014e-308;i=g;return+l}if((tb|0)==0){Rb=ub}else{if((tb|0)<9){u=h+(ub<<2)|0;ra=c[u>>2]|0;db=tb;do{ra=ra*10|0;db=db+1|0;}while((db|0)!=9);c[u>>2]=ra}Rb=ub+1|0}do{if((vb|0)<9){if(!((vb|0)<=(Pb|0)&(Pb|0)<18)){break}if((Pb|0)==9){l=+(r|0)*+((c[sa>>2]|0)>>>0);i=g;return+l}if((Pb|0)<9){l=+(r|0)*+((c[sa>>2]|0)>>>0)/+(c[239280+(8-Pb<<2)>>2]|0);i=g;return+l}db=j+27+(ea(Pb,-3)|0)|0;qa=c[sa>>2]|0;if((db|0)<=30){if((qa>>>db|0)!=0){break}}l=+(r|0)*+(qa>>>0)*+(c[239280+(Pb+ -10<<2)>>2]|0);i=g;return+l}}while(0);sa=(Pb|0)%9|0;if((sa|0)==0){Sb=0;Tb=0;Ub=Pb;Vb=Rb}else{ra=(Pb|0)>-1?sa:sa+9|0;sa=c[239280+(8-ra<<2)>>2]|0;do{if((Rb|0)==0){Wb=0;Xb=Pb;Yb=0}else{u=1e9/(sa|0)|0;qa=0;db=0;cb=0;bb=Pb;while(1){$a=h+(cb<<2)|0;_a=c[$a>>2]|0;Za=((_a>>>0)/(sa>>>0)|0)+db|0;c[$a>>2]=Za;Zb=ea((_a>>>0)%(sa>>>0)|0,u)|0;_a=cb+1|0;if((cb|0)==(qa|0)&(Za|0)==0){_b=_a&127;$b=bb+ -9|0}else{_b=qa;$b=bb}if((_a|0)==(Rb|0)){break}else{qa=_b;bb=$b;cb=_a;db=Zb}}if((Zb|0)==0){Wb=_b;Xb=$b;Yb=Rb;break}c[h+(Rb<<2)>>2]=Zb;Wb=_b;Xb=$b;Yb=Rb+1|0}}while(0);Sb=Wb;Tb=0;Ub=9-ra+Xb|0;Vb=Yb}f:while(1){sa=h+(Sb<<2)|0;if((Ub|0)<18){db=Tb;cb=Vb;while(1){bb=0;qa=cb+127|0;u=cb;while(1){_a=qa&127;Za=h+(_a<<2)|0;$a=cn(c[Za>>2]|0,0,29)|0;Ya=_m($a|0,I|0,bb|0,0)|0;$a=I;if($a>>>0>0|($a|0)==0&Ya>>>0>1e9){Xa=mn(Ya|0,$a|0,1e9,0)|0;Wa=nn(Ya|0,$a|0,1e9,0)|0;ac=Wa;bc=Xa}else{ac=Ya;bc=0}c[Za>>2]=ac;Za=(_a|0)==(Sb|0);if((_a|0)!=(u+127&127|0)|Za){cc=u}else{cc=(ac|0)==0?_a:u}if(Za){break}else{bb=bc;qa=_a+ -1|0;u=cc}}u=db+ -29|0;if((bc|0)==0){db=u;cb=cc}else{dc=u;ec=bc;fc=cc;break}}}else{if((Ub|0)==18){gc=Tb;hc=Vb}else{ic=Sb;jc=Tb;kc=Ub;lc=Vb;break}while(1){if(!((c[sa>>2]|0)>>>0<9007199)){ic=Sb;jc=gc;kc=18;lc=hc;break f}cb=0;db=hc+127|0;u=hc;while(1){qa=db&127;bb=h+(qa<<2)|0;_a=cn(c[bb>>2]|0,0,29)|0;Za=_m(_a|0,I|0,cb|0,0)|0;_a=I;if(_a>>>0>0|(_a|0)==0&Za>>>0>1e9){Ya=mn(Za|0,_a|0,1e9,0)|0;Xa=nn(Za|0,_a|0,1e9,0)|0;mc=Xa;nc=Ya}else{mc=Za;nc=0}c[bb>>2]=mc;bb=(qa|0)==(Sb|0);if((qa|0)!=(u+127&127|0)|bb){oc=u}else{oc=(mc|0)==0?qa:u}if(bb){break}else{cb=nc;db=qa+ -1|0;u=oc}}u=gc+ -29|0;if((nc|0)==0){gc=u;hc=oc}else{dc=u;ec=nc;fc=oc;break}}}sa=Sb+127&127;if((sa|0)==(fc|0)){u=fc+127&127;db=h+((fc+126&127)<<2)|0;c[db>>2]=c[db>>2]|c[h+(u<<2)>>2];pc=u}else{pc=fc}c[h+(sa<<2)>>2]=ec;Sb=sa;Tb=dc;Ub=Ub+9|0;Vb=pc}g:while(1){qc=lc+1&127;ra=h+((lc+127&127)<<2)|0;sa=ic;u=jc;db=kc;while(1){cb=(db|0)==18;qa=(db|0)>27?9:1;rc=sa;sc=u;while(1){bb=0;while(1){Za=bb+rc&127;if((Za|0)==(lc|0)){tc=2;break}Ya=c[h+(Za<<2)>>2]|0;Za=c[239272+(bb<<2)>>2]|0;if(Ya>>>0<Za>>>0){tc=2;break}Xa=bb+1|0;if(Ya>>>0>Za>>>0){tc=bb;break}if((Xa|0)<2){bb=Xa}else{tc=Xa;break}}if((tc|0)==2&cb){break g}uc=qa+sc|0;if((rc|0)==(lc|0)){rc=lc;sc=uc}else{break}}cb=(1<<qa)+ -1|0;bb=1e9>>>qa;vc=rc;wc=0;Xa=rc;xc=db;do{Za=h+(Xa<<2)|0;Ya=c[Za>>2]|0;_a=(Ya>>>qa)+wc|0;c[Za>>2]=_a;wc=ea(Ya&cb,bb)|0;Ya=(Xa|0)==(vc|0)&(_a|0)==0;Xa=Xa+1&127;xc=Ya?xc+ -9|0:xc;vc=Ya?Xa:vc;}while((Xa|0)!=(lc|0));if((wc|0)==0){sa=vc;u=uc;db=xc;continue}if((qc|0)!=(vc|0)){break}c[ra>>2]=c[ra>>2]|1;sa=vc;u=uc;db=xc}c[h+(lc<<2)>>2]=wc;ic=vc;jc=uc;kc=xc;lc=qc}db=rc&127;if((db|0)==(lc|0)){c[h+(qc+ -1<<2)>>2]=0;yc=qc}else{yc=lc}za=+((c[h+(db<<2)>>2]|0)>>>0);db=rc+1&127;if((db|0)==(yc|0)){u=yc+1&127;c[h+(u+ -1<<2)>>2]=0;zc=u}else{zc=yc}pa=+(r|0);Ac=pa*(za*1.0e9+ +((c[h+(db<<2)>>2]|0)>>>0));db=sc+53|0;u=db-k|0;if((u|0)<(j|0)){Bc=(u|0)<0?0:u;Cc=1}else{Bc=j;Cc=0}if((Bc|0)<53){za=+Sa(+(+Sm(1.0,105-Bc|0)),+Ac);Dc=+Ma(+Ac,+(+Sm(1.0,53-Bc|0)));Ec=za;Fc=Dc;Gc=za+(Ac-Dc)}else{Ec=0.0;Fc=0.0;Gc=Ac}sa=rc+2&127;do{if((sa|0)==(zc|0)){Hc=Fc}else{ra=c[h+(sa<<2)>>2]|0;do{if(ra>>>0<5e8){if((ra|0)==0){if((rc+3&127|0)==(zc|0)){Ic=Fc;break}}Ic=pa*.25+Fc}else{if(ra>>>0>5e8){Ic=pa*.75+Fc;break}if((rc+3&127|0)==(zc|0)){Ic=pa*.5+Fc;break}else{Ic=pa*.75+Fc;break}}}while(0);if((53-Bc|0)<=1){Hc=Ic;break}if(+Ma(+Ic,1.0)!=0.0){Hc=Ic;break}Hc=Ic+1.0}}while(0);pa=Gc+Hc-Ec;do{if((db&2147483647|0)>(-2-o|0)){if(!(+T(+pa)>=9007199254740992.0)){Jc=Cc;Kc=sc;Lc=pa}else{Jc=(Cc|0)!=0&(Bc|0)==(u|0)?0:Cc;Kc=sc+1|0;Lc=pa*.5}if((Kc+50|0)<=(p|0)){if(!((Jc|0)!=0&Hc!=0.0)){Mc=Kc;Nc=Lc;break}}c[(ab()|0)>>2]=34;Mc=Kc;Nc=Lc}else{Mc=sc;Nc=pa}}while(0);l=+Tm(Nc,Mc);i=g;return+l}else{if((c[m>>2]|0)!=0){c[e>>2]=(c[e>>2]|0)+ -1}c[(ab()|0)>>2]=22;Qm(b,0);l=0.0;i=g;return+l}}}while(0);do{if((v|0)==23){b=(c[m>>2]|0)==0;if(!b){c[e>>2]=(c[e>>2]|0)+ -1}if(t>>>0<4|(f|0)==0|b){break}else{Oc=t}do{c[e>>2]=(c[e>>2]|0)+ -1;Oc=Oc+ -1|0;}while(Oc>>>0>3)}}while(0);l=+(r|0)*y;i=g;return+l}function Pm(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=i;f=a+4|0;g=c[f>>2]|0;h=a+100|0;if(g>>>0<(c[h>>2]|0)>>>0){c[f>>2]=g+1;j=d[g]|0}else{j=Rm(a)|0}do{if((j|0)==43|(j|0)==45){g=(j|0)==45|0;k=c[f>>2]|0;if(k>>>0<(c[h>>2]|0)>>>0){c[f>>2]=k+1;l=d[k]|0}else{l=Rm(a)|0}if((l+ -48|0)>>>0<10|(b|0)==0){m=l;n=g;break}if((c[h>>2]|0)==0){m=l;n=g;break}c[f>>2]=(c[f>>2]|0)+ -1;m=l;n=g}else{m=j;n=0}}while(0);if((m+ -48|0)>>>0>9){if((c[h>>2]|0)==0){o=0;p=-2147483648;I=p;i=e;return o|0}c[f>>2]=(c[f>>2]|0)+ -1;o=0;p=-2147483648;I=p;i=e;return o|0}else{q=m;r=0}while(1){s=q+ -48+r|0;m=c[f>>2]|0;if(m>>>0<(c[h>>2]|0)>>>0){c[f>>2]=m+1;t=d[m]|0}else{t=Rm(a)|0}if(!((t+ -48|0)>>>0<10&(s|0)<214748364)){break}q=t;r=s*10|0}r=((s|0)<0)<<31>>31;if((t+ -48|0)>>>0<10){q=s;m=r;j=t;while(1){l=ln(q|0,m|0,10,0)|0;b=I;g=_m(j|0,((j|0)<0)<<31>>31|0,-48,-1)|0;k=_m(g|0,I|0,l|0,b|0)|0;b=I;l=c[f>>2]|0;if(l>>>0<(c[h>>2]|0)>>>0){c[f>>2]=l+1;u=d[l]|0}else{u=Rm(a)|0}if((u+ -48|0)>>>0<10&((b|0)<21474836|(b|0)==21474836&k>>>0<2061584302)){j=u;m=b;q=k}else{v=k;w=b;x=u;break}}}else{v=s;w=r;x=t}if((x+ -48|0)>>>0<10){do{x=c[f>>2]|0;if(x>>>0<(c[h>>2]|0)>>>0){c[f>>2]=x+1;y=d[x]|0}else{y=Rm(a)|0}}while((y+ -48|0)>>>0<10)}if((c[h>>2]|0)!=0){c[f>>2]=(c[f>>2]|0)+ -1}f=(n|0)!=0;n=Zm(0,0,v|0,w|0)|0;o=f?n:v;p=f?I:w;I=p;i=e;return o|0}function Qm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;c[a+104>>2]=b;e=c[a+8>>2]|0;f=c[a+4>>2]|0;g=e-f|0;c[a+108>>2]=g;if((b|0)!=0&(g|0)>(b|0)){c[a+100>>2]=f+b;i=d;return}else{c[a+100>>2]=e;i=d;return}}function Rm(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;f=b+104|0;g=c[f>>2]|0;if((g|0)==0){h=3}else{if((c[b+108>>2]|0)<(g|0)){h=3}}do{if((h|0)==3){g=Vm(b)|0;if((g|0)<0){break}j=c[f>>2]|0;k=c[b+8>>2]|0;do{if((j|0)==0){h=8}else{l=c[b+4>>2]|0;m=j-(c[b+108>>2]|0)+ -1|0;if((k-l|0)<=(m|0)){h=8;break}c[b+100>>2]=l+m}}while(0);if((h|0)==8){c[b+100>>2]=k}j=c[b+4>>2]|0;if((k|0)!=0){m=b+108|0;c[m>>2]=k+1-j+(c[m>>2]|0)}m=j+ -1|0;if((d[m]|0|0)==(g|0)){n=g;i=e;return n|0}a[m]=g;n=g;i=e;return n|0}}while(0);c[b+100>>2]=0;n=-1;i=e;return n|0}function Sm(a,b){a=+a;b=b|0;var d=0,e=0.0,f=0,g=0,j=0.0;d=i;do{if((b|0)>1023){e=a*8.98846567431158e+307;f=b+ -1023|0;if((f|0)<=1023){g=f;j=e;break}f=b+ -2046|0;g=(f|0)>1023?1023:f;j=e*8.98846567431158e+307}else{if(!((b|0)<-1022)){g=b;j=a;break}e=a*2.2250738585072014e-308;f=b+1022|0;if(!((f|0)<-1022)){g=f;j=e;break}f=b+2044|0;g=(f|0)<-1022?-1022:f;j=e*2.2250738585072014e-308}}while(0);b=cn(g+1023|0,0,52)|0;g=I;c[k>>2]=b;c[k+4>>2]=g;a=j*+h[k>>3];i=d;return+a}function Tm(a,b){a=+a;b=b|0;var c=0,d=0.0;c=i;d=+Sm(a,b);i=c;return+d}function Um(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=b+74|0;f=a[e]|0;a[e]=f+255|f;f=b+20|0;e=b+44|0;if((c[f>>2]|0)>>>0>(c[e>>2]|0)>>>0){gc[c[b+36>>2]&31](b,0,0)|0}c[b+16>>2]=0;c[b+28>>2]=0;c[f>>2]=0;f=b;g=c[f>>2]|0;if((g&20|0)==0){h=c[e>>2]|0;c[b+8>>2]=h;c[b+4>>2]=h;j=0;i=d;return j|0}if((g&4|0)==0){j=-1;i=d;return j|0}c[f>>2]=g|32;j=-1;i=d;return j|0}function Vm(a){a=a|0;var b=0,e=0,f=0,g=0;b=i;i=i+8|0;e=b;if((c[a+8>>2]|0)==0){if((Um(a)|0)==0){f=3}else{g=-1}}else{f=3}do{if((f|0)==3){if((gc[c[a+32>>2]&31](a,e,1)|0)!=1){g=-1;break}g=d[e]|0}}while(0);i=b;return g|0}function Wm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0.0,j=0,k=0;d=i;i=i+112|0;e=d;f=e+0|0;g=f+112|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));f=e+4|0;c[f>>2]=a;g=e+8|0;c[g>>2]=-1;c[e+44>>2]=a;c[e+76>>2]=-1;Qm(e,0);h=+Om(e,2,1);j=(c[f>>2]|0)-(c[g>>2]|0)+(c[e+108>>2]|0)|0;if((b|0)==0){i=d;return+h}if((j|0)==0){k=a}else{k=a+j|0}c[b>>2]=k;i=d;return+h}function Xm(){c[56816]=o;c[56842]=o;c[59580]=o;c[59810]=o}function Ym(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function Zm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return(I=e,a-c>>>0|0)|0}function _m(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return(I=b+d+(e>>>0<a>>>0|0)>>>0,e|0)|0}function $m(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return nb(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function an(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b]=a[c]|0}b=e}else{$m(b,c,d)|0}return b|0}function bn(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function cn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}I=a<<c-32;return 0}function dn(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}I=0;return b>>>c-32|0}function en(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b>>c;return a>>>c|(b&(1<<c)-1)<<32-c}I=(b|0)<0?-1:0;return b>>c-32|0}function fn(b){b=b|0;var c=0;c=a[n+(b>>>24)|0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)|0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)|0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)|0]|0)+24|0}function gn(b){b=b|0;var c=0;c=a[m+(b&255)|0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)|0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)|0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)|0]|0)+24|0}function hn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=ea(d,c)|0;f=a>>>16;a=(e>>>16)+(ea(d,f)|0)|0;d=b>>>16;b=ea(d,c)|0;return(I=(a>>>16)+(ea(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function jn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=Zm(e^a,f^b,e,f)|0;b=I;a=g^e;e=h^f;f=Zm((on(i,b,Zm(g^c,h^d,g,h)|0,I,0)|0)^a,I^e,a,e)|0;return(I=I,f)|0}function kn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+8|0;g=f|0;h=b>>31|((b|0)<0?-1:0)<<1;j=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;k=e>>31|((e|0)<0?-1:0)<<1;l=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;m=Zm(h^a,j^b,h,j)|0;b=I;on(m,b,Zm(k^d,l^e,k,l)|0,I,g)|0;l=Zm(c[g>>2]^h,c[g+4>>2]^j,h,j)|0;j=I;i=f;return(I=j,l)|0}function ln(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=hn(e,a)|0;f=I;return(I=(ea(b,a)|0)+(ea(d,e)|0)+f|f&0,c|0|0)|0}function mn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=on(a,b,c,d,0)|0;return(I=I,e)|0}function nn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+8|0;g=f|0;on(a,b,d,e,g)|0;i=f;return(I=c[g+4>>2]|0,c[g>>2]|0)|0}function on(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0;g=a;h=b;i=h;j=d;k=e;l=k;if((i|0)==0){m=(f|0)!=0;if((l|0)==0){if(m){c[f>>2]=(g>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return(I=n,o)|0}else{if(!m){n=0;o=0;return(I=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return(I=n,o)|0}}m=(l|0)==0;do{if((j|0)==0){if(m){if((f|0)!=0){c[f>>2]=(i>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return(I=n,o)|0}if((g|0)==0){if((f|0)!=0){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(l>>>0)}n=0;o=(i>>>0)/(l>>>0)>>>0;return(I=n,o)|0}p=l-1|0;if((p&l|0)==0){if((f|0)!=0){c[f>>2]=a|0;c[f+4>>2]=p&i|b&0}n=0;o=i>>>((gn(l|0)|0)>>>0);return(I=n,o)|0}p=(fn(l|0)|0)-(fn(i|0)|0)|0;if(p>>>0<=30){q=p+1|0;r=31-p|0;s=q;t=i<<r|g>>>(q>>>0);u=i>>>(q>>>0);v=0;w=g<<r;break}if((f|0)==0){n=0;o=0;return(I=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(I=n,o)|0}else{if(!m){r=(fn(l|0)|0)-(fn(i|0)|0)|0;if(r>>>0<=31){q=r+1|0;p=31-r|0;x=r-31>>31;s=q;t=g>>>(q>>>0)&x|i<<p;u=i>>>(q>>>0)&x;v=0;w=g<<p;break}if((f|0)==0){n=0;o=0;return(I=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return(I=n,o)|0}p=j-1|0;if((p&j|0)!=0){x=(fn(j|0)|0)+33-(fn(i|0)|0)|0;q=64-x|0;r=32-x|0;y=r>>31;z=x-32|0;A=z>>31;s=x;t=r-1>>31&i>>>(z>>>0)|(i<<r|g>>>(x>>>0))&A;u=A&i>>>(x>>>0);v=g<<q&y;w=(i<<q|g>>>(z>>>0))&y|g<<r&x-33>>31;break}if((f|0)!=0){c[f>>2]=p&g;c[f+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return(I=n,o)|0}else{p=gn(j|0)|0;n=i>>>(p>>>0)|0;o=i<<32-p|g>>>(p>>>0)|0;return(I=n,o)|0}}}while(0);if((s|0)==0){B=w;C=v;D=u;E=t;F=0;G=0}else{g=d|0|0;d=k|e&0;e=_m(g,d,-1,-1)|0;k=I;i=w;w=v;v=u;u=t;t=s;s=0;while(1){H=w>>>31|i<<1;J=s|w<<1;j=u<<1|i>>>31|0;a=u>>>31|v<<1|0;Zm(e,k,j,a)|0;b=I;h=b>>31|((b|0)<0?-1:0)<<1;K=h&1;L=Zm(j,a,h&g,(((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1)&d)|0;M=I;b=t-1|0;if((b|0)==0){break}else{i=H;w=J;v=M;u=L;t=b;s=K}}B=H;C=J;D=M;E=L;F=0;G=K}K=C;C=0;if((f|0)!=0){c[f>>2]=E;c[f+4>>2]=D}n=(K|0)>>>31|(B|C)<<1|(C<<1|K>>>31)&0|F;o=(K<<1|0>>>31)&-2|G;return(I=n,o)|0}function pn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return gc[a&31](b|0,c|0,d|0)|0}function qn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;hc[a&63](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function rn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ic[a&3](b|0,c|0,d|0,e|0,f|0)}function sn(a,b){a=a|0;b=b|0;jc[a&127](b|0)}function tn(a,b,c){a=a|0;b=b|0;c=c|0;kc[a&63](b|0,c|0)}function un(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;lc[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function vn(a,b){a=a|0;b=b|0;return mc[a&63](b|0)|0}function wn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=+h;nc[a&3](b|0,c|0,d|0,e|0,f|0,g|0,+h)}function xn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;oc[a&3](b|0,c|0,d|0)}function yn(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;pc[a&7](b|0,c|0,d|0,e|0,f|0,+g)}function zn(a){a=a|0;qc[a&0]()}function An(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;return rc[a&15](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)|0}function Bn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return sc[a&7](b|0,c|0,d|0,e|0)|0}function Cn(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;tc[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)}function Dn(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;uc[a&15](b|0,c|0,d|0,e|0,f|0,g|0)}function En(a,b,c){a=a|0;b=b|0;c=c|0;return vc[a&15](b|0,c|0)|0}function Fn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return wc[a&15](b|0,c|0,d|0,e|0,f|0)|0}function Gn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;xc[a&7](b|0,c|0,d|0,e|0)}function Hn(a,b,c){a=a|0;b=b|0;c=c|0;fa(0);return 0}function In(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;fa(1)}function Jn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;fa(2)}function Kn(a){a=a|0;fa(3)}function Ln(a,b){a=a|0;b=b|0;fa(4)}function Mn(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;fa(5)}function Nn(a){a=a|0;fa(6);return 0}function On(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;fa(7)}function Pn(a,b,c){a=a|0;b=b|0;c=c|0;fa(8)}function Qn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;fa(9)}function Rn(){fa(10)}function Sn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;fa(11);return 0}function Tn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;fa(12);return 0}function Un(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;fa(13)}function Vn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;fa(14)}function Wn(a,b){a=a|0;b=b|0;fa(15);return 0}function Xn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;fa(16);return 0}function Yn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;fa(17)}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nvar gc=[Hn,Ze,cf,od,gf,Le,Qe,Cd,Ue,ae,be,Tf,Yf,zj,Ej,jk,lk,ok,Wj,$j,bk,ek,qm,Hn,Hn,Hn,Hn,Hn,Hn,Hn,Hn,Hn];var hc=[In,$f,bg,dg,fg,hg,jg,lg,ng,pg,rg,tg,yg,Ag,Cg,Eg,Gg,Ig,Kg,Mg,Og,Qg,Sg,eh,gh,sh,uh,Dh,Eh,Fh,Gh,Hh,Qh,Rh,Sh,Th,Uh,qj,wj,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In,In];var ic=[Jn,xm,wm,vm];var jc=[Kn,kd,ld,rd,sd,yd,zd,Fd,Gd,Sd,Rd,Xd,Wd,Zd,ge,fe,Je,Ie,Xe,We,kf,jf,mf,lf,qf,pf,sf,rf,vf,uf,xf,wf,Df,Cf,Ff,Ef,Lf,Kf,Fe,Mf,Jf,Nf,Pf,Of,Tj,Vf,Uf,_f,Zf,xg,wg,$g,_g,nh,mh,Bh,Ah,Oh,Nh,_h,Zh,bi,ai,fi,ei,qi,pi,Bi,Ai,Mi,Li,Xi,Wi,fj,ej,mj,lj,sj,rj,yj,xj,Dj,Cj,Mj,Lj,hk,gk,Hj,yk,dl,cl,fl,el,Qf,Sj,Vj,qk,Gk,Rk,al,bl,im,hm,km,nm,lm,mm,om,pm,Lm,Km,jd,Uj,Nl,Zi,Cm,Ul,Tl,Sl,Rl,Ql,Pl,me,xe,Kn,Kn,Kn,Kn];var kc=[Ln,md,td,Ad,Hd,Ke,Ye,ii,ji,ki,li,ni,oi,ti,ui,vi,wi,yi,zi,Ei,Fi,Gi,Hi,Ji,Ki,Pi,Qi,Ri,Si,Ui,Vi,Bj,Gj,kl,ml,ol,ll,nl,pl,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln,Ln];var lc=[Mn,Ih,Vh,Mn];var mc=[Nn,nd,bf,df,ef,af,ud,vd,Bd,Pe,Re,Se,Oe,Id,Jd,Td,Yd,Hf,Ch,ql,sl,ul,Al,Cl,wl,yl,Ph,rl,tl,vl,Bl,Dl,xl,zl,gi,hi,mi,ri,si,xi,Ci,Di,Ii,Ni,Oi,Ti,Ck,Dk,Fk,gl,il,hl,jl,uk,vk,xk,Mk,Nk,Qk,Xk,Yk,$k,jm,Mm];var nc=[On,nj,tj,On];var oc=[Pn,$d,If,Pn];var pc=[Qn,hh,kh,vh,xh,Qn,Qn,Qn];var qc=[Rn];var rc=[Sn,zk,Ak,rk,sk,Hk,Jk,Sk,Uk,Sn,Sn,Sn,Sn,Sn,Sn,Sn];var sc=[Tn,nk,Xj,Yj,Zj,dk,Tn,Tn];var tc=[Un,$h,ci,Yi,aj,gj,ij,Un];var uc=[Vn,_e,Me,ah,bh,fh,lh,oh,ph,th,yh,Aj,Fj,Am,zm,ym];var vc=[Wn,ff,pd,wd,hf,Te,Dd,Kd,Ve,ik,kk,mk,_j,ak,ck,Wn];var wc=[Xn,Rf,Wf,pk,Bk,Ek,fk,tk,wk,Lk,Ok,Wk,Zk,Xn,Xn,Xn];var xc=[Yn,$e,Ne,Sf,Xf,rm,sm,tm];return{_i64Subtract:Zm,_free:Cm,_main:dd,_realloc:Dm,_i64Add:_m,_memmove:an,_strlen:bn,_memset:Ym,_malloc:Bm,_memcpy:$m,_bitshift64Shl:cn,__GLOBAL__I_a:Md,runPostSets:Xm,stackAlloc:yc,stackSave:zc,stackRestore:Ac,setThrew:Bc,setTempRet0:Ec,setTempRet1:Fc,setTempRet2:Gc,setTempRet3:Hc,setTempRet4:Ic,setTempRet5:Jc,setTempRet6:Kc,setTempRet7:Lc,setTempRet8:Mc,setTempRet9:Nc,dynCall_iiii:pn,dynCall_viiiiiii:qn,dynCall_viiiii:rn,dynCall_vi:sn,dynCall_vii:tn,dynCall_viiiiiiiii:un,dynCall_ii:vn,dynCall_viiiiiid:wn,dynCall_viii:xn,dynCall_viiiiid:yn,dynCall_v:zn,dynCall_iiiiiiiii:An,dynCall_iiiii:Bn,dynCall_viiiiiiii:Cn,dynCall_viiiiii:Dn,dynCall_iii:En,dynCall_iiiiii:Fn,dynCall_viiii:Gn}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"invoke_iiii\": invoke_iiii, \"invoke_viiiiiii\": invoke_viiiiiii, \"invoke_viiiii\": invoke_viiiii, \"invoke_vi\": invoke_vi, \"invoke_vii\": invoke_vii, \"invoke_viiiiiiiii\": invoke_viiiiiiiii, \"invoke_ii\": invoke_ii, \"invoke_viiiiiid\": invoke_viiiiiid, \"invoke_viii\": invoke_viii, \"invoke_viiiiid\": invoke_viiiiid, \"invoke_v\": invoke_v, \"invoke_iiiiiiiii\": invoke_iiiiiiiii, \"invoke_iiiii\": invoke_iiiii, \"invoke_viiiiiiii\": invoke_viiiiiiii, \"invoke_viiiiii\": invoke_viiiiii, \"invoke_iii\": invoke_iii, \"invoke_iiiiii\": invoke_iiiiii, \"invoke_viiii\": invoke_viiii, \"_fabs\": _fabs, \"_pthread_cond_wait\": _pthread_cond_wait, \"_freelocale\": _freelocale, \"__formatString\": __formatString, \"_asprintf\": _asprintf, \"_send\": _send, \"_strtoll_l\": _strtoll_l, \"_vsscanf\": _vsscanf, \"___ctype_b_loc\": ___ctype_b_loc, \"__ZSt9terminatev\": __ZSt9terminatev, \"_fmod\": _fmod, \"___cxa_guard_acquire\": ___cxa_guard_acquire, \"_isspace\": _isspace, \"___setErrNo\": ___setErrNo, \"___cxa_is_number_type\": ___cxa_is_number_type, \"_atexit\": _atexit, \"_copysign\": _copysign, \"_ungetc\": _ungetc, \"___cxa_free_exception\": ___cxa_free_exception, \"___cxa_allocate_exception\": ___cxa_allocate_exception, \"__ZSt18uncaught_exceptionv\": __ZSt18uncaught_exceptionv, \"_isxdigit_l\": _isxdigit_l, \"___ctype_toupper_loc\": ___ctype_toupper_loc, \"_fflush\": _fflush, \"___cxa_guard_release\": ___cxa_guard_release, \"__addDays\": __addDays, \"___errno_location\": ___errno_location, \"_strtoll\": _strtoll, \"_strerror_r\": _strerror_r, \"_strftime_l\": _strftime_l, \"_llvm_lifetime_start\": _llvm_lifetime_start, \"_isdigit\": _isdigit, \"_sscanf\": _sscanf, \"_sbrk\": _sbrk, \"_uselocale\": _uselocale, \"_catgets\": _catgets, \"_newlocale\": _newlocale, \"_snprintf\": _snprintf, \"___cxa_begin_catch\": ___cxa_begin_catch, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"_fileno\": _fileno, \"_pread\": _pread, \"___resumeException\": ___resumeException, \"___cxa_find_matching_catch\": ___cxa_find_matching_catch, \"__exit\": __exit, \"_strtoull\": _strtoull, \"_isdigit_l\": _isdigit_l, \"_strftime\": _strftime, \"__arraySum\": __arraySum, \"___cxa_throw\": ___cxa_throw, \"___ctype_tolower_loc\": ___ctype_tolower_loc, \"___cxa_end_catch\": ___cxa_end_catch, \"_pthread_mutex_unlock\": _pthread_mutex_unlock, \"_fread\": _fread, \"_pthread_cond_broadcast\": _pthread_cond_broadcast, \"_isxdigit\": _isxdigit, \"_sprintf\": _sprintf, \"__reallyNegative\": __reallyNegative, \"_vasprintf\": _vasprintf, \"_write\": _write, \"__isLeapYear\": __isLeapYear, \"__scanString\": __scanString, \"_recv\": _recv, \"_vsnprintf\": _vsnprintf, \"__ZNSt9exceptionD2Ev\": __ZNSt9exceptionD2Ev, \"_fgetc\": _fgetc, \"_strtoull_l\": _strtoull_l, \"_mkport\": _mkport, \"___cxa_does_inherit\": ___cxa_does_inherit, \"_sysconf\": _sysconf, \"_read\": _read, \"___cxa_rethrow\": ___cxa_rethrow, \"__parseInt64\": __parseInt64, \"_abort\": _abort, \"_catclose\": _catclose, \"_fwrite\": _fwrite, \"_time\": _time, \"_pthread_mutex_lock\": _pthread_mutex_lock, \"_strerror\": _strerror, \"_gettimeofday\": _gettimeofday, \"_llvm_lifetime_end\": _llvm_lifetime_end, \"_pwrite\": _pwrite, \"_catopen\": _catopen, \"_exit\": _exit, \"__getFloat\": __getFloat, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"cttz_i8\": cttz_i8, \"ctlz_i8\": ctlz_i8, \"NaN\": NaN, \"Infinity\": Infinity, \"__ZTISt9exception\": __ZTISt9exception, \"___dso_handle\": ___dso_handle, \"_stderr\": _stderr, \"_stdin\": _stdin, \"_stdout\": _stdout }, buffer);\nvar _i64Subtract = Module[\"_i64Subtract\"] = asm[\"_i64Subtract\"];\nvar _free = Module[\"_free\"] = asm[\"_free\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _realloc = Module[\"_realloc\"] = asm[\"_realloc\"];\nvar _i64Add = Module[\"_i64Add\"] = asm[\"_i64Add\"];\nvar _memmove = Module[\"_memmove\"] = asm[\"_memmove\"];\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar _malloc = Module[\"_malloc\"] = asm[\"_malloc\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _bitshift64Shl = Module[\"_bitshift64Shl\"] = asm[\"_bitshift64Shl\"];\nvar __GLOBAL__I_a = Module[\"__GLOBAL__I_a\"] = asm[\"__GLOBAL__I_a\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\nvar dynCall_iiii = Module[\"dynCall_iiii\"] = asm[\"dynCall_iiii\"];\nvar dynCall_viiiiiii = Module[\"dynCall_viiiiiii\"] = asm[\"dynCall_viiiiiii\"];\nvar dynCall_viiiii = Module[\"dynCall_viiiii\"] = asm[\"dynCall_viiiii\"];\nvar dynCall_vi = Module[\"dynCall_vi\"] = asm[\"dynCall_vi\"];\nvar dynCall_vii = Module[\"dynCall_vii\"] = asm[\"dynCall_vii\"];\nvar dynCall_viiiiiiiii = Module[\"dynCall_viiiiiiiii\"] = asm[\"dynCall_viiiiiiiii\"];\nvar dynCall_ii = Module[\"dynCall_ii\"] = asm[\"dynCall_ii\"];\nvar dynCall_viiiiiid = Module[\"dynCall_viiiiiid\"] = asm[\"dynCall_viiiiiid\"];\nvar dynCall_viii = Module[\"dynCall_viii\"] = asm[\"dynCall_viii\"];\nvar dynCall_viiiiid = Module[\"dynCall_viiiiid\"] = asm[\"dynCall_viiiiid\"];\nvar dynCall_v = Module[\"dynCall_v\"] = asm[\"dynCall_v\"];\nvar dynCall_iiiiiiiii = Module[\"dynCall_iiiiiiiii\"] = asm[\"dynCall_iiiiiiiii\"];\nvar dynCall_iiiii = Module[\"dynCall_iiiii\"] = asm[\"dynCall_iiiii\"];\nvar dynCall_viiiiiiii = Module[\"dynCall_viiiiiiii\"] = asm[\"dynCall_viiiiiiii\"];\nvar dynCall_viiiiii = Module[\"dynCall_viiiiii\"] = asm[\"dynCall_viiiiii\"];\nvar dynCall_iii = Module[\"dynCall_iii\"] = asm[\"dynCall_iii\"];\nvar dynCall_iiiiii = Module[\"dynCall_iiiiii\"] = asm[\"dynCall_iiiiii\"];\nvar dynCall_viiii = Module[\"dynCall_viiii\"] = asm[\"dynCall_viiii\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// TODO: strip out parts of this we do not need\n\n//======= begin closure i64 code =======\n\n// Copyright 2009 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Defines a Long class for representing a 64-bit two's-complement\n * integer value, which faithfully simulates the behavior of a Java \"long\". This\n * implementation is derived from LongLib in GWT.\n *\n */\n\nvar i64Math = (function() { // Emscripten wrapper\n var goog = { math: {} };\n\n\n /**\n * Constructs a 64-bit two's-complement integer, given its low and high 32-bit\n * values as *signed* integers. See the from* functions below for more\n * convenient ways of constructing Longs.\n *\n * The internal representation of a long is the two given signed, 32-bit values.\n * We use 32-bit pieces because these are the size of integers on which\n * Javascript performs bit-operations. For operations like addition and\n * multiplication, we split each number into 16-bit pieces, which can easily be\n * multiplied within Javascript's floating-point representation without overflow\n * or change in sign.\n *\n * In the algorithms below, we frequently reduce the negative case to the\n * positive case by negating the input(s) and then post-processing the result.\n * Note that we must ALWAYS check specially whether those values are MIN_VALUE\n * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n * a positive number, it overflows back into a negative). Not handling this\n * case would often result in infinite recursion.\n *\n * @param {number} low The low (signed) 32 bits of the long.\n * @param {number} high The high (signed) 32 bits of the long.\n * @constructor\n */\n goog.math.Long = function(low, high) {\n /**\n * @type {number}\n * @private\n */\n this.low_ = low | 0; // force into 32 signed bits.\n\n /**\n * @type {number}\n * @private\n */\n this.high_ = high | 0; // force into 32 signed bits.\n };\n\n\n // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n // from* methods on which they depend.\n\n\n /**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @private\n */\n goog.math.Long.IntCache_ = {};\n\n\n /**\n * Returns a Long representing the given (32-bit) integer value.\n * @param {number} value The 32-bit integer in question.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromInt = function(value) {\n if (-128 <= value && value < 128) {\n var cachedObj = goog.math.Long.IntCache_[value];\n if (cachedObj) {\n return cachedObj;\n }\n }\n\n var obj = new goog.math.Long(value | 0, value < 0 ? -1 : 0);\n if (-128 <= value && value < 128) {\n goog.math.Long.IntCache_[value] = obj;\n }\n return obj;\n };\n\n\n /**\n * Returns a Long representing the given value, provided that it is a finite\n * number. Otherwise, zero is returned.\n * @param {number} value The number in question.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromNumber = function(value) {\n if (isNaN(value) || !isFinite(value)) {\n return goog.math.Long.ZERO;\n } else if (value <= -goog.math.Long.TWO_PWR_63_DBL_) {\n return goog.math.Long.MIN_VALUE;\n } else if (value + 1 >= goog.math.Long.TWO_PWR_63_DBL_) {\n return goog.math.Long.MAX_VALUE;\n } else if (value < 0) {\n return goog.math.Long.fromNumber(-value).negate();\n } else {\n return new goog.math.Long(\n (value % goog.math.Long.TWO_PWR_32_DBL_) | 0,\n (value / goog.math.Long.TWO_PWR_32_DBL_) | 0);\n }\n };\n\n\n /**\n * Returns a Long representing the 64-bit integer that comes by concatenating\n * the given high and low bits. Each is assumed to use 32 bits.\n * @param {number} lowBits The low 32-bits.\n * @param {number} highBits The high 32-bits.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromBits = function(lowBits, highBits) {\n return new goog.math.Long(lowBits, highBits);\n };\n\n\n /**\n * Returns a Long representation of the given string, written using the given\n * radix.\n * @param {string} str The textual representation of the Long.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!goog.math.Long} The corresponding Long value.\n */\n goog.math.Long.fromString = function(str, opt_radix) {\n if (str.length == 0) {\n throw Error('number format error: empty string');\n }\n\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (str.charAt(0) == '-') {\n return goog.math.Long.fromString(str.substring(1), radix).negate();\n } else if (str.indexOf('-') >= 0) {\n throw Error('number format error: interior \"-\" character: ' + str);\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 8));\n\n var result = goog.math.Long.ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = goog.math.Long.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(goog.math.Long.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(goog.math.Long.fromNumber(value));\n }\n }\n return result;\n };\n\n\n // NOTE: the compiler should inline these constant values below and then remove\n // these variables, so there should be no runtime penalty for these.\n\n\n /**\n * Number used repeated below in calculations. This must appear before the\n * first call to any from* function below.\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_16_DBL_ = 1 << 16;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_24_DBL_ = 1 << 24;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_32_DBL_ =\n goog.math.Long.TWO_PWR_16_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_31_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ / 2;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_48_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_64_DBL_ =\n goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_32_DBL_;\n\n\n /**\n * @type {number}\n * @private\n */\n goog.math.Long.TWO_PWR_63_DBL_ =\n goog.math.Long.TWO_PWR_64_DBL_ / 2;\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.ZERO = goog.math.Long.fromInt(0);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.ONE = goog.math.Long.fromInt(1);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.NEG_ONE = goog.math.Long.fromInt(-1);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.MAX_VALUE =\n goog.math.Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);\n\n\n /** @type {!goog.math.Long} */\n goog.math.Long.MIN_VALUE = goog.math.Long.fromBits(0, 0x80000000 | 0);\n\n\n /**\n * @type {!goog.math.Long}\n * @private\n */\n goog.math.Long.TWO_PWR_24_ = goog.math.Long.fromInt(1 << 24);\n\n\n /** @return {number} The value, assuming it is a 32-bit integer. */\n goog.math.Long.prototype.toInt = function() {\n return this.low_;\n };\n\n\n /** @return {number} The closest floating-point representation to this value. */\n goog.math.Long.prototype.toNumber = function() {\n return this.high_ * goog.math.Long.TWO_PWR_32_DBL_ +\n this.getLowBitsUnsigned();\n };\n\n\n /**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n */\n goog.math.Long.prototype.toString = function(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (this.isZero()) {\n return '0';\n }\n\n if (this.isNegative()) {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = goog.math.Long.fromNumber(radix);\n var div = this.div(radixLong);\n var rem = div.multiply(radixLong).subtract(this);\n return div.toString(radix) + rem.toInt().toString(radix);\n } else {\n return '-' + this.negate().toString(radix);\n }\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 6));\n\n var rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower);\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();\n var digits = intval.toString(radix);\n\n rem = remDiv;\n if (rem.isZero()) {\n return digits + result;\n } else {\n while (digits.length < 6) {\n digits = '0' + digits;\n }\n result = '' + digits + result;\n }\n }\n };\n\n\n /** @return {number} The high 32-bits as a signed value. */\n goog.math.Long.prototype.getHighBits = function() {\n return this.high_;\n };\n\n\n /** @return {number} The low 32-bits as a signed value. */\n goog.math.Long.prototype.getLowBits = function() {\n return this.low_;\n };\n\n\n /** @return {number} The low 32-bits as an unsigned value. */\n goog.math.Long.prototype.getLowBitsUnsigned = function() {\n return (this.low_ >= 0) ?\n this.low_ : goog.math.Long.TWO_PWR_32_DBL_ + this.low_;\n };\n\n\n /**\n * @return {number} Returns the number of bits needed to represent the absolute\n * value of this Long.\n */\n goog.math.Long.prototype.getNumBitsAbs = function() {\n if (this.isNegative()) {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return 64;\n } else {\n return this.negate().getNumBitsAbs();\n }\n } else {\n var val = this.high_ != 0 ? this.high_ : this.low_;\n for (var bit = 31; bit > 0; bit--) {\n if ((val & (1 << bit)) != 0) {\n break;\n }\n }\n return this.high_ != 0 ? bit + 33 : bit + 1;\n }\n };\n\n\n /** @return {boolean} Whether this value is zero. */\n goog.math.Long.prototype.isZero = function() {\n return this.high_ == 0 && this.low_ == 0;\n };\n\n\n /** @return {boolean} Whether this value is negative. */\n goog.math.Long.prototype.isNegative = function() {\n return this.high_ < 0;\n };\n\n\n /** @return {boolean} Whether this value is odd. */\n goog.math.Long.prototype.isOdd = function() {\n return (this.low_ & 1) == 1;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long equals the other.\n */\n goog.math.Long.prototype.equals = function(other) {\n return (this.high_ == other.high_) && (this.low_ == other.low_);\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long does not equal the other.\n */\n goog.math.Long.prototype.notEquals = function(other) {\n return (this.high_ != other.high_) || (this.low_ != other.low_);\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than the other.\n */\n goog.math.Long.prototype.lessThan = function(other) {\n return this.compare(other) < 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than or equal to the other.\n */\n goog.math.Long.prototype.lessThanOrEqual = function(other) {\n return this.compare(other) <= 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than the other.\n */\n goog.math.Long.prototype.greaterThan = function(other) {\n return this.compare(other) > 0;\n };\n\n\n /**\n * @param {goog.math.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than or equal to the other.\n */\n goog.math.Long.prototype.greaterThanOrEqual = function(other) {\n return this.compare(other) >= 0;\n };\n\n\n /**\n * Compares this Long with the given one.\n * @param {goog.math.Long} other Long to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n * if the given one is greater.\n */\n goog.math.Long.prototype.compare = function(other) {\n if (this.equals(other)) {\n return 0;\n }\n\n var thisNeg = this.isNegative();\n var otherNeg = other.isNegative();\n if (thisNeg && !otherNeg) {\n return -1;\n }\n if (!thisNeg && otherNeg) {\n return 1;\n }\n\n // at this point, the signs are the same, so subtraction will not overflow\n if (this.subtract(other).isNegative()) {\n return -1;\n } else {\n return 1;\n }\n };\n\n\n /** @return {!goog.math.Long} The negation of this value. */\n goog.math.Long.prototype.negate = function() {\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.MIN_VALUE;\n } else {\n return this.not().add(goog.math.Long.ONE);\n }\n };\n\n\n /**\n * Returns the sum of this and the given Long.\n * @param {goog.math.Long} other Long to add to this one.\n * @return {!goog.math.Long} The sum of this and the given Long.\n */\n goog.math.Long.prototype.add = function(other) {\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n };\n\n\n /**\n * Returns the difference of this and the given Long.\n * @param {goog.math.Long} other Long to subtract from this.\n * @return {!goog.math.Long} The difference of this and the given Long.\n */\n goog.math.Long.prototype.subtract = function(other) {\n return this.add(other.negate());\n };\n\n\n /**\n * Returns the product of this and the given long.\n * @param {goog.math.Long} other Long to multiply with this.\n * @return {!goog.math.Long} The product of this and the other.\n */\n goog.math.Long.prototype.multiply = function(other) {\n if (this.isZero()) {\n return goog.math.Long.ZERO;\n } else if (other.isZero()) {\n return goog.math.Long.ZERO;\n }\n\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n return other.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return this.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().multiply(other.negate());\n } else {\n return this.negate().multiply(other).negate();\n }\n } else if (other.isNegative()) {\n return this.multiply(other.negate()).negate();\n }\n\n // If both longs are small, use float multiplication\n if (this.lessThan(goog.math.Long.TWO_PWR_24_) &&\n other.lessThan(goog.math.Long.TWO_PWR_24_)) {\n return goog.math.Long.fromNumber(this.toNumber() * other.toNumber());\n }\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n };\n\n\n /**\n * Returns this Long divided by the given one.\n * @param {goog.math.Long} other Long by which to divide.\n * @return {!goog.math.Long} This Long divided by the given one.\n */\n goog.math.Long.prototype.div = function(other) {\n if (other.isZero()) {\n throw Error('division by zero');\n } else if (this.isZero()) {\n return goog.math.Long.ZERO;\n }\n\n if (this.equals(goog.math.Long.MIN_VALUE)) {\n if (other.equals(goog.math.Long.ONE) ||\n other.equals(goog.math.Long.NEG_ONE)) {\n return goog.math.Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.ONE;\n } else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shiftRight(1);\n var approx = halfThis.div(other).shiftLeft(1);\n if (approx.equals(goog.math.Long.ZERO)) {\n return other.isNegative() ? goog.math.Long.ONE : goog.math.Long.NEG_ONE;\n } else {\n var rem = this.subtract(other.multiply(approx));\n var result = approx.add(rem.div(other));\n return result;\n }\n }\n } else if (other.equals(goog.math.Long.MIN_VALUE)) {\n return goog.math.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().div(other.negate());\n } else {\n return this.negate().div(other).negate();\n }\n } else if (other.isNegative()) {\n return this.div(other.negate()).negate();\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n var res = goog.math.Long.ZERO;\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n var approxRes = goog.math.Long.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = goog.math.Long.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) {\n approxRes = goog.math.Long.ONE;\n }\n\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return res;\n };\n\n\n /**\n * Returns this Long modulo the given one.\n * @param {goog.math.Long} other Long by which to mod.\n * @return {!goog.math.Long} This Long modulo the given one.\n */\n goog.math.Long.prototype.modulo = function(other) {\n return this.subtract(this.div(other).multiply(other));\n };\n\n\n /** @return {!goog.math.Long} The bitwise-NOT of this value. */\n goog.math.Long.prototype.not = function() {\n return goog.math.Long.fromBits(~this.low_, ~this.high_);\n };\n\n\n /**\n * Returns the bitwise-AND of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to AND.\n * @return {!goog.math.Long} The bitwise-AND of this and the other.\n */\n goog.math.Long.prototype.and = function(other) {\n return goog.math.Long.fromBits(this.low_ & other.low_,\n this.high_ & other.high_);\n };\n\n\n /**\n * Returns the bitwise-OR of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to OR.\n * @return {!goog.math.Long} The bitwise-OR of this and the other.\n */\n goog.math.Long.prototype.or = function(other) {\n return goog.math.Long.fromBits(this.low_ | other.low_,\n this.high_ | other.high_);\n };\n\n\n /**\n * Returns the bitwise-XOR of this Long and the given one.\n * @param {goog.math.Long} other The Long with which to XOR.\n * @return {!goog.math.Long} The bitwise-XOR of this and the other.\n */\n goog.math.Long.prototype.xor = function(other) {\n return goog.math.Long.fromBits(this.low_ ^ other.low_,\n this.high_ ^ other.high_);\n };\n\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the left by the given amount.\n */\n goog.math.Long.prototype.shiftLeft = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var low = this.low_;\n if (numBits < 32) {\n var high = this.high_;\n return goog.math.Long.fromBits(\n low << numBits,\n (high << numBits) | (low >>> (32 - numBits)));\n } else {\n return goog.math.Long.fromBits(0, low << (numBits - 32));\n }\n }\n };\n\n\n /**\n * Returns this Long with bits shifted to the right by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the right by the given amount.\n */\n goog.math.Long.prototype.shiftRight = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return goog.math.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >> numBits);\n } else {\n return goog.math.Long.fromBits(\n high >> (numBits - 32),\n high >= 0 ? 0 : -1);\n }\n }\n };\n\n\n /**\n * Returns this Long with bits shifted to the right by the given amount, with\n * the new top bits matching the current sign bit.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Long} This shifted to the right by the given amount, with\n * zeros placed into the new leading bits.\n */\n goog.math.Long.prototype.shiftRightUnsigned = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return goog.math.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >>> numBits);\n } else if (numBits == 32) {\n return goog.math.Long.fromBits(high, 0);\n } else {\n return goog.math.Long.fromBits(high >>> (numBits - 32), 0);\n }\n }\n };\n\n //======= begin jsbn =======\n\n var navigator = { appName: 'Modern Browser' }; // polyfill a little\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // http://www-cs-students.stanford.edu/~tjw/jsbn/\n\n /*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. \n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n if(j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<<dbits)-1);\n BigInteger.prototype.DV = (1<<dbits);\n\n var BI_FP = 52;\n BigInteger.prototype.FV = Math.pow(2,BI_FP);\n BigInteger.prototype.F1 = BI_FP-dbits;\n BigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n // Digit conversions\n var BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n var BI_RC = new Array();\n var rr,vv;\n rr = \"0\".charCodeAt(0);\n for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\n rr = \"a\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n rr = \"A\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\n function int2char(n) { return BI_RM.charAt(n); }\n function intAt(s,i) {\n var c = BI_RC[s.charCodeAt(i)];\n return (c==null)?-1:c;\n }\n\n // (protected) copy this to r\n function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n this[this.t++] = (x>>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<<sh;\n sh += k;\n if(sh >= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n }\n this.clamp();\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) clamp off excess high words\n function bnpClamp() {\n var c = this.s&this.DM;\n while(this.t > 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }\n\n // (protected) r = this - a\n function bnpSubTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]-a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3;\t\t// y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // jsbn2 stuff\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }\n\n // (protected) r = this + a\n function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.addTo = bnpAddTo;\n\n //======= end jsbn =======\n\n // Emscripten wrapper\n var Wrapper = {\n abs: function(l, h) {\n var x = new goog.math.Long(l, h);\n var ret;\n if (x.isNegative()) {\n ret = x.negate();\n } else {\n ret = x;\n }\n HEAP32[tempDoublePtr>>2] = ret.low_;\n HEAP32[tempDoublePtr+4>>2] = ret.high_;\n },\n ensureTemps: function() {\n if (Wrapper.ensuredTemps) return;\n Wrapper.ensuredTemps = true;\n Wrapper.two32 = new BigInteger();\n Wrapper.two32.fromString('4294967296', 10);\n Wrapper.two64 = new BigInteger();\n Wrapper.two64.fromString('18446744073709551616', 10);\n Wrapper.temp1 = new BigInteger();\n Wrapper.temp2 = new BigInteger();\n },\n lh2bignum: function(l, h) {\n var a = new BigInteger();\n a.fromString(h.toString(), 10);\n var b = new BigInteger();\n a.multiplyTo(Wrapper.two32, b);\n var c = new BigInteger();\n c.fromString(l.toString(), 10);\n var d = new BigInteger();\n c.addTo(b, d);\n return d;\n },\n stringify: function(l, h, unsigned) {\n var ret = new goog.math.Long(l, h).toString();\n if (unsigned && ret[0] == '-') {\n // unsign slowly using jsbn bignums\n Wrapper.ensureTemps();\n var bignum = new BigInteger();\n bignum.fromString(ret, 10);\n ret = new BigInteger();\n Wrapper.two64.addTo(bignum, ret);\n ret = ret.toString(10);\n }\n return ret;\n },\n fromString: function(str, base, min, max, unsigned) {\n Wrapper.ensureTemps();\n var bignum = new BigInteger();\n bignum.fromString(str, base);\n var bigmin = new BigInteger();\n bigmin.fromString(min, 10);\n var bigmax = new BigInteger();\n bigmax.fromString(max, 10);\n if (unsigned && bignum.compareTo(BigInteger.ZERO) < 0) {\n var temp = new BigInteger();\n bignum.addTo(Wrapper.two64, temp);\n bignum = temp;\n }\n var error = false;\n if (bignum.compareTo(bigmin) < 0) {\n bignum = bigmin;\n error = true;\n } else if (bignum.compareTo(bigmax) > 0) {\n bignum = bigmax;\n error = true;\n }\n var ret = goog.math.Long.fromString(bignum.toString()); // min-max checks should have clamped this to a range goog.math.Long can handle well\n HEAP32[tempDoublePtr>>2] = ret.low_;\n HEAP32[tempDoublePtr+4>>2] = ret.high_;\n if (error) throw 'range error';\n }\n };\n return Wrapper;\n})();\n\n//======= end closure i64 code =======\n\n\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "hash-map", content:"//@ runDefault\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE below for additional\n * information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/******* NOTICE *********\n\nApache Harmony\nCopyright 2006, 2010 The Apache Software Foundation.\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n\nPortions of Apache Harmony were originally developed by\nIntel Corporation and are licensed to the Apache Software\nFoundation under the \"Software Grant and Corporate Contribution\nLicense Agreement\" and for which the following copyright notices\napply\n (C) Copyright 2005 Intel Corporation\n (C) Copyright 2005-2006 Intel Corporation\n (C) Copyright 2006 Intel Corporation\n\n\nThe following copyright notice(s) were affixed to portions of the code\nwith which this file is now or was at one time distributed\nand are placed here unaltered.\n\n(C) Copyright 1997,2004 International Business Machines Corporation.\nAll rights reserved.\n\n(C) Copyright IBM Corp. 2003. \n\n\nThis software contains code derived from UNIX V7, Copyright(C)\nCaldera International Inc.\n\n************************/\n\n// This code is a manual translation of Apache Harmony's HashMap class to\n// JavaScript.\n\nvar HashMap = (function() {\n var DEFAULT_SIZE = 16;\n \n function calculateCapacity(x)\n {\n if (x >= 1 << 30)\n return 1 << 30;\n if (x == 0)\n return 16;\n x = x - 1;\n x |= x >> 1;\n x |= x >> 2;\n x |= x >> 4;\n x |= x >> 8;\n x |= x >> 16;\n return x + 1;\n }\n \n function computeHashCode(key)\n {\n switch (typeof key) {\n case \"undefined\":\n return 0;\n case \"object\":\n if (!key)\n return 0;\n case \"function\":\n return key.hashCode();\n case \"boolean\":\n return key | 0;\n case \"number\":\n if ((key | 0) == key)\n return key;\n key = \"\" + key; // Compute string hash of the double. It's the best we can do.\n case \"string\":\n // source: http://en.wikipedia.org/wiki/Java_hashCode()#Sample_implementations_of_the_java.lang.String_algorithm\n var h = 0;\n var len = key.length;\n for (var index = 0; index < len; index++) {\n h = (((31 * h) | 0) + key.charCodeAt(index)) | 0;\n }\n return h;\n default:\n throw new Error(\"Internal error: Bad JavaScript value type\");\n }\n }\n \n function equals(a, b)\n {\n if (typeof a != typeof b)\n return false;\n switch (typeof a) {\n case \"object\":\n if (!a)\n return !b;\n case \"function\":\n switch (typeof b) {\n case \"object\":\n case \"function\":\n return a.equals(b);\n default:\n return false;\n }\n default:\n return a == b;\n }\n }\n \n function Entry(key, hash, value)\n {\n this._key = key;\n this._value = value;\n this._origKeyHash = hash;\n this._next = null;\n }\n\n Entry.prototype = {\n clone: function()\n {\n var result = new Entry(this._key, this._hash, this._value);\n if (this._next)\n result._next = this._next.clone();\n return result;\n },\n \n toString: function()\n {\n return this._key + \"=\" + this._value;\n },\n \n get key()\n {\n return this._key;\n },\n \n get value()\n {\n return this._value;\n }\n };\n \n function AbstractMapIterator(map)\n {\n this._associatedMap = map;\n this._expectedModCount = map._modCount;\n this._futureEntry = null;\n this._currentEntry = null;\n this._prevEntry = null;\n this._position = 0;\n }\n \n AbstractMapIterator.prototype = {\n hasNext: function()\n {\n if (this._futureEntry)\n return true;\n while (this._position < this._associatedMap._elementData.length) {\n if (!this._associatedMap._elementData[this._position])\n this._position++;\n else\n return true;\n }\n return false;\n },\n \n _checkConcurrentMod: function()\n {\n if (this._expectedModCount != this._associatedMap._modCount)\n throw new Error(\"Concurrent HashMap modification detected\");\n },\n \n _makeNext: function()\n {\n this._checkConcurrentMod();\n if (!this.hasNext())\n throw new Error(\"No such element\");\n if (!this._futureEntry) {\n this._currentEntry = this._associatedMap._elementData[this._position++];\n this._futureEntry = this._currentEntry._next;\n this._prevEntry = null;\n return;\n }\n if (this._currentEntry)\n this._prevEntry = this._currentEntry;\n this._currentEntry = this._futureEntry;\n this._futureEntry = this._futureEntry._next;\n },\n \n remove: function()\n {\n this._checkConcurrentMod();\n if (!this._currentEntry)\n throw new Error(\"Illegal state\");\n if (!this._prevEntry) {\n var index = this._currentEntry._origKeyHash & (this._associatedMap._elementData.length - 1);\n this._associatedMap._elementData[index] = this._associatedMap._elementData[index]._next;\n } else\n this._prevEntry._next = this._currentEntry._next;\n this._currentEntry = null;\n this._expectedModCount++;\n this._associatedMap._modCount++;\n this._associatedMap._elementCount--;\n }\n };\n \n function EntryIterator(map)\n {\n AbstractMapIterator.call(this, map);\n }\n \n EntryIterator.prototype = {\n next: function()\n {\n this._makeNext();\n return this._currentEntry;\n }\n };\n EntryIterator.prototype.__proto__ = AbstractMapIterator.prototype;\n \n function KeyIterator(map)\n {\n AbstractMapIterator.call(this, map);\n }\n \n KeyIterator.prototype = {\n next: function()\n {\n this.makeNext();\n return this._currentEntry._key;\n }\n };\n KeyIterator.prototype.__proto__ = AbstractMapIterator.prototype;\n \n function ValueIterator(map)\n {\n AbstractMapIterator.call(this, map);\n }\n \n ValueIterator.prototype = {\n next: function()\n {\n this.makeNext();\n return this._currentEntry._value;\n }\n };\n ValueIterator.prototype.__proto__ = AbstractMapIterator.prototype;\n \n function EntrySet(map)\n {\n this._associatedMap = map;\n }\n \n EntrySet.prototype = {\n size: function()\n {\n return this._associatedMap._elementCount;\n },\n \n clear: function()\n {\n this._associatedMap.clear();\n },\n \n remove: function(object)\n {\n var entry = this._associatedMap._getEntry(object.key);\n if (!entry)\n return false;\n if (!equals(entry._value, object.value))\n return false;\n this._associatedMap._removeEntry(entry);\n return true;\n },\n \n contains: function(object)\n {\n var entry = this._associatedMap._getEntry(object.key);\n if (!entry)\n return false;\n return equals(entry._value, object.value);\n },\n \n iterator: function()\n {\n return new EntryIterator(this._associatedMap);\n }\n };\n \n function KeySet(map)\n {\n this._associatedMap = map;\n }\n \n KeySet.prototype = {\n contains: function(object)\n {\n return this._associatedMap.contains(object);\n },\n \n size: function()\n {\n return this._associatedMap._elementCount;\n },\n \n clear: function()\n {\n this._associatedMap.clear();\n },\n \n remove: function(key)\n {\n return !!this._associatedMap.remove(key);\n },\n \n iterator: function()\n {\n return new KeyIterator(this._associatedMap);\n }\n };\n \n function ValueCollection(map)\n {\n this._associatedMap = map;\n }\n \n ValueCollection.prototype = {\n contains: function(object)\n {\n return this._associatedMap.containsValue(object);\n },\n \n size: function()\n {\n return this._associatedMap._elementCount;\n },\n \n clear: function()\n {\n this._associatedMap.clear();\n },\n \n iterator: function()\n {\n return new ValueIterator(this._associatedMap);\n }\n };\n \n function HashMap(capacity, loadFactor)\n {\n if (capacity == null)\n capacity = DEFAULT_SIZE;\n if (loadFactor == null)\n loadFactor = 0.75;\n \n if (capacity < 0)\n throw new Error(\"Invalid argument to HashMap constructor: capacity is negative\");\n if (loadFactor <= 0)\n throw new Error(\"Invalid argument to HashMap constructor: loadFactor is not positive\");\n \n this._capacity = calculateCapacity(capacity);\n this._elementCount = 0;\n this._elementData = new Array(this.capacity);\n this._loadFactor = loadFactor;\n this._modCount = 0;\n this._computeThreshold();\n }\n \n HashMap.prototype = {\n _computeThreshold: function()\n {\n this._threshold = (this._elementData.length * this._loadFactor) | 0;\n },\n \n clear: function()\n {\n if (!this._elementCount)\n return;\n \n this._elementCount = 0;\n for (var i = this._elementData.length; i--;)\n this._elementData[i] = null;\n this._modCount++;\n },\n \n clone: function()\n {\n var result = new HashMap(this._elementData.length, this._loadFactor);\n result.putAll(this);\n return result;\n },\n \n containsKey: function(key)\n {\n return !!this._getEntry(key);\n },\n \n containsValue: function(value)\n {\n for (var i = this._elementData.length; i--;) {\n for (var entry = this._elementData[i]; entry; entry = entry._next) {\n if (equals(value, entry._value))\n return true;\n }\n }\n return false;\n },\n \n entrySet: function()\n {\n return new EntrySet(this);\n },\n \n get: function(key)\n {\n var entry = this._getEntry(key);\n if (entry)\n return entry._value;\n return null;\n },\n \n _getEntry: function(key)\n {\n var hash = computeHashCode(key);\n var index = hash & (this._elementData.length - 1);\n return this._findKeyEntry(key, index, hash);\n },\n \n _findKeyEntry: function(key, index, keyHash)\n {\n var entry = this._elementData[index];\n while (entry && (entry._origKeyHash != keyHash || !equals(key, entry._key)))\n entry = entry._next;\n return entry;\n },\n \n isEmpty: function()\n {\n return !this._elementCount;\n },\n \n keySet: function()\n {\n return new KeySet(this);\n },\n \n put: function(key, value)\n {\n var hash = computeHashCode(key);\n var index = hash & (this._elementData.length - 1);\n var entry = this._findKeyEntry(key, index, hash);\n if (!entry) {\n this._modCount++;\n entry = this._createHashedEntry(key, index, hash);\n if (++this._elementCount > this._threshold)\n this._rehash();\n }\n \n var result = entry._value;\n entry._value = value;\n return result;\n },\n \n _createHashedEntry: function(key, index, hash)\n {\n var entry = new Entry(key, hash, null);\n entry._next = this._elementData[index];\n this._elementData[index] = entry;\n return entry;\n },\n \n putAll: function(map)\n {\n if (map.isEmpty())\n return;\n for (var iter = map.entrySet().iterator(); iter.hasNext();) {\n var entry = iter.next();\n put(entry.key, entry.value);\n }\n },\n \n _rehash: function(capacity)\n {\n if (capacity == null)\n capacity = this._elementData.length;\n \n var length = calculateCapacity(!capacity ? 1 : capacity << 1);\n var newData = new Array(length);\n for (var i = 0; i < this._elementData.length; ++i) {\n var entry = this._elementData[i];\n this._elementData[i] = null;\n while (entry) {\n var index = entry._origKeyHash & (length - 1);\n var next = entry._next;\n entry._next = newData[index];\n newData[index] = entry;\n entry = next;\n }\n }\n this._elementData = newData;\n this._computeThreshold();\n },\n \n remove: function(key)\n {\n var entry = this._removeEntryForKey(key);\n if (!entry)\n return null;\n return entry._value;\n },\n \n _removeEntry: function(entry)\n {\n var index = entry._origKeyHash & (this._elementData.length - 1);\n var current = this._elementData[index];\n if (current == entry)\n this._elementData[index] = entry._next;\n else {\n while (current._next != entry)\n current = current._next;\n current._next = entry._next;\n }\n this._modCount++;\n this._elementCount--;\n },\n \n _removeEntryForKey: function(key)\n {\n var hash = computeHashCode(key);\n var index = hash & (this._elementData.length - 1);\n var entry = this._elementData[index];\n var last = null;\n while (entry != null && !(entry._origKeyHash == hash && equals(key, entry._key))) {\n last = entry;\n entry = entry._next;\n }\n if (!entry)\n return null;\n if (!last)\n this._elementData[index] = entry._next;\n else\n last._next = entry._next;\n this._modCount++;\n this._elementCount--;\n return entry;\n },\n \n size: function()\n {\n return this._elementCount;\n },\n \n values: function()\n {\n return new ValueCollection(this);\n }\n };\n \n return HashMap;\n})();\n\nvar map = new HashMap();\nvar COUNT = 500000;\n\nfor (var i = 0; i < COUNT; ++i)\n map.put(i, 42);\n\nvar result = 0;\nfor (var j = 0; j < 5; ++j) {\n for (var i = 0; i < COUNT; ++i)\n result += map.get(i);\n}\n\nvar keySum = 0;\nvar valueSum = 0;\nfor (var iterator = map.entrySet().iterator(); iterator.hasNext();) {\n var entry = iterator.next();\n keySum += entry.key;\n valueSum += entry.value;\n}\n\nif (result != 105000000)\n throw \"Error: result = \" + result;\nif (keySum != 124999750000)\n throw \"Error: keySum = \" + keySum;\nif (valueSum != 21000000)\n throw \"Error: valueSum = \" + valueSum;\n\n"}, |
| {name: "n-body.c", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\n\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(291);\n/* global initializers */ __ATINIT__.push();\n\n\n/* memory initializer */ allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,222,69,190,201,60,189,67,64,44,217,60,52,160,93,19,64,124,219,31,192,171,144,242,191,240,235,37,108,249,134,186,191,188,204,147,155,6,103,227,63,155,148,125,245,242,126,6,64,21,7,90,154,215,210,153,191,216,51,171,217,149,76,163,63,103,202,50,195,205,175,32,64,176,1,222,49,203,127,16,64,124,70,235,225,83,211,217,191,66,148,135,184,33,44,240,191,19,143,31,191,233,53,253,63,180,35,17,95,72,60,129,63,55,198,7,13,73,29,135,63,207,217,167,206,234,201,41,64,126,102,38,214,232,56,46,192,160,125,37,190,87,149,204,191,239,27,145,169,28,83,241,63,197,187,84,62,127,204,235,63,124,62,242,250,107,47,134,191,179,30,244,156,210,61,92,63,42,87,5,169,103,194,46,64,32,162,200,51,88,235,57,192,64,229,171,147,243,241,198,63,74,188,89,22,182,84,239,63,163,251,196,49,198,7,227,63,246,101,118,88,136,203,161,191,172,153,23,83,243,168,96,63,37,46,57,102,10,0,0,0], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n function _llvm_lifetime_end() {}\n\n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;\n\n \n Module[\"_memset\"] = _memset;\n\n function _free() {\n }\n Module[\"_free\"] = _free;\n\n function _llvm_lifetime_start() {}\n\n \n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);\n \n function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n var _sqrt=Math_sqrt;\n\n \n \n \n \n \n \n function _mkport() { throw 'TODO' }var SOCKFS={mount:function (mount) {\n return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createSocket:function (family, type, protocol) {\n var streaming = type == 1;\n if (protocol) {\n assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp\n }\n \n // create our internal socket structure\n var sock = {\n family: family,\n type: type,\n protocol: protocol,\n server: null,\n peers: {},\n pending: [],\n recv_queue: [],\n sock_ops: SOCKFS.websocket_sock_ops\n };\n \n // create the filesystem node to store the socket structure\n var name = SOCKFS.nextname();\n var node = FS.createNode(SOCKFS.root, name, 49152, 0);\n node.sock = sock;\n \n // and the wrapping stream that enables library functions such\n // as read and write to indirectly interact with the socket\n var stream = FS.createStream({\n path: name,\n node: node,\n flags: FS.modeStringToFlags('r+'),\n seekable: false,\n stream_ops: SOCKFS.stream_ops\n });\n \n // map the new stream to the socket structure (sockets have a 1:1\n // relationship with a stream)\n sock.stream = stream;\n \n return sock;\n },getSocket:function (fd) {\n var stream = FS.getStream(fd);\n if (!stream || !FS.isSocket(stream.node.mode)) {\n return null;\n }\n return stream.node.sock;\n },stream_ops:{poll:function (stream) {\n var sock = stream.node.sock;\n return sock.sock_ops.poll(sock);\n },ioctl:function (stream, request, varargs) {\n var sock = stream.node.sock;\n return sock.sock_ops.ioctl(sock, request, varargs);\n },read:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n var msg = sock.sock_ops.recvmsg(sock, length);\n if (!msg) {\n // socket is closed\n return 0;\n }\n buffer.set(msg.buffer, offset);\n return msg.buffer.length;\n },write:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n return sock.sock_ops.sendmsg(sock, buffer, offset, length);\n },close:function (stream) {\n var sock = stream.node.sock;\n sock.sock_ops.close(sock);\n }},nextname:function () {\n if (!SOCKFS.nextname.current) {\n SOCKFS.nextname.current = 0;\n }\n return 'socket[' + (SOCKFS.nextname.current++) + ']';\n },websocket_sock_ops:{createPeer:function (sock, addr, port) {\n var ws;\n \n if (typeof addr === 'object') {\n ws = addr;\n addr = null;\n port = null;\n }\n \n if (ws) {\n // for sockets that've already connected (e.g. we're the server)\n // we can inspect the _socket property for the address\n if (ws._socket) {\n addr = ws._socket.remoteAddress;\n port = ws._socket.remotePort;\n }\n // if we're just now initializing a connection to the remote,\n // inspect the url property\n else {\n var result = /ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);\n if (!result) {\n throw new Error('WebSocket URL must be in the format ws(s)://address:port');\n }\n addr = result[1];\n port = parseInt(result[2], 10);\n }\n } else {\n // create the actual websocket object and connect\n try {\n var url = 'ws://' + addr + ':' + port;\n // the node ws library API is slightly different than the browser's\n var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];\n // If node we use the ws library.\n var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];\n ws = new WebSocket(url, opts);\n ws.binaryType = 'arraybuffer';\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);\n }\n }\n \n \n var peer = {\n addr: addr,\n port: port,\n socket: ws,\n dgram_send_queue: []\n };\n \n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);\n \n // if this is a bound dgram socket, send the port number first to allow\n // us to override the ephemeral port reported to us by remotePort on the\n // remote end.\n if (sock.type === 2 && typeof sock.sport !== 'undefined') {\n peer.dgram_send_queue.push(new Uint8Array([\n 255, 255, 255, 255,\n 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),\n ((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)\n ]));\n }\n \n return peer;\n },getPeer:function (sock, addr, port) {\n return sock.peers[addr + ':' + port];\n },addPeer:function (sock, peer) {\n sock.peers[peer.addr + ':' + peer.port] = peer;\n },removePeer:function (sock, peer) {\n delete sock.peers[peer.addr + ':' + peer.port];\n },handlePeerEvents:function (sock, peer) {\n var first = true;\n \n var handleOpen = function () {\n try {\n var queued = peer.dgram_send_queue.shift();\n while (queued) {\n peer.socket.send(queued);\n queued = peer.dgram_send_queue.shift();\n }\n } catch (e) {\n // not much we can do here in the way of proper error handling as we've already\n // lied and said this data was sent. shut it down.\n peer.socket.close();\n }\n };\n \n function handleMessage(data) {\n assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer\n data = new Uint8Array(data); // make a typed array view on the array buffer\n \n \n // if this is the port message, override the peer's port with it\n var wasfirst = first;\n first = false;\n if (wasfirst &&\n data.length === 10 &&\n data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&\n data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {\n // update the peer's port and it's key in the peer map\n var newport = ((data[8] << 8) | data[9]);\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n peer.port = newport;\n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n return;\n }\n \n sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });\n };\n \n if (ENVIRONMENT_IS_NODE) {\n peer.socket.on('open', handleOpen);\n peer.socket.on('message', function(data, flags) {\n if (!flags.binary) {\n return;\n }\n handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer\n });\n peer.socket.on('error', function() {\n // don't throw\n });\n } else {\n peer.socket.onopen = handleOpen;\n peer.socket.onmessage = function peer_socket_onmessage(event) {\n handleMessage(event.data);\n };\n }\n },poll:function (sock) {\n if (sock.type === 1 && sock.server) {\n // listen sockets should only say they're available for reading\n // if there are pending clients.\n return sock.pending.length ? (64 | 1) : 0;\n }\n \n var mask = 0;\n var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets\n SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :\n null;\n \n if (sock.recv_queue.length ||\n !dest || // connection-less sockets are always ready to read\n (dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed\n mask |= (64 | 1);\n }\n \n if (!dest || // connection-less sockets are always ready to write\n (dest && dest.socket.readyState === dest.socket.OPEN)) {\n mask |= 4;\n }\n \n if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) {\n mask |= 16;\n }\n \n return mask;\n },ioctl:function (sock, request, arg) {\n switch (request) {\n case 21531:\n var bytes = 0;\n if (sock.recv_queue.length) {\n bytes = sock.recv_queue[0].data.length;\n }\n HEAP32[((arg)>>2)]=bytes;\n return 0;\n default:\n return ERRNO_CODES.EINVAL;\n }\n },close:function (sock) {\n // if we've spawned a listen server, close it\n if (sock.server) {\n try {\n sock.server.close();\n } catch (e) {\n }\n sock.server = null;\n }\n // close any peer connections\n var peers = Object.keys(sock.peers);\n for (var i = 0; i < peers.length; i++) {\n var peer = sock.peers[peers[i]];\n try {\n peer.socket.close();\n } catch (e) {\n }\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n }\n return 0;\n },bind:function (sock, addr, port) {\n if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound\n }\n sock.saddr = addr;\n sock.sport = port || _mkport();\n // in order to emulate dgram sockets, we need to launch a listen server when\n // binding on a connection-less socket\n // note: this is only required on the server side\n if (sock.type === 2) {\n // close the existing server if it exists\n if (sock.server) {\n sock.server.close();\n sock.server = null;\n }\n // swallow error operation not supported error that occurs when binding in the\n // browser where this isn't supported\n try {\n sock.sock_ops.listen(sock, 0);\n } catch (e) {\n if (!(e instanceof FS.ErrnoError)) throw e;\n if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;\n }\n }\n },connect:function (sock, addr, port) {\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);\n }\n \n // TODO autobind\n // if (!sock.addr && sock.type == 2) {\n // }\n \n // early out if we're already connected / in the middle of connecting\n if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n if (dest) {\n if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EALREADY);\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EISCONN);\n }\n }\n }\n \n // add the socket to our peer list and set our\n // destination address / port to match\n var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n sock.daddr = peer.addr;\n sock.dport = peer.port;\n \n // always \"fail\" in non-blocking mode\n throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);\n },listen:function (sock, backlog) {\n if (!ENVIRONMENT_IS_NODE) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening\n }\n var WebSocketServer = require('ws').Server;\n var host = sock.saddr;\n sock.server = new WebSocketServer({\n host: host,\n port: sock.sport\n // TODO support backlog\n });\n \n sock.server.on('connection', function(ws) {\n if (sock.type === 1) {\n var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);\n \n // create a peer on the new socket\n var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);\n newsock.daddr = peer.addr;\n newsock.dport = peer.port;\n \n // push to queue for accept to pick up\n sock.pending.push(newsock);\n } else {\n // create a peer on the listen socket so calling sendto\n // with the listen socket and an address will resolve\n // to the correct client\n SOCKFS.websocket_sock_ops.createPeer(sock, ws);\n }\n });\n sock.server.on('closed', function() {\n sock.server = null;\n });\n sock.server.on('error', function() {\n // don't throw\n });\n },accept:function (listensock) {\n if (!listensock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var newsock = listensock.pending.shift();\n newsock.stream.flags = listensock.stream.flags;\n return newsock;\n },getname:function (sock, peer) {\n var addr, port;\n if (peer) {\n if (sock.daddr === undefined || sock.dport === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n addr = sock.daddr;\n port = sock.dport;\n } else {\n // TODO saddr and sport will be set for bind()'d UDP sockets, but what\n // should we be returning for TCP sockets that've been connect()'d?\n addr = sock.saddr || 0;\n port = sock.sport || 0;\n }\n return { addr: addr, port: port };\n },sendmsg:function (sock, buffer, offset, length, addr, port) {\n if (sock.type === 2) {\n // connection-less sockets will honor the message address,\n // and otherwise fall back to the bound destination address\n if (addr === undefined || port === undefined) {\n addr = sock.daddr;\n port = sock.dport;\n }\n // if there was no address to fall back to, error out\n if (addr === undefined || port === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);\n }\n } else {\n // connection-based sockets will only use the bound\n addr = sock.daddr;\n port = sock.dport;\n }\n \n // find the peer for the destination address\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);\n \n // early out if not connected with a connection-based socket\n if (sock.type === 1) {\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n } else if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // create a copy of the incoming data to send, as the WebSocket API\n // doesn't work entirely with an ArrayBufferView, it'll just send\n // the entire underlying buffer\n var data;\n if (buffer instanceof Array || buffer instanceof ArrayBuffer) {\n data = buffer.slice(offset, offset + length);\n } else { // ArrayBufferView\n data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);\n }\n \n // if we're emulating a connection-less dgram socket and don't have\n // a cached connection, queue the buffer to send upon connect and\n // lie, saying the data was sent now.\n if (sock.type === 2) {\n if (!dest || dest.socket.readyState !== dest.socket.OPEN) {\n // if we're not connected, open a new connection\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n }\n dest.dgram_send_queue.push(data);\n return length;\n }\n }\n \n try {\n // send the actual data\n dest.socket.send(data);\n return length;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n },recvmsg:function (sock, length) {\n // http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html\n if (sock.type === 1 && sock.server) {\n // tcp servers should not be recv()'ing on the listen socket\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n \n var queued = sock.recv_queue.shift();\n if (!queued) {\n if (sock.type === 1) {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n \n if (!dest) {\n // if we have a destination address but are not connected, error out\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n // return null if the socket has closed\n return null;\n }\n else {\n // else, our socket is in a valid state but truly has nothing available\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // queued.data will be an ArrayBuffer if it's unadulterated, but if it's\n // requeued TCP data it'll be an ArrayBufferView\n var queuedLength = queued.data.byteLength || queued.data.length;\n var queuedOffset = queued.data.byteOffset || 0;\n var queuedBuffer = queued.data.buffer || queued.data;\n var bytesRead = Math.min(length, queuedLength);\n var res = {\n buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),\n addr: queued.addr,\n port: queued.port\n };\n \n \n // push back any unread data for TCP connections\n if (sock.type === 1 && bytesRead < queuedLength) {\n var bytesRemaining = queuedLength - bytesRead;\n queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);\n sock.recv_queue.unshift(queued);\n }\n \n return res;\n }}};function _send(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _write(fd, buf, len);\n }\n \n function _pwrite(fildes, buf, nbyte, offset) {\n // ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _write(fildes, buf, nbyte) {\n // ssize_t write(int fildes, const void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }\n \n function _fileno(stream) {\n // int fileno(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) return -1;\n return stream.fd;\n }function _fwrite(ptr, size, nitems, stream) {\n // size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html\n var bytesToWrite = nitems * size;\n if (bytesToWrite == 0) return 0;\n var fd = _fileno(stream);\n var bytesWritten = _write(fd, ptr, bytesToWrite);\n if (bytesWritten == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return 0;\n } else {\n return Math.floor(bytesWritten / size);\n }\n }\n \n \n \n Module[\"_strlen\"] = _strlen;\n \n function __reallyNegative(x) {\n return x < 0 || (x === 0 && (1/x) === -Infinity);\n }function __formatString(format, varargs) {\n var textIndex = format;\n var argIndex = 0;\n function getNextArg(type) {\n // NOTE: Explicitly ignoring type safety. Otherwise this fails:\n // int x = 4; printf(\"%c\\n\", (char)x);\n var ret;\n if (type === 'double') {\n ret = (HEAP32[((tempDoublePtr)>>2)]=HEAP32[(((varargs)+(argIndex))>>2)],HEAP32[(((tempDoublePtr)+(4))>>2)]=HEAP32[(((varargs)+((argIndex)+(4)))>>2)],(+(HEAPF64[(tempDoublePtr)>>3])));\n } else if (type == 'i64') {\n ret = [HEAP32[(((varargs)+(argIndex))>>2)],\n HEAP32[(((varargs)+(argIndex+4))>>2)]];\n \n } else {\n type = 'i32'; // varargs are always i32, i64, or double\n ret = HEAP32[(((varargs)+(argIndex))>>2)];\n }\n argIndex += Runtime.getNativeFieldSize(type);\n return ret;\n }\n \n var ret = [];\n var curr, next, currArg;\n while(1) {\n var startTextIndex = textIndex;\n curr = HEAP8[(textIndex)];\n if (curr === 0) break;\n next = HEAP8[((textIndex+1)|0)];\n if (curr == 37) {\n // Handle flags.\n var flagAlwaysSigned = false;\n var flagLeftAlign = false;\n var flagAlternative = false;\n var flagZeroPad = false;\n var flagPadSign = false;\n flagsLoop: while (1) {\n switch (next) {\n case 43:\n flagAlwaysSigned = true;\n break;\n case 45:\n flagLeftAlign = true;\n break;\n case 35:\n flagAlternative = true;\n break;\n case 48:\n if (flagZeroPad) {\n break flagsLoop;\n } else {\n flagZeroPad = true;\n break;\n }\n case 32:\n flagPadSign = true;\n break;\n default:\n break flagsLoop;\n }\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n \n // Handle width.\n var width = 0;\n if (next == 42) {\n width = getNextArg('i32');\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n } else {\n while (next >= 48 && next <= 57) {\n width = width * 10 + (next - 48);\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n }\n \n // Handle precision.\n var precisionSet = false, precision = -1;\n if (next == 46) {\n precision = 0;\n precisionSet = true;\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n if (next == 42) {\n precision = getNextArg('i32');\n textIndex++;\n } else {\n while(1) {\n var precisionChr = HEAP8[((textIndex+1)|0)];\n if (precisionChr < 48 ||\n precisionChr > 57) break;\n precision = precision * 10 + (precisionChr - 48);\n textIndex++;\n }\n }\n next = HEAP8[((textIndex+1)|0)];\n }\n if (precision < 0) {\n precision = 6; // Standard default.\n precisionSet = false;\n }\n \n // Handle integer sizes. WARNING: These assume a 32-bit architecture!\n var argSize;\n switch (String.fromCharCode(next)) {\n case 'h':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 104) {\n textIndex++;\n argSize = 1; // char (actually i32 in varargs)\n } else {\n argSize = 2; // short (actually i32 in varargs)\n }\n break;\n case 'l':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 108) {\n textIndex++;\n argSize = 8; // long long\n } else {\n argSize = 4; // long\n }\n break;\n case 'L': // long long\n case 'q': // int64_t\n case 'j': // intmax_t\n argSize = 8;\n break;\n case 'z': // size_t\n case 't': // ptrdiff_t\n case 'I': // signed ptrdiff_t or unsigned size_t\n argSize = 4;\n break;\n default:\n argSize = null;\n }\n if (argSize) textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n \n // Handle type specifier.\n switch (String.fromCharCode(next)) {\n case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {\n // Integer.\n var signed = next == 100 || next == 105;\n argSize = argSize || 4;\n var currArg = getNextArg('i' + (argSize * 8));\n var origArg = currArg;\n var argText;\n // Flatten i64-1 [low, high] into a (slightly rounded) double\n if (argSize == 8) {\n currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);\n }\n // Truncate to requested size.\n if (argSize <= 4) {\n var limit = Math.pow(256, argSize) - 1;\n currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);\n }\n // Format the number.\n var currAbsArg = Math.abs(currArg);\n var prefix = '';\n if (next == 100 || next == 105) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else\n argText = reSign(currArg, 8 * argSize, 1).toString(10);\n } else if (next == 117) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else\n argText = unSign(currArg, 8 * argSize, 1).toString(10);\n currArg = Math.abs(currArg);\n } else if (next == 111) {\n argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);\n } else if (next == 120 || next == 88) {\n prefix = (flagAlternative && currArg != 0) ? '0x' : '';\n if (argSize == 8 && i64Math) {\n if (origArg[1]) {\n argText = (origArg[1]>>>0).toString(16);\n var lower = (origArg[0]>>>0).toString(16);\n while (lower.length < 8) lower = '0' + lower;\n argText += lower;\n } else {\n argText = (origArg[0]>>>0).toString(16);\n }\n } else\n if (currArg < 0) {\n // Represent negative numbers in hex as 2's complement.\n currArg = -currArg;\n argText = (currAbsArg - 1).toString(16);\n var buffer = [];\n for (var i = 0; i < argText.length; i++) {\n buffer.push((0xF - parseInt(argText[i], 16)).toString(16));\n }\n argText = buffer.join('');\n while (argText.length < argSize * 2) argText = 'f' + argText;\n } else {\n argText = currAbsArg.toString(16);\n }\n if (next == 88) {\n prefix = prefix.toUpperCase();\n argText = argText.toUpperCase();\n }\n } else if (next == 112) {\n if (currAbsArg === 0) {\n argText = '(nil)';\n } else {\n prefix = '0x';\n argText = currAbsArg.toString(16);\n }\n }\n if (precisionSet) {\n while (argText.length < precision) {\n argText = '0' + argText;\n }\n }\n \n // Add sign if needed\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n prefix = '+' + prefix;\n } else if (flagPadSign) {\n prefix = ' ' + prefix;\n }\n }\n \n // Move sign to prefix so we zero-pad after the sign\n if (argText.charAt(0) == '-') {\n prefix = '-' + prefix;\n argText = argText.substr(1);\n }\n \n // Add padding.\n while (prefix.length + argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad) {\n argText = '0' + argText;\n } else {\n prefix = ' ' + prefix;\n }\n }\n }\n \n // Insert the result into the buffer.\n argText = prefix + argText;\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {\n // Float.\n var currArg = getNextArg('double');\n var argText;\n if (isNaN(currArg)) {\n argText = 'nan';\n flagZeroPad = false;\n } else if (!isFinite(currArg)) {\n argText = (currArg < 0 ? '-' : '') + 'inf';\n flagZeroPad = false;\n } else {\n var isGeneral = false;\n var effectivePrecision = Math.min(precision, 20);\n \n // Convert g/G to f/F or e/E, as per:\n // http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html\n if (next == 103 || next == 71) {\n isGeneral = true;\n precision = precision || 1;\n var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);\n if (precision > exponent && exponent >= -4) {\n next = ((next == 103) ? 'f' : 'F').charCodeAt(0);\n precision -= exponent + 1;\n } else {\n next = ((next == 103) ? 'e' : 'E').charCodeAt(0);\n precision--;\n }\n effectivePrecision = Math.min(precision, 20);\n }\n \n if (next == 101 || next == 69) {\n argText = currArg.toExponential(effectivePrecision);\n // Make sure the exponent has at least 2 digits.\n if (/[eE][-+]\\d$/.test(argText)) {\n argText = argText.slice(0, -1) + '0' + argText.slice(-1);\n }\n } else if (next == 102 || next == 70) {\n argText = currArg.toFixed(effectivePrecision);\n if (currArg === 0 && __reallyNegative(currArg)) {\n argText = '-' + argText;\n }\n }\n \n var parts = argText.split('e');\n if (isGeneral && !flagAlternative) {\n // Discard trailing zeros and periods.\n while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&\n (parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {\n parts[0] = parts[0].slice(0, -1);\n }\n } else {\n // Make sure we have a period in alternative mode.\n if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';\n // Zero pad until required precision.\n while (precision > effectivePrecision++) parts[0] += '0';\n }\n argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');\n \n // Capitalize 'E' if needed.\n if (next == 69) argText = argText.toUpperCase();\n \n // Add sign.\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n argText = '+' + argText;\n } else if (flagPadSign) {\n argText = ' ' + argText;\n }\n }\n }\n \n // Add padding.\n while (argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {\n argText = argText[0] + '0' + argText.slice(1);\n } else {\n argText = (flagZeroPad ? '0' : ' ') + argText;\n }\n }\n }\n \n // Adjust case.\n if (next < 97) argText = argText.toUpperCase();\n \n // Insert the result into the buffer.\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 's': {\n // String.\n var arg = getNextArg('i8*');\n var argLength = arg ? _strlen(arg) : '(null)'.length;\n if (precisionSet) argLength = Math.min(argLength, precision);\n if (!flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n if (arg) {\n for (var i = 0; i < argLength; i++) {\n ret.push(HEAPU8[((arg++)|0)]);\n }\n } else {\n ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));\n }\n if (flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n break;\n }\n case 'c': {\n // Character.\n if (flagLeftAlign) ret.push(getNextArg('i8'));\n while (--width > 0) {\n ret.push(32);\n }\n if (!flagLeftAlign) ret.push(getNextArg('i8'));\n break;\n }\n case 'n': {\n // Write the length written so far to the next parameter.\n var ptr = getNextArg('i32*');\n HEAP32[((ptr)>>2)]=ret.length;\n break;\n }\n case '%': {\n // Literal percent sign.\n ret.push(curr);\n break;\n }\n default: {\n // Unknown specifiers remain untouched.\n for (var i = startTextIndex; i < textIndex + 2; i++) {\n ret.push(HEAP8[(i)]);\n }\n }\n }\n textIndex += 2;\n // TODO: Support a/A (hex float) and m (last error) specifiers.\n // TODO: Support %1${specifier} for arg selection.\n } else {\n ret.push(curr);\n textIndex += 1;\n }\n }\n return ret;\n }function _fprintf(stream, format, varargs) {\n // int fprintf(FILE *restrict stream, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var result = __formatString(format, varargs);\n var stack = Runtime.stackSave();\n var ret = _fwrite(allocate(result, 'i8', ALLOC_STACK), 1, result.length, stream);\n Runtime.stackRestore(stack);\n return ret;\n }function _printf(format, varargs) {\n // int printf(const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var stdout = HEAP32[((_stdout)>>2)];\n return _fprintf(stdout, format, varargs);\n }\n\n\n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\n__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n\nvar Math_min = Math.min;\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=+env.NaN,r=+env.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.asmPrintInt;var ba=env.asmPrintFloat;var ca=env.min;var da=env._llvm_lifetime_start;var ea=env._free;var fa=env.__formatString;var ga=env._printf;var ha=env._send;var ia=env._pwrite;var ja=env.___setErrNo;var ka=env._fwrite;var la=env._malloc;var ma=env._mkport;var na=env._fprintf;var oa=env.__reallyNegative;var pa=env._llvm_lifetime_end;var qa=env._fileno;var ra=env._sqrt;var sa=env._fflush;var ta=env._write;var ua=env._emscripten_memcpy_big;var va=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction wa(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function xa(){return i|0}function ya(a){a=a|0;i=a}function za(a,b){a=a|0;b=b|0;if((m|0)==0){m=a;n=b}}function Aa(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function Ba(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function Ca(a){a=a|0;B=a}function Da(a){a=a|0;C=a}function Ea(a){a=a|0;D=a}function Fa(a){a=a|0;E=a}function Ga(a){a=a|0;F=a}function Ha(a){a=a|0;G=a}function Ia(a){a=a|0;H=a}function Ja(a){a=a|0;I=a}function Ka(a){a=a|0;J=a}function La(a){a=a|0;K=a}function Ma(a,b,c){a=a|0;b=b|0;c=+c;var d=0,e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0;d=i;e=(a|0)>0;if(e){f=0}else{i=d;return}while(1){g=f+1|0;if((g|0)<(a|0)){j=b+(f*56|0)|0;k=b+(f*56|0)+8|0;l=b+(f*56|0)+16|0;m=b+(f*56|0)+24|0;n=b+(f*56|0)+32|0;o=b+(f*56|0)+40|0;p=b+(f*56|0)+48|0;q=g;do{r=+h[j>>3]- +h[b+(q*56|0)>>3];s=+h[k>>3]- +h[b+(q*56|0)+8>>3];t=+h[l>>3]- +h[b+(q*56|0)+16>>3];u=+N(+(r*r+s*s+t*t));v=c/(u*u*u);w=b+(q*56|0)+48|0;h[m>>3]=+h[m>>3]-v*r*+h[w>>3];h[n>>3]=+h[n>>3]-v*s*+h[w>>3];h[o>>3]=+h[o>>3]-v*t*+h[w>>3];w=b+(q*56|0)+24|0;h[w>>3]=+h[w>>3]+v*r*+h[p>>3];w=b+(q*56|0)+32|0;h[w>>3]=+h[w>>3]+v*s*+h[p>>3];w=b+(q*56|0)+40|0;h[w>>3]=+h[w>>3]+v*t*+h[p>>3];q=q+1|0;}while((q|0)!=(a|0))}if((g|0)==(a|0)){break}else{f=g}}if(e){x=0}else{i=d;return}do{e=b+(x*56|0)|0;h[e>>3]=+h[e>>3]+ +h[b+(x*56|0)+24>>3]*c;e=b+(x*56|0)+8|0;h[e>>3]=+h[e>>3]+ +h[b+(x*56|0)+32>>3]*c;e=b+(x*56|0)+16|0;h[e>>3]=+h[e>>3]+ +h[b+(x*56|0)+40>>3]*c;x=x+1|0;}while((x|0)!=(a|0));i=d;return}function Na(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,j=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0.0,t=0,u=0.0,v=0.0,w=0.0,x=0.0,y=0,z=0.0,A=0.0,B=0,C=0.0;b=i;i=i+8|0;a=b;d=i;i=i+8|0;e=+h[56>>3];f=+h[112>>3];g=+h[168>>3];j=+h[224>>3];l=+h[280>>3];m=e*+h[40>>3]+0.0+f*+h[96>>3]+g*+h[152>>3]+j*+h[208>>3]+l*+h[264>>3];n=e*+h[48>>3]+0.0+f*+h[104>>3]+g*+h[160>>3]+j*+h[216>>3]+l*+h[272>>3];o=-(+h[32>>3]*e+0.0+ +h[88>>3]*f+ +h[144>>3]*g+ +h[200>>3]*j+ +h[256>>3]*l)/39.47841760435743;h[32>>3]=o;l=-m/39.47841760435743;h[40>>3]=l;m=-n/39.47841760435743;h[48>>3]=m;n=m;m=l;l=o;o=e;e=0.0;p=0;while(1){j=e+o*.5*(l*l+m*m+n*n);q=p+1|0;if((q|0)<5){g=+h[8+(p*56|0)>>3];f=+h[16+(p*56|0)>>3];r=+h[24+(p*56|0)>>3];s=j;t=q;while(1){u=g- +h[8+(t*56|0)>>3];v=f- +h[16+(t*56|0)>>3];w=r- +h[24+(t*56|0)>>3];x=+N(+(u*u+v*v+w*w));w=s-o*+h[56+(t*56|0)>>3]/x;y=t+1|0;if((y|0)==5){z=w;break}else{t=y;s=w}}}else{z=j}if((q|0)==5){break}n=+h[48+(q*56|0)>>3];m=+h[40+(q*56|0)>>3];l=+h[32+(q*56|0)>>3];o=+h[56+(q*56|0)>>3];e=z;p=q}p=d;h[k>>3]=z;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];ga(288,d|0)|0;d=1;while(1){Ma(5,8,.01);p=d+1|0;if((p|0)==5000001){A=0.0;B=0;break}else{d=p}}while(1){z=+h[56+(B*56|0)>>3];e=+h[32+(B*56|0)>>3];o=+h[40+(B*56|0)>>3];l=+h[48+(B*56|0)>>3];m=A+z*.5*(e*e+o*o+l*l);d=B+1|0;if((d|0)<5){l=+h[8+(B*56|0)>>3];o=+h[16+(B*56|0)>>3];e=+h[24+(B*56|0)>>3];n=m;p=d;while(1){s=l- +h[8+(p*56|0)>>3];r=o- +h[16+(p*56|0)>>3];f=e- +h[24+(p*56|0)>>3];g=+N(+(s*s+r*r+f*f));f=n-z*+h[56+(p*56|0)>>3]/g;t=p+1|0;if((t|0)==5){C=f;break}else{p=t;n=f}}}else{C=m}if((d|0)==5){break}else{A=C;B=d}}B=a;h[k>>3]=C;c[B>>2]=c[k>>2];c[B+4>>2]=c[k+4>>2];ga(288,a|0)|0;i=b;return 0}function Oa(){}function Pa(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function Qa(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function Ra(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return ua(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nreturn{_strlen:Qa,_memcpy:Ra,_main:Na,_memset:Pa,runPostSets:Oa,stackAlloc:wa,stackSave:xa,stackRestore:ya,setThrew:za,setTempRet0:Ca,setTempRet1:Da,setTempRet2:Ea,setTempRet3:Fa,setTempRet4:Ga,setTempRet5:Ha,setTempRet6:Ia,setTempRet7:Ja,setTempRet8:Ka,setTempRet9:La}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"_llvm_lifetime_start\": _llvm_lifetime_start, \"_free\": _free, \"__formatString\": __formatString, \"_printf\": _printf, \"_send\": _send, \"_pwrite\": _pwrite, \"___setErrNo\": ___setErrNo, \"_fwrite\": _fwrite, \"_malloc\": _malloc, \"_mkport\": _mkport, \"_fprintf\": _fprintf, \"__reallyNegative\": __reallyNegative, \"_llvm_lifetime_end\": _llvm_lifetime_end, \"_fileno\": _fileno, \"_sqrt\": _sqrt, \"_fflush\": _fflush, \"_write\": _write, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"NaN\": NaN, \"Infinity\": Infinity }, buffer);\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math = null;\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "quicksort.c", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\n\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(200059);\n/* global initializers */ __ATINIT__.push();\n\n\n/* memory initializer */ allocate([], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n/* memory initializer */ allocate([32,69,114,114,111,114,32,105,110,32,81,117,105,99,107,46,0,0,0,0,0,0,0,0], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE+200032);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;\n\n \n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);\n \n function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n \n \n \n \n \n function _mkport() { throw 'TODO' }var SOCKFS={mount:function (mount) {\n return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createSocket:function (family, type, protocol) {\n var streaming = type == 1;\n if (protocol) {\n assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp\n }\n \n // create our internal socket structure\n var sock = {\n family: family,\n type: type,\n protocol: protocol,\n server: null,\n peers: {},\n pending: [],\n recv_queue: [],\n sock_ops: SOCKFS.websocket_sock_ops\n };\n \n // create the filesystem node to store the socket structure\n var name = SOCKFS.nextname();\n var node = FS.createNode(SOCKFS.root, name, 49152, 0);\n node.sock = sock;\n \n // and the wrapping stream that enables library functions such\n // as read and write to indirectly interact with the socket\n var stream = FS.createStream({\n path: name,\n node: node,\n flags: FS.modeStringToFlags('r+'),\n seekable: false,\n stream_ops: SOCKFS.stream_ops\n });\n \n // map the new stream to the socket structure (sockets have a 1:1\n // relationship with a stream)\n sock.stream = stream;\n \n return sock;\n },getSocket:function (fd) {\n var stream = FS.getStream(fd);\n if (!stream || !FS.isSocket(stream.node.mode)) {\n return null;\n }\n return stream.node.sock;\n },stream_ops:{poll:function (stream) {\n var sock = stream.node.sock;\n return sock.sock_ops.poll(sock);\n },ioctl:function (stream, request, varargs) {\n var sock = stream.node.sock;\n return sock.sock_ops.ioctl(sock, request, varargs);\n },read:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n var msg = sock.sock_ops.recvmsg(sock, length);\n if (!msg) {\n // socket is closed\n return 0;\n }\n buffer.set(msg.buffer, offset);\n return msg.buffer.length;\n },write:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n return sock.sock_ops.sendmsg(sock, buffer, offset, length);\n },close:function (stream) {\n var sock = stream.node.sock;\n sock.sock_ops.close(sock);\n }},nextname:function () {\n if (!SOCKFS.nextname.current) {\n SOCKFS.nextname.current = 0;\n }\n return 'socket[' + (SOCKFS.nextname.current++) + ']';\n },websocket_sock_ops:{createPeer:function (sock, addr, port) {\n var ws;\n \n if (typeof addr === 'object') {\n ws = addr;\n addr = null;\n port = null;\n }\n \n if (ws) {\n // for sockets that've already connected (e.g. we're the server)\n // we can inspect the _socket property for the address\n if (ws._socket) {\n addr = ws._socket.remoteAddress;\n port = ws._socket.remotePort;\n }\n // if we're just now initializing a connection to the remote,\n // inspect the url property\n else {\n var result = /ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);\n if (!result) {\n throw new Error('WebSocket URL must be in the format ws(s)://address:port');\n }\n addr = result[1];\n port = parseInt(result[2], 10);\n }\n } else {\n // create the actual websocket object and connect\n try {\n var url = 'ws://' + addr + ':' + port;\n // the node ws library API is slightly different than the browser's\n var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];\n // If node we use the ws library.\n var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];\n ws = new WebSocket(url, opts);\n ws.binaryType = 'arraybuffer';\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);\n }\n }\n \n \n var peer = {\n addr: addr,\n port: port,\n socket: ws,\n dgram_send_queue: []\n };\n \n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);\n \n // if this is a bound dgram socket, send the port number first to allow\n // us to override the ephemeral port reported to us by remotePort on the\n // remote end.\n if (sock.type === 2 && typeof sock.sport !== 'undefined') {\n peer.dgram_send_queue.push(new Uint8Array([\n 255, 255, 255, 255,\n 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),\n ((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)\n ]));\n }\n \n return peer;\n },getPeer:function (sock, addr, port) {\n return sock.peers[addr + ':' + port];\n },addPeer:function (sock, peer) {\n sock.peers[peer.addr + ':' + peer.port] = peer;\n },removePeer:function (sock, peer) {\n delete sock.peers[peer.addr + ':' + peer.port];\n },handlePeerEvents:function (sock, peer) {\n var first = true;\n \n var handleOpen = function () {\n try {\n var queued = peer.dgram_send_queue.shift();\n while (queued) {\n peer.socket.send(queued);\n queued = peer.dgram_send_queue.shift();\n }\n } catch (e) {\n // not much we can do here in the way of proper error handling as we've already\n // lied and said this data was sent. shut it down.\n peer.socket.close();\n }\n };\n \n function handleMessage(data) {\n assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer\n data = new Uint8Array(data); // make a typed array view on the array buffer\n \n \n // if this is the port message, override the peer's port with it\n var wasfirst = first;\n first = false;\n if (wasfirst &&\n data.length === 10 &&\n data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&\n data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {\n // update the peer's port and it's key in the peer map\n var newport = ((data[8] << 8) | data[9]);\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n peer.port = newport;\n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n return;\n }\n \n sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });\n };\n \n if (ENVIRONMENT_IS_NODE) {\n peer.socket.on('open', handleOpen);\n peer.socket.on('message', function(data, flags) {\n if (!flags.binary) {\n return;\n }\n handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer\n });\n peer.socket.on('error', function() {\n // don't throw\n });\n } else {\n peer.socket.onopen = handleOpen;\n peer.socket.onmessage = function peer_socket_onmessage(event) {\n handleMessage(event.data);\n };\n }\n },poll:function (sock) {\n if (sock.type === 1 && sock.server) {\n // listen sockets should only say they're available for reading\n // if there are pending clients.\n return sock.pending.length ? (64 | 1) : 0;\n }\n \n var mask = 0;\n var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets\n SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :\n null;\n \n if (sock.recv_queue.length ||\n !dest || // connection-less sockets are always ready to read\n (dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed\n mask |= (64 | 1);\n }\n \n if (!dest || // connection-less sockets are always ready to write\n (dest && dest.socket.readyState === dest.socket.OPEN)) {\n mask |= 4;\n }\n \n if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) {\n mask |= 16;\n }\n \n return mask;\n },ioctl:function (sock, request, arg) {\n switch (request) {\n case 21531:\n var bytes = 0;\n if (sock.recv_queue.length) {\n bytes = sock.recv_queue[0].data.length;\n }\n HEAP32[((arg)>>2)]=bytes;\n return 0;\n default:\n return ERRNO_CODES.EINVAL;\n }\n },close:function (sock) {\n // if we've spawned a listen server, close it\n if (sock.server) {\n try {\n sock.server.close();\n } catch (e) {\n }\n sock.server = null;\n }\n // close any peer connections\n var peers = Object.keys(sock.peers);\n for (var i = 0; i < peers.length; i++) {\n var peer = sock.peers[peers[i]];\n try {\n peer.socket.close();\n } catch (e) {\n }\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n }\n return 0;\n },bind:function (sock, addr, port) {\n if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound\n }\n sock.saddr = addr;\n sock.sport = port || _mkport();\n // in order to emulate dgram sockets, we need to launch a listen server when\n // binding on a connection-less socket\n // note: this is only required on the server side\n if (sock.type === 2) {\n // close the existing server if it exists\n if (sock.server) {\n sock.server.close();\n sock.server = null;\n }\n // swallow error operation not supported error that occurs when binding in the\n // browser where this isn't supported\n try {\n sock.sock_ops.listen(sock, 0);\n } catch (e) {\n if (!(e instanceof FS.ErrnoError)) throw e;\n if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;\n }\n }\n },connect:function (sock, addr, port) {\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);\n }\n \n // TODO autobind\n // if (!sock.addr && sock.type == 2) {\n // }\n \n // early out if we're already connected / in the middle of connecting\n if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n if (dest) {\n if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EALREADY);\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EISCONN);\n }\n }\n }\n \n // add the socket to our peer list and set our\n // destination address / port to match\n var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n sock.daddr = peer.addr;\n sock.dport = peer.port;\n \n // always \"fail\" in non-blocking mode\n throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);\n },listen:function (sock, backlog) {\n if (!ENVIRONMENT_IS_NODE) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening\n }\n var WebSocketServer = require('ws').Server;\n var host = sock.saddr;\n sock.server = new WebSocketServer({\n host: host,\n port: sock.sport\n // TODO support backlog\n });\n \n sock.server.on('connection', function(ws) {\n if (sock.type === 1) {\n var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);\n \n // create a peer on the new socket\n var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);\n newsock.daddr = peer.addr;\n newsock.dport = peer.port;\n \n // push to queue for accept to pick up\n sock.pending.push(newsock);\n } else {\n // create a peer on the listen socket so calling sendto\n // with the listen socket and an address will resolve\n // to the correct client\n SOCKFS.websocket_sock_ops.createPeer(sock, ws);\n }\n });\n sock.server.on('closed', function() {\n sock.server = null;\n });\n sock.server.on('error', function() {\n // don't throw\n });\n },accept:function (listensock) {\n if (!listensock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var newsock = listensock.pending.shift();\n newsock.stream.flags = listensock.stream.flags;\n return newsock;\n },getname:function (sock, peer) {\n var addr, port;\n if (peer) {\n if (sock.daddr === undefined || sock.dport === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n addr = sock.daddr;\n port = sock.dport;\n } else {\n // TODO saddr and sport will be set for bind()'d UDP sockets, but what\n // should we be returning for TCP sockets that've been connect()'d?\n addr = sock.saddr || 0;\n port = sock.sport || 0;\n }\n return { addr: addr, port: port };\n },sendmsg:function (sock, buffer, offset, length, addr, port) {\n if (sock.type === 2) {\n // connection-less sockets will honor the message address,\n // and otherwise fall back to the bound destination address\n if (addr === undefined || port === undefined) {\n addr = sock.daddr;\n port = sock.dport;\n }\n // if there was no address to fall back to, error out\n if (addr === undefined || port === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);\n }\n } else {\n // connection-based sockets will only use the bound\n addr = sock.daddr;\n port = sock.dport;\n }\n \n // find the peer for the destination address\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);\n \n // early out if not connected with a connection-based socket\n if (sock.type === 1) {\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n } else if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // create a copy of the incoming data to send, as the WebSocket API\n // doesn't work entirely with an ArrayBufferView, it'll just send\n // the entire underlying buffer\n var data;\n if (buffer instanceof Array || buffer instanceof ArrayBuffer) {\n data = buffer.slice(offset, offset + length);\n } else { // ArrayBufferView\n data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);\n }\n \n // if we're emulating a connection-less dgram socket and don't have\n // a cached connection, queue the buffer to send upon connect and\n // lie, saying the data was sent now.\n if (sock.type === 2) {\n if (!dest || dest.socket.readyState !== dest.socket.OPEN) {\n // if we're not connected, open a new connection\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n }\n dest.dgram_send_queue.push(data);\n return length;\n }\n }\n \n try {\n // send the actual data\n dest.socket.send(data);\n return length;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n },recvmsg:function (sock, length) {\n // http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html\n if (sock.type === 1 && sock.server) {\n // tcp servers should not be recv()'ing on the listen socket\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n \n var queued = sock.recv_queue.shift();\n if (!queued) {\n if (sock.type === 1) {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n \n if (!dest) {\n // if we have a destination address but are not connected, error out\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n // return null if the socket has closed\n return null;\n }\n else {\n // else, our socket is in a valid state but truly has nothing available\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // queued.data will be an ArrayBuffer if it's unadulterated, but if it's\n // requeued TCP data it'll be an ArrayBufferView\n var queuedLength = queued.data.byteLength || queued.data.length;\n var queuedOffset = queued.data.byteOffset || 0;\n var queuedBuffer = queued.data.buffer || queued.data;\n var bytesRead = Math.min(length, queuedLength);\n var res = {\n buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),\n addr: queued.addr,\n port: queued.port\n };\n \n \n // push back any unread data for TCP connections\n if (sock.type === 1 && bytesRead < queuedLength) {\n var bytesRemaining = queuedLength - bytesRead;\n queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);\n sock.recv_queue.unshift(queued);\n }\n \n return res;\n }}};function _send(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _write(fd, buf, len);\n }\n \n function _pwrite(fildes, buf, nbyte, offset) {\n // ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _write(fildes, buf, nbyte) {\n // ssize_t write(int fildes, const void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }\n \n \n Module[\"_strlen\"] = _strlen;\n \n function _fileno(stream) {\n // int fileno(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) return -1;\n return stream.fd;\n }function _fputs(s, stream) {\n // int fputs(const char *restrict s, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fputs.html\n var fd = _fileno(stream);\n return _write(fd, s, _strlen(s));\n }\n \n function _fputc(c, stream) {\n // int fputc(int c, FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fputc.html\n var chr = unSign(c & 0xFF);\n HEAP8[((_fputc.ret)|0)]=chr;\n var fd = _fileno(stream);\n var ret = _write(fd, _fputc.ret, 1);\n if (ret == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return -1;\n } else {\n return chr;\n }\n }function _puts(s) {\n // int puts(const char *s);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/puts.html\n // NOTE: puts() always writes an extra newline.\n var stdout = HEAP32[((_stdout)>>2)];\n var ret = _fputs(s, stdout);\n if (ret < 0) {\n return ret;\n } else {\n var newlineRet = _fputc(10, stdout);\n return (newlineRet < 0) ? -1 : ret + 1;\n }\n }\n\n \n Module[\"_memset\"] = _memset;\n\n\n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;\n\n function _free() {\n }\n Module[\"_free\"] = _free;\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\n__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });\n_fputc.ret = allocate([0], \"i8\", ALLOC_STATIC);\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n\nvar Math_min = Math.min;\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=+env.NaN,r=+env.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.asmPrintInt;var ba=env.asmPrintFloat;var ca=env.min;var da=env._puts;var ea=env._free;var fa=env._fputc;var ga=env._send;var ha=env._pwrite;var ia=env._fputs;var ja=env.___setErrNo;var ka=env._malloc;var la=env._mkport;var ma=env._emscripten_memcpy_big;var na=env._fileno;var oa=env._fflush;var pa=env._write;var qa=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction ra(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function sa(){return i|0}function ta(a){a=a|0;i=a}function ua(a,b){a=a|0;b=b|0;if((m|0)==0){m=a;n=b}}function va(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function wa(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function xa(a){a=a|0;B=a}function ya(a){a=a|0;C=a}function za(a){a=a|0;D=a}function Aa(a){a=a|0;E=a}function Ba(a){a=a|0;F=a}function Ca(a){a=a|0;G=a}function Da(a){a=a|0;H=a}function Ea(a){a=a|0;I=a}function Fa(a){a=a|0;J=a}function Ga(a){a=a|0;K=a}function Ha(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;e=i;f=b;while(1){b=c[a+(((f+d|0)/2|0)<<2)>>2]|0;g=f;h=d;while(1){j=g;while(1){k=a+(j<<2)|0;l=c[k>>2]|0;m=j+1|0;if((l|0)<(b|0)){j=m}else{n=h;break}}while(1){o=a+(n<<2)|0;p=c[o>>2]|0;q=n+ -1|0;if((b|0)<(p|0)){n=q}else{break}}if((j|0)>(n|0)){r=j;s=n}else{c[k>>2]=p;c[o>>2]=l;r=m;s=q}if((r|0)>(s|0)){break}else{g=r;h=s}}if((s|0)>(f|0)){Ha(a,f,s)}if((r|0)<(d|0)){f=r}else{break}}i=e;return}function Ia(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;a=i;b=0;do{c[2]=74755;c[4]=0;c[6]=0;d=0;e=0;f=74755;g=1;while(1){h=(f*1309|0)+13849&65535;j=((h>>>0)%1e5|0)+ -5e4|0;c[32+(g<<2)>>2]=j;do{if((j|0)>(e|0)){c[4]=j;k=d;l=j}else{if((j|0)>=(d|0)){k=d;l=e;break}c[6]=j;k=j;l=e}}while(0);j=g+1|0;if((j|0)==50001){break}else{d=k;e=l;g=j;f=h}}c[2]=h;Ha(32,1,5e4);if((c[36>>2]|0)==(c[6]|0)){if((c[200032>>2]|0)!=(c[4]|0)){m=10}}else{m=10}if((m|0)==10){m=0;da(200040)|0}b=b+1|0;}while((b|0)!=100);i=a;return 0}function Ja(){}function Ka(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function La(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function Ma(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return ma(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nreturn{_strlen:Ka,_memcpy:Ma,_main:Ia,_memset:La,runPostSets:Ja,stackAlloc:ra,stackSave:sa,stackRestore:ta,setThrew:ua,setTempRet0:xa,setTempRet1:ya,setTempRet2:za,setTempRet3:Aa,setTempRet4:Ba,setTempRet5:Ca,setTempRet6:Da,setTempRet7:Ea,setTempRet8:Fa,setTempRet9:Ga}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"_puts\": _puts, \"_free\": _free, \"_fputc\": _fputc, \"_send\": _send, \"_pwrite\": _pwrite, \"_fputs\": _fputs, \"___setErrNo\": ___setErrNo, \"_malloc\": _malloc, \"_mkport\": _mkport, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"_fileno\": _fileno, \"_fflush\": _fflush, \"_write\": _write, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"NaN\": NaN, \"Infinity\": Infinity }, buffer);\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math = null;\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| {name: "towers.c", content:"// The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to do an eval in order to handle the closure compiler\n// case, where this code here is minified but Module was defined\n// elsewhere (e.g. case 4 above). We also need to check if Module\n// already exists (e.g. case 3 above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module;\nif (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = {};\nfor (var key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\n\n// The environment setup code below is customized to use Module.\n// *** Environment setup code ***\nvar ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';\nvar ENVIRONMENT_IS_WEB = typeof window === 'object';\nvar ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\nif (ENVIRONMENT_IS_NODE) {\n // Expose functionality in the same simple way that the shells work\n // Note that we pollute the global namespace here, otherwise we break in node\n if (!Module['print']) Module['print'] = function print(x) {\n process['stdout'].write(x + '\\n');\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n process['stderr'].write(x + '\\n');\n };\n\n var nodeFS = require('fs');\n var nodePath = require('path');\n\n Module['read'] = function read(filename, binary) {\n filename = nodePath['normalize'](filename);\n var ret = nodeFS['readFileSync'](filename);\n // The path is absolute if the normalized version is the same as the resolved.\n if (!ret && filename != nodePath['resolve'](filename)) {\n filename = path.join(__dirname, '..', 'src', filename);\n ret = nodeFS['readFileSync'](filename);\n }\n if (ret && !binary) ret = ret.toString();\n return ret;\n };\n\n Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };\n\n Module['load'] = function load(f) {\n globalEval(read(f));\n };\n\n Module['arguments'] = process['argv'].slice(2);\n\n module['exports'] = Module;\n}\nelse if (ENVIRONMENT_IS_SHELL) {\n if (!Module['print']) Module['print'] = print;\n if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm\n\n if (typeof read != 'undefined') {\n Module['read'] = read;\n } else {\n Module['read'] = function read() { throw 'no read() available (jsc?)' };\n }\n\n Module['readBinary'] = function readBinary(f) {\n return read(f, 'binary');\n };\n\n if (typeof scriptArgs != 'undefined') {\n Module['arguments'] = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n this['Module'] = Module;\n\n eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)\n}\nelse if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n Module['read'] = function read(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n\n if (typeof arguments != 'undefined') {\n Module['arguments'] = arguments;\n }\n\n if (typeof console !== 'undefined') {\n if (!Module['print']) Module['print'] = function print(x) {\n console.log(x);\n };\n if (!Module['printErr']) Module['printErr'] = function printErr(x) {\n console.log(x);\n };\n } else {\n // Probably a worker, and without console.log. We can do very little here...\n var TRY_USE_DUMP = false;\n if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== \"undefined\") ? (function(x) {\n dump(x);\n }) : (function(x) {\n // self.postMessage(x); // enable this if you want stdout to be sent as messages\n }));\n }\n\n if (ENVIRONMENT_IS_WEB) {\n this['Module'] = Module;\n } else {\n Module['load'] = importScripts;\n }\n}\nelse {\n // Unreachable because SHELL is dependant on the others\n throw 'Unknown runtime environment. Where are we?';\n}\n\nfunction globalEval(x) {\n eval.call(null, x);\n}\nif (!Module['load'] == 'undefined' && Module['read']) {\n Module['load'] = function load(f) {\n globalEval(Module['read'](f));\n };\n}\nif (!Module['print']) {\n Module['print'] = function(){};\n}\nif (!Module['printErr']) {\n Module['printErr'] = Module['print'];\n}\nif (!Module['arguments']) {\n Module['arguments'] = [];\n}\n// *** Environment setup code ***\n\n// Closure helpers\nModule.print = Module['print'];\nModule.printErr = Module['printErr'];\n\n// Callbacks\nModule['preRun'] = [];\nModule['postRun'] = [];\n\n// Merge back in the overrides\nfor (var key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\n\n\n\n// === Auto-generated preamble library stuff ===\n\n//========================================\n// Runtime code shared with compiler\n//========================================\n\nvar Runtime = {\n stackSave: function () {\n return STACKTOP;\n },\n stackRestore: function (stackTop) {\n STACKTOP = stackTop;\n },\n forceAlign: function (target, quantum) {\n quantum = quantum || 4;\n if (quantum == 1) return target;\n if (isNumber(target) && isNumber(quantum)) {\n return Math.ceil(target/quantum)*quantum;\n } else if (isNumber(quantum) && isPowerOfTwo(quantum)) {\n return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';\n }\n return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;\n },\n isNumberType: function (type) {\n return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;\n },\n isPointerType: function isPointerType(type) {\n return type[type.length-1] == '*';\n},\n isStructType: function isStructType(type) {\n if (isPointerType(type)) return false;\n if (isArrayType(type)) return true;\n if (/<?\\{ ?[^}]* ?\\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types\n // See comment in isStructPointerType()\n return type[0] == '%';\n},\n INT_TYPES: {\"i1\":0,\"i8\":0,\"i16\":0,\"i32\":0,\"i64\":0},\n FLOAT_TYPES: {\"float\":0,\"double\":0},\n or64: function (x, y) {\n var l = (x | 0) | (y | 0);\n var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n and64: function (x, y) {\n var l = (x | 0) & (y | 0);\n var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n xor64: function (x, y) {\n var l = (x | 0) ^ (y | 0);\n var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;\n return l + h;\n },\n getNativeTypeSize: function (type) {\n switch (type) {\n case 'i1': case 'i8': return 1;\n case 'i16': return 2;\n case 'i32': return 4;\n case 'i64': return 8;\n case 'float': return 4;\n case 'double': return 8;\n default: {\n if (type[type.length-1] === '*') {\n return Runtime.QUANTUM_SIZE; // A pointer\n } else if (type[0] === 'i') {\n var bits = parseInt(type.substr(1));\n assert(bits % 8 === 0);\n return bits/8;\n } else {\n return 0;\n }\n }\n }\n },\n getNativeFieldSize: function (type) {\n return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);\n },\n dedup: function dedup(items, ident) {\n var seen = {};\n if (ident) {\n return items.filter(function(item) {\n if (seen[item[ident]]) return false;\n seen[item[ident]] = true;\n return true;\n });\n } else {\n return items.filter(function(item) {\n if (seen[item]) return false;\n seen[item] = true;\n return true;\n });\n }\n},\n set: function set() {\n var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;\n var ret = {};\n for (var i = 0; i < args.length; i++) {\n ret[args[i]] = 0;\n }\n return ret;\n},\n STACK_ALIGN: 8,\n getAlignSize: function (type, size, vararg) {\n // we align i64s and doubles on 64-bit boundaries, unlike x86\n if (!vararg && (type == 'i64' || type == 'double')) return 8;\n if (!type) return Math.min(size, 8); // align structures internally to 64 bits\n return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);\n },\n calculateStructAlignment: function calculateStructAlignment(type) {\n type.flatSize = 0;\n type.alignSize = 0;\n var diffs = [];\n var prev = -1;\n var index = 0;\n type.flatIndexes = type.fields.map(function(field) {\n index++;\n var size, alignSize;\n if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {\n size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.\n alignSize = Runtime.getAlignSize(field, size);\n } else if (Runtime.isStructType(field)) {\n if (field[1] === '0') {\n // this is [0 x something]. When inside another structure like here, it must be at the end,\n // and it adds no size\n // XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');\n size = 0;\n if (Types.types[field]) {\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n } else {\n alignSize = type.alignSize || QUANTUM_SIZE;\n }\n } else {\n size = Types.types[field].flatSize;\n alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);\n }\n } else if (field[0] == 'b') {\n // bN, large number field, like a [N x i8]\n size = field.substr(1)|0;\n alignSize = 1;\n } else if (field[0] === '<') {\n // vector type\n size = alignSize = Types.types[field].flatSize; // fully aligned\n } else if (field[0] === 'i') {\n // illegal integer field, that could not be legalized because it is an internal structure field\n // it is ok to have such fields, if we just use them as markers of field size and nothing more complex\n size = alignSize = parseInt(field.substr(1))/8;\n assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);\n } else {\n assert(false, 'invalid type for calculateStructAlignment');\n }\n if (type.packed) alignSize = 1;\n type.alignSize = Math.max(type.alignSize, alignSize);\n var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory\n type.flatSize = curr + size;\n if (prev >= 0) {\n diffs.push(curr-prev);\n }\n prev = curr;\n return curr;\n });\n if (type.name_ && type.name_[0] === '[') {\n // arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid\n // allocating a potentially huge array for [999999 x i8] etc.\n type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;\n }\n type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);\n if (diffs.length == 0) {\n type.flatFactor = type.flatSize;\n } else if (Runtime.dedup(diffs).length == 1) {\n type.flatFactor = diffs[0];\n }\n type.needsFlattening = (type.flatFactor != 1);\n return type.flatIndexes;\n },\n generateStructInfo: function (struct, typeName, offset) {\n var type, alignment;\n if (typeName) {\n offset = offset || 0;\n type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];\n if (!type) return null;\n if (type.fields.length != struct.length) {\n printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');\n return null;\n }\n alignment = type.flatIndexes;\n } else {\n var type = { fields: struct.map(function(item) { return item[0] }) };\n alignment = Runtime.calculateStructAlignment(type);\n }\n var ret = {\n __size__: type.flatSize\n };\n if (typeName) {\n struct.forEach(function(item, i) {\n if (typeof item === 'string') {\n ret[item] = alignment[i] + offset;\n } else {\n // embedded struct\n var key;\n for (var k in item) key = k;\n ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);\n }\n });\n } else {\n struct.forEach(function(item, i) {\n ret[item[1]] = alignment[i];\n });\n }\n return ret;\n },\n dynCall: function (sig, ptr, args) {\n if (args && args.length) {\n if (!args.splice) args = Array.prototype.slice.call(args);\n args.splice(0, 0, ptr);\n return Module['dynCall_' + sig].apply(null, args);\n } else {\n return Module['dynCall_' + sig].call(null, ptr);\n }\n },\n functionPointers: [],\n addFunction: function (func) {\n for (var i = 0; i < Runtime.functionPointers.length; i++) {\n if (!Runtime.functionPointers[i]) {\n Runtime.functionPointers[i] = func;\n return 2*(1 + i);\n }\n }\n throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';\n },\n removeFunction: function (index) {\n Runtime.functionPointers[(index-2)/2] = null;\n },\n getAsmConst: function (code, numArgs) {\n // code is a constant string on the heap, so we can cache these\n if (!Runtime.asmConstCache) Runtime.asmConstCache = {};\n var func = Runtime.asmConstCache[code];\n if (func) return func;\n var args = [];\n for (var i = 0; i < numArgs; i++) {\n args.push(String.fromCharCode(36) + i); // $0, $1 etc\n }\n code = Pointer_stringify(code);\n if (code[0] === '\"') {\n // tolerate EM_ASM(\"..code..\") even though EM_ASM(..code..) is correct\n if (code.indexOf('\"', 1) === code.length-1) {\n code = code.substr(1, code.length-2);\n } else {\n // something invalid happened, e.g. EM_ASM(\"..code($0)..\", input)\n abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');\n }\n }\n return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node\n },\n warnOnce: function (text) {\n if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};\n if (!Runtime.warnOnce.shown[text]) {\n Runtime.warnOnce.shown[text] = 1;\n Module.printErr(text);\n }\n },\n funcWrappers: {},\n getFuncWrapper: function (func, sig) {\n assert(sig);\n if (!Runtime.funcWrappers[func]) {\n Runtime.funcWrappers[func] = function dynCall_wrapper() {\n return Runtime.dynCall(sig, func, arguments);\n };\n }\n return Runtime.funcWrappers[func];\n },\n UTF8Processor: function () {\n var buffer = [];\n var needed = 0;\n this.processCChar = function (code) {\n code = code & 0xFF;\n\n if (buffer.length == 0) {\n if ((code & 0x80) == 0x00) { // 0xxxxxxx\n return String.fromCharCode(code);\n }\n buffer.push(code);\n if ((code & 0xE0) == 0xC0) { // 110xxxxx\n needed = 1;\n } else if ((code & 0xF0) == 0xE0) { // 1110xxxx\n needed = 2;\n } else { // 11110xxx\n needed = 3;\n }\n return '';\n }\n\n if (needed) {\n buffer.push(code);\n needed--;\n if (needed > 0) return '';\n }\n\n var c1 = buffer[0];\n var c2 = buffer[1];\n var c3 = buffer[2];\n var c4 = buffer[3];\n var ret;\n if (buffer.length == 2) {\n ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));\n } else if (buffer.length == 3) {\n ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));\n } else {\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) | (c4 & 0x3F);\n ret = String.fromCharCode(\n Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,\n (codePoint - 0x10000) % 0x400 + 0xDC00);\n }\n buffer.length = 0;\n return ret;\n }\n this.processJSString = function processJSString(string) {\n string = unescape(encodeURIComponent(string));\n var ret = [];\n for (var i = 0; i < string.length; i++) {\n ret.push(string.charCodeAt(i));\n }\n return ret;\n }\n },\n getCompilerSetting: function (name) {\n throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';\n },\n stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },\n staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },\n dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },\n alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },\n makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },\n GLOBAL_BASE: 8,\n QUANTUM_SIZE: 4,\n __dummy__: 0\n}\n\n\nModule['Runtime'] = Runtime;\n\n\n\n\n\n\n\n\n\n//========================================\n// Runtime essentials\n//========================================\n\nvar __THREW__ = 0; // Used in checking for thrown exceptions.\n\nvar ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar EXITSTATUS = 0;\n\nvar undef = 0;\n// tempInt is used for 32-bit signed values or smaller. tempBigInt is used\n// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt\nvar tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;\nvar tempI64, tempI64b;\nvar tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;\n\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed: ' + text);\n }\n}\n\nvar globalScope = this;\n\n// C calling interface. A convenient way to call C functions (in C files, or\n// defined with extern \"C\").\n//\n// Note: LLVM optimizations can inline and remove functions, after which you will not be\n// able to call them. Closure can also do so. To avoid that, add your function to\n// the exports using something like\n//\n// -s EXPORTED_FUNCTIONS='[\"_main\", \"_myfunc\"]'\n//\n// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern \"C\")\n// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and\n// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,\n// except that 'array' is not possible (there is no way for us to know the length of the array)\n// @param args An array of the arguments to the function, as native JS values (as in returnType)\n// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n// @return The return value, as a native JS value (as in returnType)\nfunction ccall(ident, returnType, argTypes, args) {\n return ccallFunc(getCFunc(ident), returnType, argTypes, args);\n}\nModule[\"ccall\"] = ccall;\n\n// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)\nfunction getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch(e) {\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n}\n\n// Internal function that does a C call using a function, not an identifier\nfunction ccallFunc(func, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n value = intArrayFromString(value);\n type = 'array';\n }\n if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}\n\n// Returns a native JS wrapper for a C function. This is similar to ccall, but\n// returns a function you can call repeatedly in a normal way. For example:\n//\n// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);\n// alert(my_function(5, 22));\n// alert(my_function(99, 12));\n//\nfunction cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}\nModule[\"cwrap\"] = cwrap;\n\n// Sets a value in memory in a dynamic way at run-time. Uses the\n// type data. This is the same as makeSetValue, except that\n// makeSetValue is done at compile-time and generates the needed\n// code then, whereas this function picks the right code at\n// run-time.\n// Note that setValue and getValue only do *aligned* writes and reads!\n// Note that ccall uses JS types as for defining types, while setValue and\n// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation\nfunction setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}\nModule['setValue'] = setValue;\n\n// Parallel to setValue.\nfunction getValue(ptr, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': return HEAP8[(ptr)];\n case 'i8': return HEAP8[(ptr)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': return HEAP32[((ptr)>>2)];\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n default: abort('invalid type for setValue: ' + type);\n }\n return null;\n}\nModule['getValue'] = getValue;\n\nvar ALLOC_NORMAL = 0; // Tries to use _malloc()\nvar ALLOC_STACK = 1; // Lives for the duration of the current function call\nvar ALLOC_STATIC = 2; // Cannot be freed\nvar ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk\nvar ALLOC_NONE = 4; // Do not allocate\nModule['ALLOC_NORMAL'] = ALLOC_NORMAL;\nModule['ALLOC_STACK'] = ALLOC_STACK;\nModule['ALLOC_STATIC'] = ALLOC_STATIC;\nModule['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;\nModule['ALLOC_NONE'] = ALLOC_NONE;\n\n// allocate(): This is for internal use. You can use it yourself as well, but the interface\n// is a little tricky (see docs right below). The reason is that it is optimized\n// for multiple syntaxes to save space in generated code. So you should\n// normally not use allocate(), and instead allocate memory using _malloc(),\n// initialize it with setValue(), and so forth.\n// @slab: An array of data, or a number. If a number, then the size of the block to allocate,\n// in *bytes* (note that this is sometimes confusing: the next parameter does not\n// affect this!)\n// @types: Either an array of types, one for each byte (or 0 if no type at that position),\n// or a single type which is used for the entire block. This only matters if there\n// is initial data - if @slab is a number, then this does not matter at all and is\n// ignored.\n// @allocator: How to allocate memory, see ALLOC_*\nfunction allocate(slab, types, allocator, ptr) {\n var zeroinit, size;\n if (typeof slab === 'number') {\n zeroinit = true;\n size = slab;\n } else {\n zeroinit = false;\n size = slab.length;\n }\n\n var singleType = typeof types === 'string' ? types : null;\n\n var ret;\n if (allocator == ALLOC_NONE) {\n ret = ptr;\n } else {\n ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));\n }\n\n if (zeroinit) {\n var ptr = ret, stop;\n assert((ret & 3) == 0);\n stop = ret + (size & ~3);\n for (; ptr < stop; ptr += 4) {\n HEAP32[((ptr)>>2)]=0;\n }\n stop = ret + size;\n while (ptr < stop) {\n HEAP8[((ptr++)|0)]=0;\n }\n return ret;\n }\n\n if (singleType === 'i8') {\n if (slab.subarray || slab.slice) {\n HEAPU8.set(slab, ret);\n } else {\n HEAPU8.set(new Uint8Array(slab), ret);\n }\n return ret;\n }\n\n var i = 0, type, typeSize, previousType;\n while (i < size) {\n var curr = slab[i];\n\n if (typeof curr === 'function') {\n curr = Runtime.getFunctionIndex(curr);\n }\n\n type = singleType || types[i];\n if (type === 0) {\n i++;\n continue;\n }\n\n if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later\n\n setValue(ret+i, curr, type);\n\n // no need to look up size unless type changes, so cache it\n if (previousType !== type) {\n typeSize = Runtime.getNativeTypeSize(type);\n previousType = type;\n }\n i += typeSize;\n }\n\n return ret;\n}\nModule['allocate'] = allocate;\n\nfunction Pointer_stringify(ptr, /* optional */ length) {\n // TODO: use TextDecoder\n // Find the length, and check for UTF while doing so\n var hasUtf = false;\n var t;\n var i = 0;\n while (1) {\n t = HEAPU8[(((ptr)+(i))|0)];\n if (t >= 128) hasUtf = true;\n else if (t == 0 && !length) break;\n i++;\n if (length && i == length) break;\n }\n if (!length) length = i;\n\n var ret = '';\n\n if (!hasUtf) {\n var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack\n var curr;\n while (length > 0) {\n curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));\n ret = ret ? ret + curr : curr;\n ptr += MAX_CHUNK;\n length -= MAX_CHUNK;\n }\n return ret;\n }\n\n var utf8 = new Runtime.UTF8Processor();\n for (i = 0; i < length; i++) {\n t = HEAPU8[(((ptr)+(i))|0)];\n ret += utf8.processCChar(t);\n }\n return ret;\n}\nModule['Pointer_stringify'] = Pointer_stringify;\n\n// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF16ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];\n if (codeUnit == 0)\n return str;\n ++i;\n // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\n str += String.fromCharCode(codeUnit);\n }\n}\nModule['UTF16ToString'] = UTF16ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\nfunction stringToUTF16(str, outPtr) {\n for(var i = 0; i < str.length; ++i) {\n // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.\n var codeUnit = str.charCodeAt(i); // possibly a lead surrogate\n HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP16[(((outPtr)+(str.length*2))>>1)]=0;\n}\nModule['stringToUTF16'] = stringToUTF16;\n\n// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns\n// a copy of that string as a Javascript String object.\nfunction UTF32ToString(ptr) {\n var i = 0;\n\n var str = '';\n while (1) {\n var utf32 = HEAP32[(((ptr)+(i*4))>>2)];\n if (utf32 == 0)\n return str;\n ++i;\n // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\n if (utf32 >= 0x10000) {\n var ch = utf32 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n}\nModule['UTF32ToString'] = UTF32ToString;\n\n// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',\n// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,\n// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.\nfunction stringToUTF32(str, outPtr) {\n var iChar = 0;\n for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.\n var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate\n if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {\n var trailSurrogate = str.charCodeAt(++iCodeUnit);\n codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);\n }\n HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;\n ++iChar;\n }\n // Null-terminate the pointer to the HEAP.\n HEAP32[(((outPtr)+(iChar*4))>>2)]=0;\n}\nModule['stringToUTF32'] = stringToUTF32;\n\nfunction demangle(func) {\n var i = 3;\n // params, etc.\n var basicTypes = {\n 'v': 'void',\n 'b': 'bool',\n 'c': 'char',\n 's': 'short',\n 'i': 'int',\n 'l': 'long',\n 'f': 'float',\n 'd': 'double',\n 'w': 'wchar_t',\n 'a': 'signed char',\n 'h': 'unsigned char',\n 't': 'unsigned short',\n 'j': 'unsigned int',\n 'm': 'unsigned long',\n 'x': 'long long',\n 'y': 'unsigned long long',\n 'z': '...'\n };\n var subs = [];\n var first = true;\n function dump(x) {\n //return;\n if (x) Module.print(x);\n Module.print(func);\n var pre = '';\n for (var a = 0; a < i; a++) pre += ' ';\n Module.print (pre + '^');\n }\n function parseNested() {\n i++;\n if (func[i] === 'K') i++; // ignore const\n var parts = [];\n while (func[i] !== 'E') {\n if (func[i] === 'S') { // substitution\n i++;\n var next = func.indexOf('_', i);\n var num = func.substring(i, next) || 0;\n parts.push(subs[num] || '?');\n i = next+1;\n continue;\n }\n if (func[i] === 'C') { // constructor\n parts.push(parts[parts.length-1]);\n i += 2;\n continue;\n }\n var size = parseInt(func.substr(i));\n var pre = size.toString().length;\n if (!size || !pre) { i--; break; } // counter i++ below us\n var curr = func.substr(i + pre, size);\n parts.push(curr);\n subs.push(curr);\n i += pre + size;\n }\n i++; // skip E\n return parts;\n }\n function parse(rawList, limit, allowVoid) { // main parser\n limit = limit || Infinity;\n var ret = '', list = [];\n function flushList() {\n return '(' + list.join(', ') + ')';\n }\n var name;\n if (func[i] === 'N') {\n // namespaced N-E\n name = parseNested().join('::');\n limit--;\n if (limit === 0) return rawList ? [name] : name;\n } else {\n // not namespaced\n if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'\n var size = parseInt(func.substr(i));\n if (size) {\n var pre = size.toString().length;\n name = func.substr(i + pre, size);\n i += pre + size;\n }\n }\n first = false;\n if (func[i] === 'I') {\n i++;\n var iList = parse(true);\n var iRet = parse(true, 1, true);\n ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';\n } else {\n ret = name;\n }\n paramLoop: while (i < func.length && limit-- > 0) {\n //dump('paramLoop');\n var c = func[i++];\n if (c in basicTypes) {\n list.push(basicTypes[c]);\n } else {\n switch (c) {\n case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer\n case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference\n case 'L': { // literal\n i++; // skip basic type\n var end = func.indexOf('E', i);\n var size = end - i;\n list.push(func.substr(i, size));\n i += size + 2; // size + 'EE'\n break;\n }\n case 'A': { // array\n var size = parseInt(func.substr(i));\n i += size.toString().length;\n if (func[i] !== '_') throw '?';\n i++; // skip _\n list.push(parse(true, 1, true)[0] + ' [' + size + ']');\n break;\n }\n case 'E': break paramLoop;\n default: ret += '?' + c; break paramLoop;\n }\n }\n }\n if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)\n return rawList ? list : ret + flushList();\n }\n try {\n // Special-case the entry point, since its name differs from other name mangling.\n if (func == 'Object._main' || func == '_main') {\n return 'main()';\n }\n if (typeof func === 'number') func = Pointer_stringify(func);\n if (func[0] !== '_') return func;\n if (func[1] !== '_') return func; // C function\n if (func[2] !== 'Z') return func;\n switch (func[3]) {\n case 'n': return 'operator new()';\n case 'd': return 'operator delete()';\n }\n return parse();\n } catch(e) {\n return func;\n }\n}\n\nfunction demangleAll(text) {\n return text.replace(/__Z[\\w\\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });\n}\n\nfunction stackTrace() {\n var stack = new Error().stack;\n return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.\n}\n\n// Memory management\n\nvar PAGE_SIZE = 4096;\nfunction alignMemoryPage(x) {\n return (x+4095)&-4096;\n}\n\nvar HEAP;\nvar HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;\n\nvar STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area\nvar STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area\nvar DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk\n\nfunction enlargeMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}\n\nvar TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;\nvar TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;\nvar FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;\n\nvar totalMemory = 4096;\nwhile (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {\n if (totalMemory < 16*1024*1024) {\n totalMemory *= 2;\n } else {\n totalMemory += 16*1024*1024\n }\n}\nif (totalMemory !== TOTAL_MEMORY) {\n Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');\n TOTAL_MEMORY = totalMemory;\n}\n\n// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),\n 'JS engine does not provide full typed array support');\n\nvar buffer = new ArrayBuffer(TOTAL_MEMORY);\nHEAP8 = new Int8Array(buffer);\nHEAP16 = new Int16Array(buffer);\nHEAP32 = new Int32Array(buffer);\nHEAPU8 = new Uint8Array(buffer);\nHEAPU16 = new Uint16Array(buffer);\nHEAPU32 = new Uint32Array(buffer);\nHEAPF32 = new Float32Array(buffer);\nHEAPF64 = new Float64Array(buffer);\n\n// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0] = 255;\nassert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');\n\nModule['HEAP'] = HEAP;\nModule['HEAP8'] = HEAP8;\nModule['HEAP16'] = HEAP16;\nModule['HEAP32'] = HEAP32;\nModule['HEAPU8'] = HEAPU8;\nModule['HEAPU16'] = HEAPU16;\nModule['HEAPU32'] = HEAPU32;\nModule['HEAPF32'] = HEAPF32;\nModule['HEAPF64'] = HEAPF64;\n\nfunction callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.shift();\n if (typeof callback == 'function') {\n callback();\n continue;\n }\n var func = callback.func;\n if (typeof func === 'number') {\n if (callback.arg === undefined) {\n Runtime.dynCall('v', func);\n } else {\n Runtime.dynCall('vi', func, [callback.arg]);\n }\n } else {\n func(callback.arg === undefined ? null : callback.arg);\n }\n }\n}\n\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATMAIN__ = []; // functions called when main() is to be run\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the runtime has exited\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n // compatibility - merge in anything from Module['preRun'] at this time\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction ensureInitRuntime() {\n if (runtimeInitialized) return;\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction preMain() {\n callRuntimeCallbacks(__ATMAIN__);\n}\n\nfunction exitRuntime() {\n callRuntimeCallbacks(__ATEXIT__);\n}\n\nfunction postRun() {\n // compatibility - merge in anything from Module['postRun'] at this time\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nModule['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nModule['addOnInit'] = Module.addOnInit = addOnInit;\n\nfunction addOnPreMain(cb) {\n __ATMAIN__.unshift(cb);\n}\nModule['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;\n\nfunction addOnExit(cb) {\n __ATEXIT__.unshift(cb);\n}\nModule['addOnExit'] = Module.addOnExit = addOnExit;\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nModule['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;\n\n// Tools\n\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy, dontAddNull, length /* optional */) {\n var ret = (new Runtime.UTF8Processor()).processJSString(stringy);\n if (length) {\n ret.length = length;\n }\n if (!dontAddNull) {\n ret.push(0);\n }\n return ret;\n}\nModule['intArrayFromString'] = intArrayFromString;\n\nfunction intArrayToString(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n var chr = array[i];\n if (chr > 0xFF) {\n chr &= 0xFF;\n }\n ret.push(String.fromCharCode(chr));\n }\n return ret.join('');\n}\nModule['intArrayToString'] = intArrayToString;\n\n// Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string, buffer, dontAddNull) {\n var array = intArrayFromString(string, dontAddNull);\n var i = 0;\n while (i < array.length) {\n var chr = array[i];\n HEAP8[(((buffer)+(i))|0)]=chr;\n i = i + 1;\n }\n}\nModule['writeStringToMemory'] = writeStringToMemory;\n\nfunction writeArrayToMemory(array, buffer) {\n for (var i = 0; i < array.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=array[i];\n }\n}\nModule['writeArrayToMemory'] = writeArrayToMemory;\n\nfunction writeAsciiToMemory(str, buffer, dontAddNull) {\n for (var i = 0; i < str.length; i++) {\n HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);\n }\n if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;\n}\nModule['writeAsciiToMemory'] = writeAsciiToMemory;\n\nfunction unSign(value, bits, ignore) {\n if (value >= 0) {\n return value;\n }\n return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts\n : Math.pow(2, bits) + value;\n}\nfunction reSign(value, bits, ignore) {\n if (value <= 0) {\n return value;\n }\n var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32\n : Math.pow(2, bits-1);\n if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that\n // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n // TODO: In i64 mode 1, resign the two parts separately and safely\n value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n }\n return value;\n}\n\n// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )\nif (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {\n var ah = a >>> 16;\n var al = a & 0xffff;\n var bh = b >>> 16;\n var bl = b & 0xffff;\n return (al*bl + ((ah*bl + al*bh) << 16))|0;\n};\nMath.imul = Math['imul'];\n\n\nvar Math_abs = Math.abs;\nvar Math_cos = Math.cos;\nvar Math_sin = Math.sin;\nvar Math_tan = Math.tan;\nvar Math_acos = Math.acos;\nvar Math_asin = Math.asin;\nvar Math_atan = Math.atan;\nvar Math_atan2 = Math.atan2;\nvar Math_exp = Math.exp;\nvar Math_log = Math.log;\nvar Math_sqrt = Math.sqrt;\nvar Math_ceil = Math.ceil;\nvar Math_floor = Math.floor;\nvar Math_pow = Math.pow;\nvar Math_imul = Math.imul;\nvar Math_fround = Math.fround;\nvar Math_min = Math.min;\n\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\n\nfunction addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n}\nModule['addRunDependency'] = addRunDependency;\nfunction removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\nModule['removeRunDependency'] = removeRunDependency;\n\nModule[\"preloadedImages\"] = {}; // maps url to image data\nModule[\"preloadedAudios\"] = {}; // maps url to audio data\n\n\nvar memoryInitializer = null;\n\n// === Body ===\n\n\n\n\n\nSTATIC_BASE = 8;\n\nSTATICTOP = STATIC_BASE + Runtime.alignMemory(283);\n/* global initializers */ __ATINIT__.push();\n\n\n/* memory initializer */ allocate([32,69,114,114,111,114,32,105,110,32,84,111,119,101,114,115,58,32,37,115,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,117,116,32,111,102,32,115,112,97,99,101,32,32,32,0,100,105,115,99,32,115,105,122,101,32,101,114,114,111,114,0,110,111,116,104,105,110,103,32,116,111,32,112,111,112,32,0,0,0,0,0,0,0,0,0,32,69,114,114,111,114,32,105,110,32,84,111,119,101,114,115,46,0,0,0,0,0,0,0], \"i8\", ALLOC_NONE, Runtime.GLOBAL_BASE);\n\n\n\n\nvar tempDoublePtr = Runtime.alignMemory(allocate(12, \"i8\", ALLOC_STATIC), 8);\n\nassert(tempDoublePtr % 8 == 0);\n\nfunction copyTempFloat(ptr) { // functions, because inlining this code increases code size too much\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n}\n\nfunction copyTempDouble(ptr) {\n\n HEAP8[tempDoublePtr] = HEAP8[ptr];\n\n HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];\n\n HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];\n\n HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];\n\n HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];\n\n HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];\n\n HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];\n\n HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];\n\n}\n\n\n function _llvm_lifetime_end() {}\n\n function _malloc(bytes) {\n /* Over-allocate to make sure it is byte-aligned by 8.\n * This will leak memory, but this is only the dummy\n * implementation (replaced by dlmalloc normally) so\n * not an issue.\n */\n var ptr = Runtime.dynamicAlloc(bytes + 8);\n return (ptr+8) & 0xFFFFFFF8;\n }\n Module[\"_malloc\"] = _malloc;\n\n \n \n \n \n var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};\n \n var ERRNO_MESSAGES={0:\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"};\n \n \n var ___errno_state=0;function ___setErrNo(value) {\n // For convenient setting and returning of errno.\n HEAP32[((___errno_state)>>2)]=value;\n return value;\n }\n \n var PATH={splitPath:function (filename) {\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n return splitPathRe.exec(filename).slice(1);\n },normalizeArray:function (parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n return parts;\n },normalize:function (path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n path = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n return (isAbsolute ? '/' : '') + path;\n },dirname:function (path) {\n var result = PATH.splitPath(path),\n root = result[0],\n dir = result[1];\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n return root + dir;\n },basename:function (path) {\n // EMSCRIPTEN return '/'' for '/', not an empty string\n if (path === '/') return '/';\n var lastSlash = path.lastIndexOf('/');\n if (lastSlash === -1) return path;\n return path.substr(lastSlash+1);\n },extname:function (path) {\n return PATH.splitPath(path)[3];\n },join:function () {\n var paths = Array.prototype.slice.call(arguments, 0);\n return PATH.normalize(paths.join('/'));\n },join2:function (l, r) {\n return PATH.normalize(l + '/' + r);\n },resolve:function () {\n var resolvedPath = '',\n resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : FS.cwd();\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n },relative:function (from, to) {\n from = PATH.resolve(from).substr(1);\n to = PATH.resolve(to).substr(1);\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n }};\n \n var TTY={ttys:[],init:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // currently, FS.init does not distinguish if process.stdin is a file or TTY\n // // device, it always assumes it's a TTY device. because of this, we're forcing\n // // process.stdin to UTF8 encoding to at least make stdin reading compatible\n // // with text files until FS.init can be refactored.\n // process['stdin']['setEncoding']('utf8');\n // }\n },shutdown:function () {\n // https://github.com/kripken/emscripten/pull/1555\n // if (ENVIRONMENT_IS_NODE) {\n // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?\n // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation\n // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?\n // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle\n // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call\n // process['stdin']['pause']();\n // }\n },register:function (dev, ops) {\n TTY.ttys[dev] = { input: [], output: [], ops: ops };\n FS.registerDevice(dev, TTY.stream_ops);\n },stream_ops:{open:function (stream) {\n var tty = TTY.ttys[stream.node.rdev];\n if (!tty) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n stream.tty = tty;\n stream.seekable = false;\n },close:function (stream) {\n // flush any pending line data\n if (stream.tty.output.length) {\n stream.tty.ops.put_char(stream.tty, 10);\n }\n },read:function (stream, buffer, offset, length, pos /* ignored */) {\n if (!stream.tty || !stream.tty.ops.get_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = stream.tty.ops.get_char(stream.tty);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },write:function (stream, buffer, offset, length, pos) {\n if (!stream.tty || !stream.tty.ops.put_char) {\n throw new FS.ErrnoError(ERRNO_CODES.ENXIO);\n }\n for (var i = 0; i < length; i++) {\n try {\n stream.tty.ops.put_char(stream.tty, buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }},default_tty_ops:{get_char:function (tty) {\n if (!tty.input.length) {\n var result = null;\n if (ENVIRONMENT_IS_NODE) {\n result = process['stdin']['read']();\n if (!result) {\n if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {\n return null; // EOF\n }\n return undefined; // no data available\n }\n } else if (typeof window != 'undefined' &&\n typeof window.prompt == 'function') {\n // Browser.\n result = window.prompt('Input: '); // returns null on cancel\n if (result !== null) {\n result += '\\n';\n }\n } else if (typeof readline == 'function') {\n // Command line.\n result = readline();\n if (result !== null) {\n result += '\\n';\n }\n }\n if (!result) {\n return null;\n }\n tty.input = intArrayFromString(result, true);\n }\n return tty.input.shift();\n },put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['print'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }},default_tty1_ops:{put_char:function (tty, val) {\n if (val === null || val === 10) {\n Module['printErr'](tty.output.join(''));\n tty.output = [];\n } else {\n tty.output.push(TTY.utf8.processCChar(val));\n }\n }}};\n \n var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {\n return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createNode:function (parent, name, mode, dev) {\n if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {\n // no supported\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (!MEMFS.ops_table) {\n MEMFS.ops_table = {\n dir: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n lookup: MEMFS.node_ops.lookup,\n mknod: MEMFS.node_ops.mknod,\n rename: MEMFS.node_ops.rename,\n unlink: MEMFS.node_ops.unlink,\n rmdir: MEMFS.node_ops.rmdir,\n readdir: MEMFS.node_ops.readdir,\n symlink: MEMFS.node_ops.symlink\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek\n }\n },\n file: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: {\n llseek: MEMFS.stream_ops.llseek,\n read: MEMFS.stream_ops.read,\n write: MEMFS.stream_ops.write,\n allocate: MEMFS.stream_ops.allocate,\n mmap: MEMFS.stream_ops.mmap\n }\n },\n link: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr,\n readlink: MEMFS.node_ops.readlink\n },\n stream: {}\n },\n chrdev: {\n node: {\n getattr: MEMFS.node_ops.getattr,\n setattr: MEMFS.node_ops.setattr\n },\n stream: FS.chrdev_stream_ops\n },\n };\n }\n var node = FS.createNode(parent, name, mode, dev);\n if (FS.isDir(node.mode)) {\n node.node_ops = MEMFS.ops_table.dir.node;\n node.stream_ops = MEMFS.ops_table.dir.stream;\n node.contents = {};\n } else if (FS.isFile(node.mode)) {\n node.node_ops = MEMFS.ops_table.file.node;\n node.stream_ops = MEMFS.ops_table.file.stream;\n node.contents = [];\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n } else if (FS.isLink(node.mode)) {\n node.node_ops = MEMFS.ops_table.link.node;\n node.stream_ops = MEMFS.ops_table.link.stream;\n } else if (FS.isChrdev(node.mode)) {\n node.node_ops = MEMFS.ops_table.chrdev.node;\n node.stream_ops = MEMFS.ops_table.chrdev.stream;\n }\n node.timestamp = Date.now();\n // add the new node to the parent\n if (parent) {\n parent.contents[name] = node;\n }\n return node;\n },ensureFlexible:function (node) {\n if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {\n var contents = node.contents;\n node.contents = Array.prototype.slice.call(contents);\n node.contentMode = MEMFS.CONTENT_FLEXIBLE;\n }\n },node_ops:{getattr:function (node) {\n var attr = {};\n // device numbers reuse inode numbers.\n attr.dev = FS.isChrdev(node.mode) ? node.id : 1;\n attr.ino = node.id;\n attr.mode = node.mode;\n attr.nlink = 1;\n attr.uid = 0;\n attr.gid = 0;\n attr.rdev = node.rdev;\n if (FS.isDir(node.mode)) {\n attr.size = 4096;\n } else if (FS.isFile(node.mode)) {\n attr.size = node.contents.length;\n } else if (FS.isLink(node.mode)) {\n attr.size = node.link.length;\n } else {\n attr.size = 0;\n }\n attr.atime = new Date(node.timestamp);\n attr.mtime = new Date(node.timestamp);\n attr.ctime = new Date(node.timestamp);\n // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),\n // but this is not required by the standard.\n attr.blksize = 4096;\n attr.blocks = Math.ceil(attr.size / attr.blksize);\n return attr;\n },setattr:function (node, attr) {\n if (attr.mode !== undefined) {\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n node.timestamp = attr.timestamp;\n }\n if (attr.size !== undefined) {\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n if (attr.size < contents.length) contents.length = attr.size;\n else while (attr.size > contents.length) contents.push(0);\n }\n },lookup:function (parent, name) {\n throw FS.genericErrors[ERRNO_CODES.ENOENT];\n },mknod:function (parent, name, mode, dev) {\n return MEMFS.createNode(parent, name, mode, dev);\n },rename:function (old_node, new_dir, new_name) {\n // if we're overwriting a directory at new_name, make sure it's empty.\n if (FS.isDir(old_node.mode)) {\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n }\n if (new_node) {\n for (var i in new_node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n }\n }\n // do the internal rewiring\n delete old_node.parent.contents[old_node.name];\n old_node.name = new_name;\n new_dir.contents[new_name] = old_node;\n old_node.parent = new_dir;\n },unlink:function (parent, name) {\n delete parent.contents[name];\n },rmdir:function (parent, name) {\n var node = FS.lookupNode(parent, name);\n for (var i in node.contents) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n delete parent.contents[name];\n },readdir:function (node) {\n var entries = ['.', '..']\n for (var key in node.contents) {\n if (!node.contents.hasOwnProperty(key)) {\n continue;\n }\n entries.push(key);\n }\n return entries;\n },symlink:function (parent, newname, oldpath) {\n var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);\n node.link = oldpath;\n return node;\n },readlink:function (node) {\n if (!FS.isLink(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return node.link;\n }},stream_ops:{read:function (stream, buffer, offset, length, position) {\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (size > 8 && contents.subarray) { // non-trivial, and typed array\n buffer.set(contents.subarray(position, position + size), offset);\n } else\n {\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n }\n return size;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n var node = stream.node;\n node.timestamp = Date.now();\n var contents = node.contents;\n if (length && contents.length === 0 && position === 0 && buffer.subarray) {\n // just replace it with the new data\n if (canOwn && offset === 0) {\n node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.\n node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;\n } else {\n node.contents = new Uint8Array(buffer.subarray(offset, offset+length));\n node.contentMode = MEMFS.CONTENT_FIXED;\n }\n return length;\n }\n MEMFS.ensureFlexible(node);\n var contents = node.contents;\n while (contents.length < position) contents.push(0);\n for (var i = 0; i < length; i++) {\n contents[position + i] = buffer[offset + i];\n }\n return length;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n position += stream.node.contents.length;\n }\n }\n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n stream.ungotten = [];\n stream.position = position;\n return position;\n },allocate:function (stream, offset, length) {\n MEMFS.ensureFlexible(stream.node);\n var contents = stream.node.contents;\n var limit = offset + length;\n while (limit > contents.length) contents.push(0);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n if (!FS.isFile(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n var ptr;\n var allocated;\n var contents = stream.node.contents;\n // Only make a new copy when MAP_PRIVATE is specified.\n if ( !(flags & 2) &&\n (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {\n // We can't emulate MAP_SHARED when the file is not backed by the buffer\n // we're mapping to (e.g. the HEAP buffer).\n allocated = false;\n ptr = contents.byteOffset;\n } else {\n // Try to avoid unnecessary slices.\n if (position > 0 || position + length < contents.length) {\n if (contents.subarray) {\n contents = contents.subarray(position, position + length);\n } else {\n contents = Array.prototype.slice.call(contents, position, position + length);\n }\n }\n allocated = true;\n ptr = _malloc(length);\n if (!ptr) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);\n }\n buffer.set(contents, ptr);\n }\n return { ptr: ptr, allocated: allocated };\n }}};\n \n var IDBFS={dbs:{},indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_VERSION:21,DB_STORE_NAME:\"FILE_DATA\",mount:function (mount) {\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },syncfs:function (mount, populate, callback) {\n IDBFS.getLocalSet(mount, function(err, local) {\n if (err) return callback(err);\n \n IDBFS.getRemoteSet(mount, function(err, remote) {\n if (err) return callback(err);\n \n var src = populate ? remote : local;\n var dst = populate ? local : remote;\n \n IDBFS.reconcile(src, dst, callback);\n });\n });\n },getDB:function (name, callback) {\n // check the cache first\n var db = IDBFS.dbs[name];\n if (db) {\n return callback(null, db);\n }\n \n var req;\n try {\n req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);\n } catch (e) {\n return callback(e);\n }\n req.onupgradeneeded = function(e) {\n var db = e.target.result;\n var transaction = e.target.transaction;\n \n var fileStore;\n \n if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {\n fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);\n } else {\n fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);\n }\n \n fileStore.createIndex('timestamp', 'timestamp', { unique: false });\n };\n req.onsuccess = function() {\n db = req.result;\n \n // add to the cache\n IDBFS.dbs[name] = db;\n callback(null, db);\n };\n req.onerror = function() {\n callback(this.error);\n };\n },getLocalSet:function (mount, callback) {\n var entries = {};\n \n function isRealDir(p) {\n return p !== '.' && p !== '..';\n };\n function toAbsolute(root) {\n return function(p) {\n return PATH.join2(root, p);\n }\n };\n \n var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));\n \n while (check.length) {\n var path = check.pop();\n var stat;\n \n try {\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));\n }\n \n entries[path] = { timestamp: stat.mtime };\n }\n \n return callback(null, { type: 'local', entries: entries });\n },getRemoteSet:function (mount, callback) {\n var entries = {};\n \n IDBFS.getDB(mount.mountpoint, function(err, db) {\n if (err) return callback(err);\n \n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');\n transaction.onerror = function() { callback(this.error); };\n \n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n var index = store.index('timestamp');\n \n index.openKeyCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (!cursor) {\n return callback(null, { type: 'remote', db: db, entries: entries });\n }\n \n entries[cursor.primaryKey] = { timestamp: cursor.key };\n \n cursor.continue();\n };\n });\n },loadLocalEntry:function (path, callback) {\n var stat, node;\n \n try {\n var lookup = FS.lookupPath(path);\n node = lookup.node;\n stat = FS.stat(path);\n } catch (e) {\n return callback(e);\n }\n \n if (FS.isDir(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode });\n } else if (FS.isFile(stat.mode)) {\n return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });\n } else {\n return callback(new Error('node type not supported'));\n }\n },storeLocalEntry:function (path, entry, callback) {\n try {\n if (FS.isDir(entry.mode)) {\n FS.mkdir(path, entry.mode);\n } else if (FS.isFile(entry.mode)) {\n FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });\n } else {\n return callback(new Error('node type not supported'));\n }\n \n FS.utime(path, entry.timestamp, entry.timestamp);\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },removeLocalEntry:function (path, callback) {\n try {\n var lookup = FS.lookupPath(path);\n var stat = FS.stat(path);\n \n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n } catch (e) {\n return callback(e);\n }\n \n callback(null);\n },loadRemoteEntry:function (store, path, callback) {\n var req = store.get(path);\n req.onsuccess = function(event) { callback(null, event.target.result); };\n req.onerror = function() { callback(this.error); };\n },storeRemoteEntry:function (store, path, entry, callback) {\n var req = store.put(entry, path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },removeRemoteEntry:function (store, path, callback) {\n var req = store.delete(path);\n req.onsuccess = function() { callback(null); };\n req.onerror = function() { callback(this.error); };\n },reconcile:function (src, dst, callback) {\n var total = 0;\n \n var create = [];\n Object.keys(src.entries).forEach(function (key) {\n var e = src.entries[key];\n var e2 = dst.entries[key];\n if (!e2 || e.timestamp > e2.timestamp) {\n create.push(key);\n total++;\n }\n });\n \n var remove = [];\n Object.keys(dst.entries).forEach(function (key) {\n var e = dst.entries[key];\n var e2 = src.entries[key];\n if (!e2) {\n remove.push(key);\n total++;\n }\n });\n \n if (!total) {\n return callback(null);\n }\n \n var errored = false;\n var completed = 0;\n var db = src.type === 'remote' ? src.db : dst.db;\n var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');\n var store = transaction.objectStore(IDBFS.DB_STORE_NAME);\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= total) {\n return callback(null);\n }\n };\n \n transaction.onerror = function() { done(this.error); };\n \n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort().forEach(function (path) {\n if (dst.type === 'local') {\n IDBFS.loadRemoteEntry(store, path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeLocalEntry(path, entry, done);\n });\n } else {\n IDBFS.loadLocalEntry(path, function (err, entry) {\n if (err) return done(err);\n IDBFS.storeRemoteEntry(store, path, entry, done);\n });\n }\n });\n \n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse().forEach(function(path) {\n if (dst.type === 'local') {\n IDBFS.removeLocalEntry(path, done);\n } else {\n IDBFS.removeRemoteEntry(store, path, done);\n }\n });\n }};\n \n var NODEFS={isWindows:false,staticInit:function () {\n NODEFS.isWindows = !!process.platform.match(/^win/);\n },mount:function (mount) {\n assert(ENVIRONMENT_IS_NODE);\n return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);\n },createNode:function (parent, name, mode, dev) {\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node = FS.createNode(parent, name, mode);\n node.node_ops = NODEFS.node_ops;\n node.stream_ops = NODEFS.stream_ops;\n return node;\n },getMode:function (path) {\n var stat;\n try {\n stat = fs.lstatSync(path);\n if (NODEFS.isWindows) {\n // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so \n // propagate write bits to execute bits.\n stat.mode = stat.mode | ((stat.mode & 146) >> 1);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return stat.mode;\n },realPath:function (node) {\n var parts = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return PATH.join.apply(null, parts);\n },flagsToPermissionStringMap:{0:\"r\",1:\"r+\",2:\"r+\",64:\"r\",65:\"r+\",66:\"r+\",129:\"rx+\",193:\"rx+\",514:\"w+\",577:\"w\",578:\"w+\",705:\"wx\",706:\"wx+\",1024:\"a\",1025:\"a\",1026:\"a+\",1089:\"a\",1090:\"a+\",1153:\"ax\",1154:\"ax+\",1217:\"ax\",1218:\"ax+\",4096:\"rs\",4098:\"rs+\"},flagsToPermissionString:function (flags) {\n if (flags in NODEFS.flagsToPermissionStringMap) {\n return NODEFS.flagsToPermissionStringMap[flags];\n } else {\n return flags;\n }\n },node_ops:{getattr:function (node) {\n var path = NODEFS.realPath(node);\n var stat;\n try {\n stat = fs.lstatSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.\n // See http://support.microsoft.com/kb/140365\n if (NODEFS.isWindows && !stat.blksize) {\n stat.blksize = 4096;\n }\n if (NODEFS.isWindows && !stat.blocks) {\n stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n },setattr:function (node, attr) {\n var path = NODEFS.realPath(node);\n try {\n if (attr.mode !== undefined) {\n fs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n var date = new Date(attr.timestamp);\n fs.utimesSync(path, date, date);\n }\n if (attr.size !== undefined) {\n fs.truncateSync(path, attr.size);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },lookup:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n var mode = NODEFS.getMode(path);\n return NODEFS.createNode(parent, name, mode);\n },mknod:function (parent, name, mode, dev) {\n var node = NODEFS.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n var path = NODEFS.realPath(node);\n try {\n if (FS.isDir(node.mode)) {\n fs.mkdirSync(path, node.mode);\n } else {\n fs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return node;\n },rename:function (oldNode, newDir, newName) {\n var oldPath = NODEFS.realPath(oldNode);\n var newPath = PATH.join2(NODEFS.realPath(newDir), newName);\n try {\n fs.renameSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },unlink:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.unlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },rmdir:function (parent, name) {\n var path = PATH.join2(NODEFS.realPath(parent), name);\n try {\n fs.rmdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readdir:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readdirSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },symlink:function (parent, newName, oldPath) {\n var newPath = PATH.join2(NODEFS.realPath(parent), newName);\n try {\n fs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },readlink:function (node) {\n var path = NODEFS.realPath(node);\n try {\n return fs.readlinkSync(path);\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }},stream_ops:{open:function (stream) {\n var path = NODEFS.realPath(stream.node);\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },close:function (stream) {\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n fs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) throw e;\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n },read:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(length);\n var res;\n try {\n res = fs.readSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n if (res > 0) {\n for (var i = 0; i < res; i++) {\n buffer[offset + i] = nbuffer[i];\n }\n }\n return res;\n },write:function (stream, buffer, offset, length, position) {\n // FIXME this is terrible.\n var nbuffer = new Buffer(buffer.subarray(offset, offset + length));\n var res;\n try {\n res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n return res;\n },llseek:function (stream, offset, whence) {\n var position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (FS.isFile(stream.node.mode)) {\n try {\n var stat = fs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES[e.code]);\n }\n }\n }\n \n if (position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n stream.position = position;\n return position;\n }}};\n \n var _stdin=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stdout=allocate(1, \"i32*\", ALLOC_STATIC);\n \n var _stderr=allocate(1, \"i32*\", ALLOC_STATIC);\n \n function _fflush(stream) {\n // int fflush(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html\n // we don't currently perform any user-space buffering of data\n }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {\n if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();\n return ___setErrNo(e.errno);\n },lookupPath:function (path, opts) {\n path = PATH.resolve(FS.cwd(), path);\n opts = opts || {};\n \n var defaults = {\n follow_mount: true,\n recurse_count: 0\n };\n for (var key in defaults) {\n if (opts[key] === undefined) {\n opts[key] = defaults[key];\n }\n }\n \n if (opts.recurse_count > 8) { // max recursive lookup of 8\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n \n // split the path\n var parts = PATH.normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), false);\n \n // start at the root\n var current = FS.root;\n var current_path = '/';\n \n for (var i = 0; i < parts.length; i++) {\n var islast = (i === parts.length-1);\n if (islast && opts.parent) {\n // stop resolving\n break;\n }\n \n current = FS.lookupNode(current, parts[i]);\n current_path = PATH.join2(current_path, parts[i]);\n \n // jump to the mount's root node if this is a mountpoint\n if (FS.isMountpoint(current)) {\n if (!islast || (islast && opts.follow_mount)) {\n current = current.mounted.root;\n }\n }\n \n // by default, lookupPath will not follow a symlink if it is the final path component.\n // setting opts.follow = true will override this behavior.\n if (!islast || opts.follow) {\n var count = 0;\n while (FS.isLink(current.mode)) {\n var link = FS.readlink(current_path);\n current_path = PATH.resolve(PATH.dirname(current_path), link);\n \n var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });\n current = lookup.node;\n \n if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).\n throw new FS.ErrnoError(ERRNO_CODES.ELOOP);\n }\n }\n }\n }\n \n return { path: current_path, node: current };\n },getPath:function (node) {\n var path;\n while (true) {\n if (FS.isRoot(node)) {\n var mount = node.mount.mountpoint;\n if (!path) return mount;\n return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;\n }\n path = path ? node.name + '/' + path : node.name;\n node = node.parent;\n }\n },hashName:function (parentid, name) {\n var hash = 0;\n \n \n for (var i = 0; i < name.length; i++) {\n hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;\n }\n return ((parentid + hash) >>> 0) % FS.nameTable.length;\n },hashAddNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n node.name_next = FS.nameTable[hash];\n FS.nameTable[hash] = node;\n },hashRemoveNode:function (node) {\n var hash = FS.hashName(node.parent.id, node.name);\n if (FS.nameTable[hash] === node) {\n FS.nameTable[hash] = node.name_next;\n } else {\n var current = FS.nameTable[hash];\n while (current) {\n if (current.name_next === node) {\n current.name_next = node.name_next;\n break;\n }\n current = current.name_next;\n }\n }\n },lookupNode:function (parent, name) {\n var err = FS.mayLookup(parent);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n var hash = FS.hashName(parent.id, name);\n for (var node = FS.nameTable[hash]; node; node = node.name_next) {\n var nodeName = node.name;\n if (node.parent.id === parent.id && nodeName === name) {\n return node;\n }\n }\n // if we failed to find it in the cache, call into the VFS\n return FS.lookup(parent, name);\n },createNode:function (parent, name, mode, rdev) {\n if (!FS.FSNode) {\n FS.FSNode = function(parent, name, mode, rdev) {\n if (!parent) {\n parent = this; // root node sets parent to itself\n }\n this.parent = parent;\n this.mount = parent.mount;\n this.mounted = null;\n this.id = FS.nextInode++;\n this.name = name;\n this.mode = mode;\n this.node_ops = {};\n this.stream_ops = {};\n this.rdev = rdev;\n };\n \n FS.FSNode.prototype = {};\n \n // compatibility\n var readMode = 292 | 73;\n var writeMode = 146;\n \n // NOTE we must use Object.defineProperties instead of individual calls to\n // Object.defineProperty in order to make closure compiler happy\n Object.defineProperties(FS.FSNode.prototype, {\n read: {\n get: function() { return (this.mode & readMode) === readMode; },\n set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }\n },\n write: {\n get: function() { return (this.mode & writeMode) === writeMode; },\n set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }\n },\n isFolder: {\n get: function() { return FS.isDir(this.mode); },\n },\n isDevice: {\n get: function() { return FS.isChrdev(this.mode); },\n },\n });\n }\n \n var node = new FS.FSNode(parent, name, mode, rdev);\n \n FS.hashAddNode(node);\n \n return node;\n },destroyNode:function (node) {\n FS.hashRemoveNode(node);\n },isRoot:function (node) {\n return node === node.parent;\n },isMountpoint:function (node) {\n return !!node.mounted;\n },isFile:function (mode) {\n return (mode & 61440) === 32768;\n },isDir:function (mode) {\n return (mode & 61440) === 16384;\n },isLink:function (mode) {\n return (mode & 61440) === 40960;\n },isChrdev:function (mode) {\n return (mode & 61440) === 8192;\n },isBlkdev:function (mode) {\n return (mode & 61440) === 24576;\n },isFIFO:function (mode) {\n return (mode & 61440) === 4096;\n },isSocket:function (mode) {\n return (mode & 49152) === 49152;\n },flagModes:{\"r\":0,\"rs\":1052672,\"r+\":2,\"w\":577,\"wx\":705,\"xw\":705,\"w+\":578,\"wx+\":706,\"xw+\":706,\"a\":1089,\"ax\":1217,\"xa\":1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},modeStringToFlags:function (str) {\n var flags = FS.flagModes[str];\n if (typeof flags === 'undefined') {\n throw new Error('Unknown file open mode: ' + str);\n }\n return flags;\n },flagsToPermissionString:function (flag) {\n var accmode = flag & 2097155;\n var perms = ['r', 'w', 'rw'][accmode];\n if ((flag & 512)) {\n perms += 'w';\n }\n return perms;\n },nodePermissions:function (node, perms) {\n if (FS.ignorePermissions) {\n return 0;\n }\n // return 0 if any user, group or owner bits are set.\n if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {\n return ERRNO_CODES.EACCES;\n } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {\n return ERRNO_CODES.EACCES;\n }\n return 0;\n },mayLookup:function (dir) {\n return FS.nodePermissions(dir, 'x');\n },mayCreate:function (dir, name) {\n try {\n var node = FS.lookupNode(dir, name);\n return ERRNO_CODES.EEXIST;\n } catch (e) {\n }\n return FS.nodePermissions(dir, 'wx');\n },mayDelete:function (dir, name, isdir) {\n var node;\n try {\n node = FS.lookupNode(dir, name);\n } catch (e) {\n return e.errno;\n }\n var err = FS.nodePermissions(dir, 'wx');\n if (err) {\n return err;\n }\n if (isdir) {\n if (!FS.isDir(node.mode)) {\n return ERRNO_CODES.ENOTDIR;\n }\n if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {\n return ERRNO_CODES.EBUSY;\n }\n } else {\n if (FS.isDir(node.mode)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return 0;\n },mayOpen:function (node, flags) {\n if (!node) {\n return ERRNO_CODES.ENOENT;\n }\n if (FS.isLink(node.mode)) {\n return ERRNO_CODES.ELOOP;\n } else if (FS.isDir(node.mode)) {\n if ((flags & 2097155) !== 0 || // opening for write\n (flags & 512)) {\n return ERRNO_CODES.EISDIR;\n }\n }\n return FS.nodePermissions(node, FS.flagsToPermissionString(flags));\n },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {\n fd_start = fd_start || 0;\n fd_end = fd_end || FS.MAX_OPEN_FDS;\n for (var fd = fd_start; fd <= fd_end; fd++) {\n if (!FS.streams[fd]) {\n return fd;\n }\n }\n throw new FS.ErrnoError(ERRNO_CODES.EMFILE);\n },getStream:function (fd) {\n return FS.streams[fd];\n },createStream:function (stream, fd_start, fd_end) {\n if (!FS.FSStream) {\n FS.FSStream = function(){};\n FS.FSStream.prototype = {};\n // compatibility\n Object.defineProperties(FS.FSStream.prototype, {\n object: {\n get: function() { return this.node; },\n set: function(val) { this.node = val; }\n },\n isRead: {\n get: function() { return (this.flags & 2097155) !== 1; }\n },\n isWrite: {\n get: function() { return (this.flags & 2097155) !== 0; }\n },\n isAppend: {\n get: function() { return (this.flags & 1024); }\n }\n });\n }\n if (stream.__proto__) {\n // reuse the object\n stream.__proto__ = FS.FSStream.prototype;\n } else {\n var newStream = new FS.FSStream();\n for (var p in stream) {\n newStream[p] = stream[p];\n }\n stream = newStream;\n }\n var fd = FS.nextfd(fd_start, fd_end);\n stream.fd = fd;\n FS.streams[fd] = stream;\n return stream;\n },closeStream:function (fd) {\n FS.streams[fd] = null;\n },getStreamFromPtr:function (ptr) {\n return FS.streams[ptr - 1];\n },getPtrForStream:function (stream) {\n return stream ? stream.fd + 1 : 0;\n },chrdev_stream_ops:{open:function (stream) {\n var device = FS.getDevice(stream.node.rdev);\n // override node's stream ops with the device's\n stream.stream_ops = device.stream_ops;\n // forward the open call\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n },llseek:function () {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }},major:function (dev) {\n return ((dev) >> 8);\n },minor:function (dev) {\n return ((dev) & 0xff);\n },makedev:function (ma, mi) {\n return ((ma) << 8 | (mi));\n },registerDevice:function (dev, ops) {\n FS.devices[dev] = { stream_ops: ops };\n },getDevice:function (dev) {\n return FS.devices[dev];\n },getMounts:function (mount) {\n var mounts = [];\n var check = [mount];\n \n while (check.length) {\n var m = check.pop();\n \n mounts.push(m);\n \n check.push.apply(check, m.mounts);\n }\n \n return mounts;\n },syncfs:function (populate, callback) {\n if (typeof(populate) === 'function') {\n callback = populate;\n populate = false;\n }\n \n var mounts = FS.getMounts(FS.root.mount);\n var completed = 0;\n \n function done(err) {\n if (err) {\n if (!done.errored) {\n done.errored = true;\n return callback(err);\n }\n return;\n }\n if (++completed >= mounts.length) {\n callback(null);\n }\n };\n \n // sync all mounts\n mounts.forEach(function (mount) {\n if (!mount.type.syncfs) {\n return done(null);\n }\n mount.type.syncfs(mount, populate, done);\n });\n },mount:function (type, opts, mountpoint) {\n var root = mountpoint === '/';\n var pseudo = !mountpoint;\n var node;\n \n if (root && FS.root) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n } else if (!root && !pseudo) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n mountpoint = lookup.path; // use the absolute path\n node = lookup.node;\n \n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n \n if (!FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n }\n \n var mount = {\n type: type,\n opts: opts,\n mountpoint: mountpoint,\n mounts: []\n };\n \n // create a root node for the fs\n var mountRoot = type.mount(mount);\n mountRoot.mount = mount;\n mount.root = mountRoot;\n \n if (root) {\n FS.root = mountRoot;\n } else if (node) {\n // set as a mountpoint\n node.mounted = mount;\n \n // add the new mount to the current mount's children\n if (node.mount) {\n node.mount.mounts.push(mount);\n }\n }\n \n return mountRoot;\n },unmount:function (mountpoint) {\n var lookup = FS.lookupPath(mountpoint, { follow_mount: false });\n \n if (!FS.isMountpoint(lookup.node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n \n // destroy the nodes for this mount, and all its child mounts\n var node = lookup.node;\n var mount = node.mounted;\n var mounts = FS.getMounts(mount);\n \n Object.keys(FS.nameTable).forEach(function (hash) {\n var current = FS.nameTable[hash];\n \n while (current) {\n var next = current.name_next;\n \n if (mounts.indexOf(current.mount) !== -1) {\n FS.destroyNode(current);\n }\n \n current = next;\n }\n });\n \n // no longer a mountpoint\n node.mounted = null;\n \n // remove this mount from the child mounts\n var idx = node.mount.mounts.indexOf(mount);\n assert(idx !== -1);\n node.mount.mounts.splice(idx, 1);\n },lookup:function (parent, name) {\n return parent.node_ops.lookup(parent, name);\n },mknod:function (path, mode, dev) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var err = FS.mayCreate(parent, name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.mknod) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.mknod(parent, name, mode, dev);\n },create:function (path, mode) {\n mode = mode !== undefined ? mode : 438 /* 0666 */;\n mode &= 4095;\n mode |= 32768;\n return FS.mknod(path, mode, 0);\n },mkdir:function (path, mode) {\n mode = mode !== undefined ? mode : 511 /* 0777 */;\n mode &= 511 | 512;\n mode |= 16384;\n return FS.mknod(path, mode, 0);\n },mkdev:function (path, mode, dev) {\n if (typeof(dev) === 'undefined') {\n dev = mode;\n mode = 438 /* 0666 */;\n }\n mode |= 8192;\n return FS.mknod(path, mode, dev);\n },symlink:function (oldpath, newpath) {\n var lookup = FS.lookupPath(newpath, { parent: true });\n var parent = lookup.node;\n var newname = PATH.basename(newpath);\n var err = FS.mayCreate(parent, newname);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.symlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return parent.node_ops.symlink(parent, newname, oldpath);\n },rename:function (old_path, new_path) {\n var old_dirname = PATH.dirname(old_path);\n var new_dirname = PATH.dirname(new_path);\n var old_name = PATH.basename(old_path);\n var new_name = PATH.basename(new_path);\n // parents must exist\n var lookup, old_dir, new_dir;\n try {\n lookup = FS.lookupPath(old_path, { parent: true });\n old_dir = lookup.node;\n lookup = FS.lookupPath(new_path, { parent: true });\n new_dir = lookup.node;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // need to be part of the same mount\n if (old_dir.mount !== new_dir.mount) {\n throw new FS.ErrnoError(ERRNO_CODES.EXDEV);\n }\n // source must exist\n var old_node = FS.lookupNode(old_dir, old_name);\n // old path should not be an ancestor of the new path\n var relative = PATH.relative(old_path, new_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n // new path should not be an ancestor of the old path\n relative = PATH.relative(new_path, old_dirname);\n if (relative.charAt(0) !== '.') {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);\n }\n // see if the new path already exists\n var new_node;\n try {\n new_node = FS.lookupNode(new_dir, new_name);\n } catch (e) {\n // not fatal\n }\n // early out if nothing needs to change\n if (old_node === new_node) {\n return;\n }\n // we'll need to delete the old entry\n var isdir = FS.isDir(old_node.mode);\n var err = FS.mayDelete(old_dir, old_name, isdir);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // need delete permissions if we'll be overwriting.\n // need create permissions if new doesn't already exist.\n err = new_node ?\n FS.mayDelete(new_dir, new_name, isdir) :\n FS.mayCreate(new_dir, new_name);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!old_dir.node_ops.rename) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n // if we are going to change the parent, check write permissions\n if (new_dir !== old_dir) {\n err = FS.nodePermissions(old_dir, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n }\n // remove the node from the lookup hash\n FS.hashRemoveNode(old_node);\n // do the underlying fs rename\n try {\n old_dir.node_ops.rename(old_node, new_dir, new_name);\n } catch (e) {\n throw e;\n } finally {\n // add the node back to the hash (in case node_ops.rename\n // changed its name)\n FS.hashAddNode(old_node);\n }\n },rmdir:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, true);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.rmdir) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.rmdir(parent, name);\n FS.destroyNode(node);\n },readdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n if (!node.node_ops.readdir) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n return node.node_ops.readdir(node);\n },unlink:function (path) {\n var lookup = FS.lookupPath(path, { parent: true });\n var parent = lookup.node;\n var name = PATH.basename(path);\n var node = FS.lookupNode(parent, name);\n var err = FS.mayDelete(parent, name, false);\n if (err) {\n // POSIX says unlink should set EPERM, not EISDIR\n if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;\n throw new FS.ErrnoError(err);\n }\n if (!parent.node_ops.unlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isMountpoint(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EBUSY);\n }\n parent.node_ops.unlink(parent, name);\n FS.destroyNode(node);\n },readlink:function (path) {\n var lookup = FS.lookupPath(path);\n var link = lookup.node;\n if (!link.node_ops.readlink) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n return link.node_ops.readlink(link);\n },stat:function (path, dontFollow) {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n var node = lookup.node;\n if (!node.node_ops.getattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n return node.node_ops.getattr(node);\n },lstat:function (path) {\n return FS.stat(path, true);\n },chmod:function (path, mode, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n mode: (mode & 4095) | (node.mode & ~4095),\n timestamp: Date.now()\n });\n },lchmod:function (path, mode) {\n FS.chmod(path, mode, true);\n },fchmod:function (fd, mode) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chmod(stream.node, mode);\n },chown:function (path, uid, gid, dontFollow) {\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: !dontFollow });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n node.node_ops.setattr(node, {\n timestamp: Date.now()\n // we ignore the uid / gid for now\n });\n },lchown:function (path, uid, gid) {\n FS.chown(path, uid, gid, true);\n },fchown:function (fd, uid, gid) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n FS.chown(stream.node, uid, gid);\n },truncate:function (path, len) {\n if (len < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var node;\n if (typeof path === 'string') {\n var lookup = FS.lookupPath(path, { follow: true });\n node = lookup.node;\n } else {\n node = path;\n }\n if (!node.node_ops.setattr) {\n throw new FS.ErrnoError(ERRNO_CODES.EPERM);\n }\n if (FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!FS.isFile(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var err = FS.nodePermissions(node, 'w');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n node.node_ops.setattr(node, {\n size: len,\n timestamp: Date.now()\n });\n },ftruncate:function (fd, len) {\n var stream = FS.getStream(fd);\n if (!stream) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n FS.truncate(stream.node, len);\n },utime:function (path, atime, mtime) {\n var lookup = FS.lookupPath(path, { follow: true });\n var node = lookup.node;\n node.node_ops.setattr(node, {\n timestamp: Math.max(atime, mtime)\n });\n },open:function (path, flags, mode, fd_start, fd_end) {\n flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;\n mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;\n if ((flags & 64)) {\n mode = (mode & 4095) | 32768;\n } else {\n mode = 0;\n }\n var node;\n if (typeof path === 'object') {\n node = path;\n } else {\n path = PATH.normalize(path);\n try {\n var lookup = FS.lookupPath(path, {\n follow: !(flags & 131072)\n });\n node = lookup.node;\n } catch (e) {\n // ignore\n }\n }\n // perhaps we need to create the node\n if ((flags & 64)) {\n if (node) {\n // if O_CREAT and O_EXCL are set, error out if the node already exists\n if ((flags & 128)) {\n throw new FS.ErrnoError(ERRNO_CODES.EEXIST);\n }\n } else {\n // node doesn't exist, try to create it\n node = FS.mknod(path, mode, 0);\n }\n }\n if (!node) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOENT);\n }\n // can't truncate a device\n if (FS.isChrdev(node.mode)) {\n flags &= ~512;\n }\n // check permissions\n var err = FS.mayOpen(node, flags);\n if (err) {\n throw new FS.ErrnoError(err);\n }\n // do truncation if necessary\n if ((flags & 512)) {\n FS.truncate(node, 0);\n }\n // we've already handled these, don't pass down to the underlying vfs\n flags &= ~(128 | 512);\n \n // register the stream with the filesystem\n var stream = FS.createStream({\n node: node,\n path: FS.getPath(node), // we want the absolute path to the node\n flags: flags,\n seekable: true,\n position: 0,\n stream_ops: node.stream_ops,\n // used by the file family libc calls (fopen, fwrite, ferror, etc.)\n ungotten: [],\n error: false\n }, fd_start, fd_end);\n // call the new stream's open function\n if (stream.stream_ops.open) {\n stream.stream_ops.open(stream);\n }\n if (Module['logReadFiles'] && !(flags & 1)) {\n if (!FS.readFiles) FS.readFiles = {};\n if (!(path in FS.readFiles)) {\n FS.readFiles[path] = 1;\n Module['printErr']('read file: ' + path);\n }\n }\n return stream;\n },close:function (stream) {\n try {\n if (stream.stream_ops.close) {\n stream.stream_ops.close(stream);\n }\n } catch (e) {\n throw e;\n } finally {\n FS.closeStream(stream.fd);\n }\n },llseek:function (stream, offset, whence) {\n if (!stream.seekable || !stream.stream_ops.llseek) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n return stream.stream_ops.llseek(stream, offset, whence);\n },read:function (stream, buffer, offset, length, position) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.read) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);\n if (!seeking) stream.position += bytesRead;\n return bytesRead;\n },write:function (stream, buffer, offset, length, position, canOwn) {\n if (length < 0 || position < 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (FS.isDir(stream.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.EISDIR);\n }\n if (!stream.stream_ops.write) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var seeking = true;\n if (typeof position === 'undefined') {\n position = stream.position;\n seeking = false;\n } else if (!stream.seekable) {\n throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);\n }\n if (stream.flags & 1024) {\n // seek to the end before writing in append mode\n FS.llseek(stream, 0, 2);\n }\n var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);\n if (!seeking) stream.position += bytesWritten;\n return bytesWritten;\n },allocate:function (stream, offset, length) {\n if (offset < 0 || length <= 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n if ((stream.flags & 2097155) === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EBADF);\n }\n if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n if (!stream.stream_ops.allocate) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n stream.stream_ops.allocate(stream, offset, length);\n },mmap:function (stream, buffer, offset, length, position, prot, flags) {\n // TODO if PROT is PROT_WRITE, make sure we have write access\n if ((stream.flags & 2097155) === 1) {\n throw new FS.ErrnoError(ERRNO_CODES.EACCES);\n }\n if (!stream.stream_ops.mmap) {\n throw new FS.ErrnoError(ERRNO_CODES.ENODEV);\n }\n return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);\n },ioctl:function (stream, cmd, arg) {\n if (!stream.stream_ops.ioctl) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);\n }\n return stream.stream_ops.ioctl(stream, cmd, arg);\n },readFile:function (path, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'r';\n opts.encoding = opts.encoding || 'binary';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var ret;\n var stream = FS.open(path, opts.flags);\n var stat = FS.stat(path);\n var length = stat.size;\n var buf = new Uint8Array(length);\n FS.read(stream, buf, 0, length, 0);\n if (opts.encoding === 'utf8') {\n ret = '';\n var utf8 = new Runtime.UTF8Processor();\n for (var i = 0; i < length; i++) {\n ret += utf8.processCChar(buf[i]);\n }\n } else if (opts.encoding === 'binary') {\n ret = buf;\n }\n FS.close(stream);\n return ret;\n },writeFile:function (path, data, opts) {\n opts = opts || {};\n opts.flags = opts.flags || 'w';\n opts.encoding = opts.encoding || 'utf8';\n if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {\n throw new Error('Invalid encoding type \"' + opts.encoding + '\"');\n }\n var stream = FS.open(path, opts.flags, opts.mode);\n if (opts.encoding === 'utf8') {\n var utf8 = new Runtime.UTF8Processor();\n var buf = new Uint8Array(utf8.processJSString(data));\n FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);\n } else if (opts.encoding === 'binary') {\n FS.write(stream, data, 0, data.length, 0, opts.canOwn);\n }\n FS.close(stream);\n },cwd:function () {\n return FS.currentPath;\n },chdir:function (path) {\n var lookup = FS.lookupPath(path, { follow: true });\n if (!FS.isDir(lookup.node.mode)) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);\n }\n var err = FS.nodePermissions(lookup.node, 'x');\n if (err) {\n throw new FS.ErrnoError(err);\n }\n FS.currentPath = lookup.path;\n },createDefaultDirectories:function () {\n FS.mkdir('/tmp');\n },createDefaultDevices:function () {\n // create /dev\n FS.mkdir('/dev');\n // setup /dev/null\n FS.registerDevice(FS.makedev(1, 3), {\n read: function() { return 0; },\n write: function() { return 0; }\n });\n FS.mkdev('/dev/null', FS.makedev(1, 3));\n // setup /dev/tty and /dev/tty1\n // stderr needs to print output using Module['printErr']\n // so we register a second tty just for it.\n TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);\n TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);\n FS.mkdev('/dev/tty', FS.makedev(5, 0));\n FS.mkdev('/dev/tty1', FS.makedev(6, 0));\n // we're not going to emulate the actual shm device,\n // just create the tmp dirs that reside in it commonly\n FS.mkdir('/dev/shm');\n FS.mkdir('/dev/shm/tmp');\n },createStandardStreams:function () {\n // TODO deprecate the old functionality of a single\n // input / output callback and that utilizes FS.createDevice\n // and instead require a unique set of stream ops\n \n // by default, we symlink the standard streams to the\n // default tty devices. however, if the standard streams\n // have been overwritten we create a unique device for\n // them instead.\n if (Module['stdin']) {\n FS.createDevice('/dev', 'stdin', Module['stdin']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdin');\n }\n if (Module['stdout']) {\n FS.createDevice('/dev', 'stdout', null, Module['stdout']);\n } else {\n FS.symlink('/dev/tty', '/dev/stdout');\n }\n if (Module['stderr']) {\n FS.createDevice('/dev', 'stderr', null, Module['stderr']);\n } else {\n FS.symlink('/dev/tty1', '/dev/stderr');\n }\n \n // open default streams for the stdin, stdout and stderr devices\n var stdin = FS.open('/dev/stdin', 'r');\n HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);\n assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');\n \n var stdout = FS.open('/dev/stdout', 'w');\n HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);\n assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');\n \n var stderr = FS.open('/dev/stderr', 'w');\n HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);\n assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');\n },ensureErrnoError:function () {\n if (FS.ErrnoError) return;\n FS.ErrnoError = function ErrnoError(errno) {\n this.errno = errno;\n for (var key in ERRNO_CODES) {\n if (ERRNO_CODES[key] === errno) {\n this.code = key;\n break;\n }\n }\n this.message = ERRNO_MESSAGES[errno];\n };\n FS.ErrnoError.prototype = new Error();\n FS.ErrnoError.prototype.constructor = FS.ErrnoError;\n // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)\n [ERRNO_CODES.ENOENT].forEach(function(code) {\n FS.genericErrors[code] = new FS.ErrnoError(code);\n FS.genericErrors[code].stack = '<generic error, no stack>';\n });\n },staticInit:function () {\n FS.ensureErrnoError();\n \n FS.nameTable = new Array(4096);\n \n FS.mount(MEMFS, {}, '/');\n \n FS.createDefaultDirectories();\n FS.createDefaultDevices();\n },init:function (input, output, error) {\n assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');\n FS.init.initialized = true;\n \n FS.ensureErrnoError();\n \n // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\n Module['stdin'] = input || Module['stdin'];\n Module['stdout'] = output || Module['stdout'];\n Module['stderr'] = error || Module['stderr'];\n \n FS.createStandardStreams();\n },quit:function () {\n FS.init.initialized = false;\n for (var i = 0; i < FS.streams.length; i++) {\n var stream = FS.streams[i];\n if (!stream) {\n continue;\n }\n FS.close(stream);\n }\n },getMode:function (canRead, canWrite) {\n var mode = 0;\n if (canRead) mode |= 292 | 73;\n if (canWrite) mode |= 146;\n return mode;\n },joinPath:function (parts, forceRelative) {\n var path = PATH.join.apply(null, parts);\n if (forceRelative && path[0] == '/') path = path.substr(1);\n return path;\n },absolutePath:function (relative, base) {\n return PATH.resolve(base, relative);\n },standardizePath:function (path) {\n return PATH.normalize(path);\n },findObject:function (path, dontResolveLastLink) {\n var ret = FS.analyzePath(path, dontResolveLastLink);\n if (ret.exists) {\n return ret.object;\n } else {\n ___setErrNo(ret.error);\n return null;\n }\n },analyzePath:function (path, dontResolveLastLink) {\n // operate from within the context of the symlink's target\n try {\n var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n path = lookup.path;\n } catch (e) {\n }\n var ret = {\n isRoot: false, exists: false, error: 0, name: null, path: null, object: null,\n parentExists: false, parentPath: null, parentObject: null\n };\n try {\n var lookup = FS.lookupPath(path, { parent: true });\n ret.parentExists = true;\n ret.parentPath = lookup.path;\n ret.parentObject = lookup.node;\n ret.name = PATH.basename(path);\n lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });\n ret.exists = true;\n ret.path = lookup.path;\n ret.object = lookup.node;\n ret.name = lookup.node.name;\n ret.isRoot = lookup.path === '/';\n } catch (e) {\n ret.error = e.errno;\n };\n return ret;\n },createFolder:function (parent, name, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.mkdir(path, mode);\n },createPath:function (parent, path, canRead, canWrite) {\n parent = typeof parent === 'string' ? parent : FS.getPath(parent);\n var parts = path.split('/').reverse();\n while (parts.length) {\n var part = parts.pop();\n if (!part) continue;\n var current = PATH.join2(parent, part);\n try {\n FS.mkdir(current);\n } catch (e) {\n // ignore EEXIST\n }\n parent = current;\n }\n return current;\n },createFile:function (parent, name, properties, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(canRead, canWrite);\n return FS.create(path, mode);\n },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {\n var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;\n var mode = FS.getMode(canRead, canWrite);\n var node = FS.create(path, mode);\n if (data) {\n if (typeof data === 'string') {\n var arr = new Array(data.length);\n for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);\n data = arr;\n }\n // make sure we can write to the file\n FS.chmod(node, mode | 146);\n var stream = FS.open(node, 'w');\n FS.write(stream, data, 0, data.length, 0, canOwn);\n FS.close(stream);\n FS.chmod(node, mode);\n }\n return node;\n },createDevice:function (parent, name, input, output) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n var mode = FS.getMode(!!input, !!output);\n if (!FS.createDevice.major) FS.createDevice.major = 64;\n var dev = FS.makedev(FS.createDevice.major++, 0);\n // Create a fake device that a set of stream ops to emulate\n // the old behavior.\n FS.registerDevice(dev, {\n open: function(stream) {\n stream.seekable = false;\n },\n close: function(stream) {\n // flush any pending line data\n if (output && output.buffer && output.buffer.length) {\n output(10);\n }\n },\n read: function(stream, buffer, offset, length, pos /* ignored */) {\n var bytesRead = 0;\n for (var i = 0; i < length; i++) {\n var result;\n try {\n result = input();\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n if (result === undefined && bytesRead === 0) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n if (result === null || result === undefined) break;\n bytesRead++;\n buffer[offset+i] = result;\n }\n if (bytesRead) {\n stream.node.timestamp = Date.now();\n }\n return bytesRead;\n },\n write: function(stream, buffer, offset, length, pos) {\n for (var i = 0; i < length; i++) {\n try {\n output(buffer[offset+i]);\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n }\n if (length) {\n stream.node.timestamp = Date.now();\n }\n return i;\n }\n });\n return FS.mkdev(path, mode, dev);\n },createLink:function (parent, name, target, canRead, canWrite) {\n var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);\n return FS.symlink(target, path);\n },forceLoadFile:function (obj) {\n if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;\n var success = true;\n if (typeof XMLHttpRequest !== 'undefined') {\n throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\n } else if (Module['read']) {\n // Command-line.\n try {\n // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as\n // read() will try to parse UTF8.\n obj.contents = intArrayFromString(Module['read'](obj.url), true);\n } catch (e) {\n success = false;\n }\n } else {\n throw new Error('Cannot load without read() or XMLHttpRequest.');\n }\n if (!success) ___setErrNo(ERRNO_CODES.EIO);\n return success;\n },createLazyFile:function (parent, name, url, canRead, canWrite) {\n if (typeof XMLHttpRequest !== 'undefined') {\n if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';\n // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.\n function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }\n LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {\n if (idx > this.length-1 || idx < 0) {\n return undefined;\n }\n var chunkOffset = idx % this.chunkSize;\n var chunkNum = Math.floor(idx / this.chunkSize);\n return this.getter(chunkNum)[chunkOffset];\n }\n LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {\n this.getter = getter;\n }\n LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {\n // Find length\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n var datalength = Number(xhr.getResponseHeader(\"Content-length\"));\n var header;\n var hasByteServing = (header = xhr.getResponseHeader(\"Accept-Ranges\")) && header === \"bytes\";\n var chunkSize = 1024*1024; // Chunk size in bytes\n \n if (!hasByteServing) chunkSize = datalength;\n \n // Function to get a range from the remote URL.\n var doXHR = (function(from, to) {\n if (from > to) throw new Error(\"invalid range (\" + from + \", \" + to + \") or no bytes requested!\");\n if (to > datalength-1) throw new Error(\"only \" + datalength + \" bytes available! programmer error!\");\n \n // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n if (datalength !== chunkSize) xhr.setRequestHeader(\"Range\", \"bytes=\" + from + \"-\" + to);\n \n // Some hints to the browser that we want binary data.\n if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n }\n \n xhr.send(null);\n if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error(\"Couldn't load \" + url + \". Status: \" + xhr.status);\n if (xhr.response !== undefined) {\n return new Uint8Array(xhr.response || []);\n } else {\n return intArrayFromString(xhr.responseText || '', true);\n }\n });\n var lazyArray = this;\n lazyArray.setDataGetter(function(chunkNum) {\n var start = chunkNum * chunkSize;\n var end = (chunkNum+1) * chunkSize - 1; // including this byte\n end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") {\n lazyArray.chunks[chunkNum] = doXHR(start, end);\n }\n if (typeof(lazyArray.chunks[chunkNum]) === \"undefined\") throw new Error(\"doXHR failed!\");\n return lazyArray.chunks[chunkNum];\n });\n \n this._length = datalength;\n this._chunkSize = chunkSize;\n this.lengthKnown = true;\n }\n \n var lazyArray = new LazyUint8Array();\n Object.defineProperty(lazyArray, \"length\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._length;\n }\n });\n Object.defineProperty(lazyArray, \"chunkSize\", {\n get: function() {\n if(!this.lengthKnown) {\n this.cacheLength();\n }\n return this._chunkSize;\n }\n });\n \n var properties = { isDevice: false, contents: lazyArray };\n } else {\n var properties = { isDevice: false, url: url };\n }\n \n var node = FS.createFile(parent, name, properties, canRead, canWrite);\n // This is a total hack, but I want to get this lazy file code out of the\n // core of MEMFS. If we want to keep this lazy file concept I feel it should\n // be its own thin LAZYFS proxying calls to MEMFS.\n if (properties.contents) {\n node.contents = properties.contents;\n } else if (properties.url) {\n node.contents = null;\n node.url = properties.url;\n }\n // override each stream op with one that tries to force load the lazy file first\n var stream_ops = {};\n var keys = Object.keys(node.stream_ops);\n keys.forEach(function(key) {\n var fn = node.stream_ops[key];\n stream_ops[key] = function forceLoadLazyFile() {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n return fn.apply(null, arguments);\n };\n });\n // use a custom read function\n stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {\n if (!FS.forceLoadFile(node)) {\n throw new FS.ErrnoError(ERRNO_CODES.EIO);\n }\n var contents = stream.node.contents;\n if (position >= contents.length)\n return 0;\n var size = Math.min(contents.length - position, length);\n assert(size >= 0);\n if (contents.slice) { // normal array\n for (var i = 0; i < size; i++) {\n buffer[offset + i] = contents[position + i];\n }\n } else {\n for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR\n buffer[offset + i] = contents.get(position + i);\n }\n }\n return size;\n };\n node.stream_ops = stream_ops;\n return node;\n },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {\n Browser.init();\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n function processData(byteArray) {\n function finish(byteArray) {\n if (!dontCreateFile) {\n FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n }\n if (onload) onload();\n removeRunDependency('cp ' + fullname);\n }\n var handled = false;\n Module['preloadPlugins'].forEach(function(plugin) {\n if (handled) return;\n if (plugin['canHandle'](fullname)) {\n plugin['handle'](byteArray, fullname, finish, function() {\n if (onerror) onerror();\n removeRunDependency('cp ' + fullname);\n });\n handled = true;\n }\n });\n if (!handled) finish(byteArray);\n }\n addRunDependency('cp ' + fullname);\n if (typeof url == 'string') {\n Browser.asyncLoad(url, function(byteArray) {\n processData(byteArray);\n }, onerror);\n } else {\n processData(url);\n }\n },indexedDB:function () {\n return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n },DB_NAME:function () {\n return 'EM_FS_' + window.location.pathname;\n },DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {\n console.log('creating db');\n var db = openRequest.result;\n db.createObjectStore(FS.DB_STORE_NAME);\n };\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var putRequest = files.put(FS.analyzePath(path).object.contents, path);\n putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };\n putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n },loadFilesFromDB:function (paths, onload, onerror) {\n onload = onload || function(){};\n onerror = onerror || function(){};\n var indexedDB = FS.indexedDB();\n try {\n var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);\n } catch (e) {\n return onerror(e);\n }\n openRequest.onupgradeneeded = onerror; // no database to load from\n openRequest.onsuccess = function openRequest_onsuccess() {\n var db = openRequest.result;\n try {\n var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');\n } catch(e) {\n onerror(e);\n return;\n }\n var files = transaction.objectStore(FS.DB_STORE_NAME);\n var ok = 0, fail = 0, total = paths.length;\n function finish() {\n if (fail == 0) onload(); else onerror();\n }\n paths.forEach(function(path) {\n var getRequest = files.get(path);\n getRequest.onsuccess = function getRequest_onsuccess() {\n if (FS.analyzePath(path).exists) {\n FS.unlink(path);\n }\n FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);\n ok++;\n if (ok + fail == total) finish();\n };\n getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };\n });\n transaction.onerror = onerror;\n };\n openRequest.onerror = onerror;\n }};\n \n \n \n function _mkport() { throw 'TODO' }var SOCKFS={mount:function (mount) {\n return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);\n },createSocket:function (family, type, protocol) {\n var streaming = type == 1;\n if (protocol) {\n assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp\n }\n \n // create our internal socket structure\n var sock = {\n family: family,\n type: type,\n protocol: protocol,\n server: null,\n peers: {},\n pending: [],\n recv_queue: [],\n sock_ops: SOCKFS.websocket_sock_ops\n };\n \n // create the filesystem node to store the socket structure\n var name = SOCKFS.nextname();\n var node = FS.createNode(SOCKFS.root, name, 49152, 0);\n node.sock = sock;\n \n // and the wrapping stream that enables library functions such\n // as read and write to indirectly interact with the socket\n var stream = FS.createStream({\n path: name,\n node: node,\n flags: FS.modeStringToFlags('r+'),\n seekable: false,\n stream_ops: SOCKFS.stream_ops\n });\n \n // map the new stream to the socket structure (sockets have a 1:1\n // relationship with a stream)\n sock.stream = stream;\n \n return sock;\n },getSocket:function (fd) {\n var stream = FS.getStream(fd);\n if (!stream || !FS.isSocket(stream.node.mode)) {\n return null;\n }\n return stream.node.sock;\n },stream_ops:{poll:function (stream) {\n var sock = stream.node.sock;\n return sock.sock_ops.poll(sock);\n },ioctl:function (stream, request, varargs) {\n var sock = stream.node.sock;\n return sock.sock_ops.ioctl(sock, request, varargs);\n },read:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n var msg = sock.sock_ops.recvmsg(sock, length);\n if (!msg) {\n // socket is closed\n return 0;\n }\n buffer.set(msg.buffer, offset);\n return msg.buffer.length;\n },write:function (stream, buffer, offset, length, position /* ignored */) {\n var sock = stream.node.sock;\n return sock.sock_ops.sendmsg(sock, buffer, offset, length);\n },close:function (stream) {\n var sock = stream.node.sock;\n sock.sock_ops.close(sock);\n }},nextname:function () {\n if (!SOCKFS.nextname.current) {\n SOCKFS.nextname.current = 0;\n }\n return 'socket[' + (SOCKFS.nextname.current++) + ']';\n },websocket_sock_ops:{createPeer:function (sock, addr, port) {\n var ws;\n \n if (typeof addr === 'object') {\n ws = addr;\n addr = null;\n port = null;\n }\n \n if (ws) {\n // for sockets that've already connected (e.g. we're the server)\n // we can inspect the _socket property for the address\n if (ws._socket) {\n addr = ws._socket.remoteAddress;\n port = ws._socket.remotePort;\n }\n // if we're just now initializing a connection to the remote,\n // inspect the url property\n else {\n var result = /ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);\n if (!result) {\n throw new Error('WebSocket URL must be in the format ws(s)://address:port');\n }\n addr = result[1];\n port = parseInt(result[2], 10);\n }\n } else {\n // create the actual websocket object and connect\n try {\n var url = 'ws://' + addr + ':' + port;\n // the node ws library API is slightly different than the browser's\n var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];\n // If node we use the ws library.\n var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];\n ws = new WebSocket(url, opts);\n ws.binaryType = 'arraybuffer';\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);\n }\n }\n \n \n var peer = {\n addr: addr,\n port: port,\n socket: ws,\n dgram_send_queue: []\n };\n \n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);\n \n // if this is a bound dgram socket, send the port number first to allow\n // us to override the ephemeral port reported to us by remotePort on the\n // remote end.\n if (sock.type === 2 && typeof sock.sport !== 'undefined') {\n peer.dgram_send_queue.push(new Uint8Array([\n 255, 255, 255, 255,\n 'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),\n ((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)\n ]));\n }\n \n return peer;\n },getPeer:function (sock, addr, port) {\n return sock.peers[addr + ':' + port];\n },addPeer:function (sock, peer) {\n sock.peers[peer.addr + ':' + peer.port] = peer;\n },removePeer:function (sock, peer) {\n delete sock.peers[peer.addr + ':' + peer.port];\n },handlePeerEvents:function (sock, peer) {\n var first = true;\n \n var handleOpen = function () {\n try {\n var queued = peer.dgram_send_queue.shift();\n while (queued) {\n peer.socket.send(queued);\n queued = peer.dgram_send_queue.shift();\n }\n } catch (e) {\n // not much we can do here in the way of proper error handling as we've already\n // lied and said this data was sent. shut it down.\n peer.socket.close();\n }\n };\n \n function handleMessage(data) {\n assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer\n data = new Uint8Array(data); // make a typed array view on the array buffer\n \n \n // if this is the port message, override the peer's port with it\n var wasfirst = first;\n first = false;\n if (wasfirst &&\n data.length === 10 &&\n data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&\n data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {\n // update the peer's port and it's key in the peer map\n var newport = ((data[8] << 8) | data[9]);\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n peer.port = newport;\n SOCKFS.websocket_sock_ops.addPeer(sock, peer);\n return;\n }\n \n sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });\n };\n \n if (ENVIRONMENT_IS_NODE) {\n peer.socket.on('open', handleOpen);\n peer.socket.on('message', function(data, flags) {\n if (!flags.binary) {\n return;\n }\n handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer\n });\n peer.socket.on('error', function() {\n // don't throw\n });\n } else {\n peer.socket.onopen = handleOpen;\n peer.socket.onmessage = function peer_socket_onmessage(event) {\n handleMessage(event.data);\n };\n }\n },poll:function (sock) {\n if (sock.type === 1 && sock.server) {\n // listen sockets should only say they're available for reading\n // if there are pending clients.\n return sock.pending.length ? (64 | 1) : 0;\n }\n \n var mask = 0;\n var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets\n SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :\n null;\n \n if (sock.recv_queue.length ||\n !dest || // connection-less sockets are always ready to read\n (dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed\n mask |= (64 | 1);\n }\n \n if (!dest || // connection-less sockets are always ready to write\n (dest && dest.socket.readyState === dest.socket.OPEN)) {\n mask |= 4;\n }\n \n if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||\n (dest && dest.socket.readyState === dest.socket.CLOSED)) {\n mask |= 16;\n }\n \n return mask;\n },ioctl:function (sock, request, arg) {\n switch (request) {\n case 21531:\n var bytes = 0;\n if (sock.recv_queue.length) {\n bytes = sock.recv_queue[0].data.length;\n }\n HEAP32[((arg)>>2)]=bytes;\n return 0;\n default:\n return ERRNO_CODES.EINVAL;\n }\n },close:function (sock) {\n // if we've spawned a listen server, close it\n if (sock.server) {\n try {\n sock.server.close();\n } catch (e) {\n }\n sock.server = null;\n }\n // close any peer connections\n var peers = Object.keys(sock.peers);\n for (var i = 0; i < peers.length; i++) {\n var peer = sock.peers[peers[i]];\n try {\n peer.socket.close();\n } catch (e) {\n }\n SOCKFS.websocket_sock_ops.removePeer(sock, peer);\n }\n return 0;\n },bind:function (sock, addr, port) {\n if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound\n }\n sock.saddr = addr;\n sock.sport = port || _mkport();\n // in order to emulate dgram sockets, we need to launch a listen server when\n // binding on a connection-less socket\n // note: this is only required on the server side\n if (sock.type === 2) {\n // close the existing server if it exists\n if (sock.server) {\n sock.server.close();\n sock.server = null;\n }\n // swallow error operation not supported error that occurs when binding in the\n // browser where this isn't supported\n try {\n sock.sock_ops.listen(sock, 0);\n } catch (e) {\n if (!(e instanceof FS.ErrnoError)) throw e;\n if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;\n }\n }\n },connect:function (sock, addr, port) {\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);\n }\n \n // TODO autobind\n // if (!sock.addr && sock.type == 2) {\n // }\n \n // early out if we're already connected / in the middle of connecting\n if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n if (dest) {\n if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EALREADY);\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EISCONN);\n }\n }\n }\n \n // add the socket to our peer list and set our\n // destination address / port to match\n var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n sock.daddr = peer.addr;\n sock.dport = peer.port;\n \n // always \"fail\" in non-blocking mode\n throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);\n },listen:function (sock, backlog) {\n if (!ENVIRONMENT_IS_NODE) {\n throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);\n }\n if (sock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening\n }\n var WebSocketServer = require('ws').Server;\n var host = sock.saddr;\n sock.server = new WebSocketServer({\n host: host,\n port: sock.sport\n // TODO support backlog\n });\n \n sock.server.on('connection', function(ws) {\n if (sock.type === 1) {\n var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);\n \n // create a peer on the new socket\n var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);\n newsock.daddr = peer.addr;\n newsock.dport = peer.port;\n \n // push to queue for accept to pick up\n sock.pending.push(newsock);\n } else {\n // create a peer on the listen socket so calling sendto\n // with the listen socket and an address will resolve\n // to the correct client\n SOCKFS.websocket_sock_ops.createPeer(sock, ws);\n }\n });\n sock.server.on('closed', function() {\n sock.server = null;\n });\n sock.server.on('error', function() {\n // don't throw\n });\n },accept:function (listensock) {\n if (!listensock.server) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n var newsock = listensock.pending.shift();\n newsock.stream.flags = listensock.stream.flags;\n return newsock;\n },getname:function (sock, peer) {\n var addr, port;\n if (peer) {\n if (sock.daddr === undefined || sock.dport === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n addr = sock.daddr;\n port = sock.dport;\n } else {\n // TODO saddr and sport will be set for bind()'d UDP sockets, but what\n // should we be returning for TCP sockets that've been connect()'d?\n addr = sock.saddr || 0;\n port = sock.sport || 0;\n }\n return { addr: addr, port: port };\n },sendmsg:function (sock, buffer, offset, length, addr, port) {\n if (sock.type === 2) {\n // connection-less sockets will honor the message address,\n // and otherwise fall back to the bound destination address\n if (addr === undefined || port === undefined) {\n addr = sock.daddr;\n port = sock.dport;\n }\n // if there was no address to fall back to, error out\n if (addr === undefined || port === undefined) {\n throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);\n }\n } else {\n // connection-based sockets will only use the bound\n addr = sock.daddr;\n port = sock.dport;\n }\n \n // find the peer for the destination address\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);\n \n // early out if not connected with a connection-based socket\n if (sock.type === 1) {\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n } else if (dest.socket.readyState === dest.socket.CONNECTING) {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // create a copy of the incoming data to send, as the WebSocket API\n // doesn't work entirely with an ArrayBufferView, it'll just send\n // the entire underlying buffer\n var data;\n if (buffer instanceof Array || buffer instanceof ArrayBuffer) {\n data = buffer.slice(offset, offset + length);\n } else { // ArrayBufferView\n data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);\n }\n \n // if we're emulating a connection-less dgram socket and don't have\n // a cached connection, queue the buffer to send upon connect and\n // lie, saying the data was sent now.\n if (sock.type === 2) {\n if (!dest || dest.socket.readyState !== dest.socket.OPEN) {\n // if we're not connected, open a new connection\n if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);\n }\n dest.dgram_send_queue.push(data);\n return length;\n }\n }\n \n try {\n // send the actual data\n dest.socket.send(data);\n return length;\n } catch (e) {\n throw new FS.ErrnoError(ERRNO_CODES.EINVAL);\n }\n },recvmsg:function (sock, length) {\n // http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html\n if (sock.type === 1 && sock.server) {\n // tcp servers should not be recv()'ing on the listen socket\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n \n var queued = sock.recv_queue.shift();\n if (!queued) {\n if (sock.type === 1) {\n var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);\n \n if (!dest) {\n // if we have a destination address but are not connected, error out\n throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);\n }\n else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {\n // return null if the socket has closed\n return null;\n }\n else {\n // else, our socket is in a valid state but truly has nothing available\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n } else {\n throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);\n }\n }\n \n // queued.data will be an ArrayBuffer if it's unadulterated, but if it's\n // requeued TCP data it'll be an ArrayBufferView\n var queuedLength = queued.data.byteLength || queued.data.length;\n var queuedOffset = queued.data.byteOffset || 0;\n var queuedBuffer = queued.data.buffer || queued.data;\n var bytesRead = Math.min(length, queuedLength);\n var res = {\n buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),\n addr: queued.addr,\n port: queued.port\n };\n \n \n // push back any unread data for TCP connections\n if (sock.type === 1 && bytesRead < queuedLength) {\n var bytesRemaining = queuedLength - bytesRead;\n queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);\n sock.recv_queue.unshift(queued);\n }\n \n return res;\n }}};function _send(fd, buf, len, flags) {\n var sock = SOCKFS.getSocket(fd);\n if (!sock) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n // TODO honor flags\n return _write(fd, buf, len);\n }\n \n function _pwrite(fildes, buf, nbyte, offset) {\n // ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte, offset);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }function _write(fildes, buf, nbyte) {\n // ssize_t write(int fildes, const void *buf, size_t nbyte);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html\n var stream = FS.getStream(fildes);\n if (!stream) {\n ___setErrNo(ERRNO_CODES.EBADF);\n return -1;\n }\n \n \n try {\n var slab = HEAP8;\n return FS.write(stream, slab, buf, nbyte);\n } catch (e) {\n FS.handleFSError(e);\n return -1;\n }\n }\n \n \n Module[\"_strlen\"] = _strlen;\n \n function _fileno(stream) {\n // int fileno(FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html\n stream = FS.getStreamFromPtr(stream);\n if (!stream) return -1;\n return stream.fd;\n }function _fputs(s, stream) {\n // int fputs(const char *restrict s, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fputs.html\n var fd = _fileno(stream);\n return _write(fd, s, _strlen(s));\n }\n \n function _fputc(c, stream) {\n // int fputc(int c, FILE *stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fputc.html\n var chr = unSign(c & 0xFF);\n HEAP8[((_fputc.ret)|0)]=chr;\n var fd = _fileno(stream);\n var ret = _write(fd, _fputc.ret, 1);\n if (ret == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return -1;\n } else {\n return chr;\n }\n }function _puts(s) {\n // int puts(const char *s);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/puts.html\n // NOTE: puts() always writes an extra newline.\n var stdout = HEAP32[((_stdout)>>2)];\n var ret = _fputs(s, stdout);\n if (ret < 0) {\n return ret;\n } else {\n var newlineRet = _fputc(10, stdout);\n return (newlineRet < 0) ? -1 : ret + 1;\n }\n }\n\n \n Module[\"_memset\"] = _memset;\n\n function _free() {\n }\n Module[\"_free\"] = _free;\n\n function _llvm_lifetime_start() {}\n\n var Browser={mainLoop:{scheduler:null,method:\"\",shouldPause:false,paused:false,queue:[],pause:function () {\n Browser.mainLoop.shouldPause = true;\n },resume:function () {\n if (Browser.mainLoop.paused) {\n Browser.mainLoop.paused = false;\n Browser.mainLoop.scheduler();\n }\n Browser.mainLoop.shouldPause = false;\n },updateStatus:function () {\n if (Module['setStatus']) {\n var message = Module['statusMessage'] || 'Please wait...';\n var remaining = Browser.mainLoop.remainingBlockers;\n var expected = Browser.mainLoop.expectedBlockers;\n if (remaining) {\n if (remaining < expected) {\n Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');\n } else {\n Module['setStatus'](message);\n }\n } else {\n Module['setStatus']('');\n }\n }\n }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {\n if (!Module[\"preloadPlugins\"]) Module[\"preloadPlugins\"] = []; // needs to exist even in workers\n \n if (Browser.initted || ENVIRONMENT_IS_WORKER) return;\n Browser.initted = true;\n \n try {\n new Blob();\n Browser.hasBlobConstructor = true;\n } catch(e) {\n Browser.hasBlobConstructor = false;\n console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\");\n }\n Browser.BlobBuilder = typeof MozBlobBuilder != \"undefined\" ? MozBlobBuilder : (typeof WebKitBlobBuilder != \"undefined\" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log(\"warning: no BlobBuilder\") : null));\n Browser.URLObject = typeof window != \"undefined\" ? (window.URL ? window.URL : window.webkitURL) : undefined;\n if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {\n console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\");\n Module.noImageDecoding = true;\n }\n \n // Support for plugins that can process preloaded files. You can add more of these to\n // your app by creating and appending to Module.preloadPlugins.\n //\n // Each plugin is asked if it can handle a file based on the file's name. If it can,\n // it is given the file's raw data. When it is done, it calls a callback with the file's\n // (possibly modified) data. For example, a plugin might decompress a file, or it\n // might create some side data structure for use later (like an Image element, etc.).\n \n var imagePlugin = {};\n imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {\n return !Module.noImageDecoding && /\\.(jpg|jpeg|png|bmp)$/i.test(name);\n };\n imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {\n var b = null;\n if (Browser.hasBlobConstructor) {\n try {\n b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n if (b.size !== byteArray.length) { // Safari bug #118630\n // Safari's Blob can only take an ArrayBuffer\n b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });\n }\n } catch(e) {\n Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');\n }\n }\n if (!b) {\n var bb = new Browser.BlobBuilder();\n bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range\n b = bb.getBlob();\n }\n var url = Browser.URLObject.createObjectURL(b);\n var img = new Image();\n img.onload = function img_onload() {\n assert(img.complete, 'Image ' + name + ' could not be decoded');\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n Module[\"preloadedImages\"][name] = canvas;\n Browser.URLObject.revokeObjectURL(url);\n if (onload) onload(byteArray);\n };\n img.onerror = function img_onerror(event) {\n console.log('Image ' + url + ' could not be decoded');\n if (onerror) onerror();\n };\n img.src = url;\n };\n Module['preloadPlugins'].push(imagePlugin);\n \n var audioPlugin = {};\n audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {\n return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };\n };\n audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {\n var done = false;\n function finish(audio) {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = audio;\n if (onload) onload(byteArray);\n }\n function fail() {\n if (done) return;\n done = true;\n Module[\"preloadedAudios\"][name] = new Audio(); // empty shim\n if (onerror) onerror();\n }\n if (Browser.hasBlobConstructor) {\n try {\n var b = new Blob([byteArray], { type: Browser.getMimetype(name) });\n } catch(e) {\n return fail();\n }\n var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!\n var audio = new Audio();\n audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926\n audio.onerror = function audio_onerror(event) {\n if (done) return;\n console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');\n function encode64(data) {\n var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var PAD = '=';\n var ret = '';\n var leftchar = 0;\n var leftbits = 0;\n for (var i = 0; i < data.length; i++) {\n leftchar = (leftchar << 8) | data[i];\n leftbits += 8;\n while (leftbits >= 6) {\n var curr = (leftchar >> (leftbits-6)) & 0x3f;\n leftbits -= 6;\n ret += BASE[curr];\n }\n }\n if (leftbits == 2) {\n ret += BASE[(leftchar&3) << 4];\n ret += PAD + PAD;\n } else if (leftbits == 4) {\n ret += BASE[(leftchar&0xf) << 2];\n ret += PAD;\n }\n return ret;\n }\n audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);\n finish(audio); // we don't wait for confirmation this worked - but it's worth trying\n };\n audio.src = url;\n // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\n Browser.safeSetTimeout(function() {\n finish(audio); // try to use it even though it is not necessarily ready to play\n }, 10000);\n } else {\n return fail();\n }\n };\n Module['preloadPlugins'].push(audioPlugin);\n \n // Canvas event setup\n \n var canvas = Module['canvas'];\n \n // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module\n // Module['forcedAspectRatio'] = 4 / 3;\n \n canvas.requestPointerLock = canvas['requestPointerLock'] ||\n canvas['mozRequestPointerLock'] ||\n canvas['webkitRequestPointerLock'] ||\n canvas['msRequestPointerLock'] ||\n function(){};\n canvas.exitPointerLock = document['exitPointerLock'] ||\n document['mozExitPointerLock'] ||\n document['webkitExitPointerLock'] ||\n document['msExitPointerLock'] ||\n function(){}; // no-op if function does not exist\n canvas.exitPointerLock = canvas.exitPointerLock.bind(document);\n \n function pointerLockChange() {\n Browser.pointerLock = document['pointerLockElement'] === canvas ||\n document['mozPointerLockElement'] === canvas ||\n document['webkitPointerLockElement'] === canvas ||\n document['msPointerLockElement'] === canvas;\n }\n \n document.addEventListener('pointerlockchange', pointerLockChange, false);\n document.addEventListener('mozpointerlockchange', pointerLockChange, false);\n document.addEventListener('webkitpointerlockchange', pointerLockChange, false);\n document.addEventListener('mspointerlockchange', pointerLockChange, false);\n \n if (Module['elementPointerLock']) {\n canvas.addEventListener(\"click\", function(ev) {\n if (!Browser.pointerLock && canvas.requestPointerLock) {\n canvas.requestPointerLock();\n ev.preventDefault();\n }\n }, false);\n }\n },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {\n var ctx;\n var errorInfo = '?';\n function onContextCreationError(event) {\n errorInfo = event.statusMessage || errorInfo;\n }\n try {\n if (useWebGL) {\n var contextAttributes = {\n antialias: false,\n alpha: false\n };\n \n if (webGLContextAttributes) {\n for (var attribute in webGLContextAttributes) {\n contextAttributes[attribute] = webGLContextAttributes[attribute];\n }\n }\n \n \n canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);\n try {\n ['experimental-webgl', 'webgl'].some(function(webglId) {\n return ctx = canvas.getContext(webglId, contextAttributes);\n });\n } finally {\n canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);\n }\n } else {\n ctx = canvas.getContext('2d');\n }\n if (!ctx) throw ':(';\n } catch (e) {\n Module.print('Could not create canvas: ' + [errorInfo, e]);\n return null;\n }\n if (useWebGL) {\n // Set the background of the WebGL canvas to black\n canvas.style.backgroundColor = \"black\";\n \n // Warn on context loss\n canvas.addEventListener('webglcontextlost', function(event) {\n alert('WebGL context lost. You will need to reload the page.');\n }, false);\n }\n if (setInModule) {\n GLctx = Module.ctx = ctx;\n Module.useWebGL = useWebGL;\n Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });\n Browser.init();\n }\n return ctx;\n },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {\n Browser.lockPointer = lockPointer;\n Browser.resizeCanvas = resizeCanvas;\n if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;\n if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;\n \n var canvas = Module['canvas'];\n var canvasContainer = canvas.parentNode;\n function fullScreenChange() {\n Browser.isFullScreen = false;\n if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvasContainer) {\n canvas.cancelFullScreen = document['cancelFullScreen'] ||\n document['mozCancelFullScreen'] ||\n document['webkitCancelFullScreen'] ||\n document['msExitFullscreen'] ||\n document['exitFullscreen'] ||\n function() {};\n canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);\n if (Browser.lockPointer) canvas.requestPointerLock();\n Browser.isFullScreen = true;\n if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();\n } else {\n \n // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen\n var canvasContainer = canvas.parentNode;\n canvasContainer.parentNode.insertBefore(canvas, canvasContainer);\n canvasContainer.parentNode.removeChild(canvasContainer);\n \n if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();\n }\n if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);\n Browser.updateCanvasDimensions(canvas);\n }\n \n if (!Browser.fullScreenHandlersInstalled) {\n Browser.fullScreenHandlersInstalled = true;\n document.addEventListener('fullscreenchange', fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', fullScreenChange, false);\n document.addEventListener('webkitfullscreenchange', fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', fullScreenChange, false);\n }\n \n // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root\n var canvasContainer = document.createElement(\"div\");\n canvas.parentNode.insertBefore(canvasContainer, canvas);\n canvasContainer.appendChild(canvas);\n \n // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)\n canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||\n canvasContainer['mozRequestFullScreen'] ||\n canvasContainer['msRequestFullscreen'] ||\n (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);\n canvasContainer.requestFullScreen();\n },requestAnimationFrame:function requestAnimationFrame(func) {\n if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)\n setTimeout(func, 1000/60);\n } else {\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = window['requestAnimationFrame'] ||\n window['mozRequestAnimationFrame'] ||\n window['webkitRequestAnimationFrame'] ||\n window['msRequestAnimationFrame'] ||\n window['oRequestAnimationFrame'] ||\n window['setTimeout'];\n }\n window.requestAnimationFrame(func);\n }\n },safeCallback:function (func) {\n return function() {\n if (!ABORT) return func.apply(null, arguments);\n };\n },safeRequestAnimationFrame:function (func) {\n return Browser.requestAnimationFrame(function() {\n if (!ABORT) func();\n });\n },safeSetTimeout:function (func, timeout) {\n return setTimeout(function() {\n if (!ABORT) func();\n }, timeout);\n },safeSetInterval:function (func, timeout) {\n return setInterval(function() {\n if (!ABORT) func();\n }, timeout);\n },getMimetype:function (name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n },getUserMedia:function (func) {\n if(!window.getUserMedia) {\n window.getUserMedia = navigator['getUserMedia'] ||\n navigator['mozGetUserMedia'];\n }\n window.getUserMedia(func);\n },getMovementX:function (event) {\n return event['movementX'] ||\n event['mozMovementX'] ||\n event['webkitMovementX'] ||\n 0;\n },getMovementY:function (event) {\n return event['movementY'] ||\n event['mozMovementY'] ||\n event['webkitMovementY'] ||\n 0;\n },getMouseWheelDelta:function (event) {\n return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));\n },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup\n if (Browser.pointerLock) {\n // When the pointer is locked, calculate the coordinates\n // based on the movement of the mouse.\n // Workaround for Firefox bug 764498\n if (event.type != 'mousemove' &&\n ('mozMovementX' in event)) {\n Browser.mouseMovementX = Browser.mouseMovementY = 0;\n } else {\n Browser.mouseMovementX = Browser.getMovementX(event);\n Browser.mouseMovementY = Browser.getMovementY(event);\n }\n \n // check if SDL is available\n if (typeof SDL != \"undefined\") {\n \tBrowser.mouseX = SDL.mouseX + Browser.mouseMovementX;\n \tBrowser.mouseY = SDL.mouseY + Browser.mouseMovementY;\n } else {\n \t// just add the mouse delta to the current absolut mouse position\n \t// FIXME: ideally this should be clamped against the canvas size and zero\n \tBrowser.mouseX += Browser.mouseMovementX;\n \tBrowser.mouseY += Browser.mouseMovementY;\n } \n } else {\n // Otherwise, calculate the movement based on the changes\n // in the coordinates.\n var rect = Module[\"canvas\"].getBoundingClientRect();\n var x, y;\n \n // Neither .scrollX or .pageXOffset are defined in a spec, but\n // we prefer .scrollX because it is currently in a spec draft.\n // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)\n var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);\n var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);\n if (event.type == 'touchstart' ||\n event.type == 'touchend' ||\n event.type == 'touchmove') {\n var t = event.touches.item(0);\n if (t) {\n x = t.pageX - (scrollX + rect.left);\n y = t.pageY - (scrollY + rect.top);\n } else {\n return;\n }\n } else {\n x = event.pageX - (scrollX + rect.left);\n y = event.pageY - (scrollY + rect.top);\n }\n \n // the canvas might be CSS-scaled compared to its backbuffer;\n // SDL-using content will want mouse coordinates in terms\n // of backbuffer units.\n var cw = Module[\"canvas\"].width;\n var ch = Module[\"canvas\"].height;\n x = x * (cw / rect.width);\n y = y * (ch / rect.height);\n \n Browser.mouseMovementX = x - Browser.mouseX;\n Browser.mouseMovementY = y - Browser.mouseY;\n Browser.mouseX = x;\n Browser.mouseY = y;\n }\n },xhrLoad:function (url, onload, onerror) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = function xhr_onload() {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n } else {\n onerror();\n }\n };\n xhr.onerror = onerror;\n xhr.send(null);\n },asyncLoad:function (url, onload, onerror, noRunDep) {\n Browser.xhrLoad(url, function(arrayBuffer) {\n assert(arrayBuffer, 'Loading data file \"' + url + '\" failed (no arrayBuffer).');\n onload(new Uint8Array(arrayBuffer));\n if (!noRunDep) removeRunDependency('al ' + url);\n }, function(event) {\n if (onerror) {\n onerror();\n } else {\n throw 'Loading data file \"' + url + '\" failed.';\n }\n });\n if (!noRunDep) addRunDependency('al ' + url);\n },resizeListeners:[],updateResizeListeners:function () {\n var canvas = Module['canvas'];\n Browser.resizeListeners.forEach(function(listener) {\n listener(canvas.width, canvas.height);\n });\n },setCanvasSize:function (width, height, noUpdates) {\n var canvas = Module['canvas'];\n Browser.updateCanvasDimensions(canvas, width, height);\n if (!noUpdates) Browser.updateResizeListeners();\n },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags | 0x00800000; // set SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },setWindowedCanvasSize:function () {\n // check if SDL is available \n if (typeof SDL != \"undefined\") {\n \tvar flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];\n \tflags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag\n \tHEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags\n }\n Browser.updateResizeListeners();\n },updateCanvasDimensions:function (canvas, wNative, hNative) {\n if (wNative && hNative) {\n canvas.widthNative = wNative;\n canvas.heightNative = hNative;\n } else {\n wNative = canvas.widthNative;\n hNative = canvas.heightNative;\n }\n var w = wNative;\n var h = hNative;\n if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {\n if (w/h < Module['forcedAspectRatio']) {\n w = Math.round(h * Module['forcedAspectRatio']);\n } else {\n h = Math.round(w / Module['forcedAspectRatio']);\n }\n }\n if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||\n document['mozFullScreenElement'] || document['mozFullscreenElement'] ||\n document['fullScreenElement'] || document['fullscreenElement'] ||\n document['msFullScreenElement'] || document['msFullscreenElement'] ||\n document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {\n var factor = Math.min(screen.width / w, screen.height / h);\n w = Math.round(w * factor);\n h = Math.round(h * factor);\n }\n if (Browser.resizeCanvas) {\n if (canvas.width != w) canvas.width = w;\n if (canvas.height != h) canvas.height = h;\n if (typeof canvas.style != 'undefined') {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n } else {\n if (canvas.width != wNative) canvas.width = wNative;\n if (canvas.height != hNative) canvas.height = hNative;\n if (typeof canvas.style != 'undefined') {\n if (w != wNative || h != hNative) {\n canvas.style.setProperty( \"width\", w + \"px\", \"important\");\n canvas.style.setProperty(\"height\", h + \"px\", \"important\");\n } else {\n canvas.style.removeProperty( \"width\");\n canvas.style.removeProperty(\"height\");\n }\n }\n }\n }};\n\n \n \n function _fwrite(ptr, size, nitems, stream) {\n // size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html\n var bytesToWrite = nitems * size;\n if (bytesToWrite == 0) return 0;\n var fd = _fileno(stream);\n var bytesWritten = _write(fd, ptr, bytesToWrite);\n if (bytesWritten == -1) {\n var streamObj = FS.getStreamFromPtr(stream);\n if (streamObj) streamObj.error = true;\n return 0;\n } else {\n return Math.floor(bytesWritten / size);\n }\n }\n \n \n function __reallyNegative(x) {\n return x < 0 || (x === 0 && (1/x) === -Infinity);\n }function __formatString(format, varargs) {\n var textIndex = format;\n var argIndex = 0;\n function getNextArg(type) {\n // NOTE: Explicitly ignoring type safety. Otherwise this fails:\n // int x = 4; printf(\"%c\\n\", (char)x);\n var ret;\n if (type === 'double') {\n ret = (HEAP32[((tempDoublePtr)>>2)]=HEAP32[(((varargs)+(argIndex))>>2)],HEAP32[(((tempDoublePtr)+(4))>>2)]=HEAP32[(((varargs)+((argIndex)+(4)))>>2)],(+(HEAPF64[(tempDoublePtr)>>3])));\n } else if (type == 'i64') {\n ret = [HEAP32[(((varargs)+(argIndex))>>2)],\n HEAP32[(((varargs)+(argIndex+4))>>2)]];\n \n } else {\n type = 'i32'; // varargs are always i32, i64, or double\n ret = HEAP32[(((varargs)+(argIndex))>>2)];\n }\n argIndex += Runtime.getNativeFieldSize(type);\n return ret;\n }\n \n var ret = [];\n var curr, next, currArg;\n while(1) {\n var startTextIndex = textIndex;\n curr = HEAP8[(textIndex)];\n if (curr === 0) break;\n next = HEAP8[((textIndex+1)|0)];\n if (curr == 37) {\n // Handle flags.\n var flagAlwaysSigned = false;\n var flagLeftAlign = false;\n var flagAlternative = false;\n var flagZeroPad = false;\n var flagPadSign = false;\n flagsLoop: while (1) {\n switch (next) {\n case 43:\n flagAlwaysSigned = true;\n break;\n case 45:\n flagLeftAlign = true;\n break;\n case 35:\n flagAlternative = true;\n break;\n case 48:\n if (flagZeroPad) {\n break flagsLoop;\n } else {\n flagZeroPad = true;\n break;\n }\n case 32:\n flagPadSign = true;\n break;\n default:\n break flagsLoop;\n }\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n \n // Handle width.\n var width = 0;\n if (next == 42) {\n width = getNextArg('i32');\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n } else {\n while (next >= 48 && next <= 57) {\n width = width * 10 + (next - 48);\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n }\n }\n \n // Handle precision.\n var precisionSet = false, precision = -1;\n if (next == 46) {\n precision = 0;\n precisionSet = true;\n textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n if (next == 42) {\n precision = getNextArg('i32');\n textIndex++;\n } else {\n while(1) {\n var precisionChr = HEAP8[((textIndex+1)|0)];\n if (precisionChr < 48 ||\n precisionChr > 57) break;\n precision = precision * 10 + (precisionChr - 48);\n textIndex++;\n }\n }\n next = HEAP8[((textIndex+1)|0)];\n }\n if (precision < 0) {\n precision = 6; // Standard default.\n precisionSet = false;\n }\n \n // Handle integer sizes. WARNING: These assume a 32-bit architecture!\n var argSize;\n switch (String.fromCharCode(next)) {\n case 'h':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 104) {\n textIndex++;\n argSize = 1; // char (actually i32 in varargs)\n } else {\n argSize = 2; // short (actually i32 in varargs)\n }\n break;\n case 'l':\n var nextNext = HEAP8[((textIndex+2)|0)];\n if (nextNext == 108) {\n textIndex++;\n argSize = 8; // long long\n } else {\n argSize = 4; // long\n }\n break;\n case 'L': // long long\n case 'q': // int64_t\n case 'j': // intmax_t\n argSize = 8;\n break;\n case 'z': // size_t\n case 't': // ptrdiff_t\n case 'I': // signed ptrdiff_t or unsigned size_t\n argSize = 4;\n break;\n default:\n argSize = null;\n }\n if (argSize) textIndex++;\n next = HEAP8[((textIndex+1)|0)];\n \n // Handle type specifier.\n switch (String.fromCharCode(next)) {\n case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {\n // Integer.\n var signed = next == 100 || next == 105;\n argSize = argSize || 4;\n var currArg = getNextArg('i' + (argSize * 8));\n var origArg = currArg;\n var argText;\n // Flatten i64-1 [low, high] into a (slightly rounded) double\n if (argSize == 8) {\n currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);\n }\n // Truncate to requested size.\n if (argSize <= 4) {\n var limit = Math.pow(256, argSize) - 1;\n currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);\n }\n // Format the number.\n var currAbsArg = Math.abs(currArg);\n var prefix = '';\n if (next == 100 || next == 105) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else\n argText = reSign(currArg, 8 * argSize, 1).toString(10);\n } else if (next == 117) {\n if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else\n argText = unSign(currArg, 8 * argSize, 1).toString(10);\n currArg = Math.abs(currArg);\n } else if (next == 111) {\n argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);\n } else if (next == 120 || next == 88) {\n prefix = (flagAlternative && currArg != 0) ? '0x' : '';\n if (argSize == 8 && i64Math) {\n if (origArg[1]) {\n argText = (origArg[1]>>>0).toString(16);\n var lower = (origArg[0]>>>0).toString(16);\n while (lower.length < 8) lower = '0' + lower;\n argText += lower;\n } else {\n argText = (origArg[0]>>>0).toString(16);\n }\n } else\n if (currArg < 0) {\n // Represent negative numbers in hex as 2's complement.\n currArg = -currArg;\n argText = (currAbsArg - 1).toString(16);\n var buffer = [];\n for (var i = 0; i < argText.length; i++) {\n buffer.push((0xF - parseInt(argText[i], 16)).toString(16));\n }\n argText = buffer.join('');\n while (argText.length < argSize * 2) argText = 'f' + argText;\n } else {\n argText = currAbsArg.toString(16);\n }\n if (next == 88) {\n prefix = prefix.toUpperCase();\n argText = argText.toUpperCase();\n }\n } else if (next == 112) {\n if (currAbsArg === 0) {\n argText = '(nil)';\n } else {\n prefix = '0x';\n argText = currAbsArg.toString(16);\n }\n }\n if (precisionSet) {\n while (argText.length < precision) {\n argText = '0' + argText;\n }\n }\n \n // Add sign if needed\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n prefix = '+' + prefix;\n } else if (flagPadSign) {\n prefix = ' ' + prefix;\n }\n }\n \n // Move sign to prefix so we zero-pad after the sign\n if (argText.charAt(0) == '-') {\n prefix = '-' + prefix;\n argText = argText.substr(1);\n }\n \n // Add padding.\n while (prefix.length + argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad) {\n argText = '0' + argText;\n } else {\n prefix = ' ' + prefix;\n }\n }\n }\n \n // Insert the result into the buffer.\n argText = prefix + argText;\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {\n // Float.\n var currArg = getNextArg('double');\n var argText;\n if (isNaN(currArg)) {\n argText = 'nan';\n flagZeroPad = false;\n } else if (!isFinite(currArg)) {\n argText = (currArg < 0 ? '-' : '') + 'inf';\n flagZeroPad = false;\n } else {\n var isGeneral = false;\n var effectivePrecision = Math.min(precision, 20);\n \n // Convert g/G to f/F or e/E, as per:\n // http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html\n if (next == 103 || next == 71) {\n isGeneral = true;\n precision = precision || 1;\n var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);\n if (precision > exponent && exponent >= -4) {\n next = ((next == 103) ? 'f' : 'F').charCodeAt(0);\n precision -= exponent + 1;\n } else {\n next = ((next == 103) ? 'e' : 'E').charCodeAt(0);\n precision--;\n }\n effectivePrecision = Math.min(precision, 20);\n }\n \n if (next == 101 || next == 69) {\n argText = currArg.toExponential(effectivePrecision);\n // Make sure the exponent has at least 2 digits.\n if (/[eE][-+]\\d$/.test(argText)) {\n argText = argText.slice(0, -1) + '0' + argText.slice(-1);\n }\n } else if (next == 102 || next == 70) {\n argText = currArg.toFixed(effectivePrecision);\n if (currArg === 0 && __reallyNegative(currArg)) {\n argText = '-' + argText;\n }\n }\n \n var parts = argText.split('e');\n if (isGeneral && !flagAlternative) {\n // Discard trailing zeros and periods.\n while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&\n (parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {\n parts[0] = parts[0].slice(0, -1);\n }\n } else {\n // Make sure we have a period in alternative mode.\n if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';\n // Zero pad until required precision.\n while (precision > effectivePrecision++) parts[0] += '0';\n }\n argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');\n \n // Capitalize 'E' if needed.\n if (next == 69) argText = argText.toUpperCase();\n \n // Add sign.\n if (currArg >= 0) {\n if (flagAlwaysSigned) {\n argText = '+' + argText;\n } else if (flagPadSign) {\n argText = ' ' + argText;\n }\n }\n }\n \n // Add padding.\n while (argText.length < width) {\n if (flagLeftAlign) {\n argText += ' ';\n } else {\n if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {\n argText = argText[0] + '0' + argText.slice(1);\n } else {\n argText = (flagZeroPad ? '0' : ' ') + argText;\n }\n }\n }\n \n // Adjust case.\n if (next < 97) argText = argText.toUpperCase();\n \n // Insert the result into the buffer.\n argText.split('').forEach(function(chr) {\n ret.push(chr.charCodeAt(0));\n });\n break;\n }\n case 's': {\n // String.\n var arg = getNextArg('i8*');\n var argLength = arg ? _strlen(arg) : '(null)'.length;\n if (precisionSet) argLength = Math.min(argLength, precision);\n if (!flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n if (arg) {\n for (var i = 0; i < argLength; i++) {\n ret.push(HEAPU8[((arg++)|0)]);\n }\n } else {\n ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));\n }\n if (flagLeftAlign) {\n while (argLength < width--) {\n ret.push(32);\n }\n }\n break;\n }\n case 'c': {\n // Character.\n if (flagLeftAlign) ret.push(getNextArg('i8'));\n while (--width > 0) {\n ret.push(32);\n }\n if (!flagLeftAlign) ret.push(getNextArg('i8'));\n break;\n }\n case 'n': {\n // Write the length written so far to the next parameter.\n var ptr = getNextArg('i32*');\n HEAP32[((ptr)>>2)]=ret.length;\n break;\n }\n case '%': {\n // Literal percent sign.\n ret.push(curr);\n break;\n }\n default: {\n // Unknown specifiers remain untouched.\n for (var i = startTextIndex; i < textIndex + 2; i++) {\n ret.push(HEAP8[(i)]);\n }\n }\n }\n textIndex += 2;\n // TODO: Support a/A (hex float) and m (last error) specifiers.\n // TODO: Support %1${specifier} for arg selection.\n } else {\n ret.push(curr);\n textIndex += 1;\n }\n }\n return ret;\n }function _fprintf(stream, format, varargs) {\n // int fprintf(FILE *restrict stream, const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var result = __formatString(format, varargs);\n var stack = Runtime.stackSave();\n var ret = _fwrite(allocate(result, 'i8', ALLOC_STACK), 1, result.length, stream);\n Runtime.stackRestore(stack);\n return ret;\n }function _printf(format, varargs) {\n // int printf(const char *restrict format, ...);\n // http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html\n var stdout = HEAP32[((_stdout)>>2)];\n return _fprintf(stdout, format, varargs);\n }\n\n\n \n function _emscripten_memcpy_big(dest, src, num) {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n return dest;\n } \n Module[\"_memcpy\"] = _memcpy;\nFS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module[\"noFSInit\"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module[\"FS_createFolder\"] = FS.createFolder;Module[\"FS_createPath\"] = FS.createPath;Module[\"FS_createDataFile\"] = FS.createDataFile;Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;Module[\"FS_createLazyFile\"] = FS.createLazyFile;Module[\"FS_createLink\"] = FS.createLink;Module[\"FS_createDevice\"] = FS.createDevice;\n___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;\n__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();\nif (ENVIRONMENT_IS_NODE) { var fs = require(\"fs\"); NODEFS.staticInit(); }\n__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });\n_fputc.ret = allocate([0], \"i8\", ALLOC_STATIC);\nModule[\"requestFullScreen\"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };\n Module[\"requestAnimationFrame\"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };\n Module[\"setCanvasSize\"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n Module[\"pauseMainLoop\"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n Module[\"resumeMainLoop\"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n Module[\"getUserMedia\"] = function Module_getUserMedia() { Browser.getUserMedia() }\nSTACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);\n\nstaticSealed = true; // seal the static portion of memory\n\nSTACK_MAX = STACK_BASE + 5242880;\n\nDYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);\n\nassert(DYNAMIC_BASE < TOTAL_MEMORY, \"TOTAL_MEMORY not big enough for stack\");\n\n\nvar Math_min = Math.min;\nfunction asmPrintInt(x, y) {\n Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);\n}\nfunction asmPrintFloat(x, y) {\n Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);\n}\n// EMSCRIPTEN_START_ASM\nvar asm=(function(global,env,buffer){\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=+env.NaN,r=+env.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.asmPrintInt;var ba=env.asmPrintFloat;var ca=env.min;var da=env._puts;var ea=env._llvm_lifetime_start;var fa=env._fflush;var ga=env.__formatString;var ha=env._fputc;var ia=env._send;var ja=env._pwrite;var ka=env._fileno;var la=env.__reallyNegative;var ma=env._fwrite;var na=env._malloc;var oa=env._printf;var pa=env._fprintf;var qa=env.___setErrNo;var ra=env._llvm_lifetime_end;var sa=env._fputs;var ta=env._free;var ua=env._write;var va=env._emscripten_memcpy_big;var wa=env._mkport;var xa=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction ya(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function za(){return i|0}function Aa(a){a=a|0;i=a}function Ba(a,b){a=a|0;b=b|0;if((m|0)==0){m=a;n=b}}function Ca(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function Da(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function Ea(a){a=a|0;B=a}function Fa(a){a=a|0;C=a}function Ga(a){a=a|0;D=a}function Ha(a){a=a|0;E=a}function Ia(a){a=a|0;F=a}function Ja(a){a=a|0;G=a}function Ka(a){a=a|0;H=a}function La(a){a=a|0;I=a}function Ma(a){a=a|0;J=a}function Na(a){a=a|0;K=a}function Oa(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+8|0;e=d;f=i;i=i+8|0;g=i;i=i+8|0;h=32+(a<<2)|0;a=c[h>>2]|0;if((a|0)>0){j=c[56+(a<<3)>>2]|0;k=60+(a<<3)|0;l=c[k>>2]|0;c[k>>2]=c[12];c[12]=a;c[h>>2]=l;m=j}else{c[g>>2]=240;oa(8,g|0)|0;m=0}g=32+(b<<2)|0;b=c[g>>2]|0;do{if((b|0)>0){if((c[56+(b<<3)>>2]|0)>(m|0)){break}c[f>>2]=224;oa(8,f|0)|0;n=c[64]|0;o=n+1|0;c[64]=o;i=d;return}}while(0);f=c[12]|0;if((f|0)>0){c[12]=c[60+(f<<3)>>2];p=b;q=f}else{c[e>>2]=208;oa(8,e|0)|0;p=c[g>>2]|0;q=0}c[60+(q<<3)>>2]=p;c[g>>2]=q;c[56+(q<<3)>>2]=m;n=c[64]|0;o=n+1|0;c[64]=o;i=d;return}function Pa(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=i;if((c|0)==1){e=a}else{f=a;a=c;while(1){c=6-f-b|0;g=a+ -1|0;Pa(f,c,g);Oa(f,b);if((g|0)==1){e=c;break}else{a=g;f=c}}}Oa(e,b);i=d;return}function Qa(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0;a=i;i=i+8|0;b=a;d=i;i=i+8|0;c[68>>2]=0;c[76>>2]=1;c[84>>2]=2;c[92>>2]=3;c[100>>2]=4;c[108>>2]=5;c[116>>2]=6;c[124>>2]=7;c[132>>2]=8;c[140>>2]=9;c[148>>2]=10;c[156>>2]=11;c[164>>2]=12;c[172>>2]=13;c[180>>2]=14;c[188>>2]=15;c[196>>2]=16;c[204>>2]=17;c[12]=18;c[36>>2]=0;e=0;f=14;while(1){do{if((e|0)>0){if((c[56+(e<<3)>>2]|0)>(f|0)){g=5;break}c[d>>2]=224;oa(8,d|0)|0}else{g=5}}while(0);if((g|0)==5){g=0;h=c[12]|0;if((h|0)>0){c[12]=c[60+(h<<3)>>2];j=e;k=h}else{c[b>>2]=208;oa(8,b|0)|0;j=c[36>>2]|0;k=0}c[60+(k<<3)>>2]=j;c[36>>2]=k;c[56+(k<<3)>>2]=f}h=f+ -1|0;if((h|0)<=0){break}e=c[36>>2]|0;f=h}c[40>>2]=0;c[44>>2]=0;c[64]=0;Pa(1,2,14);if((c[64]|0)==16383){i=a;return}da(264)|0;i=a;return}function Ra(){var a=0,b=0;a=i;b=0;do{Qa();b=b+1|0;}while((b|0)!=1e3);i=a;return 0}function Sa(){}function Ta(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0}return c-b|0}function Ua(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b]=d;b=b+1|0}return b-e|0}function Va(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return va(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}\n\n\n\n\n// EMSCRIPTEN_END_FUNCS\nreturn{_strlen:Ta,_memcpy:Va,_main:Ra,_memset:Ua,runPostSets:Sa,stackAlloc:ya,stackSave:za,stackRestore:Aa,setThrew:Ba,setTempRet0:Ea,setTempRet1:Fa,setTempRet2:Ga,setTempRet3:Ha,setTempRet4:Ia,setTempRet5:Ja,setTempRet6:Ka,setTempRet7:La,setTempRet8:Ma,setTempRet9:Na}})\n\n\n// EMSCRIPTEN_END_ASM\n({ \"Math\": Math, \"Int8Array\": Int8Array, \"Int16Array\": Int16Array, \"Int32Array\": Int32Array, \"Uint8Array\": Uint8Array, \"Uint16Array\": Uint16Array, \"Uint32Array\": Uint32Array, \"Float32Array\": Float32Array, \"Float64Array\": Float64Array }, { \"abort\": abort, \"assert\": assert, \"asmPrintInt\": asmPrintInt, \"asmPrintFloat\": asmPrintFloat, \"min\": Math_min, \"_puts\": _puts, \"_llvm_lifetime_start\": _llvm_lifetime_start, \"_fflush\": _fflush, \"__formatString\": __formatString, \"_fputc\": _fputc, \"_send\": _send, \"_pwrite\": _pwrite, \"_fileno\": _fileno, \"__reallyNegative\": __reallyNegative, \"_fwrite\": _fwrite, \"_malloc\": _malloc, \"_printf\": _printf, \"_fprintf\": _fprintf, \"___setErrNo\": ___setErrNo, \"_llvm_lifetime_end\": _llvm_lifetime_end, \"_fputs\": _fputs, \"_free\": _free, \"_write\": _write, \"_emscripten_memcpy_big\": _emscripten_memcpy_big, \"_mkport\": _mkport, \"STACKTOP\": STACKTOP, \"STACK_MAX\": STACK_MAX, \"tempDoublePtr\": tempDoublePtr, \"ABORT\": ABORT, \"NaN\": NaN, \"Infinity\": Infinity }, buffer);\nvar _strlen = Module[\"_strlen\"] = asm[\"_strlen\"];\nvar _memcpy = Module[\"_memcpy\"] = asm[\"_memcpy\"];\nvar _main = Module[\"_main\"] = asm[\"_main\"];\nvar _memset = Module[\"_memset\"] = asm[\"_memset\"];\nvar runPostSets = Module[\"runPostSets\"] = asm[\"runPostSets\"];\n\nRuntime.stackAlloc = function(size) { return asm['stackAlloc'](size) };\nRuntime.stackSave = function() { return asm['stackSave']() };\nRuntime.stackRestore = function(top) { asm['stackRestore'](top) };\n\n\n// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math = null;\n\n// === Auto-generated postamble setup entry stuff ===\n\nif (memoryInitializer) {\n if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {\n var data = Module['readBinary'](memoryInitializer);\n HEAPU8.set(data, STATIC_BASE);\n } else {\n addRunDependency('memory initializer');\n Browser.asyncLoad(memoryInitializer, function(data) {\n HEAPU8.set(data, STATIC_BASE);\n removeRunDependency('memory initializer');\n }, function(data) {\n throw 'could not load memory initializer ' + memoryInitializer;\n });\n }\n}\n\nfunction ExitStatus(status) {\n this.name = \"ExitStatus\";\n this.message = \"Program terminated with exit(\" + status + \")\";\n this.status = status;\n};\nExitStatus.prototype = new Error();\nExitStatus.prototype.constructor = ExitStatus;\n\nvar initialStackTop;\nvar preloadStartTime = null;\nvar calledMain = false;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!Module['calledRun'] && shouldRunNow) run();\n if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n}\n\nModule['callMain'] = Module.callMain = function callMain(args) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');\n assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');\n\n args = args || [];\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n ensureInitRuntime();\n\n var argc = args.length+1;\n function pad() {\n for (var i = 0; i < 4-1; i++) {\n argv.push(0);\n }\n }\n var argv = [allocate(intArrayFromString(\"/bin/this.program\"), 'i8', ALLOC_NORMAL) ];\n pad();\n for (var i = 0; i < argc-1; i = i + 1) {\n argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));\n pad();\n }\n argv.push(0);\n argv = allocate(argv, 'i32', ALLOC_NORMAL);\n\n initialStackTop = STACKTOP;\n\n try {\n\n var ret = Module['_main'](argc, argv, 0);\n\n\n // if we're not running an evented main loop, it's time to exit\n if (!Module['noExitRuntime']) {\n exit(ret);\n }\n }\n catch(e) {\n if (e instanceof ExitStatus) {\n // exit() throws this once it's done to make sure execution\n // has been stopped completely\n return;\n } else if (e == 'SimulateInfiniteLoop') {\n // running an evented main loop, don't immediately exit\n Module['noExitRuntime'] = true;\n return;\n } else {\n if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);\n throw e;\n }\n } finally {\n calledMain = true;\n }\n}\n\n\n\n\nfunction run(args) {\n args = args || Module['arguments'];\n\n if (preloadStartTime === null) preloadStartTime = Date.now();\n\n if (runDependencies > 0) {\n Module.printErr('run() called, but dependencies remain, so not running');\n return;\n }\n\n preRun();\n\n if (runDependencies > 0) return; // a preRun added a dependency, run will be called later\n if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame\n\n function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n if (!ABORT) doRun();\n }, 1);\n } else {\n doRun();\n }\n}\nModule['run'] = Module.run = run;\n\nfunction exit(status) {\n ABORT = true;\n EXITSTATUS = status;\n STACKTOP = initialStackTop;\n\n // exit the runtime\n exitRuntime();\n\n // TODO We should handle this differently based on environment.\n // In the browser, the best we can do is throw an exception\n // to halt execution, but in node we could process.exit and\n // I'd imagine SM shell would have something equivalent.\n // This would let us set a proper exit status (which\n // would be great for checking test exit statuses).\n // https://github.com/kripken/emscripten/issues/1371\n\n // throw an exception to halt the current execution\n throw new ExitStatus(status);\n}\nModule['exit'] = Module.exit = exit;\n\nfunction abort(text) {\n if (text) {\n Module.print(text);\n Module.printErr(text);\n }\n\n ABORT = true;\n EXITSTATUS = 1;\n\n var extra = '\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';\n\n throw 'abort() at ' + stackTrace() + extra;\n}\nModule['abort'] = Module.abort = abort;\n\n// {{PRE_RUN_ADDITIONS}}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\n// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow = true;\nif (Module['noInitialRun']) {\n shouldRunNow = false;\n}\n\n\nrun();\n\n// {{POST_RUN_ADDITIONS}}\n\n\n\n\n\n\n// {{MODULE_ADDITIONS}}\n\n\n\n\n\n\n"}, |
| ]; |